SoNodeKitListPart Class Reference
[NodeKits]

Group node with restricted children. More...

#include <Inventor/nodekits/SoNodeKitListPart.h>

Inheritance diagram for SoNodeKitListPart:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoNodeKitListPart ()
SoType getContainerType () const
void setContainerType (SoType newContainerType)
const SoTypeListgetChildTypes () const
void addChildType (SoType typeToAdd)
SbBool isTypePermitted (SoType typeToCheck) const
SbBool isChildPermitted (const SoNode *child) const
void containerSet (const SbString &fieldDataString)
void lockTypes ()
SbBool isTypeLocked () const
void addChild (SoNode *child)
void insertChild (SoNode *child, int childIndex)
SoNodegetChild (int index) const
int findChild (const SoNode *child) const
int getNumChildren () const
void removeChild (int index)
void removeChild (SoNode *child)
void replaceChild (int index, SoNode *newChild)
void replaceChild (SoNode *oldChild, SoNode *newChild)
virtual SbBool affectsState () const

Static Public Member Functions

static SoType getClassTypeId ()

Friends

class SoBaseKit

Detailed Description

Group node with restricted children.

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.

FILE FORMAT/DEFAULT

SEE ALSO

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


Constructor & Destructor Documentation

SoNodeKitListPart::SoNodeKitListPart (  ) 

Constructor.


Member Function Documentation

void SoNodeKitListPart::addChild ( SoNode child  ) 

Adds child as last one in nodekit.

This is one of several functions used to edit the children. 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  ) 

Permits the node type typeToAdd as a child.

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]

Returns TRUE if a node has an effect on the state during traversal.

The default method returns TRUE. Node classes (such as SoSeparator) that isolate their effects from the rest of the graph override this method to return FALSE.

Reimplemented from SoNode.

void SoNodeKitListPart::containerSet ( const SbString fieldDataString  ) 

Sends a string to the set() method on the container node.

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

int SoNodeKitListPart::findChild ( const SoNode child  )  const

Finds index of given child within nodekit.

Returns -1 if not found. This is one of several functions used to edit the children. They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

SoNode* SoNodeKitListPart::getChild ( int  index  )  const

Returns the child node with the given index.

This is one of several functions used to edit the children. They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

const SoTypeList& SoNodeKitListPart::getChildTypes (  )  const

Returns the permitted child node types.

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

static SoType SoNodeKitListPart::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

SoType SoNodeKitListPart::getContainerType (  )  const

Gets the type of node used as the container .

int SoNodeKitListPart::getNumChildren (  )  const

Returns the number of children in the nodekit.

This is one of several functions used to edit the children. They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

virtual SoType SoNodeKitListPart::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

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

Adds a child so that it becomes the one with the given index.

This is one of several functions used to edit the children. 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

Returns whether the node child may be added to this list.

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

SbBool SoNodeKitListPart::isTypeLocked (  )  const [inline]

Returns whether the permitted child types and the container type are locked (i.e.

cannot be changed). See lockTypes()

SbBool SoNodeKitListPart::isTypePermitted ( SoType  typeToCheck  )  const

Returns whether a node of type typeToCheck may be added as a child.

void SoNodeKitListPart::lockTypes (  ) 

This function permanently locks the permitted child types and the container type permanently.

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

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

Removes first instance of given child from nodekit.

This is one of several functions used to edit the children. They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

void SoNodeKitListPart::removeChild ( int  index  ) 

Removes child with given index from the nodekit.

This is one of several functions used to edit the children. 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]

Replaces first instance of given child with new child.

This is one of several functions used to edit the children. 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 ( int  index,
SoNode newChild 
)

Replaces child with given index with new child.

This is one of several functions used to edit the children. They parallel those of SoGroup, except that they always check the child types against those which are permissible. See SoGroup for details.

void SoNodeKitListPart::setContainerType ( SoType  newContainerType  ) 

Sets the type of node used as the container .


Friends And Related Function Documentation

friend class SoBaseKit [friend]

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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/