Open Inventor Reference
SoNodeKitListPart Class Reference

Group node with restricted children. More...

#include <Inventor/nodekits/SoNodeKitListPart.h>

Inheritance diagram for SoNodeKitListPart:
SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoNodeKitListPart ()
 Constructor.
SoType getContainerType () const
 Gets and sets the type of node used as the container.
void setContainerType (SoType newContainerType)
 Gets and sets the type of node used as the container.
const SoTypeListgetChildTypes () const
 Returns the permitted child node types.
void addChildType (SoType typeToAdd)
 Permits the node type typeToAdd as a child.
SbBool isTypePermitted (SoType typeToCheck) const
 Returns whether a node of type typeToCheck may be added as a child.
SbBool isChildPermitted (const SoNode *child) const
 Returns whether the node child may be added to this list.
void containerSet (const char *fieldDataString)
 Sends a string to the set() method on the container node.
void lockTypes ()
 This function permanently locks the permitted child types and the container type permanently.
SbBool isTypeLocked () const
 Returns whether the permitted child types and the container type are locked (i.e.
void addChild (SoNode *child)
 These are the functions used to edit the children.
void insertChild (SoNode *child, int childIndex)
 These are the functions used to edit the children.
SoNodegetChild (int index) const
 These are the functions used to edit the children.
int findChild (SoNode *child) const
 These are the functions used to edit the children.
int getNumChildren () const
 These are the functions used to edit the children.
void removeChild (int index)
 These are the functions used to edit the children.
void removeChild (SoNode *child)
 These are the functions used to edit the children.
void replaceChild (int index, SoNode *newChild)
 These are the functions used to edit the children.
void replaceChild (SoNode *oldChild, SoNode *newChild)
 These are the functions used to edit the children.
virtual SbBool affectsState () const
 Depending on the type of the container, this may or may not affect the state.
virtual void doAction (SoAction *action)
 These functions implement all actions for nodekits.
virtual void callback (SoCallbackAction *action)
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void handleEvent (SoHandleEventAction *action)
virtual void pick (SoPickAction *action)
virtual void search (SoSearchAction *action)
virtual SoChildListgetChildren () const
 Returns pointer to children.

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Protected Member Functions

SoGroupgetContainerNode ()
virtual SbBool readInstance (SoInput *in, unsigned short flags)
 Reads in from file. Takes care of setting parts and stuff.
virtual void copyContents (const SoFieldContainer *fromFC, SbBool copyConnections)
 Copies the contents of the given nodekit into this instance.
virtual ~SoNodeKitListPart ()

Protected Attributes

SoChildListchildren

Friends

class SoBaseKit

Detailed Description

This node class is very similar to SoGroup with the exception that it specifies restrictions on the type of children that it allows. It is used by nodekits to restrict child types within list parts (see the reference page for SoBaseKit).

By default, any kind of child may be added. Methods of this class allow you to restrict the type of allowable children, and to lock down the types so that this type list may no longer be altered.

Inside the SoNodeKitListPart is a container node, which in turn contains the children. The container node is a hidden child, and the type of node used may be set with setContainerType(). In this way, you can make the nodekitlist behave like a group, a separator, or any other subclass of group. The container is not accessible so that the nodekitlist may retain control over what kinds of children are added.

See Also
SoBaseKit, SoNodeKit, SoNodeKitDetail, SoNodeKitPath, SoNodekitCatalog, SoSceneKit, SoSeparatorKit, SoShapeKit, SoWrapperKit

Definition at line 121 of file SoNodeKitListPart.h.


Constructor & Destructor Documentation

SoNodeKitListPart::SoNodeKitListPart ( )
virtual SoNodeKitListPart::~SoNodeKitListPart ( ) [protected, virtual]

Member Function Documentation

void SoNodeKitListPart::addChild ( SoNode child)

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

void SoNodeKitListPart::addChildType ( SoType  typeToAdd)

The first time the addChildType() method is called, the default of SoNode is overridden and only the new typeToAdd is permitted. In subsequent calls to addChildType(), the typeToAdd is added to the existing types.

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

Reimplemented from SoNode.

virtual void SoNodeKitListPart::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoNode.

void SoNodeKitListPart::containerSet ( const char *  fieldDataString)

This is how you can set the value of a switch node if the container node is an SoSwitch, for example.

virtual void SoNodeKitListPart::copyContents ( const SoFieldContainer fromFC,
SbBool  copyConnections 
) [protected, virtual]

Reimplemented from SoNode.

virtual void SoNodeKitListPart::doAction ( SoAction action) [virtual]

Reimplemented from SoNode.

int SoNodeKitListPart::findChild ( SoNode child) const

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

virtual void SoNodeKitListPart::getBoundingBox ( SoGetBoundingBoxAction action) [virtual]

Reimplemented from SoNode.

SoNode* SoNodeKitListPart::getChild ( int  index) const

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

virtual SoChildList* SoNodeKitListPart::getChildren ( ) const [virtual]

Reimplemented from SoNode.

const SoTypeList& SoNodeKitListPart::getChildTypes ( ) const

By default, any type of node is permitted, so the list contains one entry of type SoNode.

SoGroup* SoNodeKitListPart::getContainerNode ( ) [protected]
SoType SoNodeKitListPart::getContainerType ( ) const
virtual void SoNodeKitListPart::getMatrix ( SoGetMatrixAction action) [virtual]

Reimplemented from SoNode.

int SoNodeKitListPart::getNumChildren ( ) const

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

virtual void SoNodeKitListPart::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

virtual void SoNodeKitListPart::handleEvent ( SoHandleEventAction action) [virtual]

Reimplemented from SoNode.

static void SoNodeKitListPart::initClass ( ) [static]

Reimplemented from SoNode.

void SoNodeKitListPart::insertChild ( SoNode child,
int  childIndex 
)

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

SbBool SoNodeKitListPart::isChildPermitted ( const SoNode child) const

This will return TRUE if the type of child is one of the permissible child types.

SbBool SoNodeKitListPart::isTypeLocked ( ) const [inline]

cannot be changed). See lockTypes()

Definition at line 175 of file SoNodeKitListPart.h.

SbBool SoNodeKitListPart::isTypePermitted ( SoType  typeToCheck) const
void SoNodeKitListPart::lockTypes ( )

Calls to setContainerType() and addChildType() will have no effect after this function is called.

virtual void SoNodeKitListPart::pick ( SoPickAction action) [virtual]

Reimplemented from SoNode.

virtual SbBool SoNodeKitListPart::readInstance ( SoInput in,
unsigned short  flags 
) [protected, virtual]

Reimplemented from SoFieldContainer.

void SoNodeKitListPart::removeChild ( SoNode child) [inline]

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

Definition at line 211 of file SoNodeKitListPart.h.

References removeChild().

Referenced by removeChild().

void SoNodeKitListPart::removeChild ( int  index)

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

void SoNodeKitListPart::replaceChild ( SoNode oldChild,
SoNode newChild 
) [inline]

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

Definition at line 222 of file SoNodeKitListPart.h.

References replaceChild().

Referenced by replaceChild().

void SoNodeKitListPart::replaceChild ( int  index,
SoNode newChild 
)

They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

virtual void SoNodeKitListPart::search ( SoSearchAction action) [virtual]

Reimplemented from SoNode.

void SoNodeKitListPart::setContainerType ( SoType  newContainerType)

Friends And Related Function Documentation

friend class SoBaseKit [friend]

Definition at line 273 of file SoNodeKitListPart.h.


Member Data Documentation

Definition at line 255 of file SoNodeKitListPart.h.


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