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