VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes
makVrv::DtModelInstance Class Referenceabstract

The base class for all model instances.

The details required to draw a model, such as geometry, filename, scale, or texture are provided by a DtModelDefinition. A DtModelDefinition is a set of parameters, whose names and types are defined by a DtSchema. The DtModelDefinitionManager saves and loads model-definitions and schemas and maintains settings for model instancing and caching. Model-definitions and schemas are distributed, but not by the usual agent mechanism. Instead, the DtDeSharedState distributes them directly.

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

Public Member Functions

 DtModelInstance (DtDe &de)
 
virtual ~DtModelInstance ()
 
virtual bool realize (const DtModelDefinition &definition)
 
virtual bool cloneInstanceBackground (const DtModelDefinition &definition, const std::string &filename, const DtModelLoadParams &params, DtDefinitionCachePayload &payload)
 
virtual bool cloneInstanceMainThread (const DtModelDefinition &definition, const std::string &filename)
 
const std::string & realizedDefinitionName () const
 
virtual bool saveModelToFile (const std::string &filename) const
 
const DtVector & boundingBoxExtents () const
 
void getBoundingBoxExtents (double &x, double &y, double &z) const
 
const DtVector & boundingBoxCenter () const
 
void getBoundingBoxCenter (double &x, double &y, double &z) const
 
void getBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
 
const DtVector & allGeometryboundingBoxExtents () const
 
void getAllGeometryBoundingBoxExtents (double &x, double &y, double &z) const
 
const DtVector & allGeometryboundingBoxCenter () const
 
void getAllGeometryBoundingBoxCenter (double &x, double &y, double &z) const
 
void getAllGeometryBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
 
virtual void setContributesToBound (bool trueOrFalse)
 
bool contributesToBound () const
 
virtual void setVisible (bool isVisible)=0
 
virtual void setBlendColor (float r, float g, float b, float a)
 
virtual void enableColorBlending (bool b)
 
virtual void setSensorMask (unsigned int sensorMask)
 

Static Public Member Functions

static float readFloat (const std::string &paramName, const DtModelDefinition &definition)
 
static DtVector readVector (const std::string &paramName, const DtModelDefinition &definition)
 
static DtVector4< float > readVector4 (const std::string &paramName, const DtModelDefinition &definition)
 

Public Attributes

boost::signalslib::signal
< void(DtModelInstance *)> 
signal_modelInstanceChanged
 

Protected Attributes

DtDe & myDe
 
std::string myRealizedModelDefinitionName
 
DtVector myBoundingBoxCenter
 
DtVector myBoundingBoxExtents
 
DtVector myBoundingBoxMinimum
 
DtVector myBoundingBoxMaximum
 
DtVector myAllGeometryBoundingBoxCenter
 
DtVector myAllGeometryBoundingBoxExtents
 
DtVector myAllGeometryBoundingBoxMinimum
 
DtVector myAllGeometryBoundingBoxMaximum
 
bool myContributesToBound
 
bool myColorBlendingEnabled
 
float myBlendRed
 
float myBlendBlue
 
float myBlendGreen
 
float myBlendAlpha
 

Constructor & Destructor Documentation

makVrv::DtModelInstance::DtModelInstance ( DtDe &  de)

CTOR.

virtual makVrv::DtModelInstance::~DtModelInstance ( )
virtual

DTOR.

Member Function Documentation

virtual bool makVrv::DtModelInstance::realize ( const DtModelDefinition &  definition)
virtual
virtual bool makVrv::DtModelInstance::cloneInstanceBackground ( const DtModelDefinition &  definition,
const std::string &  filename,
const DtModelLoadParams &  params,
DtDefinitionCachePayload &  payload 
)
virtual

Attempt to clone the basic geometry from a background thread. Pass the filename and params captured from the lease snapshot. Cache entries are accumulated in the payload and committed to the definition automatically when the background task completes. If the model instance can't clone the definition it should return false.

Reimplemented in makVrv::DtOsgSimpleModelInstance.

virtual bool makVrv::DtModelInstance::cloneInstanceMainThread ( const DtModelDefinition &  definition,
const std::string &  filename 
)
virtual

Attempt to clone the basic geometry from the main thread. Reads parameters directly from the live definition; safe only on the main thread. If the model instance can't clone the definition it should return false.

Reimplemented in makVrv::DtOsgModelInstance, and makVrv::DtOsgSimpleModelInstance.

const std::string& makVrv::DtModelInstance::realizedDefinitionName ( ) const

Get the name of the definition that this model instance was realized with.

virtual bool makVrv::DtModelInstance::saveModelToFile ( const std::string &  filename) const
virtual

Attempt to save the model to a file.

Reimplemented in makVrv::DtOsgModelInstance.

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

Get the bounding box extents of the model instance.

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

Get the bounding box extents of the model instance.

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

Get the bounding box center of the model instance.

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

Get the bounding box center of the model instance.

void makVrv::DtModelInstance::getBoundingBoxComponents ( DtVector &  minimum,
DtVector &  maximum 
)

Get the bounding box min/max of the model instance.

const DtVector& makVrv::DtModelInstance::allGeometryboundingBoxExtents ( ) const

functions for getting the allGeometry versions of the extents (they are calculated by traversing as if all switch paths are active)

Get the all geometry version of bounding box extents of the model instance

void makVrv::DtModelInstance::getAllGeometryBoundingBoxExtents ( double &  x,
double &  y,
double &  z 
) const

Get the all geometry version of bounding box extents of the model instance.

const DtVector& makVrv::DtModelInstance::allGeometryboundingBoxCenter ( ) const

Get the all geometry version of bounding box center of the model instance.

void makVrv::DtModelInstance::getAllGeometryBoundingBoxCenter ( double &  x,
double &  y,
double &  z 
) const

Get the all geometry version of bounding box center of the model instance.

void makVrv::DtModelInstance::getAllGeometryBoundingBoxComponents ( DtVector &  minimum,
DtVector &  maximum 
)

Get the all geometry version of bounding box min/max of the model instance.

virtual void makVrv::DtModelInstance::setContributesToBound ( bool  trueOrFalse)
virtual

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

Reimplemented in makVrv::DtCubeModelInstance.

bool makVrv::DtModelInstance::contributesToBound ( ) const

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

virtual void makVrv::DtModelInstance::setVisible ( bool  isVisible)
pure virtual
virtual void makVrv::DtModelInstance::setBlendColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

set the model's color

Reimplemented in makVrv::DtOsgModelInstance.

virtual void makVrv::DtModelInstance::enableColorBlending ( bool  b)
virtual

Enable / disable coloring on all models in the scene object Note about enableColorBlending: If this particular model has instancing enabled then this flag is set to false and color blending is handled by the instance manager. It should not be set to true if the model has instancing enabled.

Reimplemented in makVrv::DtOsgModelInstance, and makVrv::DtPolygonModelInstance.

virtual void makVrv::DtModelInstance::setSensorMask ( unsigned int  sensorMask)
virtual

Set a sensor mask which should match the vrv_sensorCullMask for a channel.

Reimplemented in makVrv::DtOsgModelInstance.

static float makVrv::DtModelInstance::readFloat ( const std::string &  paramName,
const DtModelDefinition &  definition 
)
static
static DtVector makVrv::DtModelInstance::readVector ( const std::string &  paramName,
const DtModelDefinition &  definition 
)
static
static DtVector4<float> makVrv::DtModelInstance::readVector4 ( const std::string &  paramName,
const DtModelDefinition &  definition 
)
static

Member Data Documentation

boost::signalslib::signal<void (DtModelInstance*)> makVrv::DtModelInstance::signal_modelInstanceChanged
DtDe& makVrv::DtModelInstance::myDe
protected
std::string makVrv::DtModelInstance::myRealizedModelDefinitionName
protected
DtVector makVrv::DtModelInstance::myBoundingBoxCenter
protected
DtVector makVrv::DtModelInstance::myBoundingBoxExtents
protected
DtVector makVrv::DtModelInstance::myBoundingBoxMinimum
protected
DtVector makVrv::DtModelInstance::myBoundingBoxMaximum
protected
DtVector makVrv::DtModelInstance::myAllGeometryBoundingBoxCenter
protected
DtVector makVrv::DtModelInstance::myAllGeometryBoundingBoxExtents
protected
DtVector makVrv::DtModelInstance::myAllGeometryBoundingBoxMinimum
protected
DtVector makVrv::DtModelInstance::myAllGeometryBoundingBoxMaximum
protected
bool makVrv::DtModelInstance::myContributesToBound
protected
bool makVrv::DtModelInstance::myColorBlendingEnabled
protected
float makVrv::DtModelInstance::myBlendRed
protected
float makVrv::DtModelInstance::myBlendBlue
protected
float makVrv::DtModelInstance::myBlendGreen
protected
float makVrv::DtModelInstance::myBlendAlpha
protected

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)