![]() |
VR-Forces 4.8 Class Documentation
|
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it to another object. More...
Classes | |
| struct | FindModelFunctor |
| struct | ModelConnections |
| struct | ModelRecord |
| struct | ObjectTransform |
Public Types | |
| enum | ModelSet { ModelSet_Unspecified = -1, ModelSet_3D = 0, ModelSet_3DColorized = 1, ModelSet_2DIcons = 5 } |
| typedef std::vector < ObjectTransform > | TransformList |
| typedef std::vector< ModelRecord > | ModelList |
Public Member Functions | |
| DtSceneObject (DtDe &de, DtUniqueID id) | |
| CTOR. More... | |
| virtual | ~DtSceneObject () |
| DTOR. More... | |
| void | addModel (DtModel *model, int visualizerType) |
| Add a model, and indicate the model's visualizerType. More... | |
| void | removeModel (DtModel *model) |
| Remove a model. More... | |
| void | removeModels () |
| Remove all models. More... | |
| void | setPosition (int vtx, const DtVector &position) |
| Sets the position of the object's specified vertex. More... | |
| void | addPosition (int vtx, const DtVector &position) |
| Add (or insert) a new vtx with the specified position value. More... | |
| void | getPosition (int vtx, DtVector &position) const |
| Gets the position of the object's specified vertex. More... | |
| void | setOffset (const DtVector &offset) |
| Set an offset (or origin) The offset will be added to each position when transmitted to the scene object's model(s) More... | |
| void | getOffset (DtVector &offset) const |
| Get the offset, if any (may be <0,0,0>) More... | |
| void | setOrientation (int vtx, const DtTaitBryan &orientation) |
| Sets the orientation of the object and all of it's models. More... | |
| void | setPositionAndOrientation (int vtx, const DtVector &position, const DtTaitBryan &orientation) |
| Sets the position and orientation of the object and all of it's models. More... | |
| void | setTopographicOrientation (int vtx, const DtTaitBryan &topoOrientation) |
| Sets the orientation of the object and all of it's models using a. More... | |
| void | getOrientation (int vtx, DtTaitBryan &orientation) const |
| Gets the orientation of the object and all of it's models. More... | |
| void | getTopographicOrientation (int vtx, DtTaitBryan &orientation) const |
| Gets the orientation of the object and all of it's models using a. More... | |
| void | getOrientation (int vtx, DtQuat &orientation) const |
| Gets the orientation of the object and all of it's models. More... | |
| virtual void | transformToSceneObjectCoord (const DtVector &dbCoord, DtVector &soCoord) |
| Transform a database coordinate into a scene object coordinate The scene object coordinate system is a y-front/x-left/z-up system. More... | |
| virtual void | transformToDatabaseCoord (const DtVector &soCoord, DtVector &dbCoord) |
| Transform a scene object coordinate into a database coordinate The scene object coordinate system is a y-front/x-left/z-up system. More... | |
| void | setColor (float r, float g, float b, float a) |
| Set the blend color value of the scene object. More... | |
| void | setModelSet (int modelSet) |
| Set the model set this object uses; ignored if isProp is true. More... | |
| int | modelSet () const |
| Get the model set this object uses. More... | |
| void | setIsProp (bool isProp) |
| Set if the object is a prop. More... | |
| bool | isProp () const |
| Get if the object is a prop. More... | |
| void | setIsSupportObject (bool b) |
| Is this scene object using the support object flag. More... | |
| bool | isSupportObject () |
| Is this object a support object. More... | |
| void | setSolid (bool b) |
| Set if the object should be drawn solid. More... | |
| bool | isSolid () const |
| Is this object drawn solid. More... | |
| DtElementID | elementID () const |
| get the id of the element that this scene object (partially) represents More... | |
| void | setElementID (DtElementID elementID) |
| set the id of the element that this scene object (partially) represents More... | |
| DtUniqueID | uniqueId () const |
| Get the unique ID of the object. More... | |
| const ModelList & | models () const |
| Get a const list of model instance owners (DtModel*s) More... | |
| ModelList & | models () |
| Get a non-const list of model instance owners (DtModel*s) More... | |
| const TransformList & | transforms () const |
| Get the list of transforms. More... | |
| virtual void | removePosition (int) |
| Remove a transform at the specified index. More... | |
| void | setBoundingBoxSize (double minX, double maxX, double minY, double maxY, double minZ, double maxZ) |
| Explicitly set the bound box size. More... | |
| const DtVector & | boundingBoxExtents () const |
| Get the bounding box extents of the object. More... | |
| void | getBoundingBoxExtents (double &x, double &y, double &z) const |
| Get the bounding box extents of the object. More... | |
| const DtVector & | boundingBoxCenter () const |
| Get the bounding box center of the object. More... | |
| void | getBoundingBoxCenter (double &x, double &y, double &z) const |
| Get the bounding box center of the object. More... | |
| double | boundingRadius () const |
| Get the current bounding radius. More... | |
| void | setVisible (bool visible) |
| Set the visible state of the scene object. More... | |
| bool | isVisible () const |
| Get the visible state of the scene object. More... | |
| virtual void | setBeingObserved (bool observed) |
| Set/get the being observed flag When a scene object is invisible, dead reckoning, calls to set position, etc. More... | |
| virtual bool | beingObserved () const |
| void | setUpdater (DtSceneObjectUpdater *updater) |
| Set the updater for the scene object. More... | |
| DtSceneObjectUpdater * | findUpdater () |
| Get the updater for the scene object, it may be NULL. More... | |
| const DtSceneObjectUpdater * | findUpdater () const |
| virtual float | getAndResetMinModelDistance () |
| walks through the model list and returns the closest distance for using in updating. More... | |
Public Attributes | |
Signals | |
| boost::signal< void(DtModel *)> | signal_modelAdded |
| Signaled after a model has been added. More... | |
| boost::signal< void(DtModel *)> | signal_modelRemoved |
| Signaled after the model has been removed. More... | |
| boost::signal< void(const DtUniqueID &) > | signal_sceneObjectToBeDeleted |
| Emitted before the scene object is destroyed. More... | |
| boost::signal< void(DtSceneObject *)> | signal_boundingVolumeChanged |
| Emitted after the bounding volume of the object changes. More... | |
Protected Types | |
| typedef std::pair< DtModel *, ModelConnections > | ModelConnectionsPair |
| typedef boost::unordered_map < DtModel *, ModelConnections > | ModelConnectionsMap |
Protected Member Functions | |
| void | initializeModel (DtModel *modelInstanceOwner) |
| Initialize the specified model. More... | |
| void | modelChanged (DtModel *model) |
| Register that a model has changed. More... | |
| bool | modelVisibilityRequested (DtModel *model, bool visible) |
| Part of an elaborate scheme to allow multiple models within a single scene object where some models may be visible while others. More... | |
| void | resetModelTransforms () |
| Push all scene object transforms to all models. More... | |
| void | updateBoundingBoxViaContents () |
| Update the bounding box of this scene object based on the bounding boxes of the models it contains. More... | |
| void | calculateBoundingRadius () |
| Calculate the scene object's bounding radius. More... | |
| virtual void | addModelConnections (DtModel *model) |
| Create connections to signals from the specified model. More... | |
| virtual void | removeModelConnections (DtModel *model) |
| Remove connections to signals from the specified model. More... | |
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it to another object.
The DtSceneObject is a container class that 'groups' multiple models into a single scene-object. A scene-object is an association of models that can be manipulated as a single unit. Among other features, the DtSceneObject identifies a single position and attitude within the scene for all models associated with it. As such, models are added to (and removed from) the scene object to be inserted to (and removed from) the scene itself. Once constructed the DtSceneObject can be positioned and oriented within the scene so that any models added to the object will also be positioned and oriented.
| typedef std::vector<ObjectTransform> makVrv::DtSceneObject::TransformList |
| typedef std::vector<ModelRecord> makVrv::DtSceneObject::ModelList |
|
protected |
|
protected |
| makVrv::DtSceneObject::DtSceneObject | ( | DtDe & | de, |
| DtUniqueID | id | ||
| ) |
CTOR.
|
virtual |
DTOR.
Add a model, and indicate the model's visualizerType.
The visualizerType is ignored if the scene object is a prop
| void makVrv::DtSceneObject::removeModel | ( | DtModel * | model | ) |
Remove a model.
| void makVrv::DtSceneObject::removeModels | ( | ) |
Remove all models.
Sets the position of the object's specified vertex.
If the vtx does not exist, it will be added
Add (or insert) a new vtx with the specified position value.
Gets the position of the object's specified vertex.
| void makVrv::DtSceneObject::setOffset | ( | const DtVector & | offset | ) |
Set an offset (or origin) The offset will be added to each position when transmitted to the scene object's model(s)
| void makVrv::DtSceneObject::getOffset | ( | DtVector & | offset | ) | const |
Get the offset, if any (may be <0,0,0>)
| void makVrv::DtSceneObject::setOrientation | ( | int | vtx, |
| const DtTaitBryan & | orientation | ||
| ) |
Sets the orientation of the object and all of it's models.
| void makVrv::DtSceneObject::setPositionAndOrientation | ( | int | vtx, |
| const DtVector & | position, | ||
| const DtTaitBryan & | orientation | ||
| ) |
Sets the position and orientation of the object and all of it's models.
| void makVrv::DtSceneObject::setTopographicOrientation | ( | int | vtx, |
| const DtTaitBryan & | topoOrientation | ||
| ) |
Sets the orientation of the object and all of it's models using a.
| void makVrv::DtSceneObject::getOrientation | ( | int | vtx, |
| DtTaitBryan & | orientation | ||
| ) | const |
Gets the orientation of the object and all of it's models.
| void makVrv::DtSceneObject::getTopographicOrientation | ( | int | vtx, |
| DtTaitBryan & | orientation | ||
| ) | const |
Gets the orientation of the object and all of it's models using a.
Gets the orientation of the object and all of it's models.
|
virtual |
Transform a database coordinate into a scene object coordinate The scene object coordinate system is a y-front/x-left/z-up system.
|
virtual |
Transform a scene object coordinate into a database coordinate The scene object coordinate system is a y-front/x-left/z-up system.
| void makVrv::DtSceneObject::setColor | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) |
Set the blend color value of the scene object.
| void makVrv::DtSceneObject::setModelSet | ( | int | modelSet | ) |
Set the model set this object uses; ignored if isProp is true.
| int makVrv::DtSceneObject::modelSet | ( | ) | const |
Get the model set this object uses.
| void makVrv::DtSceneObject::setIsProp | ( | bool | isProp | ) |
Set if the object is a prop.
Objects must either be props OR have a valid model set.
| bool makVrv::DtSceneObject::isProp | ( | ) | const |
Get if the object is a prop.
| void makVrv::DtSceneObject::setIsSupportObject | ( | bool | b | ) |
Is this scene object using the support object flag.
| bool makVrv::DtSceneObject::isSupportObject | ( | ) |
Is this object a support object.
| void makVrv::DtSceneObject::setSolid | ( | bool | b | ) |
Set if the object should be drawn solid.
| bool makVrv::DtSceneObject::isSolid | ( | ) | const |
Is this object drawn solid.
| DtElementID makVrv::DtSceneObject::elementID | ( | ) | const |
get the id of the element that this scene object (partially) represents
| void makVrv::DtSceneObject::setElementID | ( | DtElementID | elementID | ) |
set the id of the element that this scene object (partially) represents
| DtUniqueID makVrv::DtSceneObject::uniqueId | ( | ) | const |
Get the unique ID of the object.
Referenced by makVrv::DtAttachableUpdater::ObjectAttachedPoint::setSceneObject().
| const ModelList& makVrv::DtSceneObject::models | ( | ) | const |
Get a const list of model instance owners (DtModel*s)
| ModelList& makVrv::DtSceneObject::models | ( | ) |
Get a non-const list of model instance owners (DtModel*s)
| const TransformList& makVrv::DtSceneObject::transforms | ( | ) | const |
Get the list of transforms.
|
virtual |
Remove a transform at the specified index.
| void makVrv::DtSceneObject::setBoundingBoxSize | ( | double | minX, |
| double | maxX, | ||
| double | minY, | ||
| double | maxY, | ||
| double | minZ, | ||
| double | maxZ | ||
| ) |
Explicitly set the bound box size.
To use the automatic bounding box size set with all 0's.
| const DtVector& makVrv::DtSceneObject::boundingBoxExtents | ( | ) | const |
Get the bounding box extents of the object.
Get the bounding box extents of the object.
| const DtVector& makVrv::DtSceneObject::boundingBoxCenter | ( | ) | const |
Get the bounding box center of the object.
Get the bounding box center of the object.
| double makVrv::DtSceneObject::boundingRadius | ( | ) | const |
Get the current bounding radius.
| void makVrv::DtSceneObject::setVisible | ( | bool | visible | ) |
Set the visible state of the scene object.
| [in] | visible | is the new visible state; true = visible, false = hidden. |
| bool makVrv::DtSceneObject::isVisible | ( | ) | const |
Get the visible state of the scene object.
| true | if set visible. |
| false | otherwise. |
|
virtual |
Set/get the being observed flag When a scene object is invisible, dead reckoning, calls to set position, etc.
are skipped. This effectively disables those optimizations by indicating that the object still needs to updated even if invisible
|
virtual |
| void makVrv::DtSceneObject::setUpdater | ( | DtSceneObjectUpdater * | updater | ) |
Set the updater for the scene object.
| DtSceneObjectUpdater* makVrv::DtSceneObject::findUpdater | ( | ) |
Get the updater for the scene object, it may be NULL.
| const DtSceneObjectUpdater* makVrv::DtSceneObject::findUpdater | ( | ) | const |
|
virtual |
walks through the model list and returns the closest distance for using in updating.
|
protected |
Initialize the specified model.
|
protected |
Register that a model has changed.
Part of an elaborate scheme to allow multiple models within a single scene object where some models may be visible while others.
|
protected |
Push all scene object transforms to all models.
|
protected |
Update the bounding box of this scene object based on the bounding boxes of the models it contains.
|
protected |
Calculate the scene object's bounding radius.
|
protectedvirtual |
Create connections to signals from the specified model.
|
protectedvirtual |
Remove connections to signals from the specified model.
| boost::signal<void (DtModel*)> makVrv::DtSceneObject::signal_modelAdded |
Signaled after a model has been added.
| boost::signal<void (DtModel*)> makVrv::DtSceneObject::signal_modelRemoved |
Signaled after the model has been removed.
| boost::signal< void (const DtUniqueID&) > makVrv::DtSceneObject::signal_sceneObjectToBeDeleted |
Emitted before the scene object is destroyed.
| boost::signal<void (DtSceneObject*)> makVrv::DtSceneObject::signal_boundingVolumeChanged |
Emitted after the bounding volume of the object changes.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |