MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Visualization3DContainer Class Reference

A standalone container for 3D visualizations, similar to Visualization3DView but as lightweight standalone widget instead of a view within the RCP framework. More...

#include <visualization/Visualization3DContainer.h>

Inheritance diagram for Visualization3DContainer:
Inheritance graph
[legend]

Public Types

enum  CameraMode { PERSPECTIVE =0, ORTHOGRAPHIC, BIRDS_EYE }
 
enum  StereoMode { NONE, CROSSED_EYE }
 
enum  BackgroundMode { BACKGROUND_SOLID =0, BACKGROUND_GRADIENT, BACKGROUND_WHITE, BACKGROUND_BLACK }
 
enum  RenderMode { NORMAL = 0, WIREFRAME, HIDDEN_LINE }
 

Public Member Functions

 Visualization3DContainer (QWidget *parent=NULL, bool enableOrbitTool=true)
 
virtual ~Visualization3DContainer ()
 
Visualization3DaddVisualization (const std::string &visualizationClassName)
 Creates an instance of the specified visualization class, adds it to the container and returns a pointer to it. More...
 
void addVisualization (Visualization3D *vis)
 Adds the specified visualization instance to the container. More...
 
std::string getPropertyString (Visualization3D *vis, const std::string &property)
 Returns the value of the specified property for the specified visualization as string. More...
 
template<typename T >
getProperty (Visualization3D *vis, const std::string &property)
 Returns the value of the specified property for the specified visualization. More...
 
void setPropertyString (Visualization3D *vis, const std::string &property, const std::string &value)
 Sets the value of the specified property for the specified visualization from string. More...
 
template<typename T >
void setProperty (Visualization3D *vis, const std::string &property, const T &value)
 Sets the value of the specified property for the specified visualization. More...
 
PropertyEditorgetPropertyEditor (QWidget *parent=NULL)
 Creates a property editor (if not yet created) and returns the pointer to it. More...
 
virtual Ogre::SceneManager * getSceneManager ()
 
virtual void registerInteractionListener (InteractionListener3D *listener)
 
virtual void removeInteractionListener (InteractionListener3D *listener)
 
virtual std::set
< InteractionListener3D * > 
getInteractionListeners ()
 
virtual const CameragetCamera () const
 Obtains the current camera settings (position, orientation, etc.) of the views own camera. More...
 
virtual void setCamera (const Camera &camera)
 Sets the current camera settings (position, orientation, etc.) of the views own camera. More...
 
virtual Ogre::Camera * acquireCamera (boost::function< void()> lostCameraCallback=boost::function< void()>())
 Requests the camera of the visualization site. More...
 
virtual void releaseCamera ()
 Releases a camera that previously was acquired. More...
 
virtual const std::string & getFixedFrame () const
 
virtual const std::string & getCameraFrame () const
 
void setFixedFrame (const std::string &frame)
 
void setCameraFrame (const std::string &frame)
 
virtual void mousePressEvent (QMouseEvent *e)
 
virtual void mouseReleaseEvent (QMouseEvent *e)
 
virtual void mouseMoveEvent (QMouseEvent *e)
 
virtual void wheelEvent (QWheelEvent *e)
 
virtual void timerEvent (QTimerEvent *e)
 
void setBackgroundMode (BackgroundMode mode)
 
void setBackgroundColor1 (Ogre::ColourValue color1)
 
void setBackgroundColor2 (Ogre::ColourValue color2)
 
void setBackgroundColors (Ogre::ColourValue color1, Ogre::ColourValue color2)
 
void setCameraMode (CameraMode mode)
 
void setRenderMode (RenderMode mode)
 
void setStereoMode (StereoMode mode)
 
void showBoundingBoxes (bool show=true)
 
void setCamera (const Point3f &position, float yaw, float pitch, float roll, float distance)
 
void lookAt (const Point3f &from, const Point3f &to)
 
virtual void paintGL ()
 

Protected Member Functions

virtual void initOgre ()
 May be overwritten in subclasses to initialize your Ogre components. More...
 
void updateCamera ()
 
virtual void initializeGL ()
 
virtual void resizeGL (int w, int h)
 
Ogre::RenderWindow * getRenderWindow ()
 

Protected Attributes

BackgroundMode mBackgroundMode
 
Ogre::ColourValue mBackgroundColor1
 
Ogre::ColourValue mBackgroundColor2
 
CameraMode mCameraMode
 
RenderMode mRenderMode
 
StereoMode mStereoMode
 
float mStereoEyeDistance
 
bool mShowBoundingBoxes
 
Ogre::Light * mLight
 
Ogre::Camera * mCamera
 
Ogre::Camera * mCameraRight
 
Ogre::Viewport * mViewport
 
Ogre::Viewport * mViewportRight
 
Ogre::SceneManager * mSceneManager
 
ColouredRectangle2D * mBackground
 
RenderModeTechniqueMod * mRenderModeTechniqueMod
 

Detailed Description

A standalone container for 3D visualizations, similar to Visualization3DView but as lightweight standalone widget instead of a view within the RCP framework.

Member Enumeration Documentation

enum CameraMode
inherited
Enumerator
PERSPECTIVE 
ORTHOGRAPHIC 
BIRDS_EYE 
enum StereoMode
inherited
Enumerator
NONE 
CROSSED_EYE 
enum BackgroundMode
inherited
Enumerator
BACKGROUND_SOLID 
BACKGROUND_GRADIENT 
BACKGROUND_WHITE 
BACKGROUND_BLACK 
enum RenderMode
inherited
Enumerator
NORMAL 
WIREFRAME 
HIDDEN_LINE 

