Open Inventor Reference
SoInteractionKit Class Reference

Base class for all interaction nodekit classes. More...

#include <Inventor/nodekits/SoInteractionKit.h>

Inheritance diagram for SoInteractionKit:
SoBaseKit SoNode SoFieldContainer SoBase SoDragger SoCenterballDragger SoDirectionalLightDragger SoDragPointDragger SoHandleBoxDragger SoJackDragger SoPointLightDragger SoRotateCylindricalDragger SoRotateDiscDragger SoRotateSphericalDragger SoScale1Dragger SoScale2Dragger SoScale2UniformDragger SoScaleUniformDragger SoSpotLightDragger SoTabBoxDragger SoTabPlaneDragger SoTrackballDragger SoTransformBoxDragger SoTransformerDragger SoTranslate1Dragger SoTranslate2Dragger

List of all members.

Public Types

enum  CacheEnabled { OFF, ON, AUTO }
 Possible values for caching. More...

Public Member Functions

virtual SbBool setPartAsPath (const SbName &partName, SoPath *surrogatePath)
 Sets any public part in the interaction kit as a "surrogate" path instead.
virtual SbBool affectsState () const
 Override the default behavior of SoNode.
virtual SbBool setPartAsDefault (const SbName &partName, SoNode *newNode, SbBool onlyIfAlready=TRUE)
 Sets the part, then sets the field for that part to default using partField.setDefault(TRUE).
virtual SbBool setPartAsDefault (const SbName &partName, const SbName &newNodeName, SbBool onlyIfAlready=TRUE)
SbBool isPathSurrogateInMySubgraph (const SoPath *pathToCheck)
 Is the 'inPath' valid as a surrogate path anywhere in this node's subgraph? Examines the surrogate paths of all InteractionKits from this node down.
SbBool isPathSurrogateInMySubgraph (const SoPath *pathToCheck, SoPath *&pathToOwner, SbName &surrogateNameInOwner, SoPath *&surrogatePathInOwner, SbBool fillArgs=TRUE)

Static Public Member Functions

static void setSwitchValue (SoNode *n, int newVal)
static void initClass ()
 initialize the class

Public Attributes

Fields
SoSFEnum renderCaching
 Set render caching mode. Default is AUTO.
SoSFEnum boundingBoxCaching
 Set bounding box caching mode.
SoSFEnum renderCulling
 Set render culling mode.
SoSFEnum pickCulling
 Set pick caching mode. Default is AUTO.

Protected Member Functions

 SoInteractionKit ()
 ~SoInteractionKit ()
virtual void copyContents (const SoFieldContainer *fromFC, SbBool copyConnections)
 Copies the contents of the given instance into this instance This copies the surrogatePartPathList and the surrogatePartNameList.
virtual SoNodegetAnyPart (const SbName &partName, SbBool makeIfNeeded, SbBool leafCheck=FALSE, SbBool publicCheck=FALSE)
 These are overloaded to set the surrogate path to NULL after completing their work.
virtual SoNodeKitPathcreatePathToAnyPart (const SbName &partName, SbBool makeIfNeeded, SbBool leafCheck=FALSE, SbBool publicCheck=FALSE, const SoPath *pathToExtend=NULL)
virtual SbBool setAnyPart (const SbName &partName, SoNode *from, SbBool anyPart=TRUE)
virtual SbBool setAnyPartAsPath (const SbName &partName, SoPath *surrogatePath, SbBool leafCheck=FALSE, SbBool publicCheck=FALSE)
 This allows you to set any part in the nodekit as a surrogate path.
virtual SbBool readInstance (SoInput *in, unsigned short flags)
 Reads in from file.
virtual SbBool setAnyPartAsDefault (const SbName &partName, SoNode *newNode, SbBool anyPart=TRUE, SbBool onlyIfAlready=TRUE)
 Protected versions of these methods that allow you to set non-leaf and/or private parts.
virtual SbBool setAnyPartAsDefault (const SbName &partName, const SbName &newNodeName, SbBool anyPart=TRUE, SbBool onlyIfAlready=TRUE)
SbBool setAnySurrogatePath (const SbName &inName, SoPath *inPath, SbBool leafCheck=FALSE, SbBool publicCheck=FALSE)
virtual SbBool setUpConnections (SbBool onOff, SbBool doItAlways=FALSE)
 detach/attach any sensors, callbacks, and/or field connections.
