Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

MoleculeInfo.h

Go to the documentation of this file.
00001 #ifndef MoleculeInfoH
00002 #define MoleculeInfoH
00003 
00004 /*******************************************************************************
00005 Copyright 2002,2003 Petr Kulhanek
00006 
00007     This file is part of Core plugin.
00008 
00009     Core plugin is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     Core plugin is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with Core plugin; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 *******************************************************************************/
00023 /*******************************************************************************
00024 ** PROJECT:             Project NEMESIS
00025 ** FILE:                MoleculeInfo
00026 ** FUNCTION:            define properties of one geometry, eg. coords, bonds, velocities
00027 ** VERSION:             1.0
00028 ** LANGUAGE:            CBuilder C++
00029 ** TARGET COMPUTER:     IBM PC
00030 ** PROGRAMMER:          Petr Kulhánek
00031 ** HISTORY:
00032 VERSION DATE        NOTE
00033 2002-09             1.0
00034 *******************************************************************************/
00035 
00039 /* HEADER FILES ***************************************************************/
00040 
00041 #include "CoreMainHeader.h"
00042 #include "Point.h"
00043 #include "ExtObject.h"
00044 
00045 /* HEADER FILES END ***********************************************************/
00046 
00047 class CJob;
00048 class CCalculation;
00049 class CXMLElement;
00050 class CMolecule;
00051 class CExtUUID;
00052 class CPluginObjectInfo;
00053 class CAtom;
00054 
00055 //---------------------------------------------------------------------------
00056 
00058 
00061 enum EMoleculeInfoType{
00062     MIT_LOAD = 0,
00063     MIT_COORDS = 1,
00064     MIT_COORDS_BONDS = 2,
00065     MIT_COORDS_VELOCITIES = 3,
00066     MIT_FULL = 4,
00067     };
00068 
00069 //---------------------------------------------------------------------------
00070 
00072 
00075 class NEMESIS_CORE_PACKAGE CMoleculeInfo : public CExtObject {
00076     public:
00077         __fastcall CMoleculeInfo(CCalculation* p_cal,EMoleculeInfoType type=MIT_LOAD);
00078         __fastcall CMoleculeInfo(CCalculation* p_cal,CJob* p_job,int local_id,EMoleculeInfoType type=MIT_LOAD);
00079     void __fastcall RemoveFromBaseList(void);
00080 
00081  // name manipulation methods --------------------------------------------------
00082     bool __fastcall ChangeName(const CSmallString& name); // recorded in history list
00083 
00084     CSmallString __fastcall GetFullCaption(CJob* p_forjob);
00085 
00086  // atom manipulation methods --------------------------------------------------
00087     inline int      __fastcall GetNumOfAtoms(void);
00088     int             __fastcall GetAtomicNumber(int index);
00089     const CPoint&   __fastcall GetCoord(int index);
00090     const CPoint&   __fastcall GetAtomPos(CAtom* p_atom);
00091     void __fastcall SetCoord(int index,const CPoint& pos);
00092 
00093  // operation for disk file manipulation ---------------------------------------
00094     bool __fastcall MustItSave(void);
00095 
00096     bool __fastcall Load(CXMLElement* p_ele);
00097     bool __fastcall Save(CXMLElement* p_ele);
00098 
00099     bool __fastcall LoadData(void);
00100     bool __fastcall LoadData(const CSmallString& name);
00101     bool __fastcall SaveData(void);
00102 
00103  // operation for molecule manipulation ----------------------------------------
00104     bool __fastcall LoadFromMolecule(CMolecule* p_mol);
00105     bool __fastcall SaveToMolecule(CMolecule* p_mol);
00106 
00107  // job specific methods -------------------------------------------------------
00108     inline CJob* __fastcall GetOwnerJob(void);
00109     inline int   __fastcall GetLocalIndex(void);
00110     bool         __fastcall ConnectWithJob(void);
00111     bool         __fastcall NeedData(void);
00112 
00113     bool         __fastcall RegisterJob(CJob* p_job);
00114     bool         __fastcall UnregisterJob(CJob* p_job);
00115 
00116  // private data ---------------------------------------------------------------
00117     private:
00118     CCalculation*       FCalculation;        
00119     int                 NumOfAtoms;
00120     EMoleculeInfoType   Type;
00121     CJob*               Job;
00122     int                 JobIndex;
00123     int                 LocalIndex;  // index in job calculation archive ( if -1 data are non-permanent )
00124     bool                Loaded;      // data is loaded
00125     bool                Changed;     // if name was changed - save info to _calculation
00126 
00127     CPoint* Coords;                  //
00128     CPoint* Velocities;
00129 
00130     void __fastcall InitVectors(void);
00131 
00132     public:
00133     __fastcall ~CMoleculeInfo(void); // do not use this, do use RemoveFromBaseList
00134     };
00135 
00136 //---------------------------------------------------------------------------
00137 
00138 extern CExtUUID            ID_MoleculeInfo;
00139 extern CPluginObjectInfo   MoleculeInfoObjectInfo;
00140 
00141 //---------------------------------------------------------------------------
00142 
00143 inline int __fastcall CMoleculeInfo::GetNumOfAtoms(void)
00144 {
00145  return(NumOfAtoms);
00146 }
00147 
00148 //---------------------------------------------------------------------------
00149 
00150 inline CJob* __fastcall CMoleculeInfo::GetOwnerJob(void)
00151 {
00152  return(Job);
00153 }
00154 
00155 //---------------------------------------------------------------------------
00156 
00157 inline int __fastcall CMoleculeInfo::GetLocalIndex(void)
00158 {
00159  return(LocalIndex);
00160 }
00161 
00162 //---------------------------------------------------------------------------
00163     
00164 #endif

Generated on Sun Feb 9 12:53:51 2003 for NemesisCore by doxygen1.3-rc2