Changes in src/molecule.hpp [273382:6cfa36]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.hpp
r273382 r6cfa36 34 34 #include "tesselation.hpp" 35 35 #include "Patterns/Observer.hpp" 36 #include "Patterns/ObservedIterator.hpp" 36 37 #include "Patterns/Cacheable.hpp" 38 39 #include "Descriptors/MoleculeDescriptor_impl.hpp" 37 40 38 41 /****************************************** forward declarations *****************************/ … … 88 91 friend molecule *NewMolecule(); 89 92 friend void DeleteMolecule(molecule *); 93 90 94 public: 91 double cell_size[6];//!< cell size 95 typedef std::set<atom*> atomSet; 96 typedef ObservedIterator<atomSet> iterator; 97 typedef atomSet::const_iterator const_iterator; 98 92 99 const periodentafel * const elemente; //!< periodic table with each element 93 atom *start; //!< start of atom list 94 atom *end; //!< end of atom list 95 bond *first; //!< start of bond list 96 bond *last; //!< end of bond list 100 // old deprecated atom handling 101 //atom *start; //!< start of atom list 102 //atom *end; //!< end of atom list 103 //bond *first; //!< start of bond list 104 //bond *last; //!< end of bond list 97 105 int MDSteps; //!< The number of MD steps in Trajectories 98 int AtomCount; //!< number of atoms, brought up-to-date by CountAtoms()106 //int AtomCount; //!< number of atoms, brought up-to-date by CountAtoms() 99 107 int BondCount; //!< number of atoms, brought up-to-date by CountBonds() 100 108 int ElementCount; //!< how many unique elements are therein … … 111 119 private: 112 120 Cacheable<string> formula; 121 Cacheable<int> AtomCount; 113 122 moleculeId_t id; 123 atomSet atoms; //<!set of atoms 114 124 protected: 125 //void CountAtoms(); 126 /** 127 * this iterator type should be used for internal variables, \ 128 * since it will not lock 129 */ 130 typedef atomSet::iterator internal_iterator; 131 132 115 133 molecule(const periodentafel * const teil); 116 134 virtual ~molecule(); … … 120 138 //getter and setter 121 139 const std::string getName(); 140 int getAtomCount() const; 141 int doCountAtoms(); 122 142 moleculeId_t getId(); 123 143 void setId(moleculeId_t); … … 126 146 std::string calcFormula(); 127 147 148 iterator begin(); 149 const_iterator begin() const; 150 iterator end(); 151 const_iterator end() const; 152 bool empty() const; 153 size_t size() const; 154 const_iterator erase( const_iterator loc ); 155 const_iterator erase( atom * key ); 156 const_iterator find ( atom * key ) const; 157 pair<iterator,bool> insert ( atom * const key ); 158 bool containsAtom(atom* key); 159 128 160 129 161 // re-definition of virtual functions from PointCloud … … 131 163 Vector *GetCenter() const ; 132 164 TesselPoint *GetPoint() const ; 133 TesselPoint *GetTerminalPoint() const ;134 165 int GetMaxId() const; 135 166 void GoToNext() const ; 136 void GoToPrevious() const ;137 167 void GoToFirst() const ; 138 void GoToLast() const ;139 168 bool IsEmpty() const ; 140 169 bool IsEnd() const ; … … 225 254 bool RemoveBond(bond *pointer); 226 255 bool RemoveBonds(atom *BondPartner); 256 bool hasBondStructure(); 257 unsigned int CountBonds() const; 227 258 228 259 /// Find atoms. … … 231 262 232 263 /// Count and change present atoms' coordination. 233 void CountAtoms();234 264 void CountElements(); 235 265 void CalculateOrbitals(class config &configuration); … … 248 278 Vector * DetermineCenterOfGravity(); 249 279 Vector * DetermineCenterOfAll() const; 280 Vector * DetermineCenterOfBox() const; 250 281 void SetNameFromFilename(const char *filename); 251 282 void SetBoxDimension(Vector *dim); … … 293 324 int FragmentMolecule(int Order, config *configuration); 294 325 bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL); 295 bool StoreBondsToFile(char *path );296 bool StoreAdjacencyToFile(char *path );326 bool StoreBondsToFile(char *path, char *filename); 327 bool StoreAdjacencyToFile(char *path, char *filename); 297 328 bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms); 298 329 bool ParseOrderAtSiteFromFile(char *path); … … 300 331 bool StoreForcesFile(MoleculeListClass *BondFragments, char *path, int *SortIndex); 301 332 bool CreateMappingLabelsToConfigSequence(int *&SortIndex); 333 bool CreateFatherLookupTable(atom **&LookupTable, int count = 0); 302 334 void BreadthFirstSearchAdd(molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem); 303 335 /// -# BOSSANOVA … … 328 360 private: 329 361 int last_atom; //!< number given to last atom 330 mutable atom *InternalPointer; //!< internal pointer for PointCloud362 mutable internal_iterator InternalPointer; //!< internal pointer for PointCloud 331 363 }; 332 364 … … 349 381 bool StoreForcesFile(char *path, int *SortIndex); 350 382 void insert(molecule *mol); 383 void erase(molecule *mol); 351 384 molecule * ReturnIndex(int index); 352 385 bool OutputConfigForListOfFragments(config *configuration, int *SortIndex);
Note:
See TracChangeset
for help on using the changeset viewer.