Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.hpp

    r24a5e0 r8ab0407  
    2727#include <vector>
    2828
    29 #include <string>
    30 
    31 #include "defs.hpp"
    3229#include "graph.hpp"
    3330#include "stackclass.hpp"
    3431#include "tesselation.hpp"
    35 #include "Patterns/Observer.hpp"
    36 #include "Patterns/Cacheable.hpp"
    3732
    3833/****************************************** forward declarations *****************************/
     
    8580 * Class incorporates number of types
    8681 */
    87 class molecule : public PointCloud , public Observable {
    88   friend molecule *NewMolecule();
    89   friend void DeleteMolecule(molecule *);
     82class molecule : public PointCloud {
    9083  public:
    9184    double cell_size[6];//!< cell size
     
    10699    bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules
    107100    Vector Center;      //!< Center of molecule in a global box
     101    char name[MAXSTRINGSIZE];         //!< arbitrary name
    108102    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();
    128106
    129107  // re-definition of virtual functions from PointCloud
     
    291269  int FragmentMolecule(int Order, config *configuration);
    292270  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);
    295273  bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms);
    296274  bool ParseOrderAtSiteFromFile(char *path);
     
    321299  bool OutputTemperatureFromTrajectories(ofstream * const output, int startstep, int endstep);
    322300
    323   // Manipulation routines
    324   void flipActiveFlag();
    325 
    326301  private:
    327302  int last_atom;      //!< number given to last atom
     
    329304};
    330305
    331 molecule *NewMolecule();
    332 void DeleteMolecule(molecule* mol);
    333 
    334306#include "molecule_template.hpp"
    335307
    336308/** A list of \a molecule classes.
    337309 */
    338 class MoleculeListClass : public Observable {
     310class MoleculeListClass {
    339311  public:
    340312    MoleculeList ListOfMolecules; //!< List of the contained molecules
    341313    int MaxIndex;
    342314
    343   MoleculeListClass(World *world);
     315  MoleculeListClass();
    344316  ~MoleculeListClass();
    345317
     
    350322  bool OutputConfigForListOfFragments(config *configuration, int *SortIndex);
    351323  int NumberOfActiveMolecules();
    352   void Enumerate(ostream *out);
     324  void Enumerate(ofstream *out);
    353325  void Output(ofstream *out);
    354326  void DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration);
    355327  int CountAllAtoms() const;
    356 
    357   // Methods moved here from the menus
    358   // TODO: more refactoring needed on these methods
    359   void flipChosen();
    360   void createNewMolecule(periodentafel *periode);
    361   void loadFromXYZ(periodentafel *periode);
    362   void setMoleculeFilename();
    363   void parseXYZIntoMolecule();
    364   void eraseMolecule();
    365 
    366328
    367329  // merging of molecules
     
    374336
    375337  private:
    376   World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor
    377338};
    378339
Note: See TracChangeset for help on using the changeset viewer.