SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
SmDynamicObjectKit Class Reference
Inheritance diagram for SmDynamicObjectKit:

Public Member Functions

 SmDynamicObjectKit (void)
 
SmDynamicObjectKitaddObject (SmDynamicObjectKit *newObject, const SbName parentId)
 
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
 
SbBool getGeometryVisibility (void)
 
SmDynamicObjectKitgetObjectByObjectId (const SbName objectId)
 
virtual void GLRender (SoGLRenderAction *action)
 
void preRender (SoAction *action)
 
SmDynamicObjectKitremoveObject (const SbName objectId)
 
void reset (void)
 
void setGeometryVisibility (SbBool visibility)
 
void setOrientation (float heading, float pitch, float roll)
 

Static Public Member Functions

static void initClass (void)
 
static void setElevationCallback (dok_elevation_cb_type cbfunc)
 

Public Attributes

SoSFVec3f cameraOffset
 
SoSFRotation cameraRotation
 
SoSFBool hasRelativeElevation
 
SoSFBool hasRelativePosition
 
SoSFFloat heading
 
SoSFBool isThreadSafe
 
SoSFName objectId
 
SoSFString objectName
 
SoSFFloat pitch
 
SoSFVec3d position
 
SoSFFloat roll
 

Protected Member Functions

virtual ~SmDynamicObjectKit ()
 

Constructor & Destructor Documentation

◆ SmDynamicObjectKit()

SmDynamicObjectKit::SmDynamicObjectKit ( void )

Constructor.

◆ ~SmDynamicObjectKit()

SmDynamicObjectKit::~SmDynamicObjectKit ( )
protectedvirtual

Destructor

Member Function Documentation

◆ addObject()

SmDynamicObjectKit * SmDynamicObjectKit::addObject ( SmDynamicObjectKit * newObject,
const SbName parentId )
Parameters
newObjectPointer to object to be added
parentIdObjectId of desired parent object
Returns
Pointer to parent if successful (i.e. parent was found) otherwise NULL

Add a new object to the object hierarchy. parentId controls where in the object hierarchy the new object is inserted. Note that "" is default objectId for new SmDynamicObjectKit instances; calling this method on the root object with parentId = "" means new object will be added directly under the root object (since root object always has default id).

newObject is only added once, as a child of the first found object matching parentId.

If no existing nodekit has objectId == parentId, newObject is not added to the node hierarchy, and NULL is returned.

See also
getObjectByObjectId

◆ getObjectByObjectId()

SmDynamicObjectKit * SmDynamicObjectKit::getObjectByObjectId ( const SbName objectId)

Find nodekit (this or one of its descendants) by objectId. Only the first nodekit with matching objectId is returned.

This mechanism (in a small way) duplicates the node name functionality in Open Inventor, for two reasons:

  • cannot limit id to node name acceptable by Coin, and
  • cannot limit id to not duplicate node name already used elsewhere in the scene graph.

◆ preRender()

void SmDynamicObjectKit::preRender ( SoAction * action)

Method needed for thread safe rendering. If multiple threads are used to render a scene graph containing this nodekit, you must set the threadSafe field to TRUE, and use an SoCallbackAction to call this method before rendering the scene graph.

◆ removeObject()

SmDynamicObjectKit * SmDynamicObjectKit::removeObject ( const SbName objectId)
Parameters
objectIdObjectId of object to be removed

Returns pointer to removed object, or NULL if no object with objectId was found.

◆ reset()

void SmDynamicObjectKit::reset ( void )

Reset the kit. All elements and nodes will be removed.

◆ setElevationCallback()

void SmDynamicObjectKit::setElevationCallback ( dok_elevation_cb_type cbfunc)
static

Init callback function used to get terrain elevation when object has relative elevation.

This method need only be called once.

◆ setGeometryVisibility()

void SmDynamicObjectKit::setGeometryVisibility ( SbBool visibility)

Hide or show file geometry and all children (see 'childList').

◆ setOrientation()

void SmDynamicObjectKit::setOrientation ( float heading,
float pitch,
float roll )

Set the 'orientation' part.


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