Frapper  1.0a
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
Frapper::ViewportWidget Class Reference

Class for a 3D viewport widget powered by OGRE. More...

#include <ViewportWidget.h>

Inheritance diagram for Frapper::ViewportWidget:
Inheritance graph
[legend]
Collaboration diagram for Frapper::ViewportWidget:
Collaboration graph
[legend]

Public Slots

void applyViewingParameters (ViewingParameters *viewingParameters)
 Applies the given viewing parameters to the viewport's viewing parameters.
 
void setImage (unsigned int stageIndex, Ogre::TexturePtr image)
 Sets the image that should be displayed in the viewport.
 
void homeView ()
 Resets the viewport's view settings.
 
void setWireframe (bool wireframe)
 Activates or deactivates wireframe view in the viewport.
 
void setBackfaceCulling (bool backfaceCulling)
 Activates or deactivates the omission of polygons facing away from the camera.
 
void toggleOrigin ()
 Toggles the display of the point of origin in the viewport.
 
void toggleCenterPoint ()
 Toggles the display of the center point in the viewport.
 
void toggleOrientationIndicator ()
 Toggles the display of the orientation indicator in the viewport.
 
void toggleGrid ()
 Toggles the display of the coordinate grid in the viewport.
 
void screenCapture ()
 Write the contents of the current render window to image file.
 

Signals

void objectSelected (const QString &objectName, bool toggle)
 Signal that is emitted when an object in the viewport has been clicked.
 
void viewChanged (ViewingParameters *viewingParameters)
 Signal that is emitted when the viewing parameters have changed.
 
void frameSelectedObjectsRequested (ViewingParameters *viewingParameters)
 Signal that is emitted when the selected objects in the viewport should be framed by the viewport's camera.
 
void renderingTriggered ()
 Rendering process has been initiated.
 

Public Member Functions

 ViewportWidget (QWidget *parent=0, unsigned int stageIndex=1, bool fullscreen=false, bool stereo=false, int width=1024, int height=768)
 Constructor of the ViewportWidget class.
 
virtual ~ViewportWidget ()
 Destructor of the ViewportWidget class.
 
virtual QPaintEngine * paintEngine () const
 Returns a pointer to the paint engine used for drawing on the device.
 
unsigned int getStageIndex ()
 Returns the index of the stage to display in the viewport.
 
void setStageIndex (unsigned int stageIndex)
 Sets the index of the stage to display in the viewport.
 
void setViewMode (bool viewMode)
 Activates or deactivates the view mode in the viewport widget.
 
void frameSelectedObjects ()
 Centers the viewport's view on currently selected objects.
 
void setFog (bool enabled, float density)
 Sets the fog parameters of the viewport.
 
QColor getFogColor ()
 Returns the fog color of the scene.
 
void setFogColor (const QColor &color)
 Sets the fog color of the scene.
 
QColor getBackgroundColor ()
 Returns the background color of the scene.
 
void setBackgroundColor (const QColor &color)
 Sets the background color of the scene.
 
void setFullscreen (bool fullscreen, int width, int height)
 Sets fullscreen mode for the viewport widget.
 
void getStereoParameters (float &rttWidth, float &rttHeight, float &eyeDist, float &fOffsetMultiplier, float &nearClip, float &farClip, float &fov, float &focalLength)
 Fills the given variables with stereo parameter values.
 
void setStereoParameters (const unsigned int rttWidth, const unsigned int rttHeight, const float eyeDist, const float fOffsetMultiplier, const float nearClip, const float farClip, const float fov, const float focalLength)
 Sets the stereo parameters to the given values.
 
void setStereo (bool enable)
 Toggles the stereo mode for the viewport widget.
 
void setOverlayOnly (bool enable)
 Sets whether only overlays (no geometry) should be displayed in viewport.
 
float getFps ()
 Returns the current number of frames per second rendered in the viewport.
 
int getTriangleCount ()
 Returns the number of triangles last rendered in the viewport.
 
ViewingParametersgetViewingParameters ()
 Returns the viewing parameter's of the currently active camera.
 
void updateView ()
 Calculates the transformation of the viewport's camera according to the current viewing angles, the viewing radius, and the center of view.
 
Ogre::RenderWindow * getRenderWindow ()
 Get the created render window.
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *event)
 Handles resize events for the widget.
 
