ARGoS 3
A parallel, multi-engine simulator for swarm robotics
qtopengl_user_functions.cpp
Go to the documentation of this file.
1
9#include <QPainter>
10
11namespace argos {
12
13 /****************************************/
14 /****************************************/
15
16 const GLfloat DEFAULT_SPECULAR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
17 const GLfloat DEFAULT_SHININESS[] = { 100.0f };
18 const GLfloat DEFAULT_EMISSION[] = { 0.0f, 0.0f, 0.0f, 1.0f };
19
20 /****************************************/
21 /****************************************/
22
23 static void Rototranslate(const CVector3& c_position,
24 const CQuaternion& c_orientation) {
25 /* Get Euler angles */
26 CRadians cZAngle, cYAngle, cXAngle;
27 c_orientation.ToEulerAngles(cZAngle, cYAngle, cXAngle);
28 /* Translate */
29 glTranslated(c_position.GetX(), c_position.GetY(), c_position.GetZ());
30 /* Rotate */
31 glRotated(ToDegrees(cXAngle).GetValue(), 1.0f, 0.0f, 0.0f);
32 glRotated(ToDegrees(cYAngle).GetValue(), 0.0f, 1.0f, 0.0f);
33 glRotated(ToDegrees(cZAngle).GetValue(), 0.0f, 0.0f, 1.0f);
34 }
35
36 /****************************************/
37 /****************************************/
38
40 m_vecFunctionHolders(1),
41 m_pcQTOpenGLMainWindow(nullptr) {
42 m_cThunks.Add<CEntity>((TThunk)nullptr);
43 }
44
45 /****************************************/
46 /****************************************/
47
54
55 /****************************************/
56 /****************************************/
57
58 void CQTOpenGLUserFunctions::KeyPressed(QKeyEvent* pc_event) {
59 m_pcQTOpenGLMainWindow->GetOpenGLWidget().KeyPressed(pc_event);
60 }
61
62 /****************************************/
63 /****************************************/
64
65 void CQTOpenGLUserFunctions::KeyReleased(QKeyEvent* pc_event) {
66 m_pcQTOpenGLMainWindow->GetOpenGLWidget().KeyReleased(pc_event);
67 }
68
69 /****************************************/
70 /****************************************/
71
75
76 /****************************************/
77 /****************************************/
78
80 m_pcQTOpenGLMainWindow->GetOpenGLWidget().SelectEntity(c_entity);
81 }
82
83 /****************************************/
84 /****************************************/
85
87 m_pcQTOpenGLMainWindow->GetOpenGLWidget().DeselectEntity();
88 }
89
90 /****************************************/
91 /****************************************/
92
94 return *m_pcQTOpenGLMainWindow;
95 }
96
97 /****************************************/
98 /****************************************/
99
101 m_pcQTOpenGLMainWindow = &c_main_win;
102 }
103
104 /****************************************/
105 /****************************************/
106
108 return m_pcQTOpenGLMainWindow->GetOpenGLWidget();
109 }
110
111 /****************************************/
112 /****************************************/
113
115 const GLfloat pfColor[] = {
116 c_color.GetRed() / 255.0f,
117 c_color.GetGreen() / 255.0f,
118 c_color.GetBlue() / 255.0f,
119 1.0f
120 };
121 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, DEFAULT_SPECULAR);
122 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, DEFAULT_SHININESS);
123 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, DEFAULT_EMISSION);
124 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, pfColor);
125 }
126
127 /****************************************/
128 /****************************************/
129
131 const CColor& c_color,
132 const Real f_diameter) {
133 /* Save attributes */
134 glPushAttrib(GL_POINT_BIT);
135 /* Set color */
136 SetColor(c_color);
137 /* Set point attributes */
138 glPointSize(static_cast<GLfloat>(f_diameter));
139 glEnable(GL_POINT_SMOOTH);
140 /* Draw */
141 glBegin(GL_POINTS);
142 glVertex3d(c_position.GetX(), c_position.GetY(), c_position.GetZ());
143 glEnd();
144 /* Restore saved attributes */
145 glPopAttrib();
146 }
147
148 /****************************************/
149 /****************************************/
150
152 const CQuaternion& c_orientation,
153 Real f_base,
154 Real f_height,
155 const CColor& c_color,
156 const bool b_fill) {
157 /* Save attributes and current matrix */
158 glPushAttrib(GL_POLYGON_BIT);
159 glPushMatrix();
160 /* Set color */
161 SetColor(c_color);
162 /* Disable face culling, to make the triangle visible from any angle */
163 glDisable(GL_CULL_FACE);
164 /* Set polygon attributes */
165 glEnable(GL_POLYGON_SMOOTH);
166 glPolygonMode(GL_FRONT_AND_BACK, b_fill ? GL_FILL : GL_LINE);
167 /* Set position/orientation */
168 Rototranslate(c_position, c_orientation);
169 /* Draw */
170 glBegin(GL_TRIANGLES);
171 glNormal3d(0.0f, 0.0f, 1.0f);
172 glVertex3d(-f_base * 0.5f, 0.0f, 0.0f);
173 glVertex3d( f_base * 0.5f, 0.0f, 0.0f);
174 glVertex3d( 0.0f, f_height, 0.0f);
175 glEnd();
176 /* Restore saved stuff */
177 glPopMatrix();
178 glPopAttrib();
179 }
180
181 /****************************************/
182 /****************************************/
183
185 const CQuaternion& c_orientation,
186 const std::vector<CVector2>& vec_points,
187 const CColor& c_color,
188 const bool b_fill) {
189 if(vec_points.size() < 2) {
190 LOGERR << "CQTOpenGLUserFunctions::DrawPolygon() needs at least 3 points." << std::endl;
191 return;
192 }
193 /* Save attributes and current matrix */
194 glPushAttrib(GL_POLYGON_BIT);
195 /* Set color */
196 SetColor(c_color);
197 /* Disable face culling, to make the triangle visible from any angle */
198 glDisable(GL_CULL_FACE);
199 /* Set polygon attributes */
200 glEnable(GL_POLYGON_SMOOTH);
201 glPolygonMode(GL_FRONT_AND_BACK, b_fill ? GL_FILL : GL_LINE);
202 /* Set position/orientation */
203 Rototranslate(c_position, c_orientation);
204 /* Draw */
205 glBegin(GL_POLYGON);
206 glNormal3d(0.0f, 0.0f, 1.0f);
207 for(size_t i = 0; i < vec_points.size(); ++i) {
208 glVertex3d(vec_points[i].GetX(), vec_points[i].GetY(), 0.0f);
209 }
210 glEnd();
211 /* Reset translation */
212 glTranslated(-c_position.GetX(), -c_position.GetY(), -c_position.GetZ());
213 /* Restore saved stuff */
214 glPopAttrib();
215 }
216
217 /****************************************/
218 /****************************************/
219
221 const CQuaternion& c_orientation,
222 Real f_radius,
223 const CColor& c_color,
224 const bool b_fill,
225 GLuint un_vertices) {
226 /* Save attributes and current matrix */
227 glPushAttrib(GL_POLYGON_BIT);
228 glPushMatrix();
229 /* Set color */
230 SetColor(c_color);
231 /* Disable face culling, to make the triangle visible from any angle */
232 glDisable(GL_CULL_FACE);
233 /* Set polygon attributes */
234 glEnable(GL_POLYGON_SMOOTH);
235 glPolygonMode(GL_FRONT_AND_BACK, b_fill ? GL_FILL : GL_LINE);
236 /* Set position/orientation */
237 Rototranslate(c_position, c_orientation);
238 /* Draw */
239 CVector2 cVertex(f_radius, 0.0f);
240 CRadians cAngle(CRadians::TWO_PI / un_vertices);
241 glBegin(GL_POLYGON);
242 glNormal3d(0.0f, 0.0f, 1.0f);
243 for(size_t i = 0; i < un_vertices; ++i) {
244 glVertex3d(cVertex.GetX(), cVertex.GetY(), 0.0f);
245 cVertex.Rotate(cAngle);
246 }
247 glEnd();
248 /* Restore saved stuff */
249 glPopAttrib();
250 glPopMatrix();
251 }
252
253 /****************************************/
254 /****************************************/
255
257 const CQuaternion& c_orientation,
258 Real f_radius,
259 Real f_height,
260 const CColor& c_color,
261 GLuint un_vertices) {
262 /* Save current matrix */
263 glPushMatrix();
264 /* Set color */
265 SetColor(c_color);
266 /* Set position/orientation */
267 Rototranslate(c_position, c_orientation);
268 /* Draw side surface */
269 Real fHalfHeight = f_height * 0.5f;
270 CVector2 cVertex(1.0f, 0.0f);
271 CRadians cAngle(CRadians::TWO_PI / un_vertices);
272 glBegin(GL_QUAD_STRIP);
273 for(GLuint i = 0; i <= un_vertices; i++) {
274 glNormal3d(cVertex.GetX(), cVertex.GetY(), 0.0f);
275 glVertex3d(cVertex.GetX() * f_radius, cVertex.GetY() * f_radius, fHalfHeight);
276 glVertex3d(cVertex.GetX() * f_radius, cVertex.GetY() * f_radius, -fHalfHeight);
277 cVertex.Rotate(cAngle);
278 }
279 glEnd();
280 /* Draw top disk */
281 cVertex.Set(f_radius, 0.0f);
282 glBegin(GL_POLYGON);
283 glNormal3d(0.0f, 0.0f, 1.0f);
284 for(GLuint i = 0; i <= un_vertices; i++) {
285 glVertex3d(cVertex.GetX(), cVertex.GetY(), fHalfHeight);
286 cVertex.Rotate(cAngle);
287 }
288 glEnd();
289 /* Draw bottom disk */
290 cVertex.Set(f_radius, 0.0f);
291 cAngle = -cAngle;
292 glBegin(GL_POLYGON);
293 glNormal3d(0.0f, 0.0f, -1.0f);
294 for(GLuint i = 0; i <= un_vertices; i++) {
295 glVertex3d(cVertex.GetX(), cVertex.GetY(), -fHalfHeight);
296 cVertex.Rotate(cAngle);
297 }
298 glEnd();
299 /* Restore saved matrix */
300 glPopMatrix();
301 }
302
303 /****************************************/
304 /****************************************/
305
307 const CQuaternion& c_orientation,
308 const CVector3& c_size,
309 const CColor& c_color) {
310 /* Save current matrix */
311 glPushMatrix();
312 /* Set color */
313 SetColor(c_color);
314 /* Set position/orientation */
315 Rototranslate(c_position, c_orientation);
316 /* Draw top and bottom faces (parallel to XY) */
317 CVector3 cHalfSize = c_size * 0.5f;
318 glBegin(GL_QUADS);
319 /* Bottom face */
320 glNormal3d(0.0f, 0.0f, -1.0f);
321 glVertex3d( cHalfSize.GetX(), cHalfSize.GetY(), -cHalfSize.GetZ());
322 glVertex3d( cHalfSize.GetX(), -cHalfSize.GetY(), -cHalfSize.GetZ());
323 glVertex3d(-cHalfSize.GetX(), -cHalfSize.GetY(), -cHalfSize.GetZ());
324 glVertex3d(-cHalfSize.GetX(), cHalfSize.GetY(), -cHalfSize.GetZ());
325 /* Top face */
326 glNormal3d(0.0f, 0.0f, 1.0f);
327 glVertex3d(-cHalfSize.GetX(), -cHalfSize.GetY(), cHalfSize.GetZ());
328 glVertex3d( cHalfSize.GetX(), -cHalfSize.GetY(), cHalfSize.GetZ());
329 glVertex3d( cHalfSize.GetX(), cHalfSize.GetY(), cHalfSize.GetZ());
330 glVertex3d(-cHalfSize.GetX(), cHalfSize.GetY(), cHalfSize.GetZ());
331 glEnd();
332 /* Draw the other faces (South, East, North, West) */
333 glBegin(GL_QUADS);
334 /* North face */
335 glNormal3d(1.0f, 0.0f, 0.0f);
336 glVertex3d( cHalfSize.GetX(), -cHalfSize.GetY(), -cHalfSize.GetZ());
337 glVertex3d( cHalfSize.GetX(), cHalfSize.GetY(), -cHalfSize.GetZ());
338 glVertex3d( cHalfSize.GetX(), cHalfSize.GetY(), cHalfSize.GetZ());
339 glVertex3d( cHalfSize.GetX(), -cHalfSize.GetY(), cHalfSize.GetZ());
340 /* South face */
341 glNormal3d(-1.0f, 0.0f, 0.0f);
342 glVertex3d(-cHalfSize.GetX(), -cHalfSize.GetY(), -cHalfSize.GetZ());
343 glVertex3d(-cHalfSize.GetX(), -cHalfSize.GetY(), cHalfSize.GetZ());
344 glVertex3d(-cHalfSize.GetX(), cHalfSize.GetY(), cHalfSize.GetZ());
345 glVertex3d(-cHalfSize.GetX(), cHalfSize.GetY(), -cHalfSize.GetZ());
346 /* East face */
347 glNormal3d(0.0f, -1.0f, 0.0f);
348 glVertex3d(-cHalfSize.GetX(), -cHalfSize.GetY(), -cHalfSize.GetZ());
349 glVertex3d( cHalfSize.GetX(), -cHalfSize.GetY(), -cHalfSize.GetZ());
350 glVertex3d( cHalfSize.GetX(), -cHalfSize.GetY(), cHalfSize.GetZ());
351 glVertex3d(-cHalfSize.GetX(), -cHalfSize.GetY(), cHalfSize.GetZ());
352 /* West face */
353 glNormal3d(0.0f, 1.0f, 0.0f);
354 glVertex3d(-cHalfSize.GetX(), cHalfSize.GetY(), -cHalfSize.GetZ());
355 glVertex3d(-cHalfSize.GetX(), cHalfSize.GetY(), cHalfSize.GetZ());
356 glVertex3d( cHalfSize.GetX(), cHalfSize.GetY(), cHalfSize.GetZ());
357 glVertex3d( cHalfSize.GetX(), cHalfSize.GetY(), -cHalfSize.GetZ());
358 glEnd();
359 /* Restore saved matrix */
360 glPopMatrix();
361 }
362
363 /****************************************/
364 /****************************************/
365
367 const CColor& c_color,
368 Real f_width) {
369 /* Save attributes and current matrix */
370 glPushAttrib(GL_LINE_BIT | GL_ENABLE_BIT);
371 /* Set line attributes */
372 glEnable(GL_LINE_SMOOTH);
373 glLineWidth(static_cast<GLfloat>(f_width));
374 /* Unset lighting */
375 glDisable(GL_LIGHTING);
376 glDisable(GL_COLOR_MATERIAL);
377 /* Set color */
378 glColor3ub(c_color.GetRed(), c_color.GetGreen(), c_color.GetBlue());
379 /* Draw ray */
380 glBegin(GL_LINES);
381 glVertex3d(c_ray.GetStart().GetX(), c_ray.GetStart().GetY(), c_ray.GetStart().GetZ());
382 glVertex3d(c_ray.GetEnd().GetX(), c_ray.GetEnd().GetY(), c_ray.GetEnd().GetZ());
383 glEnd();
384 /* Restore saved stuff */
385 glPopAttrib();
386 }
387
388 /****************************************/
389 /****************************************/
390
391 static void TransformPoint(Real* pf_vec_out,
392 const Real* pf_trans,
393 const Real* pf_vec_in) {
394#define M(row,col) pf_trans[col * 4 + row]
395 pf_vec_out[0] =
396 M(0, 0) * pf_vec_in[0] +
397 M(0, 1) * pf_vec_in[1] +
398 M(0, 2) * pf_vec_in[2] +
399 M(0, 3) * pf_vec_in[3];
400 pf_vec_out[1] =
401 M(1, 0) * pf_vec_in[0] +
402 M(1, 1) * pf_vec_in[1] +
403 M(1, 2) * pf_vec_in[2] +
404 M(1, 3) * pf_vec_in[3];
405 pf_vec_out[2] =
406 M(2, 0) * pf_vec_in[0] +
407 M(2, 1) * pf_vec_in[1] +
408 M(2, 2) * pf_vec_in[2] +
409 M(2, 3) * pf_vec_in[3];
410 pf_vec_out[3] =
411 M(3, 0) * pf_vec_in[0] +
412 M(3, 1) * pf_vec_in[1] +
413 M(3, 2) * pf_vec_in[2] +
414 M(3, 3) * pf_vec_in[3];
415#undef M
416 }
417
418 /****************************************/
419 /****************************************/
420
422 const std::string& str_text,
423 const CColor& c_color,
424 const QFont& c_font) {
425 /* Get current modelview matrix */
426 GLdouble pf_mv[16];
427 glGetDoublev(GL_MODELVIEW_MATRIX, pf_mv);
428 /* Get current projection matrix */
429 GLdouble pf_proj[16];
430 glGetDoublev(GL_PROJECTION_MATRIX, pf_proj);
431 /* Get current viewport */
432 GLint pn_vp[4];
433 glGetIntegerv(GL_VIEWPORT, pn_vp);
434 /* Buffers for projection calculations */
435 GLdouble pf_v1[4], pf_v2[4];
436 /* Transform original position with modelview matrix */
437 pf_v1[0] = c_position.GetX();
438 pf_v1[1] = c_position.GetY();
439 pf_v1[2] = c_position.GetZ();
440 pf_v1[3] = 1.0;
441 TransformPoint(pf_v2, pf_mv, pf_v1);
442 /* Transform pf_v2 with projection matrix */
443 TransformPoint(pf_v1, pf_proj, pf_v2);
444 /* Failed projection? Get out */
445 if (pf_v1[3] == 0.0) return;
446 /* Rescale projection */
447 pf_v1[0] /= pf_v1[3];
448 pf_v1[1] /= pf_v1[3];
449 /* Get screen position (before mirroring) */
450 pf_v2[0] =
451 (pn_vp[0] + (1. + pf_v1[0]) * pn_vp[2] / 2.) /
452 GetMainWindow().devicePixelRatio();
453 pf_v2[1] =
454 (pn_vp[1] + (1. + pf_v1[1]) * pn_vp[3] / 2.) /
455 GetMainWindow().devicePixelRatio();
456 /* Mirror along Y because screen goes up to down */
457 pf_v2[1] = GetMainWindow().GetOpenGLWidget().height() - pf_v2[1];
458 /* Save OpenGL attributes */
459 glPushAttrib(GL_ENABLE_BIT);
460 /* Disable lighting to make text color unaffected by light */
461 glDisable(GL_LIGHTING);
462 glDisable(GL_COLOR_MATERIAL);
463 /* Disable culling to make text visibile from any angle */
464 glDisable(GL_CULL_FACE);
465 /* Initialize Qt screen painter */
466 QPainter cPainter(&GetMainWindow().GetOpenGLWidget());
467 /* Set antialiasing */
468 cPainter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
469 /* Set pen color */
470 cPainter.setPen(
471 QColor(c_color.GetRed(),
472 c_color.GetGreen(),
473 c_color.GetBlue(),
474 c_color.GetAlpha()));
475 /* Set font */
476 cPainter.setFont(c_font);
477 /* Render text */
478 cPainter.drawText(static_cast<UInt32>(pf_v2[0]),
479 static_cast<UInt32>(pf_v2[1]),
480 str_text.c_str());
481 /* Dispose of Qt screen painter */
482 cPainter.end();
483 /* Restore saved attributes */
484 glPopAttrib();
485 }
486
487 /****************************************/
488 /****************************************/
489
491 TThunk t_thunk = m_cThunks[c_entity.GetTag()];
492 if(t_thunk) (this->*t_thunk)(c_entity);
493 }
494
495 /****************************************/
496 /****************************************/
497
498}
#define M(row, col)
unsigned int UInt32
32-bit unsigned integer.
Definition datatypes.h:97
float Real
Collects all ARGoS code.
Definition datatypes.h:39
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
CARGoSLog LOGERR(std::cerr, SLogColor(ARGOS_LOG_ATTRIBUTE_BRIGHT, ARGOS_LOG_COLOR_RED))
Definition argos_log.h:180
const GLfloat DEFAULT_SPECULAR[]
CDegrees ToDegrees(const CRadians &c_radians)
Converts CRadians to CDegrees.
Definition angles.h:489
const GLfloat DEFAULT_EMISSION[]
const GLfloat DEFAULT_SHININESS[]
The basic entity type.
Definition entity.h:90
The basic color type.
Definition color.h:25
UInt8 GetBlue() const
Returns the blue channel of the color.
Definition color.h:101
UInt8 GetGreen() const
Returns the green channel of the color.
Definition color.h:90
UInt8 GetRed() const
Returns the red channel of the color.
Definition color.h:79
UInt8 GetAlpha() const
Returns the alpha channel of the color.
Definition color.h:112
It defines the basic type CRadians, used to store an angle value in radians.
Definition angles.h:42
static const CRadians TWO_PI
Set to PI * 2.
Definition angles.h:54
CVector3 & GetStart()
Definition ray3.h:37
CVector3 & GetEnd()
Definition ray3.h:45
A 2D vector class.
Definition vector2.h:27
Real GetY() const
Returns the y coordinate of this vector.
Definition vector2.h:110
CVector2 & Rotate(const CRadians &c_angle)
Rotates this vector by the wanted angle.
Definition vector2.h:194
void Set(Real f_x, Real f_y)
Sets the vector contents from Cartesian coordinates.
Definition vector2.h:127
Real GetX() const
Returns the x coordinate of this vector.
Definition vector2.h:94
A 3D vector class.
Definition vector3.h:31
Real GetX() const
Returns the x coordinate of this vector.
Definition vector3.h:105
Real GetY() const
Returns the y coordinate of this vector.
Definition vector3.h:121
Real GetZ() const
Returns the z coordinate of this vector.
Definition vector3.h:137
CQTOpenGLWidget & GetOpenGLWidget()
std::vector< CFunctionHolder * > m_vecFunctionHolders
A vector of function holders.
void SetColor(const CColor &c_color)
Sets the current drawing color.
void SetMainWindow(CQTOpenGLMainWindow &c_main_win)
Sets the QTOpenGL main window for these user functions.
CVTable< CQTOpenGLUserFunctions, CEntity, TThunk > m_cThunks
The vtable storing the thunks.
void DrawPoint(const CVector3 &c_position, const CColor &c_color=CColor::RED, Real f_diameter=5.0)
Draws a point.
void DrawTriangle(const CVector3 &c_position, const CQuaternion &c_orientation, Real f_base, Real f_height, const CColor &c_color=CColor::RED, const bool b_fill=true)
Draws an isosceles triangle.
virtual void SelectEntity(CEntity &c_entity)
Selects the specified entity.
void(CQTOpenGLUserFunctions::*) TThunk(CEntity &)
Pointer-to-thunk type definition.
virtual void KeyPressed(QKeyEvent *pc_event)
Called when a key press event occurs.
virtual ~CQTOpenGLUserFunctions()
Class destructor.
CQTOpenGLMainWindow & GetMainWindow()
Returns the QTOpenGL main window.
virtual void KeyReleased(QKeyEvent *pc_event)
Called when a key release event occurs.
virtual void Call(CEntity &c_entity)
Calls a user method for the given entity.
void DrawPolygon(const CVector3 &c_position, const CQuaternion &c_orientation, const std::vector< CVector2 > &vec_points, const CColor &c_color=CColor::RED, const bool b_fill=true)
Draws a 2D polygon.
void DrawBox(const CVector3 &c_position, const CQuaternion &c_orientation, const CVector3 &c_size, const CColor &c_color=CColor::RED)
Draws a box.
CQTOpenGLWidget & GetQTOpenGLWidget()
Returns the QTOpenGLWidget.
void DrawText(const CVector3 &c_position, const std::string &str_text, const CColor &c_color=CColor::BLACK, const QFont &c_font=QFont())
Draws a string of text.
void DrawCylinder(const CVector3 &c_position, const CQuaternion &c_orientation, Real f_radius, Real f_height, const CColor &c_color=CColor::RED, GLuint un_vertices=20)
Draws a cylinder, with the height perpendicular to the XY plane.
CEntity * GetSelectedEntity()
Returns the currently selected entity, or NULL.
void DrawCircle(const CVector3 &c_position, const CQuaternion &c_orientation, Real f_radius, const CColor &c_color=CColor::RED, const bool b_fill=true, GLuint un_vertices=20)
Draws a circle.
void DrawRay(const CRay3 &c_ray, const CColor &c_color=CColor::RED, Real f_width=1.0f)
Draws a ray, with optional endpoint markers.
virtual void DeselectEntity()
Deselects the currently selected entity.
CEntity * GetSelectedEntity()
Returns the currently selected entity, or NULL if none is selected.
void KeyPressed(QKeyEvent *pc_event)
Handles key press events.
void SelectEntity(CEntity &c_entity)
Selects the passed entity.
void KeyReleased(QKeyEvent *pc_event)
Handles key release events.
void DeselectEntity()
Deselects the currently selected entity.