-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAtom.h
279 lines (234 loc) · 7.37 KB
/
Atom.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
/**
* @file Atom.h
* @author Donal Evans
* @date 03 Jun 2016
* @see Residue.h
* @brief This class stores information for one atom from the input files.
*
* Detailed description goes here
*/
#ifndef ATOM_H
#define ATOM_H
#include <QVector>
#include <QVector3D>
class Atom
{
public:
/**
* @brief Getter for the Atom name.
* @return The Atom name as a QString.
*/
QString GetAtomName();
/**
* @brief Setter for the Atom name.
* @param atomName The name of the Atom as a QString.
*/
void SetAtomName(QString atomName);
/**
* @brief Getter for the name of the parent Residue of the Atom.
* @return A String containing the name of the parent Residue.
*/
QString GetParentResidue();
/**
* @brief Setter for the name of the parent Residue of the Atom.
* @param parentResidue The name of the Residue to which this Atom belongs.
*/
void SetParentResidue(QString parentResidue);
/**
* @brief Getter for the Residue ID for this Atom.
* @return The ID of the Residue to which this Atom belongs.
*/
int GetParentResidueID();
/**
* @brief Getter for the path curvature vector for this Atom.
* @return A QVector containing the calculated path curvature at each
* time step as a float value.
*/
QVector<float>& GetPathCurvatureRef();
/**
* @brief Getter for the path length vector for this Atom.
* @return A QVector containing the calculated path length at each
* time step as a float value.
*/
QVector<float>& GetPathLengthRef();
/**
* @brief Getter for the step time vector for this Atom.
* @return A QVector containing the time for each step in ms as an int.
*/
QVector<int>& GetStepTimeRef();
/**
* @brief Getter for the trajectory vector for this Atom.
* @return A QVector containing the 3D coordinates of the Atom at each
* time step.
*/
QVector<QVector3D>& GetTrajectoryRef();
/**
* @brief Getter for the velocity magnitude for this Atom.
* @return A QVector containing the velocity magnitude of the Atom at each
* time step.
*/
QVector<float>& GetVelocityRef();
/**
* @brief Empty constructor.
*/
Atom();
/**
* @brief Constructor using a String containing Atom name, parent Residue
* name and parent Residue ID.
* @param atomDetail The line of the .gro file for this Atom.
*/
Atom(QString& atomDetail);
/**
* @brief addTimeStep Adds a new time step to the atom data.
* @param xPos The x position of the atom.
* @param yPos The y position of the atom.
* @param zPos The z position of the atom.
* @param stepTime The time at which this step occurs.
*/
void AddTimeStep(float xPos,
float yPos,
float zPos,
int stepTime);
/**
* @brief Calculates the path curvature for this Atom at each time step
* using the trajectory data and stores the calcualted values.
*/
void CalculatePathCurvature();
/**
* @brief Calculates the path length for this Atom at each time step using
* the trajectory data and stores the calcualted values.
*/
void CalculatePathLength();
/**
* @brief Calculates the velocity of this Atom at each time step using
* the trajectory data and stores the calcualted values.
*/
void CalculateVelocity();
/**
* @brief Prints out the information stored in the Atom object.
*/
void PrintAtom();
/**
* @brief Prints the information contained within this Atom at the
* specified frame.
* @param frame The frame to be printed.
*/
void PrintAtomFrame(int frame);
/**
* @brief The offset within a line of .gro file data of the atom name
* string, in characters.
*/
static const int ATOM_NAME_START = 10;
/**
* @brief The number of spatial dimensions in the Atom data.
*/
static const int DIMENSIONS = 3;
/**
* @brief The size in characters of the residue name and atom name
* fields in the .gro file.
*/
static const int GRO_FIELD_SIZE = 5;
/**
* @brief The offset within a line of .gro file data of the residue name
* string, in characters.
*/
static const int RESIDUE_NAME_START = 5;
private:
/**
* @brief Setter for the ID of the Residue to which this Atom belongs.
* @param parentResidueID The ID of the Residue to which this Atom belongs.
*/
void setParentResidueID(int parentResidueID);
/**
* @brief Setter for the path curvature vector for this Atom.
* @param pathCurvature A QVector of float values representing the
* curvature of the atom path at each time step.
*/
void setPathCurvature(QVector<float> pathCurvature);
/**
* @brief Setter for the path length vector for this Atom.
* @param pathLength A QVector of float values representing the
* length of the atom path at each time step.
*/
void setPathLength(QVector<float> pathLength);
/**
* @brief Setter for the step time vector for this Atom.
* @param stepTime A QVector of int values representing the
* time for each step in ms.
*/
void setStepTime(QVector<int> stepTime);
/**
* @brief Setter for the trajectory vector for this Atom.
* @param trajectory A QVector of 3D coordinates for the atom at
* each time step.
*/
void setTrajectory(QVector<QVector3D> trajectory);
/**
* @brief Setter for the velocity vector for this Atom.
* @param velocity A QVector of velocity magnitude values for the atom at
* each time step.
*/
void setVelocity(QVector<float> velocity);
/**
* @brief m_AtomName The name of the Atom.
*/
QString m_AtomName;
/**
* @brief The name of the Residue to which this Atom belongs.
*/
QString m_ParentResidue;
/**
* @brief The ID number of the Residue to which this Atom belongs.
*/
int m_ParentResidueID;
/**
* @brief A QVector containing the path curvature for the Atom at each
* time step.
*/
QVector<float> m_PathCurvature;
/**
* @brief A QVector containing the path length for the Atom at each
* time step.
*/
QVector<float> m_PathLength;
/**
* @brief The value of Phi for the previous frame, used in calculating
* path curvature.
*/
float m_PrevPhi = 0;
/**
* @brief The value of Theta for the previous frame, used in calculating
* path curvature.
*/
float m_PrevTheta = 0;
/**
* @brief A QVector containing the step time in ms for each step.
*/
QVector<int> m_StepTime;
/**
* @brief The value of Phi for the current frame, used in calculating
* path curvature.
*/
float m_ThisPhi;
/**
* @brief The value of Theta for the current frame, used in calculating
* path curvature.
*/
float m_ThisTheta;
/**
* @brief A QVector containing the 3D position of the Atom at each
* time step.
*/
QVector<QVector3D> m_Trajectory;
/**
* @brief A QVector containing the 3D velocity of the Atom at each
* time step.
*/
QVector<float> m_Velocity;
/**
* @brief The number of miliseconds in a second, used for scaling
* velocity values.
*/
const int MS_SECOND = 1000;
};
#endif // ATOM_H