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

InsertAdapter.h

Go to the documentation of this file.
00001 #ifndef InsertAdapterH
00002 #define InsertAdapterH
00003 
00004 /*******************************************************************************
00005 Copyright 2001,2002 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:                InsertAdapter
00026 ** FUNCTION:            base class for structure insertion into molecule
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 *******************************************************************************/
00034 
00038 /* HEADER FILES ***************************************************************/
00039 
00040 #include "CoreHistoryList.h"
00041 #include "ExtObject.h"
00042 
00043 /* HEADER FILES END ***********************************************************/
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;  // při vložení provede centrování
00082     };
00083 
00084 //---------------------------------------------------------------------------
00085 
00087 
00090 class NEMESIS_CORE_PACKAGE CInsertAdapter : public CExtObject{
00091     public:
00092         __fastcall CInsertAdapter(CMolecule* p_molecule);
00093 
00094  // správa zakladačů
00095     bool __fastcall ActivateInserter(CInserter* p_inserter);
00096 
00097  // zakládaní struktury
00098     bool __fastcall InsertStructure(CStructure* p_structure,CAtom* p_atom);
00099     bool __fastcall InsertStructure(CStructure* p_structure,const CPoint& pos);
00100 
00101  // zjišťovací operace
00102     inline CMolecule* __fastcall GetMolecule(void);
00103 
00104  // privátní data -----------------------------------------------------------
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  // konstruktor a destruktor ---------------------------------------------------
00128         __fastcall CMoleculeAddStructureHistory(CMolecule* p_mol,const CStructure* p_str);
00129 
00130                 // zjištění celého řetězce popisujícího změnu
00131     virtual CSmallString __fastcall GetDescription(const CSmallString& format);
00132 
00133  // sekce soukromých dat -------------------------------------------------------
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

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