VR-Forces 4.0.4 Class Documentation
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
makVrv::DtSceneObject Class Reference

A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it to another object. More...

List of all members.

Classes

struct  FindModelFunctor
struct  ModelRecord
struct  ObjectTransform

Public Types

typedef std::vector
< ObjectTransform
TransformList
typedef std::vector< ModelRecordModelList

Public Member Functions

 DtSceneObject (DtDe &de, DtUniqueID id)
 CTOR.
 ~DtSceneObject ()
 DTOR.
void addModel (DtModel *model, int visualizerType)
 Add a model, and indicate the model's visualizerType.
void removeModel (DtModel *model)
 Remove a model.
void removeModels ()
 Remove all models.
void setPosition (int vtx, const DtVector &position)
 Sets the position of the object's specified vertex.
void addPosition (int vtx, const DtVector &position)
 Add (or insert) a new vtx with the specified position value.
void getPosition (int vtx, DtVector &position) const
 Gets the position of the object's specified vertex.
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)
void getOffset (DtVector &offset) const
 Get the offset, if any (may be <0,0,0>)
void setOrientation (int vtx, const DtTaitBryan &orientation)
 Sets the orientation of the object and all of it's models.
void getOrientation (int vtx, DtTaitBryan &orientation) const
 Gets the orientation of the object and all of it's models.
void getOrientation (int vtx, DtQuat &orientation) const
 Gets the orientation of the object and all of it's models.
void setColor (float r, float g, float b, float a)
 Set the blend color value of the scene object.
void setModelSet (int modelSet)
 Set the model set this object uses; ignored if isProp is true.
int modelSet () const
 Get the model set this object uses.
void setIsProp (bool isProp)
 Set if the object is a prop.
bool isProp () const
 Get if the object is a prop.
void setSolid (bool b)
DtElementID elementID () const
 get the id of the element that this scene object (partially) represents
void setElementID (DtElementID elementID)
 set the id of the element that this scene object (partially) represents
DtUniqueID uniqueId () const
 Get the unique ID of the object.
const ModelListmodels () const
 Get a const list of model instance owners (DtModel*s)
ModelListmodels ()
 Get a non-const list of model instance owners (DtModel*s)
const TransformListtransforms () const
 Get the list of transforms.
virtual void removePosition (int)
 Remove a transform at the specified index.
void setBoundingBoxSize (double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
 Explicitly set the bound box size.
const DtVectorboundingBoxExtents () const
 Get the bounding box extents of the object.
void getBoundingBoxExtents (double &x, double &y, double &z) const
 Get the bounding box extents of the object.
const DtVectorboundingBoxCenter () const
 Get the bounding box center of the object.
void getBoundingBoxCenter (double &x, double &y, double &z) const
 Get the bounding box center of the object.
double boundingRadius () const
 Get the current bouding radius.
void setVisible (bool visible)
 Set the object's visibility.
void setVisibleViaSwitch (bool visible)
 Set the object's visibility but keeps it in the scene.
bool isVisible () const
 Check to see if the object is visible.
void setUpdater (DtUpdater *updater)
 Set the updater for the scene object.
DtUpdaterfindUpdater ()
 Get the updater for the scene object, it may be NULL.

Public Attributes

boost::signal< void(DtModel *)> signal_modelAdded
 Signaled after a model has been added.
boost::signal< void(DtModel *)> signal_modelRemoved
 Signaled after the model has been removed.
boost::signal< void(const
DtUniqueID &) > 
signal_sceneObjectToBeDeleted
 Emitted before the scene object is destroyed.
boost::signal< void(DtSceneObject *)> signal_boundingVolumeChanged
 Emitted after the bounding volume of the object changes.

Protected Member Functions

void initializeModel (DtModel *modelInstanceOwner)
 Initialize the specified model.
void modelChanged (DtModel *model)
 Register that a model has changed.
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.
void resetModelTransforms ()
 Push all scene object transforms to all models.
void updateBoundingBoxViaContents ()
 Update the bounding box of this scene object based on the bounding boxes of the models it contains.
void calculateBoundingRadius ()
 Calculate the scene object's bounding radius.

Protected Attributes

DtDemyDe
DtUniqueID myUniqueId
TransformList myTransforms
DtElementID myElementID
DtUpdatermyUpdater
int myModelSet
bool myIsProp
bool myGroundClampTo
ModelList myModels
bool myVisibleFlag
bool myCalculateBoundingBoxFlag
DtVector myBoundingBoxCenter
DtVector myBoundingBoxExtents
double myBoundingRadius
DtVector myOffset

Detailed Description

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.


Member Typedef Documentation


Constructor & Destructor Documentation

CTOR.

DTOR.


Member Function Documentation

void makVrv::DtSceneObject::addModel ( DtModel model,
int  visualizerType 
)

Add a model, and indicate the model's visualizerType.

The visualizerType is ignored if the scene object is a prop

Remove a model.

Remove all models.

void makVrv::DtSceneObject::setPosition ( int  vtx,
const DtVector position 
)

Sets the position of the object's specified vertex.

If the vtx does not exist, it will be added

void makVrv::DtSceneObject::addPosition ( int  vtx,
const DtVector position 
)

Add (or insert) a new vtx with the specified position value.

void makVrv::DtSceneObject::getPosition ( int  vtx,
DtVector position 
) const

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::getOrientation ( int  vtx,
DtTaitBryan &  orientation 
) const

Gets the orientation of the object and all of it's models.

void makVrv::DtSceneObject::getOrientation ( int  vtx,
DtQuat orientation 
) const

Gets the orientation of the object and all of it's models.

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.

Get the model set this object uses.

Set if the object is a prop.

Objects must either be props OR have a valid model set.

Get if the object is a prop.

get the id of the element that this scene object (partially) represents

set the id of the element that this scene object (partially) represents

Get the unique ID of the object.

Get a const list of model instance owners (DtModel*s)

Get a non-const list of model instance owners (DtModel*s)

Get the list of transforms.

virtual void makVrv::DtSceneObject::removePosition ( int  ) [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.

Get the bounding box extents of the object.

void makVrv::DtSceneObject::getBoundingBoxExtents ( double &  x,
double &  y,
double &  z 
) const

Get the bounding box extents of the object.

Get the bounding box center of the object.

void makVrv::DtSceneObject::getBoundingBoxCenter ( double &  x,
double &  y,
double &  z 
) const

Get the bounding box center of the object.

Get the current bouding radius.

Set the object's visibility.

Set the object's visibility but keeps it in the scene.

Check to see if the object is visible.

Set the updater for the scene object.

Get the updater for the scene object, it may be NULL.

void makVrv::DtSceneObject::initializeModel ( DtModel modelInstanceOwner) [protected]

Initialize the specified model.

void makVrv::DtSceneObject::modelChanged ( DtModel model) [protected]

Register that a model has changed.

bool makVrv::DtSceneObject::modelVisibilityRequested ( DtModel model,
bool  visible 
) [protected]

Part of an elaborate scheme to allow multiple models within a single scene object where some models may be visible while others.

Push all scene object transforms to all models.

Update the bounding box of this scene object based on the bounding boxes of the models it contains.

Calculate the scene object's bounding radius.


Member Data Documentation

Signaled after a model has been added.

Signaled after the model has been removed.

Emitted before the scene object is destroyed.

Emitted after the bounding volume of the object changes.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)