![]() |
VR-Forces 4.1 Class Documentation
|
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. | |
| ~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 | setSolidFlags (bool solid) |
| Mark the scene connector root nodes as solid or not solid. | |
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. | |
| DtOsgRenderer * | getRendererAndSceneParent (DtOsgRenderer::SceneRoot &sceneParent) |
| Helper to get the renderer and scene-parent. | |
| DtOsgSceneConnector () | |
| Default constructor. | |
| DtOsgSceneConnector (const DtOsgSceneConnector &) | |
| Copy constructor. | |
| DtOsgSceneConnector & | operator= (const DtOsgSceneConnector &) |
| Assignment Operator. | |
Private Attributes | |
| osg::ref_ptr < DtFastMatrixTransform > | myTransform |
| osg::ref_ptr< DtFastGroup > | myGroup |
| osg::ref_ptr< osg::Switch > | mySwitch |
| int | myModelSet |
| int | myVisualizerType |
| bool | myVisible |
| bool | myConnectWhileHidden |
| bool | myIsProp |
| bool | myModelScalingEnabled |
| bool | myLocalModelScalingEnabled |
| float | myLocalModelScalingAmount |
| float | myCurrentLocalModelScaling |
| DtDe & | myDe |
| DtChannel * | myChannel |
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.
| makVrv::DtOsgSceneConnector::DtOsgSceneConnector | ( | DtDe & | de | ) |
Initializing CTOR.
| [in] | de | is a reference to the display engine. |
| makVrv::DtOsgSceneConnector::~DtOsgSceneConnector | ( | ) |
DTOR.
|
private |
Default constructor.
|
private |
Copy constructor.
| 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.
| [in] | osgModelInstance | is the model instance. |
| [in] | sceneObjectId | is a unique identifier. |
| [in] | modelSet | is the model set this model displays with. |
| [in] | visualizerType | is 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
| [in] | osgModelInstance | is the model instance. |
| [in] | sceneObjectId | is a unique identifier. |
| [in] | modelSet | is the model set this model displays with. |
| [in] | channelRoot | is 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.
| [in] | osgModelInstance | is the model instance. |
| [in] | sceneObjectId | is a unique identifier. |
| void makVrv::DtOsgSceneConnector::removeFromScene | ( | DtOsgModelInstance * | osgModelInstance | ) |
Disconnect the model instance and remove the connector from the scene.
| [in] | osgModelInstance | is the model instance. |
| void makVrv::DtOsgSceneConnector::setPosition | ( | const DtVector & | position | ) |
Set the position of the connector.
| [in] | position | is the new position to display the model. |
| void makVrv::DtOsgSceneConnector::setOrientation | ( | const DtTaitBryan & | orientation | ) |
Set the orientation of the connector.
| [in] | orientation | is the new orientation to display the model. |
| void makVrv::DtOsgSceneConnector::setVisible | ( | bool | visible | ) |
Set the visible state of the connector.
| [in] | visible | is the new visible state; true = visible, false = hidden. |
| bool makVrv::DtOsgSceneConnector::isVisible | ( | ) | const |
Get the visible state of the connector.
| true | if set visible. |
| false | otherwise. |
| void makVrv::DtOsgSceneConnector::setConnectedWhileHidden | ( | bool | stayConnected | ) |
Set whether the connector should still be connected when hidden.
| [in] | stayConnected | is the new connected while hidden state; true = connected while hidden, false = not connected while hidden. |
| bool makVrv::DtOsgSceneConnector::connectedWhileHidden | ( | ) | const |
Get whether connected while hidden is enabled.
| true | if connected while hidden. |
| false | otherwise. |
| void makVrv::DtOsgSceneConnector::setModelScalingEnabled | ( | bool | enabled | ) |
Set whether model scaling is enabled.
| [in] | enabled | is the new scaling enabled state, default is false. |
| bool makVrv::DtOsgSceneConnector::modelScalingEnabled | ( | ) | const |
Get whether model scaling is enabled.
| true | if scaling is enabled. |
| false | otherwise. |
| 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.
| [in] | enabled | is the new local scaling enabled state, default is false. |
| bool makVrv::DtOsgSceneConnector::localModelScalingEnabled | ( | ) | const |
Get whether local model scaling is enabled.
| true | if scaling is enabled. |
| false | otherwise. |
| void makVrv::DtOsgSceneConnector::setLocalModelScalingAmount | ( | float | amount | ) |
Set the amount of scaling to apply when local scaling is enabled.
| [in] | amount | is the amount to scale, should be greater than zero. |
| double makVrv::DtOsgSceneConnector::localModelScalingAmount | ( | ) | const |
Get the amount of local model scaling.
| DtOsgRenderer::SceneRoot makVrv::DtOsgSceneConnector::findSceneParent | ( | ) |
Get the scene-root parent.
| DtException | if not a prop, and either visualizer or model set are invalid. |
| osg::MatrixTransform* makVrv::DtOsgSceneConnector::transformRoot | ( | ) |
Get the transformed root node.
| osg::Group* makVrv::DtOsgSceneConnector::groupRoot | ( | ) |
Get the untransformed root node.
| void makVrv::DtOsgSceneConnector::setSolidFlags | ( | bool | solid | ) |
Mark the scene connector root nodes as solid or not solid.
| [in] | solid | is the solid flag; true = solid, false = not solid, default is not solid. |
|
private |
Helper to set the uniform scaling amount of the transform.
|
private |
Helper to set the parent of the nodes.
| [in] | visible | is a flag specifying which parent; true = visible renderer, false = hidden updater ( if one exists ). |
| [in] | create | is a flag passed to the renderer when set as parent; not used when hidden updater is set as parent. |
|
private |
Helper to get the renderer and scene-parent.
| [out] | sceneParent | is a reference to the scene-parent; |
|
private |
Assignment Operator.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |