A wrapper class for drawing 3D shapes in OpenGL.
More...
#include <glWidget.hh>
|
virtual void | init () override |
| Initialize the openGL widget. More...
|
|
virtual void | draw () override |
| Draw a content in the openGL widget. More...
|
|
virtual QString | helpString () const override |
| Construct a help string for the openGL widget. More...
|
|
|
void | loadTexture (GLuint *texture, const std::string &path) |
| Load a texture object. More...
|
|
void | drawRobot () |
| Draw the robot shape. More...
|
|
void | drawOneObstacle (GLfloat x, GLfloat y, GLfloat z, GLfloat color) |
| Draw the one obstacle on (x, y, z) coordinates. More...
|
|
void | _drawCube (GLfloat size, GLubyte R, GLubyte G, GLubyte B) |
| Draw a cube shape. More...
|
|
void | _drawCylinder (GLfloat radius, GLfloat height, GLubyte R, GLubyte G, GLubyte B, GLuint texture) |
| Draw the cylinder shape with the texture on the top. More...
|
|
Definition at line 25 of file glWidget.hh.
◆ GLWidget()
GLWidget::GLWidget |
( |
QWidget * |
parent | ) |
|
- Parameters
-
[in,out] | parent | A pointer to the parent object. |
Definition at line 27 of file glWidget.cpp.
◆ _drawCube()
void GLWidget::_drawCube |
( |
GLfloat |
size, |
|
|
GLubyte |
R, |
|
|
GLubyte |
G, |
|
|
GLubyte |
B |
|
) |
| |
|
private |
- Parameters
-
[in] | size | A cube size. |
[in] | R | A red color value [0-255]. |
[in] | G | A green color value [0-255]. |
[in] | B | A blue color value [0-255]. |
Definition at line 186 of file glWidget.cpp.
◆ _drawCylinder()
void GLWidget::_drawCylinder |
( |
GLfloat |
radius, |
|
|
GLfloat |
height, |
|
|
GLubyte |
R, |
|
|
GLubyte |
G, |
|
|
GLubyte |
B, |
|
|
GLuint |
texture |
|
) |
| |
|
private |
- Parameters
-
[in] | radius | The cylinder radius value. |
[in] | height | The cylinder height value. |
[in] | R | A red color value [0-255]. |
[in] | G | A green color value [0-255]. |
[in] | B | A blue color value [0-255]. |
[in] | texture | The texture to draw on the top on the cylinder. |
Definition at line 233 of file glWidget.cpp.
◆ draw()
◆ drawOneObstacle()
void GLWidget::drawOneObstacle |
( |
GLfloat |
x, |
|
|
GLfloat |
y, |
|
|
GLfloat |
z, |
|
|
GLfloat |
color |
|
) |
| |
|
private |
- Parameters
-
[in] | x | Coordinate on the x axis. |
[in] | y | Coordinate on the y axis. |
[in] | z | Coordinate on the z axis. |
[in] | color | The obstacle color. |
Definition at line 177 of file glWidget.cpp.
◆ drawRobot()
void GLWidget::drawRobot |
( |
| ) |
|
|
private |
Wrapper function for drawing whole the robot shape from a cylinder shapes.
Definition at line 152 of file glWidget.cpp.
◆ helpString()
QString GLWidget::helpString |
( |
| ) |
const |
|
overrideprotectedvirtual |
◆ init()
◆ leftWheelDirection
void GLWidget::leftWheelDirection |
( |
const int & |
direction | ) |
|
|
slot |
- Parameters
-
[in] | direction | The wheel spining direction. |
Definition at line 68 of file glWidget.cpp.
◆ loadTexture()
void GLWidget::loadTexture |
( |
GLuint * |
texture, |
|
|
const std::string & |
path |
|
) |
| |
|
private |
Loads the texture from given path to passed texture handle.
- Parameters
-
[in,out] | texture | A texture handle. |
[in] | path | A path to a texture file. |
Definition at line 132 of file glWidget.cpp.
◆ obstacleDataReady
void GLWidget::obstacleDataReady |
( |
const std::map< float, int > & |
lidarData | ) |
|
|
slot |
- Parameters
-
[in] | lidarData | A lidar data from the frame parser. |
Definition at line 33 of file glWidget.cpp.
◆ rightWheelDirection
void GLWidget::rightWheelDirection |
( |
const int & |
direction | ) |
|
|
slot |
- Parameters
-
[in] | direction | The wheel spining direction. |
Definition at line 63 of file glWidget.cpp.
◆ _dimensions
◆ _leftWheelDirection
int GLWidget::_leftWheelDirection = 0 |
|
private |
◆ _obstacleColors
std::vector<float> GLWidget::_obstacleColors |
|
private |
◆ _obstacleCoordinates
std::vector<std::vector<float> > GLWidget::_obstacleCoordinates |
|
private |
◆ _rightWheelDirection
int GLWidget::_rightWheelDirection = 0 |
|
private |
◆ _robotTexturePath
QString GLWidget::_robotTexturePath |
|
private |
◆ _wheelTexturePath
QString GLWidget::_wheelTexturePath |
|
private |
The documentation for this class was generated from the following files: