Class SoNodeKitListPart
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.misc.SoBase
com.openinventor.inventor.fields.SoFieldContainer
com.openinventor.inventor.nodes.SoNode
com.openinventor.inventor.nodekits.SoNodeKitListPart
- All Implemented Interfaces:
SafeDisposable
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:
NodeKitListPart {
| containerTypeName | "Group" |
| childTypeNames | "" |
| containerNode | NULL |
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModesNested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand -
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds child as last one in nodekit.voidaddChildClass(Class<? extends Inventor> typeToAdd) Permits the node type typeToAdd as a child.voidcontainerSet(String fieldDataString) Sends a string to theset()method on the container node.intFinds index of given child within nodekit.getChild(int index) Returns the child node with the given index.Gets the type of node used as the container .intReturns the number of children in the nodekit.voidinsertChild(SoNode child, int childIndex) Adds a child so that it becomes the one with the given index.booleanisChildPermitted(SoNode child) Returns whether the node child may be added to this list.booleanReturns whether the permitted child types and the container type are locked (i.e.booleanisTypePermitted(Class<? extends Inventor> typeToCheck) Returns whether a node of type typeToCheck may be added as a child.voidThis function permanently locks the permitted child types and the container type permanently.voidremoveChild(int index) Removes child with given index from the nodekit.voidremoveChild(SoNode child) Removes first instance of given child from nodekit.voidreplaceChild(int index, SoNode newChild) Replaces child with given index with new child.voidreplaceChild(SoNode oldChild, SoNode newChild) Replaces first instance of given child with new child.voidsetContainerClass(Class<? extends Inventor> newContainerType) Sets the type of node used as the container .Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, writeMethods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaultsMethods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizableMethods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
SoNodeKitListPart
public SoNodeKitListPart()Constructor.
-
-
Method Details
-
getNumChildren
public int getNumChildren() -
getContainerClass
Gets the type of node used as the container . -
removeChild
-
addChild
-
replaceChild
-
insertChild
-
findChild
-
getChild
-
removeChild
public void removeChild(int index) -
isTypeLocked
public boolean isTypeLocked()Returns whether the permitted child types and the container type are locked (i.e. cannot be changed). SeelockTypes() -
isTypePermitted
Returns whether a node of type typeToCheck may be added as a child. -
addChildClass
Permits the node type typeToAdd as a child. The first time theaddChildType()method is called, the default ofSoNodeis overridden and only the new typeToAdd is permitted. In subsequent calls toaddChildType(), the typeToAdd is added to the existing types. -
setContainerClass
Sets the type of node used as the container . -
isChildPermitted
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. -
replaceChild
-
lockTypes
public void lockTypes()This function permanently locks the permitted child types and the container type permanently. Calls tosetContainerType()andaddChildType()will have no effect after this function is called. -
containerSet
-