VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | 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...

Classes

struct  FindModelFunctor
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< ModelRecordModelList

Public Member Functions

 DtSceneObject (DtDe &de, DtUniqueID id)
 CTOR.
virtual ~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 setTopographicOrientation (int vtx, const DtTaitBryan &topoOrientation)
 Sets the orientation of the object and all of it's models using a.
void getOrientation (int vtx, DtTaitBryan &orientation) const
 Gets the orientation of the object and all of it's models.
void getTopographicOrientation (int vtx, DtTaitBryan &orientation) const
 Gets the orientation of the object and all of it's models using a.
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 setIsSupportObject (bool b)
 Is this scene object using the support object flag.
bool isSupportObject ()
 Is this object a support object.
void setSolid (bool b)
 Set if the object should be drawn solid.
bool isSolid () const
 Is this object drawn solid.
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 bounding radius.
void setVisible (bool visible)
 Set the visible state of the scene object.
bool isVisible () const
 Get the visible state of the scene object.
void setUpdater (DtSceneObjectUpdater *updater)
 Set the updater for the scene object.
DtSceneObjectUpdaterfindUpdater ()
 Get the updater for the scene object, it may be NULL.
const DtSceneObjectUpdaterfindUpdater () const

Public Attributes

Signals
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
DtSceneObjectUpdatermyUpdater
int myModelSet
bool myIsProp
bool myGroundClampTo
bool myIsDrawnSolid
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

Member Enumeration Documentation

Enumerator:
ModelSet_Unspecified 
ModelSet_3D 
ModelSet_3DColorized 
ModelSet_2DIcons 

Constructor & Destructor Documentation

makVrv::DtSceneObject::DtSceneObject ( DtDe de,
DtUniqueID  id 
)

CTOR.

virtual makVrv::DtSceneObject::~DtSceneObject ( )
virtual

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

void makVrv::DtSceneObject::removeModel ( DtModel model)

Remove a model.

void makVrv::DtSceneObject::removeModels ( )

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::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.

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.

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.

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 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.

const DtVector& makVrv::DtSceneObject::boundingBoxExtents ( ) const

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.

const DtVector& makVrv::DtSceneObject::boundingBoxCenter ( ) const

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.

double makVrv::DtSceneObject::boundingRadius ( ) const

Get the current bounding radius.

void makVrv::DtSceneObject::setVisible ( bool  visible)

Set the visible state of the scene object.

Parameters
[in]visibleis the new visible state; true = visible, false = hidden.
bool makVrv::DtSceneObject::isVisible ( ) const

Get the visible state of the scene object.

Return values
trueif set visible.
falseotherwise.
See Also
setVisible()
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
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.

void makVrv::DtSceneObject::resetModelTransforms ( )
protected

Push all scene object transforms to all models.

void makVrv::DtSceneObject::updateBoundingBoxViaContents ( )
protected

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

void makVrv::DtSceneObject::calculateBoundingRadius ( )
protected

Calculate the scene object's bounding radius.

Member Data Documentation

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.

DtDe& makVrv::DtSceneObject::myDe
protected
DtUniqueID makVrv::DtSceneObject::myUniqueId
protected
TransformList makVrv::DtSceneObject::myTransforms
protected
DtElementID makVrv::DtSceneObject::myElementID
protected
DtSceneObjectUpdater* makVrv::DtSceneObject::myUpdater
protected
int makVrv::DtSceneObject::myModelSet
protected
bool makVrv::DtSceneObject::myIsProp
protected
bool makVrv::DtSceneObject::myGroundClampTo
protected
bool makVrv::DtSceneObject::myIsDrawnSolid
protected
ModelList makVrv::DtSceneObject::myModels
protected
bool makVrv::DtSceneObject::myVisibleFlag
protected
bool makVrv::DtSceneObject::myCalculateBoundingBoxFlag
protected
DtVector makVrv::DtSceneObject::myBoundingBoxCenter
protected
DtVector makVrv::DtSceneObject::myBoundingBoxExtents
protected
double makVrv::DtSceneObject::myBoundingRadius
protected
DtVector makVrv::DtSceneObject::myOffset
protected

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)