![]() |
http://www.sim.no http://www.coin3d.org |
The SoChildList class is a container for node children.This class does automatic notification on the parent nodes upon adding or removing children. More...
#include <Inventor/misc/SoChildList.h>
Public Member Functions | |
SoChildList (SoNode *const parent) | |
SoChildList (SoNode *const parent, const int size) | |
SoChildList (SoNode *const parent, const SoChildList &cl) | |
~SoChildList () | |
void | append (SoNode *const node) |
void | insert (SoNode *const ptr, const int addbefore) |
void | remove (const int index) |
void | truncate (const int length) |
void | copy (const SoChildList &cl) |
void | set (const int index, SoNode *const node) |
void | traverseInPath (SoAction *const action, const int numindices, const int *indices) |
void | traverse (SoAction *const action) |
void | traverse (SoAction *const action, const int index) |
void | traverse (SoAction *const action, SoNode *node) |
void | traverse (SoAction *const action, const int first, const int last) |
void | addPathAuditor (SoPath *const path) |
void | removePathAuditor (SoPath *const path) |
The SoChildList class is a container for node children.
This class does automatic notification on the parent nodes upon adding or removing children.
Methods for action traversal of the children are also provided.
SoChildList::SoChildList | ( | SoNode *const | parentptr | ) |
Default constructor, sets parent container and initializes a minimal list.
SoChildList::SoChildList | ( | SoNode *const | parentptr, |
const int | size | ||
) |
Constructor with hint about list size.
SoChildList::SoChildList | ( | SoNode *const | parentptr, |
const SoChildList & | cl | ||
) |
SoChildList::~SoChildList | ( | ) |
Destructor.
References truncate().
void SoChildList::append | ( | SoNode *const | node | ) |
Append a new node instance as a child of our parent container.
Automatically notifies parent node and any SoPath instances auditing paths with nodes from this list.
Reimplemented from SoNodeList.
References SoBase::addAuditor(), and SoNode::startNotify().
Referenced by SoGroup::addChild(), SoWWWInline::copyContents(), SoFile::copyContents(), SoFile::readNamedFile(), SoNodeKitListPart::setContainerType(), SoTransformManip::setDragger(), SoSpotLightManip::setDragger(), SoPointLightManip::setDragger(), SoDirectionalLightManip::setDragger(), SoClipPlaneManip::setDragger(), SoBaseKit::setPart(), and SoNodeKitListPart::SoNodeKitListPart().
void SoChildList::insert | ( | SoNode *const | node, |
const int | addbefore | ||
) |
Insert a new node instance as a child of our parent container at position addbefore.
Automatically notifies parent node and any SoPath instances auditing paths with nodes from this list.
References SoBase::addAuditor(), SbList< Type >::getLength(), SbPList::getLength(), and SoNode::startNotify().
Referenced by SoGroup::insertChild(), and SoBaseKit::setPart().
void SoChildList::remove | ( | const int | index | ) |
Remove the child node pointer at index.
Automatically notifies parent node and any SoPath instances auditing paths with nodes from this list.
Reimplemented from SoBaseList.
References SbList< Type >::getLength(), SbPList::getLength(), SoNodeList::operator[](), SoBase::removeAuditor(), and SoNode::startNotify().
Referenced by SoGroup::removeChild(), SoNodeKitListPart::setContainerType(), SoTransformManip::setDragger(), SoSpotLightManip::setDragger(), SoPointLightManip::setDragger(), SoDirectionalLightManip::setDragger(), SoClipPlaneManip::setDragger(), and SoBaseKit::setPart().
void SoChildList::truncate | ( | const int | length | ) |
Makes the list contain only the length first items, removing all items from index length and onwards to the end of the list. Dereferences the objects to be removed (unless addReferences() has been set to FALSE
).
Reimplemented from SoBaseList.
References SbList< Type >::getLength(), SbPList::getLength(), SoNodeList::operator[](), SoBase::removeAuditor(), and SoNode::startNotify().
Referenced by copy(), SoWWWInline::copyContents(), SoFile::copyContents(), SoBaseKit::copyContents(), SoBaseKit::readInstance(), SoGroup::removeAllChildren(), and ~SoChildList().
void SoChildList::copy | ( | const SoChildList & | cl | ) |
Copy contents of cl into this list.
References SbPList::getLength(), SoNode::startNotify(), and truncate().
Referenced by SoFile::readNamedFile(), and SoChildList().
void SoChildList::set | ( | const int | index, |
SoNode *const | node | ||
) |
Index operator to set element at index. Does not expand array bounds if index is outside the list.
References SoBase::addAuditor(), SbList< Type >::getLength(), SbPList::getLength(), SoNodeList::operator[](), SoDebugError::postInfo(), SoBase::removeAuditor(), and SoNode::startNotify().
Referenced by SoGroup::replaceChild(), SoTransformManip::setDragger(), SoSpotLightManip::setDragger(), SoPointLightManip::setDragger(), SoDirectionalLightManip::setDragger(), and SoBaseKit::setPart().
void SoChildList::traverseInPath | ( | SoAction *const | action, |
const int | numindices, | ||
const int * | indices | ||
) |
Optimized IN_PATH traversal method.
This method is an extension versus the Open Inventor API.
References SoNode::affectsState(), SoAction::getCurPathCode(), SoAction::hasTerminated(), SoAction::popCurPath(), SoAction::pushCurPath(), and SoAction::traverse().
Referenced by SoWWWInline::doAction(), SoTransformManip::doAction(), SoSwitch::doAction(), SoSpotLightManip::doAction(), SoPointLightManip::doAction(), SoNodeKitListPart::doAction(), SoLOD::doAction(), SoGroup::doAction(), SoFile::doAction(), SoDirectionalLightManip::doAction(), SoClipPlaneManip::doAction(), SoBaseKit::doAction(), SoTransformSeparator::getMatrix(), SoTransformManip::getMatrix(), SoSpotLightManip::getMatrix(), SoSeparator::getMatrix(), SoPointLightManip::getMatrix(), SoNodeKitListPart::getMatrix(), SoDirectionalLightManip::getMatrix(), SoClipPlaneManip::getMatrix(), and SoBaseKit::getMatrix().
void SoChildList::traverse | ( | SoAction *const | action | ) |
Traverse all nodes in the list, invoking their methods for the given action.
References SbPList::getLength().
Referenced by SoWWWInline::doAction(), SoTransformManip::doAction(), SoSwitch::doAction(), SoSpotLightManip::doAction(), SoPointLightManip::doAction(), SoNodeKitListPart::doAction(), SoLOD::doAction(), SoLevelOfDetail::doAction(), SoGroup::doAction(), SoFile::doAction(), SoDirectionalLightManip::doAction(), SoClipPlaneManip::doAction(), SoBaseKit::doAction(), SoWWWInline::getBoundingBox(), SoTransformManip::getBoundingBox(), SoSpotLightManip::getBoundingBox(), SoPointLightManip::getBoundingBox(), SoNodeKitListPart::getBoundingBox(), SoGroup::getBoundingBox(), SoFile::getBoundingBox(), SoDirectionalLightManip::getBoundingBox(), SoClipPlaneManip::getBoundingBox(), SoBaseKit::getBoundingBox(), SoTransformManip::getMatrix(), SoSpotLightManip::getMatrix(), SoPointLightManip::getMatrix(), SoNodeKitListPart::getMatrix(), SoDirectionalLightManip::getMatrix(), SoClipPlaneManip::getMatrix(), SoBaseKit::getMatrix(), SoSwitch::search(), traverse(), SoSwitch::write(), and SoBaseKit::write().
void SoChildList::traverse | ( | SoAction *const | action, |
const int | index | ||
) |
Traverse the node at index (and possibly its children, if its a group node), applying the nodes' method for the given action.
References SbPList::getLength(), and traverse().
Traverse the node (and possibly its children, if its a group node), applying the nodes' method for the given action.
References SbPList::find(), and traverse().
void SoChildList::traverse | ( | SoAction *const | action, |
const int | first, | ||
const int | last | ||
) |
Traverse child nodes in the list from index first up to and including index last, or until the SoAction::hasTerminated() flag of action has been set.
References SoNode::affectsState(), SoAction::getCurPathCode(), SbPList::getLength(), SoAction::hasTerminated(), SoAction::popCurPath(), SoAction::popPushCurPath(), SoDebugError::postWarning(), SoAction::pushCurPath(), and SoAction::traverse().
void SoChildList::addPathAuditor | ( | SoPath *const | path | ) |
Notify path whenever this list of node children changes.
References SbList< Type >::append(), and SoDebugError::postInfo().
Referenced by SoPath::operator=().
void SoChildList::removePathAuditor | ( | SoPath *const | path | ) |
Remove path as an auditor for our list of node children.
References SbList< Type >::find(), SoType::getName(), SbName::getString(), SoBase::getTypeId(), SoDebugError::post(), SoDebugError::postInfo(), and SbList< Type >::remove().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Feb 28 2011 10:12:07 for Coin by Doxygen. 1.7.3