00001 #ifndef MoleculeH
00002 #define MoleculeH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00045
00046
00047 #include "CoreMainHeader.h"
00048 #include "ExtObject.h"
00049 #include "Atom.h"
00050 #include "Bond.h"
00051 #include "Constraint.h"
00052 #include "StructureUnit.h"
00053 #include "Fragment.h"
00054 #include "ContainerEnumerator.h"
00055 #include "InsertAdapter.h"
00056 #include "Cell.h"
00057 #include "Sequences.h"
00058
00059
00060
00061 class CStructure;
00062 class CProject;
00063 class CHistoryList;
00064 class CIndexCounter;
00065 class CXMLElement;
00066
00067 extern CPluginObjectInfo MoleculeObjectInfo;
00068
00069
00070
00072
00075 class NEMESIS_CORE_PACKAGE CMolecule : public CExtObject{
00076 public:
00077
00078 __fastcall CMolecule(CComObject* owner,CProject* project);
00079 __fastcall ~CMolecule(void);
00080
00081
00082 bool __fastcall ChangePos(const CPoint& pos);
00083
00084
00085 bool __fastcall Load(istream& stream);
00086
00087 bool __fastcall Load(CStructure* p_structure);
00088
00089 bool __fastcall Load(CXMLElement* p_el);
00090 bool __fastcall Save(CXMLElement* p_el);
00091 bool __fastcall SaveInStructureFormat(CXMLElement* p_el);
00092
00093 CExtObject* __fastcall FindObject(int index);
00094 void __fastcall GetMoleculeMetrics(CPoint& low,CPoint& high);
00095
00096
00097 void __fastcall Clear(void);
00098
00099
00100 inline bool __fastcall IsEmpty(void) const;
00101
00102
00103 inline CConstraintsList* __fastcall GetActiveConstraintsList(void);
00104 void __fastcall SetActiveConstraintsList(CConstraintsList* p_lis);
00105
00106
00107
00108 CInsertAdapter InsertAdapter;
00109
00110 CCell Cell;
00111 CAtomsList Atoms;
00112 CBondsList Bonds;
00113 CStructureUnitsList StructureUnits;
00114 CFragmentsList Fragments;
00115 CSequencesList Sequences;
00116
00117 __property CHistoryList* HistoryList = {read = FHistoryList};
00118 __property CIndexCounter* IndexCounter = {read = FIndexCounter};
00119 __property CProject* Project = {read = GetProject};
00120
00121
00122 private:
00123 CConstraintsList* ActualConstraints;
00124 CConstraintsList Constraints;
00125 CHistoryList* FHistoryList;
00126 CIndexCounter* FIndexCounter;
00127 };
00128
00129
00130
00131 DECLARE_EVENT(Molecule_SetConstraintsList);
00132
00133
00134
00135
00136
00137 extern CPluginObjectInfo MoleculeEnumObjectInfo;
00138 extern CExtUUID ID_MoleculeEnum;
00139
00140
00141
00143
00146 class NEMESIS_CORE_PACKAGE CMoleculeEnumerator : public CContainerEnumerator {
00147 public:
00148 __fastcall CMoleculeEnumerator(CComObject* owner,CMolecule* molecule);
00149
00150 virtual CContainerEnumerator* __fastcall GetFirstSubContainer(void);
00151 virtual CContainerEnumerator* __fastcall GetNextSubContainer(void);
00152
00153 virtual bool __fastcall ContainSubContainers(void);
00154
00155 virtual int __fastcall NumOfColumns(void);
00156 virtual const CSmallString __fastcall GetColumnCaption(int index);
00157 virtual const CSmallString __fastcall GetObjectProperty(int index);
00158 virtual int __fastcall GetObjectImageIndex(void);
00159
00160 virtual int __fastcall NumOfObjects(void);
00161 virtual bool __fastcall PrepareObjects(int startpos,int size,int rstart,int rend);
00162 virtual CExtObject* __fastcall GetObject(int pos);
00163
00164 virtual CExtObject* __fastcall GetCurrentObject(void);
00165 virtual bool __fastcall SetCurrentObject(CExtObject* p_object);
00166
00167 inline CMolecule* __fastcall GetMolecule(void);
00168 virtual CExtObject* __fastcall GetMyMaster(void);
00169
00170 private:
00171 CSimpleList<CContainerEnumerator> SubContainers;
00172 CSimpleIterator<CContainerEnumerator> Pointer;
00173 CMolecule* Molecule;
00174 CContainerEnumerator* CurrentObject;
00175 CContainerEnumerator* ActualConstraintsEnum;
00176 bool Changed;
00177 bool __fastcall PrepareSubContainers(void);
00178 virtual void __fastcall ProcessEvent(const CEventIdentifier& event,CExtObject* Sender,void* p_data);
00179 };
00180
00181
00182
00183
00184 class CMoleculePosHistory:public CCoreElementsRecord{
00185 public:
00186
00187 __fastcall CMoleculePosHistory(CMolecule* p_mol,const CPoint& deltapos);
00188
00189
00190 virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00191
00192
00193 private:
00194 CMolecule* Molecule;
00195 CPoint DeltaPos;
00196
00197 virtual void __fastcall Forward(void);
00198 virtual void __fastcall Backward(void);
00199 };
00200
00201
00202
00203
00204
00205
00206
00207 inline bool __fastcall CMolecule::IsEmpty(void) const
00208 {
00209 return(Atoms.NumOfMembers()==0);
00210 }
00211
00212
00213
00214 inline CMolecule* __fastcall CMoleculeEnumerator::GetMolecule(void)
00215 {
00216 return(Molecule);
00217 }
00218
00219
00220
00221 inline CConstraintsList* __fastcall CMolecule::GetActiveConstraintsList(void)
00222 {
00223 return(ActualConstraints);
00224 }
00225
00226
00227
00228 #endif