-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLPoints.h
64 lines (50 loc) · 1.41 KB
/
GLPoints.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
#ifndef _GL_POINTS_
#define _GL_POINTS_
#include <SimpleGui/GLObject.h>
class GLPoints : public GLObject
{
public:
GLPoints()
{
m_cMarker = '.';
m_Color = GLColor();
m_dPose = Eigen::Matrix4d::Identity();
m_sObjectName = "Points";
}
void draw()
{
glPushMatrix();
glMultMatrixd(m_dPose.data());
switch( m_cMarker ) {
case '.' :
// glEnable(GL_POINT_SMOOTH);
// glEnable(GL_BLEND);
glPointSize( 1.0 );
glColor4f( m_Color.r, m_Color.g, m_Color.b, m_Color.a );
glBegin(GL_POINTS);
for( unsigned int ii = 0; ii < m_vPoints.size(); ii += 3 ) {
glVertex3d( m_vPoints[ii], m_vPoints[ii+1], m_vPoints[ii+2] );
}
glEnd();
break;
}
glPopMatrix();
}
void SetPoints( const std::vector<double>& vPoints ) {
m_vPoints = vPoints;
}
void SetPose( const Eigen::Matrix4d& Pose )
{
m_dPose = Pose;
}
void ClearPoints() {
m_vPoints.clear();
}
// TODO add more markers (small circle, X and +), write SetColor, write SetMarker
private:
std::vector< double > m_vPoints;
Eigen::Matrix4d m_dPose;
char m_cMarker;
GLColor m_Color;
};
#endif