| 1 |
NAME SoNodeKitListPart SoNkitListPart "" { group node with restricted children } |
| 2 |
|
| 3 |
INCLUDE nodekits/SoNodeKitListPart.h |
| 4 |
|
| 5 |
DESC { |
| 6 |
This node class is very similar to \cSoGroup\. with the exception |
| 7 |
that it specifies restrictions on the type of children that |
| 8 |
it allows. It is used by nodekits to restrict child types |
| 9 |
within \elist parts\. (see the reference page for \cSoBaseKit\.). |
| 10 |
\p |
| 11 |
By default, any kind of child may be added. Methods of this class |
| 12 |
allow you to restrict the type of allowable children, and to lock |
| 13 |
down the types so that this type list may no longer be altered. |
| 14 |
\p |
| 15 |
Inside the \cSoNodeKitListPart\. is a \econtainer\. node, which in |
| 16 |
turn contains the \echildren\.. The \econtainer\. node is a hidden |
| 17 |
child, and the type of node used may be set with |
| 18 |
\m\+setContainerType()\.\-SoNkitListPartSetContainerType()\.\.. |
| 19 |
In this way, you can make the nodekitlist behave like a group, a |
| 20 |
separator, or any other subclass of group. The \econtainer\. is not |
| 21 |
accessible so that the nodekitlist may retain control over what kinds |
| 22 |
of children are added. |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
METHOD "" SoNodeKitListPart() { Constructor. } |
| 27 |
|
| 28 |
|
| 29 |
METHOD "" SoType getContainerType() const {} |
| 30 |
METHOD "" void setContainerType( SoType newContainerType ) |
| 31 |
{ Gets and sets the type of node used as the \econtainer\.. } |
| 32 |
|
| 33 |
METHOD "" const SoTypeList &getChildTypes() const |
| 34 |
{ Returns the permitted child node types. By default, any type of |
| 35 |
node is permitted, so the list contains one entry of |
| 36 |
type \cSoNode\.. } |
| 37 |
|
| 38 |
METHOD "" void addChildType( SoType typeToAdd ) |
| 39 |
{ Permits the node type \atypeToAdd\. as a child. |
| 40 |
The first time the |
| 41 |
\m\+addChildType()\.\-SoNkitListPartAddChildType()\.\. method is |
| 42 |
called, |
| 43 |
the default of \cSoNode\. is overridden and only the |
| 44 |
new \atypeToAdd\. is permitted. In subsequent calls to |
| 45 |
\m\+addChildType()\.\-SoNkitListPartAddChildType()\.\., |
| 46 |
the \atypeToAdd\. is added to the existing |
| 47 |
types. } |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
METHOD "" SbBool isTypePermitted( SoType typeToCheck ) const |
| 52 |
{ Returns whether a node of type \atypeToCheck\. may be |
| 53 |
added as a child. } |
| 54 |
|
| 55 |
|
| 56 |
METHOD "" SbBool isChildPermitted( const SoNode *child ) const |
| 57 |
{ Returns whether the node \achild\. may be added to this list. |
| 58 |
This will return TRUE if the type of \achild\. is one of the permissible |
| 59 |
child types. } |
| 60 |
|
| 61 |
|
| 62 |
METHOD "" void containerSet( const char *fieldDataString ) |
| 63 |
{ Sends a string to the \m\+set()\.\-SoGroupSet()\.\. method on the |
| 64 |
container node. |
| 65 |
This is how you can set the value of a switch node if the container |
| 66 |
node is an \cSoSwitch\., for example. } |
| 67 |
|
| 68 |
|
| 69 |
METHOD "" void lockTypes() |
| 70 |
{ This function permanently locks the permitted child types and |
| 71 |
the container type permanently. |
| 72 |
Calls to |
| 73 |
\m\+setContainerType()\.\-SoNkitListPartSetContainerType()\.\. |
| 74 |
and \m\+addChildType()\.\-SoNkitListPartAddChildType()\.\. |
| 75 |
will have no effect after this function is called. } |
| 76 |
|
| 77 |
|
| 78 |
METHOD "" SbBool isTypeLocked() const |
| 79 |
{ Returns whether the permitted child types and the container type |
| 80 |
are locked |
| 81 |
(i.e. cannot be changed). See |
| 82 |
\m\+lockTypes()\.\-SoNkitListPartLockTypes()\.\. } |
| 83 |
|
| 84 |
METHOD "" void addChild( SoNode *child ) {} |
| 85 |
METHOD "" void insertChild( SoNode *child, int childIndex ) {} |
| 86 |
METHOD "" SoNode *getChild( int index ) const {} |
| 87 |
METHOD "" int findChild(SoNode *child) const {} |
| 88 |
METHOD "" int getNumChildren() const {} |
| 89 |
METHOD "" void removeChild(int index) {} |
| 90 |
METHOD removeChildNode void removeChild(SoNode *child) {} |
| 91 |
METHOD "" void replaceChild(int index, SoNode *newChild) {} |
| 92 |
METHOD replaceChildNode void replaceChild( SoNode *oldChild, SoNode *newChild) |
| 93 |
{ These are the functions used to edit the children. |
| 94 |
They parallel those of \cSoGroup\., except that they always check |
| 95 |
the child types against those which are permissible. |
| 96 |
See \cSoGroup\. for details. } |
| 97 |
|
| 98 |
METHOD "" static SoType getClassTypeId() { |
| 99 |
Returns type identifier for this class. |
| 100 |
} |
| 101 |
|
| 102 |
ALSO { |
| 103 |
SoBaseKit, |
| 104 |
SoNodeKit, |
| 105 |
SoNodeKitDetail, |
| 106 |
SoNodeKitPath, |
| 107 |
SoNodekitCatalog, |
| 108 |
SoSceneKit, |
| 109 |
SoSeparatorKit, |
| 110 |
SoShapeKit, |
| 111 |
SoWrapperKit } |