virtual void setDefaultOnNonWritingFields ()
 Called by the SoBaseKit::write() method.
void connectSeparatorFields (SoSeparator *dest, SbBool onOff)

Static Protected Member Functions

static void readDefaultParts (const char *fileName, const char defaultBuffer[], int defBufSize)
 read from buffer
static void fieldSensorCB (void *, SoSensor *)

Protected Attributes

SoFieldSensorfieldSensor
 This sensor will watch the topSeparator part.
SoSeparatoroldTopSep

Detailed Description

This is the base class for all classes of interaction nodekits. Currently, the only subclass is SoDragger, which reacts to click-drag-release events from the mouse.

This node has four fields corresponding to those of an SoSeparator: They are renderCaching , boundingBoxCaching , renderCulling , and pickCulling . They behave the same here as they do for an SoSeparator

The setPartAsPath() method provides support for creating "stand-in" objects for parts in the interaction kit. The "stand-in", or "surrogate" part, is a path to an object that lies somewhere else in the scene graph.

See Also
SoBaseKit, SoInteraction, SoNodeKitDetail, SoNodeKitPath, SoNodekitCatalog, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 96 of file SoInteractionKit.h.


Member Enumeration Documentation

Enumerator:
OFF 

Never build or use a cache.

ON 

Always try to build a cache.

AUTO 

Decide based on some heuristic.

Definition at line 141 of file SoInteractionKit.h.


Constructor & Destructor Documentation

SoInteractionKit::SoInteractionKit ( ) [protected]
SoInteractionKit::~SoInteractionKit ( ) [protected]

Member Function Documentation

virtual SbBool SoInteractionKit::affectsState ( ) const [virtual]

Reimplemented from SoNode.

void SoInteractionKit::connectSeparatorFields ( SoSeparator dest,
SbBool  onOff 
) [protected]
virtual void SoInteractionKit::copyContents ( const SoFieldContainer fromFC,
SbBool  copyConnections 
) [protected, virtual]

Reimplemented from SoBaseKit.

Reimplemented in SoRotateCylindricalDragger, and SoRotateSphericalDragger.

virtual SoNodeKitPath* SoInteractionKit::createPathToAnyPart ( const SbName partName,
SbBool  makeIfNeeded,
SbBool  leafCheck = FALSE,
SbBool  publicCheck = FALSE,
const SoPath pathToExtend = NULL 
) [protected, virtual]

Reimplemented from SoBaseKit.

virtual SoNode* SoInteractionKit::getAnyPart ( const SbName partName,
SbBool  makeIfNeeded,
SbBool  leafCheck = FALSE,
SbBool  publicCheck = FALSE 
) [protected, virtual]

Reimplemented from SoBaseKit.

SbBool SoInteractionKit::isPathSurrogateInMySubgraph ( const SoPath pathToCheck)

The first time a surrogate path is found that is contained within 'inPath', then TRUE is returned. The second version also returns information about the surrogate, only if (fillArgs == TRUE).

SbBool SoInteractionKit::isPathSurrogateInMySubgraph ( const SoPath pathToCheck,
SoPath *&  pathToOwner,
SbName surrogateNameInOwner,
SoPath *&  surrogatePathInOwner,
SbBool  fillArgs = TRUE 
)
static void SoInteractionKit::readDefaultParts ( const char *  fileName,
const char  defaultBuffer[],
int  defBufSize 
) [static, protected]
Parameters:
fileNamefile to read
defaultBufferif no file,
virtual SbBool SoInteractionKit::readInstance ( SoInput in,
unsigned short  flags 
) [protected, virtual]

Takes care of checking values in the topSeparator fields and the field of this node.

Reimplemented from SoBaseKit.

virtual SbBool SoInteractionKit::setAnyPart ( const SbName partName,
SoNode from,
SbBool  anyPart = TRUE 
) [protected, virtual]

Reimplemented from SoBaseKit.

virtual SbBool SoInteractionKit::setAnyPartAsDefault ( const SbName partName,
const SbName newNodeName,
SbBool  anyPart = TRUE,
SbBool  onlyIfAlready = TRUE 
) [protected, virtual]
virtual SbBool SoInteractionKit::setAnyPartAsDefault ( const SbName partName,
SoNode newNode,
SbBool  anyPart = TRUE,
SbBool  onlyIfAlready = TRUE 
) [protected, virtual]
virtual SbBool SoInteractionKit::setAnyPartAsPath ( const SbName partName,
SoPath surrogatePath,
SbBool  leafCheck = FALSE,
SbBool  publicCheck = FALSE 
) [protected, virtual]

