Victor
 All Data Structures Functions Variables Friends Pages
Polymer.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 
18 #ifndef _POLYMER_H_
19 #define _POLYMER_H_
20 
21 // Includes:
22 #include <Component.h>
23 #include <Debug.h>
24 
25 // Global constants, typedefs, etc. (to avoid):
26 
27 namespace Victor { namespace Biopool {
28 
33  class Polymer : public Component {
34  public:
35 
36  // CONSTRUCTORS/DESTRUCTOR:
37  Polymer(unsigned int mI = 2, unsigned int mO = 2);
38  Polymer(const Polymer& orig);
39  virtual ~Polymer();
40 
41  // PREDICATES:
42  //char getChainID() { return chainID; }
43 
44  virtual string getClassName() const {
45  return "Polymer";
46  }
47 
48  virtual vgVector3<double> getTrans() const {
49  ERROR("Polymer::getTrans is not a viable method.", exception);
50  }
51 
52  virtual vgMatrix3<double> getRot() const {
53  ERROR("Polymer::getRot is not a viable method.", exception);
54  }
55 
56  virtual void save(Saver& s) {
57  ERROR("Polymer::save is not a viable method.", exception);
58  }
59 
60  // MODIFIERS:
61  //void setChainID(char _chainID){ chainID = _chainID; }
62  virtual void insertComponent(Component* c);
63  virtual void removeComponent(Component* c);
64  //---------------------------------
65  virtual void removeComponentFromIndex(unsigned int i);
66  //---------------------------------
67  virtual void deleteComponent(Component* c);
68 
69  void copy(const Polymer& orig);
70  virtual Component* clone();
71 
72  virtual void load(Loader& l) {
73  ERROR("Polymer::load is not a viable method.", exception);
74  }
75 
76  virtual void setTrans(vgVector3<double> t) {
77  ERROR("Polymer::setTrans is not a viable method.", exception);
78  }
79 
80  virtual void addTrans(vgVector3<double> t) {
81  ERROR("Polymer::addTrans is not a viable method.", exception);
82  }
83 
84  virtual void setRot(vgMatrix3<double> r) {
85  ERROR("Polymer::setRot is not a viable method.", exception);
86  }
87 
88  virtual void addRot(vgMatrix3<double> r) {
89  ERROR("Polymer::addRot is not a viable method.", exception);
90  }
91 
92  virtual void sync() // synchronize coords with structure
93  {
94  ERROR("Polymer::sync is not a viable method.", exception);
95  }
96 
97  virtual void acceptCalculator(EnergyVisitor* v) {
98  ERROR("Polymer::acceptCalculator is not a viable method.", exception);
99  }
100 
101  virtual void acceptOptimizer(OptimizationVisitor* v) {
102  ERROR("Polymer::acceptOptimizer is not a viable method.", exception);
103  }
104 
105  // OPERATORS:
106  virtual Component& operator[](unsigned int n);
107  virtual const Component& operator[](unsigned int n) const;
108 
109  protected:
110 
111  // HELPERS:
112 
113  virtual void resetBoundaries() {
114  ERROR("Polymer::resetBoundaries is not a viable method.", exception);
115  }
116  // ATTRIBUTES
117 
118 
119  private:
120 
121  };
122 
123 
124  // ---------------------------------------------------------------------------
125  // Polymer
126  // -----------------x-------------------x-------------------x-----------------
127 
128  // PREDICATES:
129 
130  // MODIFIERS:
131 
132  // OPERATORS:
133  inline Component&
134  Polymer::operator[](unsigned int n) {
135  PRECOND(n < size(), exception);
136  return *components[n];
137  }
138 
139  inline const Component&
140  Polymer::operator[](unsigned int n) const {
141  PRECOND(n < size(), exception);
142  return *components[n];
143  }
144 
145 }} //namespace
146 #endif //_POLYMER_H_
147 
148 
Base class for saving components (Atoms, Groups, etc.).
Definition: Saver.h:39
Base class for composite structures.
Definition: Component.h:39
Base class for loading components (Atoms, Groups, etc.).
Definition: Loader.h:39
Base class implementing the visitor pattern.
Definition: Visitor.h:38
virtual void removeComponentFromIndex(unsigned int i)
Definition: Polymer.cc:98
void copy(const Polymer &orig)
Definition: Polymer.cc:54
Implements methods to manage a polymer created by components.
Definition: Polymer.h:33
virtual void insertComponent(Component *c)
Definition: Polymer.cc:71
Base class Optimizacion Patter.
Definition: Visitor.h:66
virtual void deleteComponent(Component *c)
Definition: Polymer.cc:109
virtual void removeComponent(Component *c)
Definition: Polymer.cc:81
virtual Component * clone()
Definition: Polymer.cc:63