MIRA
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

◆ CameraMode

enum CameraMode
inherited
Enumerator
PERSPECTIVE 
ORTHOGRAPHIC 
BIRDS_EYE 

◆ StereoMode

enum StereoMode
inherited
Enumerator
NONE 
CROSSED_EYE 

◆ BackgroundMode

enum BackgroundMode
inherited
Enumerator
BACKGROUND_SOLID 
BACKGROUND_GRADIENT 
BACKGROUND_WHITE 
BACKGROUND_BLACK 

◆ RenderMode

enum RenderMode
inherited
Enumerator
NORMAL 
WIREFRAME 
HIDDEN_LINE 

Constructor & Destructor Documentation

◆ Visualization3DContainer()

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

◆ ~Visualization3DContainer()

virtual ~Visualization3DContainer ( )
virtual

Member Function Documentation

◆ addVisualization() [1/2]

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.

◆ addVisualization() [2/2]

void addVisualization ( Visualization3D vis)

Adds the specified visualization instance to the container.

The container will take ownership of the visualization.

◆ getPropertyString()

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

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

◆ getProperty()

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

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

◆ setPropertyString()

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.

◆ setProperty()

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

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

◆ getPropertyEditor()

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.

◆ getSceneManager()

virtual Ogre::SceneManager* getSceneManager ( )
virtual

Implements IVisualization3DSite.

◆ registerInteractionListener()

virtual void registerInteractionListener ( InteractionListener3D listener)
virtual

Implements IVisualization3DSite.

◆ removeInteractionListener()

virtual void removeInteractionListener ( InteractionListener3D listener)
virtual

Implements IVisualization3DSite.

◆ getInteractionListeners()

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

Implements IVisualization3DSite.

◆ getCamera()

virtual const Camera& getCamera ( ) const
virtual

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

Implements IVisualization3DSite.

◆ setCamera() [1/2]

virtual void setCamera ( const Camera camera)
virtual

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

Implements IVisualization3DSite.

◆ acquireCamera()

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.

◆ releaseCamera()

virtual void releaseCamera ( )
virtual

Releases a camera that previously was acquired.

Implements IVisualization3DSite.

◆ getFixedFrame()

virtual const std::string& getFixedFrame ( ) const
virtual

◆ getCameraFrame()

virtual const std::string& getCameraFrame ( ) const
virtual

◆ setFixedFrame()

void setFixedFrame ( const std::string &  frame)

◆ setCameraFrame()

void setCameraFrame ( const std::string &  frame)

◆ mousePressEvent()

virtual void mousePressEvent ( QMouseEvent *  e)
virtual

◆ mouseReleaseEvent()

virtual void mouseReleaseEvent ( QMouseEvent *  e)
virtual

◆ mouseMoveEvent()

virtual void mouseMoveEvent ( QMouseEvent *  e)
virtual

◆ wheelEvent()

virtual void wheelEvent ( QWheelEvent *  e)
virtual

◆ timerEvent()

virtual void timerEvent ( QTimerEvent *  e)
virtual

◆ initOgre()

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.

◆ setBackgroundMode()

void setBackgroundMode ( BackgroundMode  mode)
inherited

◆ setBackgroundColor1()

void setBackgroundColor1 ( Ogre::ColourValue  color1)
inherited

◆ setBackgroundColor2()

void setBackgroundColor2 ( Ogre::ColourValue  color2)
inherited

◆ setBackgroundColors()

void setBackgroundColors ( Ogre::ColourValue  color1,
Ogre::ColourValue  color2 
)
inherited

◆ setCameraMode()

void setCameraMode ( CameraMode  mode)
inherited

◆ setRenderMode()

void setRenderMode ( RenderMode  mode)
inherited

◆ setStereoMode()

void setStereoMode ( StereoMode  mode)
inherited

◆ showBoundingBoxes()

void showBoundingBoxes ( bool  show = true)
inherited

◆ setCamera() [2/2]

void setCamera ( const Point3f position,
float  yaw,
float  pitch,
float  roll,
float  distance 
)
inherited

◆ lookAt()

void lookAt ( const Point3f from,
const Point3f to 
)
inherited

◆ updateCamera()

void updateCamera ( )
protectedinherited

◆ paintGL()

virtual void paintGL ( )
virtualinherited

◆ initializeGL()

virtual void initializeGL ( )
protectedvirtualinherited

◆ resizeGL()

virtual void resizeGL ( int  w,
int  h 
)
protectedvirtualinherited

◆ getRenderWindow()

Ogre::RenderWindow* getRenderWindow ( )
inlineprotectedinherited

Member Data Documentation

◆ mBackgroundMode

BackgroundMode mBackgroundMode
protectedinherited

◆ mBackgroundColor1

Ogre::ColourValue mBackgroundColor1
protectedinherited

◆ mBackgroundColor2

Ogre::ColourValue mBackgroundColor2
protectedinherited

◆ mCameraMode

CameraMode mCameraMode
protectedinherited

◆ position

Point3f position
inherited

◆ yaw

float yaw
inherited

◆ pitch

float pitch
inherited

◆ roll

float roll
inherited

◆ distance

float distance
inherited

◆ mRenderMode

RenderMode mRenderMode
protectedinherited

◆ mStereoMode

StereoMode mStereoMode
protectedinherited

◆ mStereoEyeDistance

float mStereoEyeDistance
protectedinherited

◆ mShowBoundingBoxes

bool mShowBoundingBoxes
protectedinherited

◆ mLight

Ogre::Light* mLight
protectedinherited

◆ mCamera

Ogre::Camera* mCamera
protectedinherited

◆ mCameraRight

Ogre::Camera* mCameraRight
protectedinherited

◆ mViewport

Ogre::Viewport* mViewport
protectedinherited

◆ mViewportRight

Ogre::Viewport* mViewportRight
protectedinherited

◆ mSceneManager

Ogre::SceneManager* mSceneManager
protectedinherited

◆ mBackground

ColouredRectangle2D* mBackground
protectedinherited

◆ mRenderModeTechniqueMod

RenderModeTechniqueMod* mRenderModeTechniqueMod
protectedinherited

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