Note: The node corresponding to 'partName' will become empty. If 'partName' is not a leaf, the subgraph below it will disappear.

SbBool SoInteractionKit::setAnySurrogatePath ( const SbName inName,
SoPath inPath,
SbBool  leafCheck = FALSE,
SbBool  publicCheck = FALSE 
) [protected]
virtual void SoInteractionKit::setDefaultOnNonWritingFields ( ) [protected, virtual]

InteractionKits don't want to write fields if they have default vals.

Calls setDefault(TRUE) on caching fields if default and not connected.

Calls setDefault(TRUE) on the topSeparator. Calls setDefault(TRUE) on the geomSeparator.

Calls setDefault(TRUE) on any non-leaf part of type exactly == SoSwitch. Subclasses can override this if they like, since the function is virtual. But interactionKits use non-leaf switches to turn parts on and off, and this does not need to be written to file.

Lastly, calls same method on SoBaseKit.

NOTE: Parts which are set to default may still wind up writing to file if, for example, they lie on a path.

Reimplemented from SoBaseKit.

Reimplemented in SoCenterballDragger, SoDirectionalLightDragger, SoDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, and SoTransformerDragger.

virtual SbBool SoInteractionKit::setPartAsDefault ( const SbName partName,
const SbName newNodeName,
SbBool  onlyIfAlready = TRUE 
) [virtual]
virtual SbBool SoInteractionKit::setPartAsDefault ( const SbName partName,
SoNode newNode,
SbBool  onlyIfAlready = TRUE 
) [virtual]

Hence 'newNode' becomes the new default value, and the part only writes if [a] the part is set to a different node. [b] values are changes in the fields of newNode. [c] any child below newNode changes.

If the flag 'onlyIfAlready' is TRUE, then this will only change values of parts that are already in a default state.

Returns FALSE on failure, TRUE otherwise. First version sets the part to the given node. Second version looks up resourceName in the global dictionary and sets the part with the node found.

virtual SbBool SoInteractionKit::setPartAsPath ( const SbName partName,
SoPath surrogatePath 
) [virtual]

The object at the end of the path serves as a stand-in when a pick occurs, and can thus initiate interaction.

Instead of the usual setPart(), which replaces partName with a new node, this will remove the node being used for partName from the scene and remember the surrogatePath you give it. Later, any pick on surrogatePath will be regarded as a pick on partName.

For example, set the XRotator part of an SoTrackballDragger to be the path to an object in the scene. The rest of the trackball will look the same, but the XRotator stripe will disappear. However, click the mouse on the object at the end of surrogatePath and the ball will start to drag in rotation around its X axis.

Note that this is different from setting the part to be the node at the end of the path. When you set the part as a node, a second instance will be drawn in the local space of the interaction kit. When you set it as a path, the object itself is used, not a copy.

The partName may be any part name that follows the nodekit syntax for parts, such as childList[0].shape or rotator.rotatorActive. (See the getPart() method in the SoBaseKit reference page for a complete description.)

static void SoInteractionKit::setSwitchValue ( SoNode n,
int  newVal 
) [static]
virtual SbBool SoInteractionKit::setUpConnections ( SbBool  onOff,
SbBool  doItAlways = FALSE 
) [protected, virtual]

Member Data Documentation

Default is ON. Setting this value to AUTO is equivalent to ON - automatic culling is not implemented.

Definition at line 156 of file SoInteractionKit.h.

If the part changes to a new node, then the fields of the old part will be disconnected and the fields of the new part will be connected. Connections are made from/to the renderCaching, boundingBoxCaching, renderCulling and pickCulling fields. This way, the SoInteractionKit can be treated from the outside just like a regular SoSeparator node. Setting the fields will affect caching and culling, even though the topSeparator takes care of it. oldTopSep keeps track of the part for comparison.

Reimplemented in SoDragPointDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoTranslate1Dragger, and SoTranslate2Dragger.

Definition at line 294 of file SoInteractionKit.h.

Definition at line 296 of file SoInteractionKit.h.

Default is OFF. Setting this value to AUTO is equivalent to ON - automatic culling is not implemented.

Definition at line 161 of file SoInteractionKit.h.


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