RobWorkProject  23.9.11-
Public Member Functions | Protected Member Functions | List of all members
GLViewRW Class Reference

Class representing an OpenGL based QT Widget for 3D visualization of Drawables. More...

#include <GLViewRW.hpp>

Inherits QOpenGLWidget.

Public Member Functions

 GLViewRW (QWidget *parent=0)
 Constructs an OpenGL based QT Widget. More...
 
 ~GLViewRW ()
 destructor
 
void setupToolBar (QToolBar *toolbar)
 sets up the toolbar
 
void setupMenu (QMenu *menu)
 sets up menu
 
void addDrawable (rwlibs::opengl::Drawable *drawable)
 Adds a Drawable to the view component. More...
 
void clear ()
 Clears the list of Drawables.
 
void saveBufferToFile (const QString &filename)
 Saves the current 3D view to disk as either jpg, bmp or png. More...
 
void showPivotPoint (bool visible)
 Specified whether to visualize the pivot point. More...
 
void setDrawType (rw::graphics::Render::DrawType drawType)
 Sets whether to visualize as SOLID, WIRE or BOTH. More...
 
void keyPressEvent (QKeyEvent *e)
 

Protected Member Functions

void initializeGL ()
 
void paintGL ()
 
void resizeGL (int width, int height)
 
void mouseDoubleClickEvent (QMouseEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void wheelEvent (QWheelEvent *event)
 

Detailed Description

Class representing an OpenGL based QT Widget for 3D visualization of Drawables.

Constructor & Destructor Documentation

◆ GLViewRW()

GLViewRW ( QWidget *  parent = 0)

Constructs an OpenGL based QT Widget.

Parameters
parent[in] Parent widget

Member Function Documentation

◆ addDrawable()

void addDrawable ( rwlibs::opengl::Drawable drawable)

Adds a Drawable to the view component.

The GLViewRW does not take control of the drawable, therefore it is the callers reponsibility to destroy the Drawable when not being used anymore.

Likewise it is the callers reponsibility not to delete the Drawable before being removed from the GLViewRW Widget.

Parameters
drawable[in] Pointer to drawable to be visualized

◆ saveBufferToFile()

void saveBufferToFile ( const QString &  filename)

Saves the current 3D view to disk as either jpg, bmp or png.

If failing a std::string is thrown with a detailed description of what when wrong.

Parameters
filename[in] Path and name of the file. The filename extension should be either ".jpg", ".bmp" or ".png" to specify which format to use.

◆ setDrawType()

void setDrawType ( rw::graphics::Render::DrawType  drawType)

Sets whether to visualize as SOLID, WIRE or BOTH.

Parameters
drawType[in] The drawtype to use

◆ showPivotPoint()

void showPivotPoint ( bool  visible)

Specified whether to visualize the pivot point.

Parameters
visible[in] True for showing pivot point, false otherwise.

The documentation for this class was generated from the following file: