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 | Protected Attributes
makVrv::DtOsgSimpleModelInstance Class Reference

A simple OSG model instance.

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

Public Member Functions

 DtOsgSimpleModelInstance (DtDe &de)
 
 DtOsgSimpleModelInstance (DtDe &de, osg::Node *rootNode)
 
virtual ~DtOsgSimpleModelInstance ()
 
virtual bool realize (const DtModelDefinition &definition)
 
virtual bool cloneInstanceBackground (const DtModelDefinition &definition, const std::string &filename, const DtModelLoadParams &params, DtDefinitionCachePayload &payload) override
 
virtual bool cloneInstanceMainThread (const DtModelDefinition &definition, const std::string &filename) override
 
virtual void setVisible (bool isVisible)
 
virtual osg::Node * getOrLoadFromDefinition (const DtModelDefinition &definition, const std::string &filename, const DtModelLoadParams &params, DtDefinitionCachePayload *payload)
 
virtual bool cloneFromNode (osg::Node *node, const DtModelLoadParams &params)
 
- Public Member Functions inherited from makVrv::DtOsgModelInstance
virtual ~DtOsgModelInstance ()
 
virtual void addToConnector (DtOsgSceneConnector *connector)
 
virtual bool removeFromConnector (DtOsgSceneConnector *connector)
 
virtual bool saveModelToFile (const std::string &filename) const
 
virtual void enableColorBlending (bool b)
 
virtual void setBlendColor (float r, float g, float b, float a)
 
virtual void enableTexture (bool onOff)
 
virtual void setSensorMask (unsigned int sensorMask)
 
virtual osg::Node * rootNode ()
 
virtual const osg::Node * rootNode () const
 
virtual osg::Node * sensorNode ()
 
virtual const osg::Node * sensorNode () const
 
virtual void setDynamicSensorRegion (const std::string &region, bool state)
 
virtual bool dynamicSensorRegion (const std::string &region)
 
virtual const
SensorRegionStateMap & 
dynamicSensorRegionMap () const
 
virtual void slot_atcGlobalModelEnableChanged ()
 
virtual bool alphaToCoverageEnabled ()
 
- Public Member Functions inherited from makVrv::DtModelInstance
 DtModelInstance (DtDe &de)
 
virtual ~DtModelInstance ()
 
const std::string & realizedDefinitionName () 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
 

Protected Attributes

float myScale
 
- Protected Attributes inherited from makVrv::DtOsgModelInstance
osg::ref_ptr< osg::Node > myModelRoot
 
osg::ref_ptr< osg::StateSet > myCachedState
 
SensorRegionStateMap mySensorRegionMap
 
AlphaToCoverageState myAlphaToCoverageState
 
DtSignalConnectionManager myConnections
 
bool myModelInstanceShaderSet
 
- Protected Attributes inherited from makVrv::DtModelInstance
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
 

Additional Inherited Members

- Public Types inherited from makVrv::DtOsgModelInstance
enum  AlphaToCoverageState { USE_GLOBAL, FORCE_OFF, FORCE_ON }
 
typedef std::unordered_map
< std::string, bool > 
SensorRegionStateMap
 
- Static Public Member Functions inherited from makVrv::DtModelInstance
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 inherited from makVrv::DtOsgModelInstance
boost::signalslib::signal
< void(const std::string
&, bool) > 
signal_dynamicSensorRegionAdded
 
boost::signalslib::signal
< void(const std::string
&, bool) > 
signal_dynamicSensorRegionChanged
 
boost::signalslib::signal
< void(bool)> 
signal_atcModeEnableChanged
 
- Public Attributes inherited from makVrv::DtModelInstance
boost::signalslib::signal
< void(DtModelInstance *)> 
signal_modelInstanceChanged
 
- Protected Member Functions inherited from makVrv::DtOsgModelInstance
 DtOsgModelInstance (DtDe &de)
 
virtual void updateColorBlending ()
 
virtual void updateColorBlending (osg::Node *node)
 
virtual void enableTexture (osg::Node *root, bool onOff)
 
virtual void updateBoundingBoxViaContents ()
 
virtual void setRootNode (osg::Node *node)
 
virtual void setUpDepthTest (osg::StateSet *stateSet)
 

Constructor & Destructor Documentation

makVrv::DtOsgSimpleModelInstance::DtOsgSimpleModelInstance ( DtDe &  de)

CTOR.

makVrv::DtOsgSimpleModelInstance::DtOsgSimpleModelInstance ( DtDe &  de,
osg::Node *  rootNode 
)

CTOR.

virtual makVrv::DtOsgSimpleModelInstance::~DtOsgSimpleModelInstance ( )
virtual

DTOR.

Member Function Documentation

virtual bool makVrv::DtOsgSimpleModelInstance::realize ( const DtModelDefinition &  definition)
virtual

Attempt to realize a definition. If the model instance can't realize the definition it should return false.

Reimplemented from makVrv::DtOsgModelInstance.

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

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 from makVrv::DtModelInstance.

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

Attempt to clone the basic geometry from the main thread. Reads parameters directly from the live definition; safe only on the main thread.

Reimplemented from makVrv::DtOsgModelInstance.

virtual void makVrv::DtOsgSimpleModelInstance::setVisible ( bool  isVisible)
inlinevirtual

Set whether the model is visible or not.

Note
Intentionally do nothing.

Implements makVrv::DtModelInstance.

virtual osg::Node* makVrv::DtOsgSimpleModelInstance::getOrLoadFromDefinition ( const DtModelDefinition &  definition,
const std::string &  filename,
const DtModelLoadParams &  params,
DtDefinitionCachePayload *  payload 
)
virtual

Loads or retrieves from cache the OSG node for the given definition.

Parameters
definitionThe model definition to load from.
filenameThe value of the definition's "filename" parameter, resolved by the caller prior to this call. Passing it explicitly avoids a redundant findParameter() call and ensures the correct mutex is selected. When called from a background thread, this should come from DtModelDefinitionLease::filename(). When called from the main thread via realize(), it is resolved from the definition directly. Pass an empty string if no filename parameter exists, in which case the definition's own mutex is used as a fallback.
payloadWhen non-null, the "prototype" cache entry is added to the payload instead of being written directly to the definition via setCachedData(). Pass null when calling from the main thread (realize() path) so the entry is committed to the definition immediately.
virtual bool makVrv::DtOsgSimpleModelInstance::cloneFromNode ( osg::Node *  node,
const DtModelLoadParams &  params 
)
virtual

Clones the given pre-loaded node directly into this instance, bypassing getOrLoadFromDefinition(). Used by backgroundLoad() callers that have already loaded the node and stored the prototype in the payload – calling cloneInstance() again would re-enter getOrLoadFromDefinition() before the payload is committed, causing a redundant file load and a direct setCachedData() from a background thread.

Member Data Documentation

float makVrv::DtOsgSimpleModelInstance::myScale
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)