VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
makVrv::DtOsgSceneConnector Class Reference

DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can place its associated model instance into the scene graph. More...

Public Member Functions

 DtOsgSceneConnector (DtDe &de)
 Initializing CTOR.
virtual ~DtOsgSceneConnector ()
 DTOR.
void addToScene (DtOsgModelInstance *osgModelInstance, const DtUniqueID &sceneObjectId, int modelSet, int visualizerType)
 Add a model instance to the connector and the connector to the scene.
void addToScene (DtOsgModelInstance *osgModelInstance, const DtUniqueID &sceneObjectId, int modelSet, DtChannel *channelRoot)
 Add the connector to the scene on the particular channel root underneath the model set root.
void addToSceneAsProp (DtOsgModelInstance *osgModelInstance, const DtUniqueID &sceneObjectId)
 Add a model instance to the connector and display as a prop.
void removeFromScene (DtOsgModelInstance *osgModelInstance)
 Disconnect the model instance and remove the connector from the scene.
void setPosition (const DtVector &position)
 Set the position of the connector.
void setOrientation (const DtTaitBryan &orientation)
 Set the orientation of the connector.
void setVisible (bool visible)
 Set the visible state of the connector.
bool isVisible () const
 Get the visible state of the connector.
void setConnectedWhileHidden (bool stayConnected)
 Set whether the connector should still be connected when hidden.
bool connectedWhileHidden () const
 Get whether connected while hidden is enabled.
void setModelScalingEnabled (bool enabled)
 Set whether model scaling is enabled.
bool modelScalingEnabled () const
 Get whether model scaling is enabled.
void setLocalModelScalingEnabled (bool enabled)
 Set whether local model scaling is enabled.
bool localModelScalingEnabled () const
 Get whether local model scaling is enabled.
void setLocalModelScalingAmount (float amount)
 Set the amount of scaling to apply when local scaling is enabled.
double localModelScalingAmount () const
 Get the amount of local model scaling.
DtOsgRenderer::SceneRoot findSceneParent ()
 Get the scene-root parent.
osg::MatrixTransform * transformRoot ()
 Get the transformed root node.
osg::Group * groupRoot ()
 Get the untransformed root node.
void setSupportFlags (bool support)
 Mark the scene connector root nodes as part of support or not.
virtual void setRendered (bool rendered)
 Set whether or not the scene connector and its children are rendered.

Private Member Functions

void setTransformModelScalingState ()
 Helper to set the uniform scaling amount of the transform.
void setToVisibleParent (bool visible=true, bool create=true)
 Helper to set the parent of the nodes.
DtOsgRenderergetRendererAndSceneParent (DtOsgRenderer::SceneRoot &sceneParent)
 Helper to get the renderer and scene-parent.
 DtOsgSceneConnector ()
 Default constructor.
 DtOsgSceneConnector (const DtOsgSceneConnector &)
 Copy constructor.
DtOsgSceneConnectoroperator= (const DtOsgSceneConnector &)
 Assignment Operator.

Private Attributes

osg::ref_ptr
< DtFastMatrixTransform
myTransform
osg::ref_ptr< DtFastGroupmyGroup
osg::ref_ptr< osg::Switch > mySwitch
int myModelSet
int myVisualizerType
bool myVisible
bool myConnectWhileHidden
bool myIsProp
bool myModelScalingEnabled
bool myLocalModelScalingEnabled
float myLocalModelScalingAmount
float myCurrentLocalModelScaling
DtDemyDe
DtChannelmyChannel

Detailed Description

DtOsgSceneConnector is used by models to create an OSG position/orientation transform so that it can place its associated model instance into the scene graph.

Constructor & Destructor Documentation

makVrv::DtOsgSceneConnector::DtOsgSceneConnector ( DtDe de)

Initializing CTOR.

Parameters
[in]deis a reference to the display engine.
virtual makVrv::DtOsgSceneConnector::~DtOsgSceneConnector ( )
virtual

DTOR.

makVrv::DtOsgSceneConnector::DtOsgSceneConnector ( )
private

Default constructor.

Note
Not implemented
makVrv::DtOsgSceneConnector::DtOsgSceneConnector ( const DtOsgSceneConnector )
private

