Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

SIGEL_CommonGUI::SIG_VisualisationWidget Class Reference

This is the superclass of all widget-classes that should be used to integrate the OpenGL-Visualisation-classes into the GUI. More...

#include <SIG_VisualisationWidget.h>

Inheritance diagram for SIGEL_CommonGUI::SIG_VisualisationWidget:

SIG_SimulationVisualisationWidget List of all members.

Public Methods

 SIG_VisualisationWidget ( QWidget *parent=0, char const *name=0, WFlags f=0 )
 The constructor of the SIG_VisualisationWidget. More...

 ~SIG_VisualisationWidget ()
 The destructor of the SIG_VisualisationWidget. More...


Public Slots

virtual void setRenderMode ( const QString & string )
virtual void setAmbientLighting ( int newValue )
virtual void setShowAncorPoints ( int state )
virtual void setYaw ( double yyaw )
 This method sets the eyepoint's yaw angle. More...

virtual void setPitch ( double ppitch )
 This method sets the eyepoint's pitch angle. More...

virtual void setDistance ( double ddistance )
 This method sets the distance between eyepoint and lookpoint. More...


Signals

void signalMouseRotation (int, int)
 This signal is emmited when the user has moved the mouse. More...

void signalMouseZoom (int)
 This signal is emmited when the user has moved the mouse. More...


Protected Methods

virtual void initializeGL ()
 Initaliazes some OpenGL stuff. More...

virtual void resizeGL (int width, int height)
 Resizes the contents of this widget. More...

virtual void paintGL ()
 Refreshes the contents of this widget by initiating the execution of appropriate OpenGL drawing commands. More...

virtual void updateEyePoint ()
 Calculates the actual eyepoint from the attributes yaw, pitch and distance. More...

void initFloatingTextWidgets ()
virtual void mousePressEvent ( QMouseEvent *event )
 This methid is inherited from the QWidget. More...

virtual void mouseMoveEvent ( QMouseEvent *event )
 This methid is inherited from the QWidget. More...


Protected Attributes

SIGEL_Visualisation::SIG_Visualisationvisualisation
 The pointer to the SIG_Visualisation object that is finally responsible for the drawing of this widgets contents. More...

double yaw
 The eyepoints actual yaw angle. More...

double pitch
 The eyepoints actual pitch angle. More...

double distance
 The actual distance between the eyepoint and the lookpoint. More...

int mouseXPos
 The last X-position of the mouse. More...

int mouseYPos
 The last Y-position of the mouse. More...

bool automaticRefresh
 If true, changing of the eyepoint effects refreshing this widget. More...

double const mouseSensity
 The mouse sensity. More...

double const pi
 The mathematical constant . More...

QVector< SIG_FloatingTextLabel > floatingTextWidgets
QSize floatingTextsSize
int showAncorPointsState

Detailed Description

This is the superclass of all widget-classes that should be used to integrate the OpenGL-Visualisation-classes into the GUI.

It inherits from QGLWidget and extends it with functionality used in all subclasses, which finally are instantiated in the GUI widgets that contain 3D views of a robot, an environment or a simulation. This includes easily changing the eyepoint (due to yaw and pitch angles and a distance value), lookpoint and OpenGL related stuff involved in widget resizing for example. To provide this functionality it need some basic features that have all visualisation-classes in common. That's why this class aggregates a pointer to the SIG_Visualisation superclass.

Definition at line 34 of file SIG_VisualisationWidget.h.


Constructor & Destructor Documentation

SIGEL_CommonGUI::SIG_VisualisationWidget::SIG_VisualisationWidget ( QWidget * parent = 0,
char const * name = 0,
WFlags f = 0 )
 

The constructor of the SIG_VisualisationWidget.

Initializes the eyepoint and calculates . MouseSensity is set to 0\. 5 at the moment.

Parameters:
parent   Pointer to this widget's parent.
name   This widget's name.
f   The widget flag of this widget.

Definition at line 8 of file SIG_VisualisationWidget.cpp.

SIGEL_CommonGUI::SIG_VisualisationWidget::~SIG_VisualisationWidget ( )
 

The destructor of the SIG_VisualisationWidget.

