1 |
#ifndef _ZCONS_VISITOR_H_ |
2 |
#define _ZCONS_VISITOR_H_ |
3 |
|
4 |
#include "visitors/BaseVisitor.hpp" |
5 |
#include "io/ZConsReader.hpp" |
6 |
#include "visitors/AtomData.hpp" |
7 |
#include "constraints/ZconsData.hpp" |
8 |
|
9 |
#include "primitives/RigidBody.hpp" |
10 |
|
11 |
enum ZConsState{zsFixed, zsMoving}; |
12 |
|
13 |
namespace oopse { |
14 |
|
15 |
class ZConsVisitor : public BaseVisitor{ |
16 |
public: |
17 |
|
18 |
|
19 |
ZConsVisitor(SimInfo* info); |
20 |
~ZConsVisitor(); |
21 |
|
22 |
virtual void visit(Atom* atom); |
23 |
virtual void visit(DirectionalAtom* datom); |
24 |
virtual void visit(RigidBody* rb); |
25 |
|
26 |
virtual void update(); |
27 |
|
28 |
bool haveZconsMol() {return haveZcons;} |
29 |
|
30 |
virtual const std::string toString(); |
31 |
protected: |
32 |
void internalVisit(StuntDouble* sd, const std::string& prefix); |
33 |
bool isZconstraint(int index, std::string& prefix); |
34 |
void getZconsPos(double time); |
35 |
|
36 |
private: |
37 |
std::vector<Molecule*> zconsMol; |
38 |
std::vector<double> zconsPos; |
39 |
std::map<int, ZConsState> zconsState; |
40 |
bool haveZcons; |
41 |
double zconsTol; |
42 |
double zconsTime; |
43 |
std::string zconsFilename; |
44 |
ZConsReader* zconsReader; |
45 |
SimInfo* info; |
46 |
}; |
47 |
|
48 |
}//namespace oopse |
49 |
#endif // _ZCONS_VISITOR_H_ |
50 |
|
51 |
|