Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.hpp

    r1f1b23 r520c8b  
    2727#include <vector>
    2828
     29#include <string>
     30
    2931#include "graph.hpp"
    3032#include "stackclass.hpp"
    3133#include "tesselation.hpp"
     34#include "Patterns/Observer.hpp"
    3235
    3336/****************************************** forward declarations *****************************/
     
    8083 * Class incorporates number of types
    8184 */
    82 class molecule : public PointCloud {
     85class molecule : public PointCloud , public Observable {
    8386  public:
    8487    double cell_size[6];//!< cell size
     
    99102    bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules
    100103    Vector Center;      //!< Center of molecule in a global box
     104    int IndexNr;        //!< index of molecule in a MoleculeListClass
    101105    char name[MAXSTRINGSIZE];         //!< arbitrary name
    102     int IndexNr;        //!< index of molecule in a MoleculeListClass
    103 
     106
     107public:
    104108  molecule(const periodentafel * const teil);
    105109  virtual ~molecule();
     110
     111  //getter and setter
     112  const std::string getName();
     113  void setName(const std::string);
    106114
    107115  // re-definition of virtual functions from PointCloud
     
    269277  int FragmentMolecule(int Order, config *configuration);
    270278  bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);
    271   bool StoreBondsToFile(char *path);
    272279  bool StoreAdjacencyToFile(char *path);
    273280  bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms);
     
    299306  bool OutputTemperatureFromTrajectories(ofstream * const output, int startstep, int endstep);
    300307
     308  // Manipulation routines
     309  void flipActiveFlag();
     310
    301311  private:
    302312  int last_atom;      //!< number given to last atom
     
    308318/** A list of \a molecule classes.
    309319 */
    310 class MoleculeListClass {
     320class MoleculeListClass : public Observable {
    311321  public:
    312322    MoleculeList ListOfMolecules; //!< List of the contained molecules
     
    327337  int CountAllAtoms() const;
    328338
     339  // Methods moved here from the menus
     340  // TODO: more refactoring needed on these methods
     341  void flipChosen();
     342  void createNewMolecule(periodentafel *periode);
     343  void loadFromXYZ(periodentafel *periode);
     344  void setMoleculeFilename();
     345  void parseXYZIntoMolecule();
     346  void eraseMolecule();
     347
     348
    329349  // merging of molecules
    330350  bool SimpleMerge(molecule *mol, molecule *srcmol);
Note: See TracChangeset for help on using the changeset viewer.