10 |
|
#define ZCONSFILENAME_ID "ZCONSFILENAME" |
11 |
|
#define ZCONSTOL_ID "ZCONSTOL" |
12 |
|
#define ZCONSFORCEPOLICY_ID "ZCONSFORCEPOLICY" |
13 |
+ |
#define ZCONSGAP_ID "ZCONSGAP" |
14 |
+ |
#define ZCONSFIXTIME_ID "ZCONSFIXTIME" |
15 |
+ |
#define ZCONSUSINGSMD_ID "ZCONSUSINGSMD" |
16 |
|
|
17 |
+ |
#define CHIVALUE_ID "CHIVALUE" |
18 |
+ |
#define INTEGRALOFCHIDT_ID "INTEGRALOFCHIDT" |
19 |
+ |
#define ETAVALUE_ID "ETAVALUE" |
20 |
+ |
|
21 |
|
using namespace std; |
22 |
|
|
23 |
|
class GenericData |
27 |
|
GenericData(const GenericData& rhs) { id = rhs.getID(); } |
28 |
|
GenericData& operator =(const GenericData& rhs); |
29 |
|
virtual ~GenericData() {} |
30 |
< |
|
30 |
> |
|
31 |
|
const string& getID() const { return id; } |
32 |
< |
void setID(string rhs) { id = rhs; } |
33 |
< |
|
32 |
> |
void setID(string rhs) { id = rhs; } |
33 |
> |
|
34 |
|
protected: |
35 |
|
string id; |
36 |
|
}; |
37 |
|
|
38 |
|
/** Something we can improve it here is to use template |
39 |
< |
** |
39 |
> |
** |
40 |
|
*/ |
41 |
+ |
|
42 |
+ |
class IntData : public GenericData{ |
43 |
+ |
|
44 |
+ |
public: |
45 |
+ |
|
46 |
+ |
double getData() { return data; } |
47 |
+ |
void setData(int rhs) { data = rhs; } |
48 |
+ |
|
49 |
+ |
protected: |
50 |
+ |
int data; |
51 |
+ |
}; |
52 |
+ |
|
53 |
|
class DoubleData : public GenericData{ |
54 |
|
|
55 |
|
public: |
56 |
|
|
57 |
|
double getData() { return data; } |
58 |
|
void setData(double rhs) { data = rhs; } |
59 |
< |
|
59 |
> |
|
60 |
|
protected: |
61 |
|
double data; |
62 |
|
}; |
63 |
|
|
64 |
|
class StringData : public GenericData{ |
65 |
< |
|
66 |
< |
public: |
65 |
> |
|
66 |
> |
public: |
67 |
|
const string& getData() const { return data; } |
68 |
|
void setData(const string& rhs) { data = rhs; } |
69 |
|
protected: |
70 |
< |
string data; |
70 |
> |
string data; |
71 |
|
}; |
72 |
|
|
73 |
< |
struct ZConsParaItem |
55 |
< |
{ |
73 |
> |
struct ZConsParaItem { |
74 |
|
int zconsIndex; |
75 |
|
bool havingZPos; |
76 |
|
double zPos; |
77 |
|
double kRatio; |
78 |
+ |
bool havingCantVel; |
79 |
+ |
double cantVel; |
80 |
|
}; |
81 |
|
|
82 |
|
class ZConsParaData : public GenericData{ |
83 |
< |
|
84 |
< |
public: |
83 |
> |
|
84 |
> |
public: |
85 |
|
ZConsParaData(); |
86 |
|
void addItem(ZConsParaItem& item) {data.push_back(item);} |
87 |
|
vector<ZConsParaItem>* getData() {return &data;} |
88 |
|
void setData(vector<ZConsParaItem>& theData) {data = theData;} |
89 |
|
void sortByIndex(); |
90 |
|
bool isIndexUnique(); |
91 |
< |
|
92 |
< |
private: |
91 |
> |
|
92 |
> |
private: |
93 |
|
vector<ZConsParaItem> data; |
94 |
|
}; |
95 |
|
|
101 |
|
|
102 |
|
}; |
103 |
|
|
104 |
+ |
class DoubleArrayData : public GenericData{ |
105 |
+ |
|
106 |
+ |
public: |
107 |
+ |
vector<double> getData() const { return data; } |
108 |
+ |
void setData(double* source, int num){ |
109 |
+ |
data.clear(); |
110 |
+ |
for(int i = 0; i < num; i++) |
111 |
+ |
data.push_back(source[i]); |
112 |
+ |
} |
113 |
+ |
protected: |
114 |
+ |
vector<double> data; |
115 |
+ |
}; |
116 |
+ |
|
117 |
+ |
struct AtomInfo : public GenericData{ |
118 |
+ |
public: |
119 |
+ |
string AtomType; |
120 |
+ |
double pos[3]; |
121 |
+ |
double dipole[3]; |
122 |
+ |
}; |
123 |
+ |
|
124 |
+ |
class AtomData : public GenericData{ |
125 |
+ |
public: |
126 |
+ |
~AtomData(); |
127 |
+ |
void addAtomInfo(AtomInfo* info) {data.push_back(info);} |
128 |
+ |
void clearAllAtomInfo(); |
129 |
+ |
AtomInfo* beginAtomInfo(vector<AtomInfo*>::iterator& i){ |
130 |
+ |
i = data.begin(); |
131 |
+ |
return i != data.end()? *i : NULL; |
132 |
+ |
} |
133 |
+ |
AtomInfo* nextAtomInfo(vector<AtomInfo*>::iterator& i){ |
134 |
+ |
++i; |
135 |
+ |
return i != data.end()? *i: NULL; |
136 |
+ |
} |
137 |
+ |
vector<AtomInfo*> getData() {return data;} |
138 |
+ |
int getSize() {return data.size();} |
139 |
+ |
protected: |
140 |
+ |
vector<AtomInfo*> data; |
141 |
+ |
}; |
142 |
+ |
|
143 |
+ |
|
144 |
+ |
|
145 |
|
#endif |