virtual void paintEvent (QPaintEvent *event)
 Handles paint events for the widget.
 
virtual void mousePressEvent (QMouseEvent *event)
 Handles mouse press events for the widget.
 
virtual void mouseMoveEvent (QMouseEvent *event)
 Handles mouse move events for the widget.
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 Handles mouse release events for the widget.
 
virtual void wheelEvent (QWheelEvent *event)
 Handles mouse wheel events for the widget.
 

Protected Attributes

unsigned int m_stageIndex
 The index of the stage to display in the viewport.
 
bool m_showOverlays
 Show overlays.
 
bool m_fullscreen
 Flag that states whether the widget is used in fullscreen mode.
 
bool m_stereo
 Flag that states whether stereo viewing is activated.
 
float m_stereoEyeDist
 Stereo view parameters.
 
float m_stereoFOffsetMultiplier
 
float m_stereoNearClip
 
float m_stereoFarClip
 
float m_stereoFov
 
float m_stereoFocalLength
 
unsigned int m_stereoRttWidth
 
unsigned int m_stereoRttHeight
 
int m_width
 The width of the viewport when in fullscreen mode.
 
int m_height
 The height of the viewport when in fullscreen mode.
 
Ogre::RenderWindow * m_renderWindow
 The OGRE render window to use in the viewport widget.
 
Ogre::SceneManager * m_sceneManager
 The main OGRE scene manager.
 
Ogre::SceneNodem_cameraSceneNode
 The main viewport's viewing camera scene node.
 
Ogre::MaterialPtr m_imageMaterial
 Material for the viewport's image overlay that is used to display image results from nodes.
 
Ogre::Camera * m_camera
 The viewport's viewing cameras.
 
Ogre::Camera * m_camera0
 
Ogre::Camera * m_camera1
 
Ogre::Camera * m_camera2
 
Ogre::Camera * m_camera3
 
Ogre::Camera * m_camera4
 
QString m_cameraName
 The current camera name.
 
Ogre::Light * m_headLight
 The viewing camera's light.
 
Ogre::CompositorInstance * m_stereoCompositor
 The stereo compositor.
 
Ogre::RenderTarget * m_stereoRenderTarget
 The stereo OGRE texture render target.
 
Ogre::Viewport * m_viewport
 The OGRE viewports.
 
Ogre::Viewport * m_stereoViewport0
 
Ogre::Viewport * m_stereoViewport1
 
Ogre::Viewport * m_stereoViewport2
 
Ogre::Viewport * m_stereoViewport3
 
Ogre::Viewport * m_stereoViewport4
 
Ogre::ColourValue m_backgroundColor
 The background color of the viewport.
 
Ogre::ColourValue m_fogColor
 The fog color of the scene.
 
Ogre::SceneNodem_orientationIndicatorCameraSceneNode
 The orientation indicator viewport's camera scene node.
 
Ogre::Camera * m_orientationIndicatorCamera
 The orientation indicator viewport's camera.
 
Ogre::Viewport * m_orientationIndicatorViewport
 The orientation indicator viewport to display axes that show the main camera's orientation.
 
Ogre::Overlay * m_labelOverlay
 The overlay for all text information panel overlay elements.
 
Ogre::Overlay * m_imageOverlay
 The overlay for the image panel overlay element.
 
Ogre::PanelOverlayElement * m_leftTopHudPanel
 The panel overlay element used for displaying text information in the top left corner of the viewport.
 
Ogre::TextAreaOverlayElement * m_leftTopHudTextArea
 The text area overlay element used for displaying text information in the top left corner of the viewport.
 
Ogre::PanelOverlayElement * m_imagePanel
 The panel overlay element used for displaying an image.
 
Ogre::SceneNodem_viewportObjectsSceneNode
 The node that all exclusive viewport object scene nodes will be attached to.
 
Ogre::SceneNodem_originSceneNode
 The node that the coordinate system's origin axes will be attached to.
 
Ogre::SceneNodem_centerPointSceneNode
 The node that the center axes will be attached to.
 
Ogre::SceneNodem_orientationIndicatorSceneNode
 The node that the orientation indicator will be attached to.
 
Ogre::SceneNodem_gridSceneNode
 The node that the coordinate grid will be attached to.
 
bool m_viewMode
 Flag that states whether the viewing mode is activated.
 
QPoint m_lastPosition
 The last position of the mouse pointer over the viewport.
 
ViewingParametersm_viewingParameters
 The viewing parameters for the viewport's active camera.
 
bool m_wireframe
 Flag that states whether wireframe view is activated.
 
bool m_backfaceCulling
 Flag that states whether backface culling is activated.
 
bool m_showOrigin
 Flag that states whether the origin should be visible in the viewport.
 
bool m_showCenterPoint
 Flag that states whether the center should be visible in the viewport.
 
bool m_showOrientationIndicator
 Flag that states whether the orientation indicator is shown in the widget.
 
bool m_showGrid
 Flag that states whether the grid should be visible in the viewport.
 
bool m_overlayOnly
 Flag that states whether the geometry should be visible.
 
float m_dbgColor
 The background color.
 

Private Member Functions

Ogre::String createUniqueName (const QString &objectName)
 Creates a unique name from the given object name by adding the viewport. widget's index.
 
bool createdefaultShaders ()
 Creates the default cg Shaders used for the default materials.
 
Ogre::HighLevelGpuProgramPtr compileShader (const Ogre::String &code, Ogre::GpuProgramType type, const Ogre::String &nameSuffix)
 Compiles the given CG Shader Code and returns a Pointer to the loaded Ogre resource.
 
bool createRenderWindow ()
 Creates the OGRE render window.
 
void initializeResources ()
 Initializes the resources that will be available to OGRE.
 
void createViewportObjects ()
 Creates basic viewport objects like the viewing camera, the head light, coordinate axes and the grid.
 
void createOverlays ()
 Creates overlay layers for visual components that will be rendered on top of the main scene layer.
 
void render ()
 Redraws the OGRE scene into the viewport widget.
 
Ogre::MaterialPtr createColorMaterial (const Ogre::String &group, const Ogre::String &name, const Ogre::ColourValue &color, bool wireframe=false)
 Creates a self-illuminating material with the given name and color under the given group name.
 
void createAxes (const QString &name, Ogre::SceneNode *parentNode, Ogre::uint32 visibilityFlags=VF_MAIN_VIEWPORT)
 Creates three manual objects for X, Y and Z axes with the given name and attaches them to the given parent scene node. The axes will each have a length of 1.
 
void createGrid (Ogre::SceneNode *parentNode)
 Creates a coordinate grid and attaches it to the given parent scene node.
 
Ogre::SceneNodegetClickedSceneNode (const QPointF &mousePosition)
 Returns the scene node that is located under the given mouse position in the viewport.
 

Static Private Attributes

static unsigned int s_viewportIndex = 0
 The index of the next viewport widget to create.
 
static Ogre::HighLevelGpuProgramPtr s_defaultVertexShader
 A simple Default vertex shader in CG.
 
static Ogre::HighLevelGpuProgramPtr s_defaultFragmentShader
 A simple Default fragment shader in CG.
 
static Ogre::HighLevelGpuProgramPtr s_defaultUVVertexShader
 A simple Default vertex shader with UV-Coordinates in CG.
 
static Ogre::HighLevelGpuProgramPtr s_defaultTU0FragmentShader
 A simple Default fragment shader with one textue in CG.
 
static Ogre::MaterialPtr s_redMaterial
 Material for self-illuminating red objects (like coordinate X axes).
 
static Ogre::MaterialPtr s_greenMaterial
 Material for self-illuminating green objects (like coordinate Y axes).
 
static Ogre::MaterialPtr s_blueMaterial
 Material for self-illuminating blue objects (like coordinate Z axes).
 
static Ogre::MaterialPtr s_grayMaterial
 Material for self-illuminating gray objects.
 
static Ogre::MaterialPtr s_blackMaterial
 Material for self-illuminating black objects.
 
static Ogre::MaterialPtr s_defaultMaterial
 Default material to use in shaded mode.
 
static Ogre::MaterialPtr s_nullMaterial
 Material for Null objects.
 

Detailed Description

Class for a 3D viewport widget powered by OGRE.

Inheritance Diagram
dot_inline_dotgraph_18.png
[legend]

Constructor & Destructor Documentation

Frapper::ViewportWidget::ViewportWidget ( QWidget *  parent = 0,
unsigned int  stageIndex = 1,
bool  fullscreen = false,
bool  stereo = false,
int  width = 1024,
int  height = 768 
)

Constructor of the ViewportWidget class.

Constructors and Destructors.

Parameters
parentThe parent widget the created instance will be a child of.
stageIndexThe index of the stage to display in the viewport.
fullscreenFlag that controls whether the widget is used in fullscreen mode.
stereoFlag that controls whether the widget is used in stereo mode.
widthThe width of the viewport when in fullscreen mode.
heightThe height of the viewport when in fullscreen mode.

Constructor of the ViewportWidget class.

Parameters
parentThe parent widget the created instance will be a child of.
stageIndexThe index of the stage to display in the viewport.
fullscreenFlag that controls whether the widget is used in fullscreen mode.
widthThe width of the viewport when in fullscreen mode.
heightThe height of the viewport when in fullscreen mode.
Frapper::ViewportWidget::~ViewportWidget ( )
virtual

Destructor of the ViewportWidget class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.

Member Function Documentation

QPaintEngine * Frapper::ViewportWidget::paintEngine ( ) const
virtual

Returns a pointer to the paint engine used for drawing on the device.

Public Functions.

Returning 0 by this function fixes the widget flickering bug in Qt 4.5.

Returns
0.

Returns a pointer to the paint engine used for drawing on the device.

Returning 0 by this function fixes the widget flickering bug in Qt 4.5.

Returns
0.
unsigned int Frapper::ViewportWidget::getStageIndex ( )

Returns the index of the stage to display in the viewport.

Returns
The index of the stage to display in the viewport.
void Frapper::ViewportWidget::setStageIndex ( unsigned int  stageIndex)

Sets the index of the stage to display in the viewport.

Parameters
stageIndexThe index of the new stage to display in the viewport.
void Frapper::ViewportWidget::setViewMode ( bool  viewMode)

Activates or deactivates the view mode in the viewport widget.

Parameters
viewModeThe new value for the view mode flag.
void Frapper::ViewportWidget::frameSelectedObjects ( )

Centers the viewport's view on currently selected objects.

void Frapper::ViewportWidget::setFog ( bool  enabled,
float  density 
)

Sets the fog parameters of the viewport.

Parameters
enabledSets whether fog is enabled or not.
densitySets the density of the fog (exponential).
QColor Frapper::ViewportWidget::getFogColor ( )

Returns the fog color of the scene.

Returns
Fog color of the scene.
void Frapper::ViewportWidget::setFogColor ( const QColor &  color)

Sets the fog color of the scene.

Parameters
colorFog color of the scene.
QColor Frapper::ViewportWidget::getBackgroundColor ( )

Returns the background color of the scene.

Returns
Fog background of the scene.
void Frapper::ViewportWidget::setBackgroundColor ( const QColor &  color)

Sets the background color of the scene.

Parameters
colorBackground color of the scene.
void Frapper::ViewportWidget::setFullscreen ( bool  fullscreen,
int  width,
int  height 
)

Sets fullscreen mode for the viewport widget.

Parameters
fullscreenFlag to control whether to enable fullscreen mode.
widthThe width of the viewport in fullscreen mode.
heightThe height of the viewport in fullscreen mode.
void Frapper::ViewportWidget::getStereoParameters ( float &  rttWidth,
float &  rttHeight,
float &  eyeDist,
float &  fOffsetMultiplier,
float &  nearClip,
float &  farClip,
float &  fov,
float &  focalLength 
)

Fills the given variables with stereo parameter values.

Parameters
rttWidthThe width of the render texture.
rttHeightThe height of the render texture.
eyeDistThe viewer's eye distance.
fOffsetMultiplierA multiplier to calculate the frustum offset from the camera position.
nearClipThe near clipping plane of the camera.
farClipThe far clippping plane of the camera.
fovThe camera's field of view setting.
focalLengthThe camera's focal length setting.
void Frapper::ViewportWidget::setStereoParameters ( const unsigned int  rttWidth,
const unsigned int  rttHeight,
const float  eyeDist,
const float  fOffsetMultiplier,
const float  nearClip,
const float  farClip,
const float  fov,
const float  focalLength 
)

Sets the stereo parameters to the given values.

