SoPrefixNode Class Reference
[libipsa classes]

All child nodes of an SoPrefixNode will be prefixed with a string specified in the node. More...

#include <SoPrefixNode.h>

List of all members.

Public Member Functions

virtual SoNode * copy (SbBool copyConnections) const
 SoPrefixNode ()
void updatePrefixes ()
virtual ~SoPrefixNode ()

Static Public Member Functions

static void initClass ()

Public Attributes

SoSFString prefix

Private Member Functions

 SO_NODE_HEADER (SoPrefixNode)

Static Private Member Functions

static SbString PrependPrefixToString (const SbString &aPrefix, const SbString &oldString)
static SoCallbackAction::Response UpdateJointsCB (void *userdata, SoCallbackAction *, const SoNode *node)
static SoCallbackAction::Response UpdatePrefixesCB (void *userdata, SoCallbackAction *, const SoNode *node)


Detailed Description

All child nodes of an SoPrefixNode will be prefixed with a string specified in the node.

This class can be used to prefix all names of childnodes with the value specified in SoPrefixNode::prefix. The prefixing will occur when SoPrefixNode::updatePrefixes() is called on an SoPrefixNode.

Warning:
Prefix nodes do not work in a cascaded way as expected (the prefix order gets reversed).

Definition at line 35 of file SoPrefixNode.h.


Constructor & Destructor Documentation

SoPrefixNode::SoPrefixNode (  ) 

The constructor of SoPrefixNode.

Definition at line 62 of file SoPrefixNode.cpp.

References prefix.

SoPrefixNode::~SoPrefixNode (  )  [virtual]

The virtual standard destructor of SoPrefixNode.

Definition at line 86 of file SoPrefixNode.cpp.


Member Function Documentation

SoNode * SoPrefixNode::copy ( SbBool  copyConnections  )  const [virtual]

The overwritten copy() method

Parameters:
copyConnections copy connections if true

Definition at line 75 of file SoPrefixNode.cpp.

void SoPrefixNode::initClass (  )  [static]

Initialises the class and it's type id variables.

Definition at line 54 of file SoPrefixNode.cpp.

SbString SoPrefixNode::PrependPrefixToString ( const SbString &  aPrefix,
const SbString &  oldString 
) [static, private]

Combines the two parameters in a new string and returns it

Parameters:
aPrefix the string to use as a prefix
oldString the old string which gets appended to the prefix
Returns:
an SbString with content <aPrefix><oldString>

Definition at line 166 of file SoPrefixNode.cpp.

Referenced by UpdateJointsCB(), and UpdatePrefixesCB().

SoPrefixNode::SO_NODE_HEADER ( SoPrefixNode   )  [private]

SoCallbackAction::Response SoPrefixNode::UpdateJointsCB ( void *  userdata,
SoCallbackAction *  ,
const SoNode *  node 
) [static, private]

Calls SoPrefixNode::updatePrefixesCB() first before prepending the contents of SoPrefixNode::prefix to the contents of SoJoint::Bodyname1 and SoJoint::Bodyname2 of the current SoJoint node.

Parameters:
userdata must be a pointer of type SoPrefixNode* (the this pointer of the prefixnode where the method is called in)
node the current node (must be of type or subtype SoJoint*)
Returns:
SoCallbackAction::CONTINUE

Definition at line 144 of file SoPrefixNode.cpp.

References SoJoint::Bodyname1, SoJoint::Bodyname2, prefix, PrependPrefixToString(), and UpdatePrefixesCB().

Referenced by updatePrefixes().

void SoPrefixNode::updatePrefixes (  ) 

The update method. An SoCallbackAction is applied to all childnodes of type SoPhysics, SoJoint and SoCollisionShape. For SoJoints the SoPrefixNode::UpdateJointsCB() is used and for the other nodes the SoPrefixNode::UpdatePrefixesCB().

Definition at line 96 of file SoPrefixNode.cpp.

References UpdateJointsCB(), and UpdatePrefixesCB().

Referenced by IpsaSimulator::applyPrefixNodes().

SoCallbackAction::Response SoPrefixNode::UpdatePrefixesCB ( void *  userdata,
SoCallbackAction *  ,
const SoNode *  node 
) [static, private]

Prepends the contents of SoPrefixNode::prefix to the name of the node passed in if it doesn't already start with this prefix.

Parameters:
userdata must be a pointer of type SoPrefixNode* (the this pointer of the prefixnode where the method is called in)
node the current node (must be of type or subtype SoJoint*)
Returns:
SoCallbackAction::CONTINUE

Definition at line 120 of file SoPrefixNode.cpp.

References prefix, and PrependPrefixToString().

Referenced by UpdateJointsCB(), and updatePrefixes().


Member Data Documentation

The string which gets prepended as a prefix when SoPrefixNode::updatePrefixes() is called (default = "").

Definition at line 50 of file SoPrefixNode.h.

Referenced by SoPrefixNode(), UpdateJointsCB(), and UpdatePrefixesCB().


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

Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:21 2012 for IPSA by  doxygen 1.5.8