Copy constructor.

Note
Not implemented

Member Function Documentation

void makVrv::DtOsgSceneConnector::addToScene ( DtOsgModelInstance osgModelInstance,
const DtUniqueID sceneObjectId,
int  modelSet,
int  visualizerType 
)

Add a model instance to the connector and the connector to the scene.

Parameters
[in]osgModelInstanceis the model instance.
[in]sceneObjectIdis a unique identifier.
[in]modelSetis the model set this model displays with.
[in]visualizerTypeis the type of visualizer for this model.
void makVrv::DtOsgSceneConnector::addToScene ( DtOsgModelInstance osgModelInstance,
const DtUniqueID sceneObjectId,
int  modelSet,
DtChannel channelRoot 
)

Add the connector to the scene on the particular channel root underneath the model set root.

Different than adding a channel to the model set root in these channel roots can have different geometry to display

Parameters
[in]osgModelInstanceis the model instance.
[in]sceneObjectIdis a unique identifier.
[in]modelSetis the model set this model displays with.
[in]channelRootis the channel to display this model on.
void makVrv::DtOsgSceneConnector::addToSceneAsProp ( DtOsgModelInstance osgModelInstance,
const DtUniqueID sceneObjectId 
)

Add a model instance to the connector and display as a prop.

Parameters
[in]osgModelInstanceis the model instance.
[in]sceneObjectIdis a unique identifier.
void makVrv::DtOsgSceneConnector::removeFromScene ( DtOsgModelInstance osgModelInstance)

Disconnect the model instance and remove the connector from the scene.

Parameters
[in]osgModelInstanceis the model instance.
void makVrv::DtOsgSceneConnector::setPosition ( const DtVector position)

Set the position of the connector.

Parameters
[in]positionis the new position to display the model.
void makVrv::DtOsgSceneConnector::setOrientation ( const DtTaitBryan &  orientation)

Set the orientation of the connector.

Parameters
[in]orientationis the new orientation to display the model.
void makVrv::DtOsgSceneConnector::setVisible ( bool  visible)

Set the visible state of the connector.

Parameters
[in]visibleis the new visible state; true = visible, false = hidden.
Note
A hidden connector is temporarily removed from the scene unless the connector is set for staying connected while hidden.
See Also
setConnectedWhileHidden()
bool makVrv::DtOsgSceneConnector::isVisible ( ) const

Get the visible state of the connector.

Return values
trueif set visible.
falseotherwise.
See Also
setVisible()
void makVrv::DtOsgSceneConnector::setConnectedWhileHidden ( bool  stayConnected)

Set whether the connector should still be connected when hidden.

Parameters
[in]stayConnectedis the new connected while hidden state; true = connected while hidden, false = not connected while hidden.
Note
A hidden connector is normally removed from the scene. This function allows the connector and associated model instance to remain connected in the scene, even though they are not displayed.
See Also
setVisible()
bool makVrv::DtOsgSceneConnector::connectedWhileHidden ( ) const

Get whether connected while hidden is enabled.

Return values
trueif connected while hidden.
falseotherwise.
See Also
setConnectedWhileHidden()
void makVrv::DtOsgSceneConnector::setModelScalingEnabled ( bool  enabled)

Set whether model scaling is enabled.

Parameters
[in]enabledis the new scaling enabled state, default is false.
Note
This value is overridden if local model scaling is enabled.
See Also
setLocalModelScalingEnabled()
bool makVrv::DtOsgSceneConnector::modelScalingEnabled ( ) const

Get whether model scaling is enabled.

Return values
trueif scaling is enabled.
falseotherwise.
See Also
setModelScalingEnabled()
void makVrv::DtOsgSceneConnector::setLocalModelScalingEnabled ( bool  enabled)

Set whether local model scaling is enabled.

When set, the connector and associated model instance are scaled uniformly by the local scaling amount.

Parameters
[in]enabledis the new local scaling enabled state, default is false.
Note
When set, this value overrides generic (global) model scaling.
See Also
setLocalModelScalingAmount()
setModelScalingEnabled()
bool makVrv::DtOsgSceneConnector::localModelScalingEnabled ( ) const

Get whether local model scaling is enabled.

Return values
trueif scaling is enabled.
falseotherwise.
See Also
setLocalModelScalingEnabled()
void makVrv::DtOsgSceneConnector::setLocalModelScalingAmount ( float  amount)

Set the amount of scaling to apply when local scaling is enabled.

Parameters
[in]amountis the amount to scale, should be greater than zero.
See Also
setLocalModelScalingEnabled()
double makVrv::DtOsgSceneConnector::localModelScalingAmount ( ) const

Get the amount of local model scaling.

Returns
The amount of scaling.
See Also
setLocalModelScalingAmount()
DtOsgRenderer::SceneRoot makVrv::DtOsgSceneConnector::findSceneParent ( )

Get the scene-root parent.

Returns
The scene-root parent.
Exceptions
DtExceptionif not a prop, and either visualizer or model set are invalid.
osg::MatrixTransform* makVrv::DtOsgSceneConnector::transformRoot ( )

Get the transformed root node.

Returns
A pointer to the transform root node.
Note
First call creates and initializes the node as not solid.
osg::Group* makVrv::DtOsgSceneConnector::groupRoot ( )

Get the untransformed root node.

Returns
A pointer to the root node.
Note
First call creates and initializes the node as not solid.
void makVrv::DtOsgSceneConnector::setSupportFlags ( bool  support)

Mark the scene connector root nodes as part of support or not.

Parameters
[in]supportis the support flag; true = is support, false = not support, default is not support.
Note
The observer and ground clamped objects only interact with object in the support group.
virtual void makVrv::DtOsgSceneConnector::setRendered ( bool  rendered)
virtual

Set whether or not the scene connector and its children are rendered.

This is different from setting visibility because non-rendered objects are still in the scene graph, and will be hit by intersection tests.

void makVrv::DtOsgSceneConnector::setTransformModelScalingState ( )
private

Helper to set the uniform scaling amount of the transform.

See Also
setModelScalingEnabled()
setLocalModelScalingEnabled()
setLocalModelScalingAmount()
void makVrv::DtOsgSceneConnector::setToVisibleParent ( bool  visible = true,
bool  create = true 
)
private

Helper to set the parent of the nodes.

Parameters
[in]visibleis a flag specifying which parent; true = visible renderer, false = hidden updater ( if one exists ).
[in]createis a flag passed to the renderer when set as parent; not used when hidden updater is set as parent.
See Also
setVisible()
setConnectedWhileHidden()
DtOsgRenderer* makVrv::DtOsgSceneConnector::getRendererAndSceneParent ( DtOsgRenderer::SceneRoot sceneParent)
private

Helper to get the renderer and scene-parent.

Parameters
[out]sceneParentis a reference to the scene-parent;
Returns
A pointer to the renderer or NULL on failure.
DtOsgSceneConnector& makVrv::DtOsgSceneConnector::operator= ( const DtOsgSceneConnector )
private

Assignment Operator.

Note
Not implemented

Member Data Documentation

osg::ref_ptr<DtFastMatrixTransform> makVrv::DtOsgSceneConnector::myTransform
private
osg::ref_ptr<DtFastGroup> makVrv::DtOsgSceneConnector::myGroup
private
osg::ref_ptr<osg::Switch> makVrv::DtOsgSceneConnector::mySwitch
private
int makVrv::DtOsgSceneConnector::myModelSet
private
int makVrv::DtOsgSceneConnector::myVisualizerType
private
bool makVrv::DtOsgSceneConnector::myVisible
private
bool makVrv::DtOsgSceneConnector::myConnectWhileHidden
private
bool makVrv::DtOsgSceneConnector::myIsProp
private
bool makVrv::DtOsgSceneConnector::myModelScalingEnabled
private
bool makVrv::DtOsgSceneConnector::myLocalModelScalingEnabled
private
float makVrv::DtOsgSceneConnector::myLocalModelScalingAmount
private
float makVrv::DtOsgSceneConnector::myCurrentLocalModelScaling
private
DtDe& makVrv::DtOsgSceneConnector::myDe
private
DtChannel* makVrv::DtOsgSceneConnector::myChannel
private

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)