Parameters
rttWidthThe width of the render texture.
rttHeightThe height of the render texture.
eyeDistThe viewer's eye distance.
fOffsetMultiplierA multiplier to calculate the frustum offset from the camera position.
nearClipThe near clipping plane of the camera.
farClipThe far clippping plane of the camera.
fovThe camera's field of view setting.
focalLengthThe camera's focal length setting.
void Frapper::ViewportWidget::setStereo ( bool  enable)

Toggles the stereo mode for the viewport widget.

Parameters
enableFlag to enable or disable the stereo mode for the viewport widget.
void Frapper::ViewportWidget::setOverlayOnly ( bool  enable)

Sets whether only overlays (no geometry) should be displayed in viewport.

Parameters
enableIf true no geometry will be displayed.
float Frapper::ViewportWidget::getFps ( )

Returns the current number of frames per second rendered in the viewport.

Returns
The current number of frames per second rendered in the viewport.
int Frapper::ViewportWidget::getTriangleCount ( )

Returns the number of triangles last rendered in the viewport.

Returns
The number of triangles last rendered in the viewport.
ViewingParameters * Frapper::ViewportWidget::getViewingParameters ( )

Returns the viewing parameter's of the currently active camera.

Returns
The viewing parameter's of the currently active camera.
void Frapper::ViewportWidget::updateView ( )

Calculates the transformation of the viewport's camera according to the current viewing angles, the viewing radius, and the center of view.

Ogre::RenderWindow * Frapper::ViewportWidget::getRenderWindow ( )

Get the created render window.

Public Slots.

void Frapper::ViewportWidget::applyViewingParameters ( ViewingParameters viewingParameters)
slot

Applies the given viewing parameters to the viewport's viewing parameters.

Parameters
viewingParametersThe viewing parameters to apply to the viewport.
void Frapper::ViewportWidget::setImage ( unsigned int  stageIndex,
Ogre::TexturePtr  image 
)
slot

Sets the image that should be displayed in the viewport.

Parameters
stageIndexThe index of the stage to which the image belongs.
imageThe image that should be displayed in the viewport.

Only affects viewports that are set to display the content of the stage with the given index.

Parameters
stageIndexThe index of the stage to which the image belongs.
imageThe image that should be displayed in the viewport.
void Frapper::ViewportWidget::homeView ( )
slot

Resets the viewport's view settings.

void Frapper::ViewportWidget::setWireframe ( bool  wireframe)
slot

Activates or deactivates wireframe view in the viewport.

Parameters
wireframeFlag that controls wireframe view in the viewport.
void Frapper::ViewportWidget::setBackfaceCulling ( bool  backfaceCulling)
slot

Activates or deactivates the omission of polygons facing away from the camera.

Parameters
backfaceCullingFlag that controls the culling of polygons facing away from the camera.
void Frapper::ViewportWidget::toggleOrigin ( )
slot

Toggles the display of the point of origin in the viewport.

void Frapper::ViewportWidget::toggleCenterPoint ( )
slot

Toggles the display of the center point in the viewport.

void Frapper::ViewportWidget::toggleOrientationIndicator ( )
slot

Toggles the display of the orientation indicator in the viewport.

void Frapper::ViewportWidget::toggleGrid ( )
slot

Toggles the display of the coordinate grid in the viewport.

void Frapper::ViewportWidget::screenCapture ( )
slot

Write the contents of the current render window to image file.

void Frapper::ViewportWidget::objectSelected ( const QString &  objectName,
bool  toggle 
)
signal

Signal that is emitted when an object in the viewport has been clicked.

Parameters
objectNameThe name of the object that was selected, or an empty string if no object has been selected.
toggleFlag that controls whether the object's selected state should be toggled.
void Frapper::ViewportWidget::viewChanged ( ViewingParameters viewingParameters)
signal

Signal that is emitted when the viewing parameters have changed.

Parameters
viewingParametersThe current viewing parameters.
void Frapper::ViewportWidget::frameSelectedObjectsRequested ( ViewingParameters viewingParameters)
signal

Signal that is emitted when the selected objects in the viewport should be framed by the viewport's camera.

Requests an adjustment of the viewing parameters the viewport's camera so that the currently selected objects are centered in the view.

Parameters
viewingParametersThe viewing parameters to modify.
void Frapper::ViewportWidget::renderingTriggered ( )
signal

