SoNodeKitListPart — group node with restricted children
Contents
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 listparts (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/Defaults
NodeKitListPart{containerTypeName"Group"childTypeNames""containerNodeNULL}Inherits From
SoBase > SoFieldContainer > SoNode > SoNodeKitListPart
Methods
SoNodeKitListPart()
Constructor.
SoTypegetContainerType()constvoidsetContainerType(SoTypenewContainerType)
Gets and sets the type of node used as the container.
constSoTypeList&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.
voidaddChildType(SoTypetypeToAdd)
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.
SbBoolisTypePermitted(SoTypetypeToCheck)const
Returns whether a node of type typeToCheck may be added as a child.
SbBoolisChildPermitted(constSoNode*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.
voidcontainerSet(constchar*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.
voidlockTypes()
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.
SbBoolisTypeLocked()const
Returns whether the permitted child types and the container type are locked (i.e. cannot be changed).
See lockTypes()voidaddChild(SoNode*child)voidinsertChild(SoNode*child,intchildIndex)SoNode*getChild(intindex)constintfindChild(SoNode*child)constintgetNumChildren()constvoidremoveChild(intindex)voidremoveChild(SoNode*child)voidreplaceChild(intindex,SoNode*newChild)voidreplaceChild(SoNode*oldChild,SoNode*newChild)
These are the 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.
staticSoTypegetClassTypeId()
Returns type identifier for this class.
Name
SoNodeKitListPart — group node with restricted children
See Also
SoBaseKit,SoNodeKit,SoNodeKitDetail,SoNodeKitPath,SoNodekitCatalog,SoSceneKit,SoSeparatorKit,SoShapeKit,SoWrapperKitSoNodeKitListPart(3IV)()
Synopsis
#include<Inventor/nodekits/SoNodeKitListPart.h>
Methods from class SoNodeKitListPart:
SoNodeKitListPart()SoTypegetContainerType()constvoidsetContainerType(SoTypenewContainerType)constSoTypeList&getChildTypes()constvoidaddChildType(SoTypetypeToAdd)SbBoolisTypePermitted(SoTypetypeToCheck)constSbBoolisChildPermitted(constSoNode*child)constvoidcontainerSet(constchar*fieldDataString)voidlockTypes()SbBoolisTypeLocked()constvoidaddChild(SoNode*child)voidinsertChild(SoNode*child,intchildIndex)SoNode*getChild(intindex)constintfindChild(SoNode*child)constintgetNumChildren()constvoidremoveChild(intindex)voidremoveChild(SoNode*child)voidreplaceChild(intindex,SoNode*newChild)voidreplaceChild(SoNode*oldChild,SoNode*newChild)staticSoTypegetClassTypeId()
Methods from class SoNode:
voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)
Methods from class SoFieldContainer:
voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)
Methods from class SoBase:
voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const