Constructor & Destructor Documentation

Visualization3DContainer ( QWidget *  parent = NULL,
bool  enableOrbitTool = true 
)
virtual ~Visualization3DContainer ( )
virtual

Member Function Documentation

Visualization3D* addVisualization ( const std::string &  visualizationClassName)

Creates an instance of the specified visualization class, adds it to the container and returns a pointer to it.

void addVisualization ( Visualization3D vis)

Adds the specified visualization instance to the container.

The container will take ownership of the visualization.

std::string getPropertyString ( Visualization3D vis,
const std::string &  property 
)

Returns the value of the specified property for the specified visualization as string.

T getProperty ( Visualization3D vis,
const std::string &  property 
)
inline

Returns the value of the specified property for the specified visualization.

void setPropertyString ( Visualization3D vis,
const std::string &  property,
const std::string &  value 
)

Sets the value of the specified property for the specified visualization from string.

void setProperty ( Visualization3D vis,
const std::string &  property,
const T &  value 
)
inline

Sets the value of the specified property for the specified visualization.

PropertyEditor* getPropertyEditor ( QWidget *  parent = NULL)

Creates a property editor (if not yet created) and returns the pointer to it.

The widget is hidden by default. Hence, you should call its show() method. Moreover, the widget has no parent by default. The parent can be set in the first call of this method as optional parameter.

virtual Ogre::SceneManager* getSceneManager ( )
virtual

Implements IVisualization3DSite.

virtual void registerInteractionListener ( InteractionListener3D listener)
virtual

Implements IVisualization3DSite.

virtual void removeInteractionListener ( InteractionListener3D listener)
virtual

Implements IVisualization3DSite.

virtual std::set<InteractionListener3D*> getInteractionListeners ( )
virtual

Implements IVisualization3DSite.

virtual const Camera& getCamera ( ) const
virtual

Obtains the current camera settings (position, orientation, etc.) of the views own camera.

Implements IVisualization3DSite.

virtual void setCamera ( const Camera camera)
virtual

Sets the current camera settings (position, orientation, etc.) of the views own camera.

Implements IVisualization3DSite.

virtual Ogre::Camera* acquireCamera ( boost::function< void()>  lostCameraCallback = boost::function< void()>())
virtual

Requests the camera of the visualization site.

This method can be called by visualizations or tools to get direct access to the camera. The visualization/tool is then responsible for updating the cameras position (e.g. in its update() method). Optionally, a callback can be specified, that is called if another visualization/tool has requested the camera. The visualization finally should release the camera by calling releaseCamera().

Implements IVisualization3DSite.

virtual void releaseCamera ( )
virtual

Releases a camera that previously was acquired.

Implements IVisualization3DSite.

virtual const std::string& getFixedFrame ( ) const
virtual
virtual const std::string& getCameraFrame ( ) const
virtual
void setFixedFrame ( const std::string &  frame)
void setCameraFrame ( const std::string &  frame)
virtual void mousePressEvent ( QMouseEvent *  e)
virtual
virtual void mouseReleaseEvent ( QMouseEvent *  e)
virtual
virtual void mouseMoveEvent ( QMouseEvent *  e)
virtual
virtual void wheelEvent ( QWheelEvent *  e)
virtual
virtual void timerEvent ( QTimerEvent *  e)
virtual
virtual void initOgre ( )
protectedvirtual

May be overwritten in subclasses to initialize your Ogre components.

This method is called after the main parts of Ogre (including the render window) are created.

Reimplemented from OgreWidgetEx.

void setBackgroundMode ( BackgroundMode  mode)
inherited
void setBackgroundColor1 ( Ogre::ColourValue  color1)
inherited
void setBackgroundColor2 ( Ogre::ColourValue  color2)
inherited
void setBackgroundColors ( Ogre::ColourValue  color1,
Ogre::ColourValue  color2 
)
inherited
void setCameraMode ( CameraMode  mode)
inherited
void setRenderMode ( RenderMode  mode)
inherited
void setStereoMode ( StereoMode  mode)
inherited
void showBoundingBoxes ( bool  show = true)
inherited
void setCamera ( const Point3f position,
float  yaw,
float  pitch,
float  roll,
float  distance 
)
inherited
void lookAt ( const Point3f from,
const Point3f to 
)
inherited
void updateCamera ( )
protectedinherited
virtual void paintGL ( )
virtualinherited
virtual void initializeGL ( )
protectedvirtualinherited
virtual void resizeGL ( int  w,
int  h 
)
protectedvirtualinherited
Ogre::RenderWindow* getRenderWindow ( )
inlineprotectedinherited

Member Data Documentation

BackgroundMode mBackgroundMode
protectedinherited
Ogre::ColourValue mBackgroundColor1
protectedinherited
Ogre::ColourValue mBackgroundColor2
protectedinherited
CameraMode mCameraMode
protectedinherited
Point3f position
inherited
float yaw
inherited
float pitch
inherited
float roll
inherited
float distance
inherited
RenderMode mRenderMode
protectedinherited
StereoMode mStereoMode
protectedinherited
float mStereoEyeDistance
protectedinherited
bool mShowBoundingBoxes
protectedinherited
Ogre::Light* mLight
protectedinherited
Ogre::Camera* mCamera
protectedinherited
Ogre::Camera* mCameraRight
protectedinherited
Ogre::Viewport* mViewport
protectedinherited
Ogre::Viewport* mViewportRight
protectedinherited
Ogre::SceneManager* mSceneManager
protectedinherited
ColouredRectangle2D* mBackground
protectedinherited
RenderModeTechniqueMod* mRenderModeTechniqueMod
protectedinherited

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