Rendering process has been initiated.

void Frapper::ViewportWidget::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Handles resize events for the widget.

Protected Events.

Parameters
eventThe description of the resize event.

Handles resize events for the widget.

Parameters
eventThe description of the resize event.
void Frapper::ViewportWidget::paintEvent ( QPaintEvent *  event)
protectedvirtual

Handles paint events for the widget.

Parameters
eventThe description of the paint event.
void Frapper::ViewportWidget::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Handles mouse press events for the widget.

Parameters
eventThe description of the mouse event.
void Frapper::ViewportWidget::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

Handles mouse move events for the widget.

Parameters
eventThe description of the mouse event.
void Frapper::ViewportWidget::mouseReleaseEvent ( QMouseEvent *  event)
protectedvirtual

Handles mouse release events for the widget.

Parameters
eventThe description of the mouse event.
void Frapper::ViewportWidget::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Handles mouse wheel events for the widget.

Parameters
eventThe description of the mouse wheel event.
Ogre::String Frapper::ViewportWidget::createUniqueName ( const QString &  objectName)
private

Creates a unique name from the given object name by adding the viewport. widget's index.

Private Functions.

Creates a unique name from the given object name by adding the viewport widget's index.

bool Frapper::ViewportWidget::createdefaultShaders ( )
private

Creates the default cg Shaders used for the default materials.

Returns
Returns false, if the shaders are not supported on ths mashine
Ogre::HighLevelGpuProgramPtr Frapper::ViewportWidget::compileShader ( const Ogre::String &  code,
Ogre::GpuProgramType  type,
const Ogre::String &  nameSuffix 
)
private

Compiles the given CG Shader Code and returns a Pointer to the loaded Ogre resource.

\param code The cg schader code.
Parameters
profileFlagsThe shader profile flags.
typeThe type of the shader.
Returns
The pointer to the loaded shader.
Parameters
codeThe cg schader code.
profileFlagsThe shader profile flags.
typeThe type of the shader.
Returns
The pointer to the loaded shader.
bool Frapper::ViewportWidget::createRenderWindow ( )
private

Creates the OGRE render window.

Returns
True if creating the OGRE render window succeeded, otherwise False.
void Frapper::ViewportWidget::initializeResources ( )
private

Initializes the resources that will be available to OGRE.

void Frapper::ViewportWidget::createViewportObjects ( )
private

Creates basic viewport objects like the viewing camera, the head light, coordinate axes and the grid.

void Frapper::ViewportWidget::createOverlays ( )
private

Creates overlay layers for visual components that will be rendered on top of the main scene layer.

void Frapper::ViewportWidget::render ( )
private

Redraws the OGRE scene into the viewport widget.

Ogre::MaterialPtr Frapper::ViewportWidget::createColorMaterial ( const Ogre::String &  group,
const Ogre::String &  name,
const Ogre::ColourValue &  color,
bool  wireframe = false 
)
private

Creates a self-illuminating material with the given name and color under the given group name.

Parameters
groupThe name of the resource group to attach the material to.
nameThe unique name for the material.
colorThe color for the material.
wireframeFlag to control whether the material will display objects in wireframe mode.
Returns
The new color material.
void Frapper::ViewportWidget::createAxes ( const QString &  name,
Ogre::SceneNode parentNode,
Ogre::uint32  visibilityFlags = VF_MAIN_VIEWPORT 
)
private

Creates three manual objects for X, Y and Z axes with the given name and attaches them to the given parent scene node. The axes will each have a length of 1.

Parameters
nameThe prefix for the axes objects to create.
parentNodeThe scene node to which to attach the axes objects.
visibilityFlagsThe visibility flags to apply to the axes objects.
void Frapper::ViewportWidget::createGrid ( Ogre::SceneNode parentNode)
private

Creates a coordinate grid and attaches it to the given parent scene node.

Parameters
parentNodeThe scene node to which to attach the grid object.
Ogre::SceneNode * Frapper::ViewportWidget::getClickedSceneNode ( const QPointF &  mousePosition)
private

Returns the scene node that is located under the given mouse position in the viewport.

Parameters
mousePositionThe position of the mouse pointer over the viewport widget.
Returns
The clicked scene node or 0 if no scene node was clicked.

Member Data Documentation