Definition at line 28 of file SIG_VisualisationWidget.cpp.


Member Function Documentation

void SIGEL_CommonGUI::SIG_VisualisationWidget::initFloatingTextWidgets ( ) [protected]
 

Definition at line 142 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::initializeGL ( ) [protected, virtual]
 

Initaliazes some OpenGL stuff.

This method is inherited from the QGLWidget. It is called automatically by the QT runtime system. Because some initialization is already done in the constructor of the contained SIG_Visualisation, there's not much to do here. At the moment just the glClearColor is set to white.

Definition at line 179 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::mouseMoveEvent ( QMouseEvent * event ) [protected, virtual]
 

This methid is inherited from the QWidget.

Subclasses of SIG_VisualisationWidget should reimplement this method and call SIG_VisualisationWidget::mouseMoveEvent from there, supplied with their QMouseEvent. When the user moves the mouse, this method emits the appropriate signals.

Reimplemented in SIG_SimulationVisualisationWidget.

Definition at line 164 of file SIG_VisualisationWidget.cpp.

Referenced by SIG_SimulationVisualisationWidget::mouseMoveEvent().

void SIGEL_CommonGUI::SIG_VisualisationWidget::mousePressEvent ( QMouseEvent * event ) [protected, virtual]
 

This methid is inherited from the QWidget.

Subclasses of SIG_VisualisationWidget should reimplement this method and call SIG_VisualisationWidget::mousePressEvent from there, supplied with their QMouseEvent. When the user presses a mousebutton the actual mouse position is stored in mouseXPos and mouseYPos.

Reimplemented in SIG_SimulationVisualisationWidget.

Definition at line 158 of file SIG_VisualisationWidget.cpp.

Referenced by SIG_SimulationVisualisationWidget::mousePressEvent().

void SIGEL_CommonGUI::SIG_VisualisationWidget::paintGL ( ) [protected, virtual]
 

Refreshes the contents of this widget by initiating the execution of appropriate OpenGL drawing commands.

This methid is inherited from the QGLWidget. It is called automatically by the QT runtime system. In some cases it is also called by other methods (when changing the eyepoint while automaticRefresh being true). This is only done indirectly by calling the method updateGL.

Reimplemented in SIG_SimulationVisualisationWidget.

Definition at line 198 of file SIG_VisualisationWidget.cpp.

Referenced by SIG_SimulationVisualisationWidget::paintGL().

void SIGEL_CommonGUI::SIG_VisualisationWidget::resizeGL ( int width,
int height ) [protected, virtual]
 

Resizes the contents of this widget.

This methid is inherited from the QGLWidget. It is called automatically by the QT runtime system. The OpenGL viewport is resizes. If visualisation points to a SIG_Visualisation object, its aspect ratio is updated.

ameter width The widget's new width in pixels.
ameter height The widget's new height in pixels.

Definition at line 184 of file SIG_VisualisationWidget.cpp.

Referenced by SIG_SimulationVisualisationWidget::visualizeThis().

void SIGEL_CommonGUI::SIG_VisualisationWidget::setAmbientLighting ( int newValue ) [virtual, slot]
 

Definition at line 48 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::setDistance ( double ddistance ) [virtual, slot]
 

This method sets the distance between eyepoint and lookpoint.

If automaticRefresh is true, the widget's contents are refreshed (now according to the new eyepoint).

Parameters:
yyaw   The new distance.

Definition at line 90 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::setPitch ( double ppitch ) [virtual, slot]
 

This method sets the eyepoint's pitch angle.

If automaticRefresh is true, the widget's contents are refreshed (now according to the new eyepoint).

Parameters:
yyaw   The pitch angle is supplied in degrees between 0 and 90.

Definition at line 84 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::setRenderMode ( const QString & string ) [virtual, slot]
 

Definition at line 33 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::setShowAncorPoints ( int state ) [virtual, slot]
 

Definition at line 63 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::setYaw ( double yyaw ) [virtual, slot]
 

This method sets the eyepoint's yaw angle.

If automaticRefresh is true, the widget's contents are refreshed (now according to the new eyepoint).

Parameters:
yyaw   The yaw angle is supplied in degrees between 0 and 360.

