1 |
gezelter |
2 |
#ifndef _BASEATOMVISITOR_H_ |
2 |
|
|
#define _BASEATOMVISITOR_H_ |
3 |
|
|
|
4 |
tim |
3 |
#include "visitors/BaseVisitor.hpp" |
5 |
gezelter |
2 |
#include <vector> |
6 |
|
|
using namespace std; |
7 |
|
|
|
8 |
|
|
class BaseAtomVisitor : public BaseVisitor{ |
9 |
|
|
public: |
10 |
|
|
virtual void visit(Atom* atom) {} |
11 |
|
|
virtual void visit(DirectionalAtom* datom) {} |
12 |
|
|
virtual void visit(RigidBody* rb); |
13 |
|
|
void setVisited(Atom* atom); |
14 |
|
|
bool isVisited(Atom* atom); |
15 |
|
|
|
16 |
|
|
protected: |
17 |
|
|
BaseAtomVisitor(SimInfo* info) : BaseVisitor() {} |
18 |
|
|
SimInfo* info; |
19 |
|
|
}; |
20 |
|
|
|
21 |
|
|
|
22 |
|
|
class SSDAtomVisitor : public BaseAtomVisitor{ |
23 |
|
|
public: |
24 |
|
|
SSDAtomVisitor(SimInfo* info) : BaseAtomVisitor(info) { |
25 |
|
|
visitorName = "SSDAtomVisitor"; |
26 |
|
|
ssdAtomType.push_back("SSD"); |
27 |
|
|
ssdAtomType.push_back("SSD_E"); |
28 |
|
|
ssdAtomType.push_back("SSD_RF"); |
29 |
|
|
ssdAtomType.push_back("SSD1"); |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
virtual void visit(Atom* atom) {} |
33 |
|
|
virtual void visit(DirectionalAtom* datom); |
34 |
|
|
virtual void visit(RigidBody* rb) {} |
35 |
|
|
|
36 |
|
|
virtual const string toString(); |
37 |
|
|
private: |
38 |
|
|
inline bool isSSDAtom(const string& atomType); |
39 |
|
|
vector<string> ssdAtomType; |
40 |
|
|
}; |
41 |
|
|
|
42 |
|
|
class DefaultAtomVisitor : public BaseAtomVisitor{ |
43 |
|
|
public: |
44 |
|
|
DefaultAtomVisitor(SimInfo* info) : BaseAtomVisitor(info) { visitorName = "DefaultAtomVisitor";} |
45 |
|
|
|
46 |
|
|
virtual void visit(Atom* atom); |
47 |
|
|
virtual void visit(DirectionalAtom* datom); |
48 |
|
|
virtual void visit(RigidBody* rb) {} |
49 |
|
|
|
50 |
|
|
virtual const string toString(); |
51 |
|
|
|
52 |
|
|
}; |
53 |
|
|
#endif |