Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoNodeKitListPart Class Reference

Group node with restricted children. More...

#include <Inventor/nodekits/SoNodeKitListPart.h>

+ Inheritance diagram for SoNodeKitListPart:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoNodeKitListPart ()
 Constructor.
 
SoType getContainerType () const
 Gets the type of node used as the container .
 
void setContainerType (SoType newContainerType)
 Sets the type of node used as the container .
 
const SoTypeListgetChildTypes () const
 Returns the permitted child node types.
 
void addChildType (SoType typeToAdd)
 Permits the node type typeToAdd as a child.
 
SbBool isTypePermitted (SoType typeToCheck) const
 Returns whether a node of type typeToCheck may be added as a child.
 
SbBool isChildPermitted (const SoNode *child) const
 Returns whether the node child may be added to this list.
 
void containerSet (const SbString &fieldDataString)
 Sends a string to the set() method on the container node.
 
void lockTypes ()
 This function permanently locks the permitted child types and the container type permanently.
 
SbBool isTypeLocked () const
 Returns whether the permitted child types and the container type are locked (i.e.
 
void addChild (SoNode *child)
 Adds child as last one in nodekit.
 
void insertChild (SoNode *child, int childIndex)
 Adds a child so that it becomes the one with the given index.
 
SoNodegetChild (int index) const
 Returns the child node with the given index.
 
int findChild (const SoNode *child) const
 Finds index of given child within nodekit.
 
int getNumChildren () const
 Returns the number of children in the nodekit.
 
void removeChild (int index)
 Removes child with given index from the nodekit.
 
void removeChild (SoNode *child)
 Removes first instance of given child from nodekit.
 
void replaceChild (int index, SoNode *newChild)
 Replaces child with given index with new child.
 
void replaceChild (SoNode *oldChild, SoNode *newChild)
 Replaces first instance of given child with new child.
 
virtual SbBool affectsState () const
 Returns TRUE if a node has an effect on the state during traversal.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

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

    NodeKitListPart {
    containerTypeName "Group"
    childTypeNames ""
    containerNode NULL
    }

SEE ALSO

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

Definition at line 121 of file SoNodeKitListPart.h.

Constructor & Destructor Documentation

◆ SoNodeKitListPart()

SoNodeKitListPart::SoNodeKitListPart ( )

Constructor.

Member Function Documentation

◆ addChild()

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.

◆ addChildType()

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.

◆ affectsState()

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.

◆ containerSet()

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.

◆ findChild()

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.

◆ getChild()

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.

◆ getChildTypes()

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.

◆ getClassTypeId()

static SoType SoNodeKitListPart::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getContainerType()

SoType SoNodeKitListPart::getContainerType ( ) const

Gets the type of node used as the container .

◆ getNumChildren()

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.

◆ getTypeId()

virtual SoType SoNodeKitListPart::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

◆ insertChild()

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.

◆ isChildPermitted()

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.

◆ isTypeLocked()

SbBool SoNodeKitListPart::isTypeLocked ( ) const
inline

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

cannot be changed). See lockTypes()

Definition at line 182 of file SoNodeKitListPart.h.

◆ isTypePermitted()

SbBool SoNodeKitListPart::isTypePermitted ( SoType  typeToCheck) const

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

◆ lockTypes()

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.

◆ removeChild() [1/2]

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.

◆ removeChild() [2/2]

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.

Definition at line 233 of file SoNodeKitListPart.h.

◆ replaceChild() [1/2]

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.

◆ replaceChild() [2/2]

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.

Definition at line 248 of file SoNodeKitListPart.h.

◆ setContainerType()

void SoNodeKitListPart::setContainerType ( SoType  newContainerType)

Sets the type of node used as the container .

Friends And Related Symbol Documentation

◆ SoBaseKit

friend class SoBaseKit
friend

Definition at line 308 of file SoNodeKitListPart.h.


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