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 |
enum ZConsState{zsFixed, zsMoving}; |
9 |
namespace oopse { |
10 |
|
11 |
class ZConsVisitor : public BaseVisitor{ |
12 |
public: |
13 |
|
14 |
|
15 |
ZConsVisitor(SimInfo* info); |
16 |
~ZConsVisitor(); |
17 |
|
18 |
virtual void visit(Atom* atom); |
19 |
virtual void visit(DirectionalAtom* datom); |
20 |
virtual void visit(RigidBody* rb); |
21 |
|
22 |
virtual void update(); |
23 |
|
24 |
bool haveZconsMol() {return haveZcons;} |
25 |
|
26 |
virtual const string toString(); |
27 |
protected: |
28 |
void internalVisit(StuntDouble* sd, const string& prefix); |
29 |
bool isZconstraint(int index, string& prefix); |
30 |
Molecule* findZconsMol(int index); |
31 |
void getZconsPos(double time); |
32 |
|
33 |
private: |
34 |
vector<Molecule*> zconsMol; |
35 |
vector<double> zconsPos; |
36 |
map<int, ZConsState> zconsState; |
37 |
bool haveZcons; |
38 |
double zconsTol; |
39 |
double zconsTime; |
40 |
string zconsFilename; |
41 |
ZConsReader* zconsReader; |
42 |
SimInfo* info; |
43 |
}; |
44 |
|
45 |
}//namespace oopse |
46 |
#endif // _ZCONS_VISITOR_H_ |
47 |
|
48 |
|