00001 #ifndef StructureH
00002 #define StructureH
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
00041
00042
00043 #include "CoreMainHeader.h"
00044 #include "Atom.h"
00045 #include "Bond.h"
00046 #include "Constraint.h"
00047 #include "Manipulator.h"
00048 #include "IndexCounter.h"
00049
00050
00051
00052 class CXMLElement;
00053
00054
00055
00057
00062 class NEMESIS_CORE_PACKAGE CStructure {
00063 public:
00064 enum EConnectorMode{
00065 Manual=0,
00066 Auto,
00067 };
00068
00069 public:
00070
00071 __fastcall CStructure(void);
00072 __fastcall ~CStructure(void);
00073
00074
00075 bool __fastcall Load(CMolecule* p_mol);
00076 bool __fastcall Load(const CSmallString& name);
00077 bool __fastcall Save(const CSmallString& name);
00078 bool __fastcall Load(CXMLElement* p_element);
00079 bool __fastcall Save(CXMLElement* p_element);
00080
00081
00082 void __fastcall Clear(void);
00083 inline bool __fastcall IsEmpty(void) const;
00084
00085
00086 void __fastcall SetFirstConnector(void);
00087 void __fastcall SetNextConnector(void);
00088 bool __fastcall SetBestConnector(EBondOrder order);
00089 int __fastcall GetNumOfUserConnectors(void);
00090 int __fastcall GetIndexOfConnector(void);
00091 int __fastcall GetConnector(void);
00092 int __fastcall GetConnector(int index);
00093 void __fastcall SetConnectorField(int* p_field,int num);
00094 void __fastcall SetConnectorMode(EConnectorMode mode);
00095 EConnectorMode __fastcall GetConnectorMode(void);
00096
00097
00098 inline void __fastcall SetZOfMasterAtom(int z);
00099 inline int __fastcall GetZOfMasterAtom(void) const;
00100
00101
00102 inline int __fastcall GetNumOfAtoms(void) const;
00103 inline int __fastcall GetNumOfBonds(void) const;
00104 inline CAtomData& __fastcall GetAtomData(int i) const;
00105 inline CBondData& __fastcall GetBondData(int i) const;
00106
00107 int __fastcall GetOppositeAtom(int at,int index=1);
00108 int __fastcall GetAtomDataFromIndex(int atomindex);
00109
00110
00111 public:
00112 CSmallString Name;
00113
00114 private:
00115 CAtomData* Atoms;
00116 CBondData* Bonds;
00117 int NA,NB;
00118 int* Connectors;
00119 int NumOfConnectors;
00120 int Connector;
00121 int MasterAtomZ;
00122 EConnectorMode Mode;
00123
00124 int __fastcall GetConnectBond(int a);
00125 };
00126
00127
00128
00129
00130
00131 inline CAtomData& __fastcall CStructure::GetAtomData(int i) const
00132 {
00133 return(Atoms[i]);
00134 }
00135
00136
00137
00138 inline CBondData& __fastcall CStructure::GetBondData(int i) const
00139 {
00140 return(Bonds[i]);
00141 }
00142
00143
00144
00145 inline int __fastcall CStructure::GetNumOfAtoms(void) const
00146 {
00147 return(NA);
00148 }
00149
00150
00151
00152 inline int __fastcall CStructure::GetNumOfBonds(void) const
00153 {
00154 return(NB);
00155 }
00156
00157
00158
00159 inline void __fastcall CStructure::SetZOfMasterAtom(int z)
00160 {
00161 MasterAtomZ = z;
00162 }
00163
00164
00165
00166 inline int __fastcall CStructure::GetZOfMasterAtom(void) const
00167 {
00168 return(MasterAtomZ);
00169 }
00170
00171
00172
00173 #endif