VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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.

Public Member Functions

 DtOsgSceneConnector (DtDe &de)
 
virtual ~DtOsgSceneConnector ()
 
void addToScene (DtOsgModelInstance *osgModelInstance, const DtUniqueID &sceneObjectId, DtModelSetId modelSet, int visualizerType, bool intersectOnly=false)
 
void addToScene (DtOsgModelInstance *osgModelInstance, const DtUniqueID &sceneObjectId, DtModelSetId modelSet, DtChannel *channelRoot)
 
void addToSceneAsProp (DtOsgModelInstance *osgModelInstance, const DtUniqueID &sceneObjectId, bool intersectOnly=false)
 
void removeFromScene (DtOsgModelInstance *osgModelInstance)
 
void setPosition (const DtVector &position)
 
void setOrientation (const DtTaitBryan &orientation)
 
void setPositionAndOrientation (const DtVector &position, const DtTaitBryan &orientation, const DtVector &positionOffset, const DtTaitBryan &orientationOffset)
 
void setVisible (bool visible)
 
bool isVisible () const
 
void setConnectedWhileHidden (bool stayConnected)
 
bool connectedWhileHidden () const
 
void setModelScalingEnabled (bool enabled)
 
bool modelScalingEnabled () const
 
void setLocalModelScalingEnabled (bool enabled)
 
bool localModelScalingEnabled () const
 
void setLocalModelScalingAmount (float amount)
 
double localModelScalingAmount () const
 
DtSceneRoot findSceneParent ()
 
DtRenderToggleTransformgetOrCreateTransformRoot ()
 
osg::Group * groupRoot ()
 
void setSupportFlags (bool support)
 
virtual void setRendered (bool rendered)
 

Private Member Functions

void setTransformModelScalingState ()
 
void setToVisibleParent (bool visible=true, bool create=true)
 
DtOsgRenderergetRendererAndSceneParent (DtSceneRoot &sceneParent)
 
 DtOsgSceneConnector ()
 
 DtOsgSceneConnector (const DtOsgSceneConnector &)
 
DtOsgSceneConnectoroperator= (const DtOsgSceneConnector &)
 

Private Attributes

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

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,
DtModelSetId  modelSet,
int  visualizerType,
bool  intersectOnly = false 
)

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.
[in]intersectOnlysets this model being added to not draw and only be intersected
void makVrv::DtOsgSceneConnector::addToScene ( DtOsgModelInstance osgModelInstance,
const DtUniqueID sceneObjectId,
DtModelSetId  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,
bool  intersectOnly = false 
)

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

Parameters
[in]osgModelInstanceis the model instance.
[in]sceneObjectIdis a unique identifier.
[in]intersectOnlysets this prop being added to not draw and only be intersected
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::setPositionAndOrientation ( const DtVector &  position,
const DtTaitBryan &  orientation,
const DtVector &  positionOffset,
const DtTaitBryan &  orientationOffset 
)

Set the position and the orientation of the connector.

Parameters
[in]positionis the new position to display the model.
[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()
DtSceneRoot 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.
DtRenderToggleTransform* makVrv::DtOsgSceneConnector::getOrCreateTransformRoot ( )

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 ( DtSceneRoot 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<DtRenderToggleTransform> makVrv::DtOsgSceneConnector::myTransform
private
osg::ref_ptr<DtFastGroup> makVrv::DtOsgSceneConnector::myGroup
private
osg::ref_ptr<osg::Switch> makVrv::DtOsgSceneConnector::mySwitch
private
DtModelSetId 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
bool makVrv::DtOsgSceneConnector::myIntersectOnly
private

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)