Group node with restricted children. More...
#include <Inventor/nodekits/SoNodeKitListPart.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoNodeKitListPart () | |
SoType | getContainerType () const |
void | setContainerType (SoType newContainerType) |
const SoTypeList & | getChildTypes () 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) |
SoNode * | getChild (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 |
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.
containerTypeName | "Group" |
childTypeNames | "" |
containerNode | NULL |
SoBaseKit, SoNodeKit, SoNodeKitDetail, SoNodeKitPath, SoNodekitCatalog, SoSceneKit, SoSeparatorKit, SoShapeKit, SoWrapperKit
SoNodeKitListPart::SoNodeKitListPart | ( | ) |
Constructor.
void SoNodeKitListPart::addChild | ( | SoNode * | child | ) |
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 | ) |
int SoNodeKitListPart::findChild | ( | const SoNode * | child | ) | const |
SoNode* SoNodeKitListPart::getChild | ( | int | index | ) | const |
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 |
virtual SoType SoNodeKitListPart::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
void SoNodeKitListPart::insertChild | ( | SoNode * | child, | |
int | childIndex | |||
) |
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()
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] |
void SoNodeKitListPart::removeChild | ( | int | index | ) |
void SoNodeKitListPart::replaceChild | ( | int | index, | |
SoNode * | newChild | |||
) |
void SoNodeKitListPart::setContainerType | ( | SoType | newContainerType | ) |
Sets the type of node used as the container .
friend class SoBaseKit [friend] |