Public Slots | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SensorDataGLWidget Class Reference

OpenGL widget to display sensor data and the 3D world model. More...

#include <SensorDataGLWidget.h>

List of all members.

Public Slots

void followNode (const QString &nodeName)
 Process ingoing messages.
void performCameraMove ()
 Performs a 360 degree camera move around the robot.
void setBgColor (float r, float g, float b, float a=0.0)
 Set clear color.
void setCameraRotation (float rotationY, float rotationZ)
 set camera rotation relative to look-at node [deg]
void setLookAt (BaseLib::Math::Vec3d lookAt)

Public Member Functions

void addPainter (PainterPlugin *painter)
PainterPlugingetPainter (std::string p)
 SensorDataGLWidget (QWidget *parent=0)
 ~SensorDataGLWidget ()

Protected Member Functions

void initializeGL ()
 This method enables the OpenGL features that are used by the widget and sets the initial perspective. It is called by Qt once while creating the widget.
virtual QSize minimumSizeHint () const
void mouseMoveEvent (QMouseEvent *event)
void mousePressEvent (QMouseEvent *event)
void paintGL ()
void resizeGL (int w, int h)
virtual QSize sizeHint () const
void wheelEvent (QWheelEvent *event)

Private Member Functions

void setProjectionMatrix ()

Private Attributes

float m_CameraDistance
bool m_CameraImageMode
float m_CameraOpeningAngle
float m_CameraRotationY
float m_CameraRotationZ
 Camera Position relative to LookAt point (degrees / mm)
int m_CameraTurning
float m_CameraTurnStartTime
 variables used for camera turn
bool m_ForceRedraw
BaseLib::Math::Vec3d m_LookAt
 Look-At coordinates relative to LookAtNode.
std::string m_LookAtNode
 Node in SceneGraph to follow.
QPoint m_MousePosOld
 the position of the mouse when a button is pressed.
std::list< PainterPlugin * > m_Painters
std::map< std::string,
PainterPlugin * > 
m_PaintersMap
QTimer * m_RedrawTimer
bool m_SceneGraphInitialized
int m_ViewportHeight
int m_ViewportWidth

Static Private Attributes

static int WidgetCounter

Detailed Description

OpenGL widget to display sensor data and the 3D world model.

Author:
David Gossow (RX/R12) This widget displays nothing in its initial state. Additional display functions can be added as PainterPlugin objects

Definition at line 37 of file SensorDataGLWidget.h.


Constructor & Destructor Documentation

SensorDataGLWidget::SensorDataGLWidget ( QWidget *  parent = 0)

The constructor initializes all member variables with meaningful values and gives the given parent to the constructor of the base class.

Parameters:
parentPointer to the parent-widget.

The destructor deletes all dynamically allocated memory.


Member Function Documentation

void SensorDataGLWidget::followNode ( const QString &  nodeName) [slot]

Process ingoing messages.

attach the camera to this node

PainterPlugin* SensorDataGLWidget::getPainter ( std::string  p) [inline]

Definition at line 58 of file SensorDataGLWidget.h.

void SensorDataGLWidget::initializeGL ( ) [protected]

This method enables the OpenGL features that are used by the widget and sets the initial perspective. It is called by Qt once while creating the widget.

virtual QSize SensorDataGLWidget::minimumSizeHint ( ) const [protected, virtual]
Returns:
Minimum size of the widget
void SensorDataGLWidget::mouseMoveEvent ( QMouseEvent *  event) [protected]

This event is caught by the widget to implement zooming and changing the view angle by dragging the mouse. The pressed button is checked and the zoom or the view angle are changed according to the distance the mouse was moved. It is only used if the left or the right mouse button is pressed.

Parameters:
eventThe event that Qt gives to this widget when the mouse is moving across this widget.
void SensorDataGLWidget::mousePressEvent ( QMouseEvent *  event) [protected]

When the widget receives this event, the mouse position is saved to enable zooming and tilting with moving the mouse.

Parameters:
eventThe event that Qt gives to this widget when a mouse button was pressed above this widget.
void SensorDataGLWidget::paintGL ( ) [protected]

This is the main painting method of the widget. It is automatically called by Qt when the window has to be drawn. It is also called when incoming messages (by the message receive slot) change the data that is displayed. The method calls the other painting methods (i.e. paintSonarData(), paintRobot(), ...) if the corresponding switches (m_PaintSonarData, m_PaintRobot) are set to true.

Performs a 360 degree camera move around the robot.

Parameters:
deltaPhidefines the angle wich the camera is turned by per step.
void SensorDataGLWidget::resizeGL ( int  w,
int  h 
) [protected]

This method is automatically called by Qt when the widget was resized. It re-sets the perspective, so that everything looks fine.

Parameters:
wnew width of the widget (given by Qt)
hnew height of the widget (given by Qt)
void SensorDataGLWidget::setBgColor ( float  r,
float  g,
float  b,
float  a = 0.0 
) [slot]

Set clear color.

void SensorDataGLWidget::setCameraRotation ( float  rotationY,
float  rotationZ 
) [slot]

set camera rotation relative to look-at node [deg]

void SensorDataGLWidget::setLookAt ( BaseLib::Math::Vec3d  lookAt) [slot]
virtual QSize SensorDataGLWidget::sizeHint ( ) const [protected, virtual]
Returns:
Preferred size of this widget.
void SensorDataGLWidget::wheelEvent ( QWheelEvent *  event) [protected]

This event is used to manipulate the z-position (zoom) of the camera.

Parameters:
eventThe event that Qt gives to this widget when the scroll wheel of the mouse was turned above this widget.

Member Data Documentation

Definition at line 152 of file SensorDataGLWidget.h.

Definition at line 169 of file SensorDataGLWidget.h.

Definition at line 154 of file SensorDataGLWidget.h.

Definition at line 151 of file SensorDataGLWidget.h.

Camera Position relative to LookAt point (degrees / mm)

Definition at line 150 of file SensorDataGLWidget.h.

Definition at line 158 of file SensorDataGLWidget.h.

variables used for camera turn

Definition at line 157 of file SensorDataGLWidget.h.

Definition at line 174 of file SensorDataGLWidget.h.

BaseLib::Math::Vec3d SensorDataGLWidget::m_LookAt [private]

Look-At coordinates relative to LookAtNode.

Definition at line 147 of file SensorDataGLWidget.h.

std::string SensorDataGLWidget::m_LookAtNode [private]

Node in SceneGraph to follow.

Definition at line 144 of file SensorDataGLWidget.h.

the position of the mouse when a button is pressed.

Definition at line 162 of file SensorDataGLWidget.h.

Definition at line 166 of file SensorDataGLWidget.h.

std::map<std::string, PainterPlugin*> SensorDataGLWidget::m_PaintersMap [private]

Definition at line 167 of file SensorDataGLWidget.h.

Definition at line 159 of file SensorDataGLWidget.h.

Definition at line 141 of file SensorDataGLWidget.h.

Definition at line 172 of file SensorDataGLWidget.h.

Definition at line 171 of file SensorDataGLWidget.h.

int SensorDataGLWidget::WidgetCounter [static, private]

Definition at line 176 of file SensorDataGLWidget.h.


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


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43