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

A model which owns a single model instance. More...

Inheritance diagram for makVrv::DtModel:
Inheritance graph
[legend]

List of all members.

Classes

struct  ObjectTransform

Public Member Functions

 DtModel (DtDe &de, DtUniqueID id)
 CTOR.
virtual ~DtModel ()
 DTOR.
virtual void setModelDefinition (const std::string &str)
 Set the model definition.
virtual void saveModelToFile (const std::string &filename)
virtual std::string className () const
 Get the class name of the model instance owner.
unsigned int transformSize () const
 Get the number of position/orientations this model has.
virtual void setPosition (int vtx, const DtVector &position)
 Set the position of a control vertex in the model.
virtual void removePosition (int vtx)
 Remove a transform at the given position.
const DtVectorposition (int vtx=0) const
 Get the Position of a given point.
virtual void setOrientation (int vtx, const DtTaitBryan &orientation)
 Set the orientation of a vertex in the model.
virtual void enableColorBlending (bool b)
 Enable / disable color blending for this model.
virtual void setBlendColor (float r, float g, float b, float a)
 Set color to use if color blending is enabled.
virtual void setColor (float r, float g, float b, float a)
 set the model's color
virtual int modelSet () const
 Get the model set this model is part of.
const DtVectorboundingBoxExtents () const
 Get the bounding box extents of the model instance.
void getBoundingBoxExtents (double &x, double &y, double &z) const
 Get the bounding box extents of the model instance.
const DtVectorboundingBoxCenter () const
 Get the bounding box center of the model instance.
void getBoundingBoxCenter (double &x, double &y, double &z) const
 Get the bounding box center of the model instance.
void getBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
void setContributesToBound (bool trueOrFalse)
 Set whether this model instance contributes to an object's overall bounding volume.
bool contributesToBound () const
 Get whether this model instance contributes to an object's overall bounding volume.
DtDede ()
 Get the DtDe object.
virtual void setModelInstance (DtModelInstance *modelInstance)
 Internally set the model instance pointer.
virtual void setVisible (bool isVisible)
 Set the model visible or invisible.
virtual void setVisibleViaSwitch (bool isVisible)
 Set the model visible or invisible.
bool visible () const
 Get if the model is visible.
DtUniqueID parentSceneObjectID () const
 Parent of the model.
virtual void addedToSceneObjectAsProp (const DtUniqueID &sceneObj)
 Called when a scene object added the model as a prop.
virtual void addedToSceneObject (const DtUniqueID &sceneObj, int modelSet, int visualizerType)
 Called when a scene object added the model with the given model set and visualizer type.
virtual void removedFromSceneObject ()
 Called when the model was removed from a scene object.
virtual void setSolid (bool isSolid)=0
 Set whether or not other scene objects can ground clamp to this model Default implementation does nothing.
virtual DtModelInstancemodelInstance ()
 Get the model instance.
virtual const DtModelInstancemodelInstance () const
 Get the model instance.
int visualizerType () const
 The visualizer type determines which channel-specific group node this model will be parented to, and consequently, which observer setting will cause it to be rendered in which channel.

Public Attributes

boost::signal< void(DtModel *)> signal_modelToBeDestroyed
 Signal emitted when the model is to be destroyed.
boost::signal< void(DtModel *)> signal_modelChanged
boost::signal< bool(DtModel
*, bool), SlotReturnOR
signal_visibilityChangeRequested
 Signal when the visibility has been requested, if any slot returns false, it will not change.
boost::signal< void(DtModelInstance
*, DtModel *)> 
signal_modelInstanceCreated
 Signal emitted when the model instance is created.
boost::signal< void(DtModelInstance
*, DtModel *)> 
signal_modelInstanceToBeDestroyed
 Signal emitted when the model instance is to be destroyed.

Protected Types

typedef std::vector
< ObjectTransform
TransformList

Protected Member Functions

virtual void addToScene (const DtUniqueID &sceneObjectId, int modelSet, int visualizerType)=0
 Virtual Functions to be implemented, add this model to the scene.
virtual void addToSceneAsProp (const DtUniqueID &sceneObjectId)
 Add this model to the scene as a prop.
virtual void removeFromScene ()=0
 Virtual Functions to be implemented, remove this model from the scene.
virtual void initializeModelInstance ()
 Push any state maintained by the model to the model instance.
void slot_modelInstanceChanged (DtModelInstance *instance)
 Called when the model instance changed.

Protected Attributes

DtDemyDe
const DtUniqueID myUniqueId

Private Attributes

TransformList myTransforms
 We keep our own copy in case we get updates before we get a model instance.
DtModelInstancemyModelInstance
int myModelSet
int myVisualizerType
bool myContributesToBound
DtUniqueID myParentSceneObjectID
bool myIsPropFlag
bool myColorBlendingEnabled
float myBlendColor [4]
bool myVisibleFlag

Detailed Description

A model which owns a single model instance.

A DtModel is a managing container for a single DtModelInstance, providing more attributes about how the DtModelInstance should be rendered. Initialization of a DtModel starts with giving it a model-definition. Unlike the DtModelInstance which can be handed a model-definition identifying the model to load, the DtModel retrieves a model-definition which has been pre-loaded into a definition-manager. Usually DtModelDefinition objects are automatically loaded from disk to populate the definition-manager.


