00001 #ifndef InsertAdapterH
00002 #define InsertAdapterH
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
00038
00039
00040 #include "CoreHistoryList.h"
00041 #include "ExtObject.h"
00042
00043
00044
00045
00046
00047 class CMolecule;
00048 class CStructure;
00049 class CAtom;
00050 class CInsertAdapter;
00051
00052
00053
00055
00058 class NEMESIS_CORE_PACKAGE CInserter: public CExtObject{
00059 public:
00060 __fastcall CInserter(CComObject* owner,CPluginObjectInfo* objectinfo);
00061 __fastcall CInserter(CVisObject* owner,CPluginObjectInfo* objectinfo);
00062
00063 virtual bool __fastcall InsertStructure(CMolecule* FMolecule,CStructure* p_structure,CAtom* p_atom);
00064 virtual bool __fastcall InsertStructure(CMolecule* FMolecule,CStructure* p_structure,const CPoint& pos);
00065 };
00066
00067
00068
00070
00073 class NEMESIS_CORE_PACKAGE CDefaultInserter: public CInserter{
00074 public:
00075 __fastcall CDefaultInserter(CComObject* owner);
00076 __fastcall CDefaultInserter(CVisObject* owner);
00077 virtual bool __fastcall InsertStructure(CMolecule* FMolecule,CStructure* p_structure,CAtom* p_atom);
00078 virtual bool __fastcall InsertStructure(CMolecule* FMolecule,CStructure* p_structure,const CPoint& pos);
00079
00080 public:
00081 bool AutoCenter;
00082 };
00083
00084
00085
00087
00090 class NEMESIS_CORE_PACKAGE CInsertAdapter : public CExtObject{
00091 public:
00092 __fastcall CInsertAdapter(CMolecule* p_molecule);
00093
00094
00095 bool __fastcall ActivateInserter(CInserter* p_inserter);
00096
00097
00098 bool __fastcall InsertStructure(CStructure* p_structure,CAtom* p_atom);
00099 bool __fastcall InsertStructure(CStructure* p_structure,const CPoint& pos);
00100
00101
00102 inline CMolecule* __fastcall GetMolecule(void);
00103
00104
00105 private:
00106 CMolecule* FMolecule;
00107 CInserter* FActiveInserter;
00108 CSimpleList<CInserter> RegisteredInserters;
00109 virtual void __fastcall RemoveFromRegistered(CExtObject* object,CElementsRecord* history=NULL);
00110 };
00111
00112
00113
00114 class CInsertStructureHistory:public CCoreElementsRecord{
00115 public:
00116 __fastcall CInsertStructureHistory(CStructure* p_structure,CAtom* atom);
00117 private:
00118 virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00119 CSmallString StructureName;
00120 CSmallString AtomName;
00121 };
00122
00123
00124
00125 class CMoleculeAddStructureHistory:public CCoreElementsRecord{
00126 public:
00127
00128 __fastcall CMoleculeAddStructureHistory(CMolecule* p_mol,const CStructure* p_str);
00129
00130
00131 virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00132
00133
00134 private:
00135 CSmallString StructureName;
00136 };
00137
00138
00139
00140 extern CPluginObjectInfo DefaultInserterInfo;
00141
00142
00143
00144 inline CMolecule* __fastcall CInsertAdapter::GetMolecule(void)
00145 {
00146 return(FMolecule);
00147 }
00148
00149
00150
00151 #endif