Changes in src/molecule.hpp [24a5e0:8ab0407]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.hpp
r24a5e0 r8ab0407 27 27 #include <vector> 28 28 29 #include <string>30 31 #include "defs.hpp"32 29 #include "graph.hpp" 33 30 #include "stackclass.hpp" 34 31 #include "tesselation.hpp" 35 #include "Patterns/Observer.hpp"36 #include "Patterns/Cacheable.hpp"37 32 38 33 /****************************************** forward declarations *****************************/ … … 85 80 * Class incorporates number of types 86 81 */ 87 class molecule : public PointCloud , public Observable { 88 friend molecule *NewMolecule(); 89 friend void DeleteMolecule(molecule *); 82 class molecule : public PointCloud { 90 83 public: 91 84 double cell_size[6];//!< cell size … … 106 99 bool ActiveFlag; //!< in a MoleculeListClass used to discern active from inactive molecules 107 100 Vector Center; //!< Center of molecule in a global box 101 char name[MAXSTRINGSIZE]; //!< arbitrary name 108 102 int IndexNr; //!< index of molecule in a MoleculeListClass 109 char name[MAXSTRINGSIZE]; //!< arbitrary name 110 111 private: 112 Cacheable<string> formula; 113 moleculeId_t id; 114 protected: 115 molecule(const periodentafel * const teil); 116 virtual ~molecule(); 117 118 119 public: 120 //getter and setter 121 const std::string getName(); 122 moleculeId_t getId(); 123 void setId(moleculeId_t); 124 void setName(const std::string); 125 const std::string getFormula(); 126 std::string calcFormula(); 127 103 104 molecule(const periodentafel * const teil); 105 virtual ~molecule(); 128 106 129 107 // re-definition of virtual functions from PointCloud … … 291 269 int FragmentMolecule(int Order, config *configuration); 292 270 bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL); 293 bool StoreBondsToFile(char *path );294 bool StoreAdjacencyToFile(char *path );271 bool StoreBondsToFile(char *path, char *filename); 272 bool StoreAdjacencyToFile(char *path, char *filename); 295 273 bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms); 296 274 bool ParseOrderAtSiteFromFile(char *path); … … 321 299 bool OutputTemperatureFromTrajectories(ofstream * const output, int startstep, int endstep); 322 300 323 // Manipulation routines324 void flipActiveFlag();325 326 301 private: 327 302 int last_atom; //!< number given to last atom … … 329 304 }; 330 305 331 molecule *NewMolecule();332 void DeleteMolecule(molecule* mol);333 334 306 #include "molecule_template.hpp" 335 307 336 308 /** A list of \a molecule classes. 337 309 */ 338 class MoleculeListClass : public Observable{310 class MoleculeListClass { 339 311 public: 340 312 MoleculeList ListOfMolecules; //!< List of the contained molecules 341 313 int MaxIndex; 342 314 343 MoleculeListClass( World *world);315 MoleculeListClass(); 344 316 ~MoleculeListClass(); 345 317 … … 350 322 bool OutputConfigForListOfFragments(config *configuration, int *SortIndex); 351 323 int NumberOfActiveMolecules(); 352 void Enumerate(o stream *out);324 void Enumerate(ofstream *out); 353 325 void Output(ofstream *out); 354 326 void DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration); 355 327 int CountAllAtoms() const; 356 357 // Methods moved here from the menus358 // TODO: more refactoring needed on these methods359 void flipChosen();360 void createNewMolecule(periodentafel *periode);361 void loadFromXYZ(periodentafel *periode);362 void setMoleculeFilename();363 void parseXYZIntoMolecule();364 void eraseMolecule();365 366 328 367 329 // merging of molecules … … 374 336 375 337 private: 376 World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor377 338 }; 378 339
Note:
See TracChangeset
for help on using the changeset viewer.