33 namespace Victor {
namespace Biopool {
43 Component(
unsigned int mI = 2,
unsigned int mO = 2);
48 unsigned int size()
const;
49 virtual string getClassName()
const = 0;
50 unsigned int getDepth()
const;
57 virtual vgVector3<double> getTrans()
const = 0;
58 virtual vgMatrix3<double> getRot()
const = 0;
61 bool hasSuperior()
const;
64 virtual void save(
Saver& s) = 0;
68 virtual void connectIn(
Component* c,
unsigned int offset = 1);
69 virtual void connectOut(
Component* c,
unsigned int offset = 1);
73 virtual void insertComponent(
Component* c) = 0;
74 virtual void removeComponent(
Component* c) = 0;
75 virtual void deleteComponent(
Component* c) = 0;
79 virtual void load(
Loader& l) = 0;
81 virtual void setTrans(vgVector3<double> t) = 0;
82 virtual void addTrans(vgVector3<double> t) = 0;
83 virtual void setRot(vgMatrix3<double> r) = 0;
84 virtual void addRot(vgMatrix3<double> r) = 0;
85 virtual void sync() = 0;
86 virtual void setModified();
101 virtual void resetBoundaries() = 0;
103 void setLowerBound(vgVector3<double> _lb);
104 void setUpperBound(vgVector3<double> _ub);
109 vector<Component*> components;
110 vgVector3<double> lowerBound;
111 vgVector3<double> upperBound;
126 Component::size()
const {
127 return components.size();
131 Component::getDepth()
const {
132 if (superior != NULL)
133 return superior->getDepth() + 1;
148 return ( (lowerBound.x <= other.upperBound.x + dist)
149 || (lowerBound.y <= other.upperBound.y + dist)
150 || (lowerBound.z <= other.upperBound.z + dist)
151 || (upperBound.x >= other.lowerBound.x - dist)
152 || (upperBound.y >= other.lowerBound.y - dist)
153 || (upperBound.z >= other.lowerBound.z - dist));
157 Component::getSuperior() {
158 if (superior != NULL)
161 DEBUG_MSG(
"Component::getSuperior() Warning: no superior found.");
167 Component::hasSuperior()
const {
168 return (superior != NULL);
178 return (!modified && (!hasSuperior() || (getSuperior().
inSync())));
183 inline void Component::setModified() {
188 getSuperior().setModified();
196 Component::setSuperior(Component* c) {
201 Component::setLowerBound(vgVector3<double> _lb) {
206 Component::setUpperBound(vgVector3<double> _ub) {
211 #endif //_COMPONENT_H_
Defines chemical and abstract bonds between objects which are compositions of atoms.
Definition: Bond.h:37
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
bool collides(Component &other, double dist=0.0)
Definition: Component.h:147
Base class Optimizacion Patter.
Definition: Visitor.h:66
void copy(const Component &orig)
Definition: Component.cc:101
virtual vgVector3< double > getUpperBound(double dist=0.0)
Definition: Component.cc:65
virtual vgVector3< double > getLowerBound(double dist=0.0)
Definition: Component.cc:51
bool inSync()
Definition: Component.h:177