Definition at line 78 of file SIG_VisualisationWidget.cpp.

void SIGEL_CommonGUI::SIG_VisualisationWidget::signalMouseRotation ( int,
int ) [signal]
 

This signal is emmited when the user has moved the mouse.

The supplied values are calculated by multiplying the mouseSensity with the amount of pixels the mouse was moved across the x- respectively y-axis while the left mouse button was pressed. This signal should be intercepted by the widget containing this SIG_Visualisationwidget and effect appropriate calling of the slots setYaw and setPitch.

void SIGEL_CommonGUI::SIG_VisualisationWidget::signalMouseZoom ( int ) [signal]
 

This signal is emmited when the user has moved the mouse.

The supplied value is calculated by multiplying the mouseSensity with the amount of pixels the mouse was moved across the y-axis while the right mouse button was pressed. This signal should be intercepted by the widget containing this SIG_Visualisationwidget and effect appropriate calling of the slot setDistance.

void SIGEL_CommonGUI::SIG_VisualisationWidget::updateEyePoint ( ) [protected, virtual]
 

Calculates the actual eyepoint from the attributes yaw, pitch and distance.

If automaticRefresh is true, the widget's contents are refreshed.

Definition at line 96 of file SIG_VisualisationWidget.cpp.


Member Data Documentation

bool SIGEL_CommonGUI::SIG_VisualisationWidget::automaticRefresh [protected]
 

If true, changing of the eyepoint effects refreshing this widget.

Definition at line 248 of file SIG_VisualisationWidget.h.

double SIGEL_CommonGUI::SIG_VisualisationWidget::distance [protected]
 

The actual distance between the eyepoint and the lookpoint.

Definition at line 224 of file SIG_VisualisationWidget.h.

QVector< SIG_FloatingTextLabel > SIGEL_CommonGUI::SIG_VisualisationWidget::floatingTextWidgets [protected]
 

Definition at line 266 of file SIG_VisualisationWidget.h.

QSize SIGEL_CommonGUI::SIG_VisualisationWidget::floatingTextsSize [protected]
 

Definition at line 268 of file SIG_VisualisationWidget.h.

double const SIGEL_CommonGUI::SIG_VisualisationWidget::mouseSensity [protected]
 

The mouse sensity.

A higher value increases the effect of mouse movements.

Definition at line 256 of file SIG_VisualisationWidget.h.

int SIGEL_CommonGUI::SIG_VisualisationWidget::mouseXPos [protected]
 

The last X-position of the mouse.

This is used to calculate the amount of pixels the mouse was moved since the last mousePresseEvent respectively mouseMoveEvent.

Definition at line 233 of file SIG_VisualisationWidget.h.

int SIGEL_CommonGUI::SIG_VisualisationWidget::mouseYPos [protected]
 

The last Y-position of the mouse.

This is used to calculate the amount of pixels the mouse was moved since the last mousePresseEvent respectively mouseMoveEvent.

Definition at line 242 of file SIG_VisualisationWidget.h.

double const SIGEL_CommonGUI::SIG_VisualisationWidget::pi [protected]
 

The mathematical constant .

Its value is calculated in the constructor as .

Definition at line 264 of file SIG_VisualisationWidget.h.

double SIGEL_CommonGUI::SIG_VisualisationWidget::pitch [protected]
 

The eyepoints actual pitch angle.

Definition at line 219 of file SIG_VisualisationWidget.h.

int SIGEL_CommonGUI::SIG_VisualisationWidget::showAncorPointsState [protected]
 

Definition at line 270 of file SIG_VisualisationWidget.h.

SIGEL_Visualisation::SIG_Visualisation * SIGEL_CommonGUI::SIG_VisualisationWidget::visualisation [protected]
 

The pointer to the SIG_Visualisation object that is finally responsible for the drawing of this widgets contents.

Definition at line 209 of file SIG_VisualisationWidget.h.

double SIGEL_CommonGUI::SIG_VisualisationWidget::yaw [protected]
 

The eyepoints actual yaw angle.

Definition at line 214 of file SIG_VisualisationWidget.h.


The documentation for this class was generated from the following files:
Generated at Mon Sep 3 01:32:58 2001 for PG 368 - SIGEL by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000