forked from raphaelmenges/MolecularDynamicsVisualization
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPath.h
More file actions
72 lines (56 loc) · 1.89 KB
/
Path.h
File metadata and controls
72 lines (56 loc) · 1.89 KB
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
//============================================================================
// Distributed under the MIT License. Author: Raphael Menges
//============================================================================
// Path of atom group.
#ifndef PATH_H
#define PATH_H
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <vector>
#include <set>
#include "SurfaceExtraction/GPUProtein.h"
#include "ShaderTools/ShaderProgram.h"
class Path
{
public:
// Constructor
Path();
// Destructor
virtual ~Path();
// Update path
void update(
GPUProtein const * pGPUProtein,
const std::set<GLuint>& atomIndices,
int smoothFrameRadius);
// Draw path
void draw(
int frame,
int drawFrameRadius,
glm::mat4 viewMatrix,
glm::mat4 projectionMatrix,
glm::vec3 pastColor,
glm::vec3 futureColor,
float pointSize) const;
// Get length of complete path
float getCompleteLength() const;
// Get length of subpath
float getLength(int startFrame, int endFrame) const;
// Get length of complete local path
float getCompleteLocalLength() const;
// Get length of local subpath
float getLocalLength(int startFrame, int endFrame) const;
// Get count of vertices in path
int getVertexCount() const { return mVertexCount; }
private:
// Members
float mlength = 0;
GLuint mVBO = 0;
GLuint mVAO = 0;
int mVertexCount = 0;
std::unique_ptr<ShaderProgram> mupProgram;
int mPositionAttribute = 0;
std::vector<std::pair<double, double> > mAccLengths; // saving accumulated lengths for easier computations.
// Size = mVertexCount - 1. Pair is global and local lengths.
// Local is global subtracted by protein's center in each frame
};
#endif // PATH_H