Member Typedef Documentation

typedef std::vector<ObjectTransform> makVrv::DtModel::TransformList [protected]

Constructor & Destructor Documentation

CTOR.

virtual makVrv::DtModel::~DtModel ( ) [virtual]

DTOR.


Member Function Documentation

virtual void makVrv::DtModel::setModelDefinition ( const std::string &  str) [virtual]
virtual void makVrv::DtModel::saveModelToFile ( const std::string &  filename) [virtual]
virtual std::string makVrv::DtModel::className ( ) const [virtual]

Get the model instance.

virtual const DtModelInstance* makVrv::DtModel::modelInstance ( ) const [virtual]

Get the model instance.

unsigned int makVrv::DtModel::transformSize ( ) const

Get the number of position/orientations this model has.

virtual void makVrv::DtModel::setPosition ( int  vtx,
const DtVector position 
) [virtual]
virtual void makVrv::DtModel::removePosition ( int  vtx) [virtual]
const DtVector& makVrv::DtModel::position ( int  vtx = 0) const

Get the Position of a given point.

Exceptions:
DtCorruptedStateif the vtx is not with-in the normal bounds.
virtual void makVrv::DtModel::setOrientation ( int  vtx,
const DtTaitBryan &  orientation 
) [virtual]
virtual void makVrv::DtModel::enableColorBlending ( bool  b) [virtual]

Enable / disable color blending for this model.

virtual void makVrv::DtModel::setBlendColor ( float  r,
float  g,
float  b,
float  a 
) [virtual]

Set color to use if color blending is enabled.

virtual void makVrv::DtModel::setColor ( float  r,
float  g,
float  b,
float  a 
) [virtual]
virtual int makVrv::DtModel::modelSet ( ) const [virtual]

Get the model set this model is part of.

Get the bounding box extents of the model instance.

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

Get the bounding box extents of the model instance.

Get the bounding box center of the model instance.

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

Get the bounding box center of the model instance.

void makVrv::DtModel::getBoundingBoxComponents ( DtVector minimum,
DtVector maximum 
)

Set whether this model instance contributes to an object's overall bounding volume.

Get whether this model instance contributes to an object's overall bounding volume.

The visualizer type determines which channel-specific group node this model will be parented to, and consequently, which observer setting will cause it to be rendered in which channel.

DtDe& makVrv::DtModel::de ( ) [inline]

Get the DtDe object.

virtual void makVrv::DtModel::setModelInstance ( DtModelInstance modelInstance) [virtual]

Internally set the model instance pointer.

If an existing model instance is set, it will be deleted. To clear the current model instance only, passing a Null pointer 0 is supported.

Warning:
Only public for internal use
Parameters:
Input
modelInstancepointer to a model instance.

Reimplemented in makVrv::DtOsg3DTextModel, makVrv::DtOsgDecalModel, and makVrv::DtOsgRibbonModel.

virtual void makVrv::DtModel::setVisible ( bool  isVisible) [virtual]
virtual void makVrv::DtModel::setVisibleViaSwitch ( bool  isVisible) [virtual]

Set the model visible or invisible.

Reimplemented in makVrv::DtOsgArticulatedModel.

Get if the model is visible.

Parent of the model.

virtual void makVrv::DtModel::addedToSceneObjectAsProp ( const DtUniqueID sceneObj) [virtual]

Called when a scene object added the model as a prop.

virtual void makVrv::DtModel::addedToSceneObject ( const DtUniqueID sceneObj,
int  modelSet,
int  visualizerType 
) [virtual]

Called when a scene object added the model with the given model set and visualizer type.

virtual void makVrv::DtModel::removedFromSceneObject ( ) [virtual]

Called when the model was removed from a scene object.

virtual void makVrv::DtModel::setSolid ( bool  isSolid) [pure virtual]
virtual void makVrv::DtModel::addToScene ( const DtUniqueID sceneObjectId,
int  modelSet,
int  visualizerType 
) [protected, pure virtual]
virtual void makVrv::DtModel::addToSceneAsProp ( const DtUniqueID sceneObjectId) [inline, protected, virtual]

Add this model to the scene as a prop.

All models are not required to re-implement this

Reimplemented in makVrv::DtOsgScribeBoxModel, and makVrv::DtOsgSimpleModel.

virtual void makVrv::DtModel::removeFromScene ( ) [protected, pure virtual]
virtual void makVrv::DtModel::initializeModelInstance ( ) [protected, virtual]

Push any state maintained by the model to the model instance.

Reimplemented in makVrv::DtOsgRibbonModel, makVrv::DtOsgDecalModel, and makVrv::DtOsgDrawModel.

Called when the model instance changed.


Member Data Documentation

Signal emitted when the model is to be destroyed.

Signal when the visibility has been requested, if any slot returns false, it will not change.

Signal emitted when the model instance is created.

Signal emitted when the model instance is to be destroyed.

We keep our own copy in case we get updates before we get a model instance.

float makVrv::DtModel::myBlendColor[4] [private]

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)