unsigned int Frapper::ViewportWidget::s_viewportIndex = 0
staticprivate

The index of the next viewport widget to create.

Private Static Data.

Ogre::HighLevelGpuProgramPtr Frapper::ViewportWidget::s_defaultVertexShader
staticprivate

A simple Default vertex shader in CG.

Ogre::HighLevelGpuProgramPtr Frapper::ViewportWidget::s_defaultFragmentShader
staticprivate

A simple Default fragment shader in CG.

Ogre::HighLevelGpuProgramPtr Frapper::ViewportWidget::s_defaultUVVertexShader
staticprivate

A simple Default vertex shader with UV-Coordinates in CG.

Ogre::HighLevelGpuProgramPtr Frapper::ViewportWidget::s_defaultTU0FragmentShader
staticprivate

A simple Default fragment shader with one textue in CG.

Ogre::MaterialPtr Frapper::ViewportWidget::s_redMaterial
staticprivate

Material for self-illuminating red objects (like coordinate X axes).

Ogre::MaterialPtr Frapper::ViewportWidget::s_greenMaterial
staticprivate

Material for self-illuminating green objects (like coordinate Y axes).

Ogre::MaterialPtr Frapper::ViewportWidget::s_blueMaterial
staticprivate

Material for self-illuminating blue objects (like coordinate Z axes).

Ogre::MaterialPtr Frapper::ViewportWidget::s_grayMaterial
staticprivate

Material for self-illuminating gray objects.

Ogre::MaterialPtr Frapper::ViewportWidget::s_blackMaterial
staticprivate

Material for self-illuminating black objects.

Ogre::MaterialPtr Frapper::ViewportWidget::s_defaultMaterial
staticprivate

Default material to use in shaded mode.

Ogre::MaterialPtr Frapper::ViewportWidget::s_nullMaterial
staticprivate

Material for Null objects.

unsigned int Frapper::ViewportWidget::m_stageIndex
protected

The index of the stage to display in the viewport.

bool Frapper::ViewportWidget::m_showOverlays
protected

Show overlays.

bool Frapper::ViewportWidget::m_fullscreen
protected

Flag that states whether the widget is used in fullscreen mode.

bool Frapper::ViewportWidget::m_stereo
protected

Flag that states whether stereo viewing is activated.

float Frapper::ViewportWidget::m_stereoEyeDist
protected

Stereo view parameters.

float Frapper::ViewportWidget::m_stereoFOffsetMultiplier
protected
float Frapper::ViewportWidget::m_stereoNearClip
protected
float Frapper::ViewportWidget::m_stereoFarClip
protected
float Frapper::ViewportWidget::m_stereoFov
protected
float Frapper::ViewportWidget::m_stereoFocalLength
protected
unsigned int Frapper::ViewportWidget::m_stereoRttWidth
protected
unsigned int Frapper::ViewportWidget::m_stereoRttHeight
protected
int Frapper::ViewportWidget::m_width
protected

The width of the viewport when in fullscreen mode.

int Frapper::ViewportWidget::m_height
protected

The height of the viewport when in fullscreen mode.

Ogre::RenderWindow* Frapper::ViewportWidget::m_renderWindow
protected

The OGRE render window to use in the viewport widget.

Ogre::SceneManager* Frapper::ViewportWidget::m_sceneManager
protected

The main OGRE scene manager.

Ogre::SceneNode* Frapper::ViewportWidget::m_cameraSceneNode
protected

The main viewport's viewing camera scene node.

Ogre::MaterialPtr Frapper::ViewportWidget::m_imageMaterial
protected

Material for the viewport's image overlay that is used to display image results from nodes.

Ogre::Camera* Frapper::ViewportWidget::m_camera
protected

The viewport's viewing cameras.

Ogre::Camera* Frapper::ViewportWidget::m_camera0
protected
Ogre::Camera* Frapper::ViewportWidget::m_camera1
protected
Ogre::Camera* Frapper::ViewportWidget::m_camera2
protected
Ogre::Camera* Frapper::ViewportWidget::m_camera3
protected
Ogre::Camera* Frapper::ViewportWidget::m_camera4
protected
QString Frapper::ViewportWidget::m_cameraName
protected

The current camera name.

Ogre::Light* Frapper::ViewportWidget::m_headLight
protected

The viewing camera's light.

Ogre::CompositorInstance* Frapper::ViewportWidget::m_stereoCompositor
protected

The stereo compositor.

Ogre::RenderTarget* Frapper::ViewportWidget::m_stereoRenderTarget
protected

The stereo OGRE texture render target.

Ogre::Viewport* Frapper::ViewportWidget::m_viewport
protected

The OGRE viewports.

Ogre::Viewport* Frapper::ViewportWidget::m_stereoViewport0
protected
Ogre::Viewport* Frapper::ViewportWidget::m_stereoViewport1
protected
Ogre::Viewport* Frapper::ViewportWidget::m_stereoViewport2
protected
Ogre::Viewport* Frapper::ViewportWidget::m_stereoViewport3
protected
Ogre::Viewport* Frapper::ViewportWidget::m_stereoViewport4
protected
Ogre::ColourValue Frapper::ViewportWidget::m_backgroundColor
protected

The background color of the viewport.

Ogre::ColourValue Frapper::ViewportWidget::m_fogColor
protected

The fog color of the scene.

Ogre::SceneNode* Frapper::ViewportWidget::m_orientationIndicatorCameraSceneNode
protected

The orientation indicator viewport's camera scene node.

Ogre::Camera* Frapper::ViewportWidget::m_orientationIndicatorCamera
protected

The orientation indicator viewport's camera.

Ogre::Viewport* Frapper::ViewportWidget::m_orientationIndicatorViewport
protected

The orientation indicator viewport to display axes that show the main camera's orientation.

Ogre::Overlay* Frapper::ViewportWidget::m_labelOverlay
protected

The overlay for all text information panel overlay elements.

Ogre::Overlay* Frapper::ViewportWidget::m_imageOverlay
protected

The overlay for the image panel overlay element.

Ogre::PanelOverlayElement* Frapper::ViewportWidget::m_leftTopHudPanel
protected

The panel overlay element used for displaying text information in the top left corner of the viewport.

Ogre::TextAreaOverlayElement* Frapper::ViewportWidget::m_leftTopHudTextArea
protected

The text area overlay element used for displaying text information in the top left corner of the viewport.

Ogre::PanelOverlayElement* Frapper::ViewportWidget::m_imagePanel
protected

The panel overlay element used for displaying an image.

Ogre::SceneNode* Frapper::ViewportWidget::m_viewportObjectsSceneNode
protected

The node that all exclusive viewport object scene nodes will be attached to.

Ogre::SceneNode* Frapper::ViewportWidget::m_originSceneNode
protected

The node that the coordinate system's origin axes will be attached to.

Ogre::SceneNode* Frapper::ViewportWidget::m_centerPointSceneNode
protected

The node that the center axes will be attached to.

Ogre::SceneNode* Frapper::ViewportWidget::m_orientationIndicatorSceneNode
protected

The node that the orientation indicator will be attached to.

Ogre::SceneNode* Frapper::ViewportWidget::m_gridSceneNode
protected

The node that the coordinate grid will be attached to.

bool Frapper::ViewportWidget::m_viewMode
protected

Flag that states whether the viewing mode is activated.

QPoint Frapper::ViewportWidget::m_lastPosition
protected

The last position of the mouse pointer over the viewport.

ViewingParameters* Frapper::ViewportWidget::m_viewingParameters
protected

The viewing parameters for the viewport's active camera.

bool Frapper::ViewportWidget::m_wireframe
protected

Flag that states whether wireframe view is activated.

bool Frapper::ViewportWidget::m_backfaceCulling
protected

Flag that states whether backface culling is activated.

bool Frapper::ViewportWidget::m_showOrigin
protected

Flag that states whether the origin should be visible in the viewport.

bool Frapper::ViewportWidget::m_showCenterPoint
protected

Flag that states whether the center should be visible in the viewport.

bool Frapper::ViewportWidget::m_showOrientationIndicator
protected

Flag that states whether the orientation indicator is shown in the widget.

bool Frapper::ViewportWidget::m_showGrid
protected

Flag that states whether the grid should be visible in the viewport.

bool Frapper::ViewportWidget::m_overlayOnly
protected

Flag that states whether the geometry should be visible.

float Frapper::ViewportWidget::m_dbgColor
protected

The background color.


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