.TH "SoGroup" 3 "Fri Sep 6 2024 15:32:06" "Version 4.0.3" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoGroup \- The \fBSoGroup\fP class is a node which managed other node instances\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBSoNode\fP\&. .PP Inherited by \fBSoArray\fP, \fBSoLOD\fP, \fBSoLevelOfDetail\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const" .br .ti -1c .RI "\fBSoGroup\fP (void)" .br .ti -1c .RI "\fBSoGroup\fP (int nchildren)" .br .ti -1c .RI "virtual void \fBaddChild\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "virtual void \fBinsertChild\fP (\fBSoNode\fP *child, int newchildindex)" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBgetChild\fP (int index) const" .br .ti -1c .RI "virtual int \fBfindChild\fP (const \fBSoNode\fP *node) const" .br .ti -1c .RI "virtual int \fBgetNumChildren\fP (void) const" .br .ti -1c .RI "virtual void \fBremoveChild\fP (int childindex)" .br .ti -1c .RI "virtual void \fBremoveChild\fP (\fBSoNode\fP *child)" .br .ti -1c .RI "virtual void \fBremoveAllChildren\fP (void)" .br .ti -1c .RI "virtual void \fBreplaceChild\fP (int index, \fBSoNode\fP *newchild)" .br .ti -1c .RI "virtual void \fBreplaceChild\fP (\fBSoNode\fP *oldchild, \fBSoNode\fP *newchild)" .br .ti -1c .RI "virtual void \fBdoAction\fP (\fBSoAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBcallback\fP (\fBSoCallbackAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetBoundingBox\fP (\fBSoGetBoundingBoxAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetMatrix\fP (\fBSoGetMatrixAction\fP *action)" .br .ti -1c .RI "virtual void \fBhandleEvent\fP (\fBSoHandleEventAction\fP *action)" .br .ti -1c .RI "virtual void \fBpick\fP (\fBSoPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBsearch\fP (\fBSoSearchAction\fP *action)" .br .ti -1c .RI "virtual void \fBwrite\fP (\fBSoWriteAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetPrimitiveCount\fP (\fBSoGetPrimitiveCountAction\fP *action)" .br .ti -1c .RI "virtual void \fBaudioRender\fP (\fBSoAudioRenderAction\fP *action)" .br .ti -1c .RI "virtual \fBSoChildList\fP * \fBgetChildren\fP (void) const" .br .ti -1c .RI "virtual void \fBaddWriteReference\fP (\fBSoOutput\fP *out, SbBool isfromfield=FALSE)" .br .in -1c Public Member Functions inherited from \fBSoNode\fP .in +1c .ti -1c .RI "void \fBsetOverride\fP (const SbBool state)" .br .ti -1c .RI "SbBool \fBisOverride\fP (void) const" .br .ti -1c .RI "void \fBsetNodeType\fP (const \fBNodeType\fP type)" .br .ti -1c .RI "\fBNodeType\fP \fBgetNodeType\fP (void) const" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBcopy\fP (SbBool copyconnections=FALSE) const" .br .ti -1c .RI "virtual SbBool \fBaffectsState\fP (void) const" .br .ti -1c .RI "virtual void \fBGLRenderBelowPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRenderInPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRenderOffPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBrayPick\fP (\fBSoRayPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBgrabEventsSetup\fP (void)" .br .ti -1c .RI "virtual void \fBgrabEventsCleanup\fP (void)" .br .ti -1c .RI "virtual void \fBstartNotify\fP (void)" .br .ti -1c .RI "virtual void \fBnotify\fP (\fBSoNotList\fP *l)" .br .ti -1c .RI "SbUniqueId \fBgetNodeId\fP (void) const" .br .ti -1c .RI "virtual void \fBwriteInstance\fP (\fBSoOutput\fP *out)" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBaddToCopyDict\fP (void) const" .br .ti -1c .RI "virtual \fBSoFieldContainer\fP * \fBcopyThroughConnection\fP (void) const" .br .in -1c Public Member Functions inherited from \fBSoFieldContainer\fP .in +1c .ti -1c .RI "void \fBsetToDefaults\fP (void)" .br .ti -1c .RI "SbBool \fBhasDefaultValues\fP (void) const" .br .ti -1c .RI "SbBool \fBfieldsAreEqual\fP (const \fBSoFieldContainer\fP *container) const" .br .ti -1c .RI "void \fBcopyFieldValues\fP (const \fBSoFieldContainer\fP *container, SbBool copyconnections=FALSE)" .br .ti -1c .RI "SbBool \fBset\fP (const char *const fielddata)" .br .ti -1c .RI "void \fBget\fP (\fBSbString\fP &fielddata)" .br .ti -1c .RI "virtual int \fBgetFields\fP (\fBSoFieldList\fP &l) const" .br .ti -1c .RI "virtual int \fBgetAllFields\fP (\fBSoFieldList\fP &l) const" .br .ti -1c .RI "virtual \fBSoField\fP * \fBgetField\fP (const \fBSbName\fP &name) const" .br .ti -1c .RI "virtual \fBSoField\fP * \fBgetEventIn\fP (const \fBSbName\fP &name) const" .br .ti -1c .RI "virtual \fBSoField\fP * \fBgetEventOut\fP (const \fBSbName\fP &name) const" .br .ti -1c .RI "SbBool \fBgetFieldName\fP (const \fBSoField\fP *const field, \fBSbName\fP &name) const" .br .ti -1c .RI "SbBool \fBenableNotify\fP (const SbBool flag)" .br .ti -1c .RI "SbBool \fBisNotifyEnabled\fP (void) const" .br .ti -1c .RI "SbBool \fBset\fP (const char *fielddata, \fBSoInput\fP *input)" .br .ti -1c .RI "void \fBget\fP (\fBSbString\fP &fielddata, \fBSoOutput\fP *out)" .br .ti -1c .RI "virtual SbBool \fBvalidateNewFieldValue\fP (\fBSoField\fP *field, void *newval)" .br .ti -1c .RI "SbBool \fBgetIsBuiltIn\fP (void) const" .br .ti -1c .RI "virtual void \fBgetFieldsMemorySize\fP (size_t &managed, size_t &unmanaged) const" .br .ti -1c .RI "void \fBsetUserData\fP (void *userdata) const" .br .ti -1c .RI "void * \fBgetUserData\fP (void) const" .br .in -1c Public Member Functions inherited from \fBSoBase\fP .in +1c .ti -1c .RI "void \fBref\fP (void) const" .br .ti -1c .RI "void \fBunref\fP (void) const" .br .ti -1c .RI "void \fBunrefNoDelete\fP (void) const" .br .ti -1c .RI "int32_t \fBgetRefCount\fP (void) const" .br .ti -1c .RI "void \fBtouch\fP (void)" .br .ti -1c .RI "SbBool \fBisOfType\fP (\fBSoType\fP type) const" .br .RI "Returns \fRTRUE\fP if the type of this object is either of the same type or inherited from \fItype\fP\&. " .ti -1c .RI "virtual \fBSbName\fP \fBgetName\fP (void) const" .br .ti -1c .RI "virtual void \fBsetName\fP (const \fBSbName\fP &newname)" .br .ti -1c .RI "void \fBaddAuditor\fP (void *const auditor, const \fBSoNotRec::Type\fP type)" .br .ti -1c .RI "void \fBremoveAuditor\fP (void *const auditor, const \fBSoNotRec::Type\fP type)" .br .ti -1c .RI "const \fBSoAuditorList\fP & \fBgetAuditors\fP (void) const" .br .ti -1c .RI "SbBool \fBshouldWrite\fP (void)" .br .ti -1c .RI "void \fBassertAlive\fP (void) const" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. " .in -1c Static Public Member Functions inherited from \fBSoNode\fP .in +1c .ti -1c .RI "static uint32_t \fBgetCompatibilityTypes\fP (const \fBSoType\fP &nodetype)" .br .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static \fBSoNode\fP * \fBgetByName\fP (const \fBSbName\fP &name)" .br .ti -1c .RI "static int \fBgetByName\fP (const \fBSbName\fP &name, \fBSoNodeList\fP &l)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. " .ti -1c .RI "static void \fBinitClasses\fP (void)" .br .ti -1c .RI "static SbUniqueId \fBgetNextNodeId\fP (void)" .br .ti -1c .RI "static int \fBgetActionMethodIndex\fP (const \fBSoType\fP type)" .br .ti -1c .RI "static void \fBgetBoundingBoxS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBGLRenderS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBcallbackS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBgetMatrixS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBhandleEventS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBpickS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBrayPickS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBsearchS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBwriteS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBaudioRenderS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .ti -1c .RI "static void \fBgetPrimitiveCountS\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .in -1c Static Public Member Functions inherited from \fBSoFieldContainer\fP .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. " .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .RI "This static method returns the \fBSoType\fP object associated with objects of this class\&. " .ti -1c .RI "static void \fBcleanupClass\fP (void)" .br .ti -1c .RI "static void \fBinitCopyDict\fP (void)" .br .ti -1c .RI "static void \fBaddCopy\fP (const \fBSoFieldContainer\fP *orig, const \fBSoFieldContainer\fP *copy)" .br .ti -1c .RI "static \fBSoFieldContainer\fP * \fBcheckCopy\fP (const \fBSoFieldContainer\fP *orig)" .br .ti -1c .RI "static \fBSoFieldContainer\fP * \fBfindCopy\fP (const \fBSoFieldContainer\fP *orig, const SbBool copyconnections)" .br .ti -1c .RI "static void \fBcopyDone\fP (void)" .br .in -1c Static Public Member Functions inherited from \fBSoBase\fP .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. " .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .RI "This static method returns the \fBSoType\fP object associated with objects of this class\&. " .ti -1c .RI "static void \fBaddName\fP (\fBSoBase\fP *const base, const char *const name)" .br .ti -1c .RI "static void \fBremoveName\fP (\fBSoBase\fP *const base, const char *const name)" .br .ti -1c .RI "static void \fBincrementCurrentWriteCounter\fP (void)" .br .ti -1c .RI "static void \fBdecrementCurrentWriteCounter\fP (void)" .br .ti -1c .RI "static \fBSoBase\fP * \fBgetNamedBase\fP (const \fBSbName\fP &name, \fBSoType\fP type)" .br .ti -1c .RI "static int \fBgetNamedBases\fP (const \fBSbName\fP &name, \fBSoBaseList\fP &baselist, \fBSoType\fP type)" .br .ti -1c .RI "static SbBool \fBread\fP (\fBSoInput\fP *input, \fBSoBase\fP *&base, \fBSoType\fP expectedtype)" .br .ti -1c .RI "static void \fBsetInstancePrefix\fP (const \fBSbString\fP &c)" .br .ti -1c .RI "static void \fBsetTraceRefs\fP (SbBool trace)" .br .ti -1c .RI "static SbBool \fBgetTraceRefs\fP (void)" .br .ti -1c .RI "static SbBool \fBconnectRoute\fP (\fBSoInput\fP *input, const \fBSbName\fP &fromnodename, const \fBSbName\fP &fromfieldname, const \fBSbName\fP &tonodename, const \fBSbName\fP &tofieldname)" .br .ti -1c .RI "static SbBool \fBreadRoute\fP (\fBSoInput\fP *input)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const" .br .ti -1c .RI "virtual \fB~SoGroup\fP ()" .br .ti -1c .RI "virtual SbBool \fBreadInstance\fP (\fBSoInput\fP *in, unsigned short flags)" .br .ti -1c .RI "virtual SbBool \fBreadChildren\fP (\fBSoInput\fP *in)" .br .ti -1c .RI "virtual void \fBcopyContents\fP (const \fBSoFieldContainer\fP *from, SbBool copyconnections)" .br .ti -1c .RI "virtual \fBSoNotRec\fP \fBcreateNotRec\fP (void)" .br .ti -1c .RI "void \fBsetOperation\fP (const \fBSoNotRec::OperationType\fP opType=SoNotRec::UNSPECIFIED, const \fBSoNode\fP *cc=NULL, const \fBSoNode\fP *pc=NULL, const int ci=\-1)" .br .in -1c Protected Member Functions inherited from \fBSoNode\fP .in +1c .ti -1c .RI "\fBSoNode\fP (void)" .br .ti -1c .RI "virtual \fB~SoNode\fP ()" .br .in -1c Protected Member Functions inherited from \fBSoFieldContainer\fP .in +1c .ti -1c .RI "\fBSoFieldContainer\fP (void)" .br .ti -1c .RI "virtual \fB~SoFieldContainer\fP ()" .br .in -1c Protected Member Functions inherited from \fBSoBase\fP .in +1c .ti -1c .RI "\fBSoBase\fP (void)" .br .ti -1c .RI "virtual \fB~SoBase\fP ()" .br .ti -1c .RI "virtual void \fBdestroy\fP (void)" .br .ti -1c .RI "SbBool \fBhasMultipleWriteRefs\fP (void) const" .br .ti -1c .RI "SbBool \fBwriteHeader\fP (\fBSoOutput\fP *out, SbBool isgroup, SbBool isengine) const" .br .ti -1c .RI "void \fBwriteFooter\fP (\fBSoOutput\fP *out) const" .br .ti -1c .RI "virtual const char * \fBgetFileFormatName\fP (void) const" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c Static Protected Member Functions inherited from \fBSoNode\fP .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .ti -1c .RI "static void \fBsetNextActionMethodIndex\fP (int index)" .br .ti -1c .RI "static int \fBgetNextActionMethodIndex\fP (void)" .br .ti -1c .RI "static void \fBincNextActionMethodIndex\fP (void)" .br .ti -1c .RI "static void \fBsetCompatibilityTypes\fP (const \fBSoType\fP &nodetype, const uint32_t bitmask)" .br .in -1c Static Protected Member Functions inherited from \fBSoBase\fP .in +1c .ti -1c .RI "static uint32_t \fBgetCurrentWriteCounter\fP (void)" .br .ti -1c .RI "static void \fBstaticDataLock\fP (void)" .br .ti -1c .RI "static void \fBstaticDataUnlock\fP (void)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBSoChildList\fP * \fBchildren\fP" .br .in -1c Protected Attributes inherited from \fBSoNode\fP .in +1c .ti -1c .RI "SbUniqueId \fBuniqueId\fP" .br .in -1c Protected Attributes inherited from \fBSoFieldContainer\fP .in +1c .ti -1c .RI "SbBool \fBisBuiltIn\fP" .br .in -1c .SS "Additional Inherited Members" Public Types inherited from \fBSoNode\fP .in +1c .ti -1c .RI "enum \fBNodeType\fP { \fBINVENTOR\fP = 0x0000, \fBVRML1\fP = 0x0001, \fBVRML2\fP = 0x0002, \fBINVENTOR_1\fP = 0x0004, \fBINVENTOR_2_0\fP = 0x0008, \fBINVENTOR_2_1\fP = 0x0010, \fBINVENTOR_2_5\fP = 0x0020, \fBINVENTOR_2_6\fP = 0x0040, \fBCOIN_1_0\fP = 0x0080, \fBCOIN_2_0\fP = 0x0100, \fBEXTENSION\fP = 0x0200, \fBCOIN_2_2\fP = 0x0400, \fBCOIN_2_3\fP = 0x0800, \fBCOIN_2_4\fP = 0x1000, \fBINVENTOR_5_0\fP = 0x2000, \fBCOIN_2_5\fP = 0x4000, \fBCOIN_3_0\fP = 0x8000, \fBINVENTOR_6_0\fP = 0x10000, \fBCOIN_4_0\fP = 0x20000 }" .br .in -1c Public Attributes inherited from \fBSoBase\fP Protected Types inherited from \fBSoBase\fP .in +1c .ti -1c .RI "enum \fBBaseFlags\fP { \fBIS_ENGINE\fP = 0x01, \fBIS_GROUP\fP = 0x02 }" .br .in -1c Static Protected Attributes inherited from \fBSoNode\fP .in +1c .ti -1c .RI "static SbUniqueId \fBnextUniqueId\fP = 1" .br .ti -1c .RI "static int \fBnextActionMethodIndex\fP = 0" .br .in -1c .SH "Detailed Description" .PP The \fBSoGroup\fP class is a node which managed other node instances\&. The internal scene data structures in Coin are managed as directed graphs\&. The graphs are built by setting up a hierarchy through the use of group nodes (either of this type, or from subclasses like \fBSoSeparator\fP) which is then traversed when applying actions (like \fBSoGLRenderAction\fP) to it\&. .PP \fBSoGroup\fP, \fBSoSeparator\fP, and other classes derived from \fBSoGroup\fP, are the 'tools' the application programmer uses when making the layout of the scene graph\&. .PP An often asked question about \fBSoGroup\fP nodes is: 'Why is there no SoGroup::getParent() method?' The answer to this is that nodes in the scene graph can have multiple parents, so a simple getParent() method wouldn't work\&. If you have a node pointer (or other node identification) of a node that you want to remove from the scene graph, what you need to do is to use an \fBSoSearchAction\fP to find all paths down to the node, and then invoke \fBSoGroup::removeChild()\fP from all found parents of the node\&. .PP The function would look something like this: .PP .PP .nf void getParents(SoNode * node, SoNode * root, SoPathList & parents) { SoSearchAction sa; sa\&.setNode(node); sa\&.setInterest(SoSearchAction::ALL); sa\&.apply(root); parents = sa\&.getPaths(); } .fi .PP .PP Or if you \fIknow\fP that your node of interest has only a single parent: .PP .PP .nf SoGroup * getParent(SoNode * node, SoNode * root) { SoSearchAction sa; sa\&.setNode(node); sa\&.setInterest(SoSearchAction::FIRST); sa\&.apply(root); SoPath * p = sa\&.getPath(); assert(p && "not found"); if (p\->getLength() < 2) { return NULL; } // no parent return (SoGroup *)p\->getNodeFromTail(1); } .fi .PP .PP An important note about a potential problem using \fBSoGroup\fP nodes which it is not common to stumble on, but which makes hard to find bugs when one does: you should not change the scene graph layout during any action traversal, as that is not allowed by the internal Coin code\&. I\&.e\&. do not use \fBaddChild()\fP, \fBremoveChild()\fP, \fBinsertChild()\fP or \fBreplaceChild()\fP from any callback that is triggered directly or indirectly from an action traversal\&. The most common way of getting hit by this error, would be something like the following (simplified) example: .PP .PP .nf #include #include #include #include #include #include #include SoPointLightManip * global_pointlightmanip; SoSeparator * global_root; // Remove point light when clicking right mouse button\&. static void mySelectionC(void * ud, SoEventCallback * n) { const SoMouseButtonEvent * mbe = (SoMouseButtonEvent*) n\->getEvent(); if ((mbe\->getButton() == SoMouseButtonEvent::BUTTON2) && (mbe\->getState() == SoButtonEvent::DOWN)) { if (global_pointlightmanip) { global_root\->removeChild(global_pointlightmanip); global_pointlightmanip = NULL; } } } int main(int argc, char ** argv) { QWidget * window = SoQt::init(argv[0]); global_root = new SoSeparator; global_root\->ref(); SoEventCallback * ecb = new SoEventCallback; ecb\->addEventCallback(SoMouseButtonEvent::getClassTypeId(), mySelectionC, 0); global_root\->addChild(ecb); global_root\->addChild(new SoCone); global_pointlightmanip = new SoPointLightManip; global_root\->addChild(global_pointlightmanip); SoQtExaminerViewer * viewer = new SoQtExaminerViewer(window); viewer\->setSceneGraph(global_root); viewer\->show(); SoQt::show(window); SoQt::mainLoop(); global_root\->unref(); delete viewer; return 0; } .fi .PP .PP What happens in the above case is this: when clicking with the right mouse button, the SoQtExaminerViewer converts the Qt event to a Coin event, which is sent down the scene graph with an \fBSoHandleEventAction\fP\&. The action traversal reaches the 'global_root' \fBSoSeparator\fP node, where it sees that it should further traverse 3 child nodes (first the \fBSoEventCallback\fP, then the \fBSoCone\fP, then the \fBSoPointLightManip\fP)\&. When it then traverses the \fBSoEventCallback\fP, the mySelectionC() callback will be invoked, which removes the last child\&. But the \fBSoHandleEventAction\fP will still continue its traversal as if the global_root node has 3 children -- and the code will crash\&. .PP (This exact example would perhaps be straight-forward to handle internally in Coin, but there are other ways to change the scene graph layout that are very difficult to handle properly\&. So in general, changing layout during action traversal is not allowed\&.) .PP What to do in these cases is to change the code inside the callback to not do any operations that immediately changes the layout of the scene graph, but to delay it for after the traversal is done\&. This can e\&.g\&. be done by using a Coin sensor\&. .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf Group { } .fi .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoGroup::SoGroup (void )" Default constructor\&. .SS "SoGroup::SoGroup (int nchildren)" Constructor\&. .PP The argument should be the approximate number of children which is expected to be inserted below this node\&. The number need not be exact, as it is only used as a hint for better memory resource allocation\&. .SS "SoGroup::~SoGroup ()\fR [protected]\fP, \fR [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoGroup::getClassTypeId (void )\fR [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .br .SS "\fBSoType\fP SoGroup::getTypeId (void ) const\fR [virtual]\fP" Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for runtime type checking and 'downward' casting\&. .br .PP Implements \fBSoBase\fP\&. .PP Reimplemented in \fBSoAnnotation\fP, \fBSoArray\fP, \fBSoBlinker\fP, \fBSoExtSelection\fP, \fBSoGeoSeparator\fP, \fBSoLevelOfDetail\fP, \fBSoLocateHighlight\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSelection\fP, \fBSoSeparator\fP, \fBSoShadowGroup\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLAnchor\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLCollision\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, \fBSoVRMLSwitch\fP, \fBSoVRMLTransform\fP, and \fBSoWWWAnchor\fP\&. .SS "const \fBSoFieldData\fP ** SoGroup::getFieldDataPtr (void )\fR [static]\fP, \fR [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br Returns the \fBSoFieldData\fP class which holds information about fields in this node\&. .br .SS "const \fBSoFieldData\fP * SoGroup::getFieldData (void ) const\fR [protected]\fP, \fR [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fRNULL\fP\&. .PP Reimplemented from \fBSoFieldContainer\fP\&. .PP Reimplemented in \fBSoAnnotation\fP, \fBSoArray\fP, \fBSoBlinker\fP, \fBSoExtSelection\fP, \fBSoGeoSeparator\fP, \fBSoLevelOfDetail\fP, \fBSoLocateHighlight\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSelection\fP, \fBSoSeparator\fP, \fBSoShadowGroup\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLAnchor\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLCollision\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, \fBSoVRMLSwitch\fP, \fBSoVRMLTransform\fP, and \fBSoWWWAnchor\fP\&. .SS "void SoGroup::addChild (\fBSoNode\fP * node)\fR [virtual]\fP" Append a child \fInode\fP to the list of children nodes this group node is managing\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::insertChild (\fBSoNode\fP * child, int newchildindex)\fR [virtual]\fP" Insert a \fIchild\fP node at position \fInewchildindex\fP\&. .PP \fInewchildindex\fP must be <= this->\fBgetNumChildren()\fP .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "\fBSoNode\fP * SoGroup::getChild (int index) const\fR [virtual]\fP" Returns pointer to child node at \fIindex\fP\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "int SoGroup::findChild (const \fBSoNode\fP * node) const\fR [virtual]\fP" Returns index in our list of children for child \fInode\fP, or -1 if \fInode\fP is not a child of this group node\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "int SoGroup::getNumChildren (void ) const\fR [virtual]\fP" Returns number of child nodes managed by this group\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::removeChild (int childindex)\fR [virtual]\fP" Remove node at \fIchildindex\fP in our list of children\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::removeChild (\fBSoNode\fP * child)\fR [virtual]\fP" Remove \fIchild\fP from the set of children managed by this group node\&. Will decrease the reference count of \fIchild\fP by 1\&. .PP This is a convenience method\&. It will simply call \fBfindChild()\fP with \fIchild\fP as argument, and then call \fBremoveChild(int)\fP if the child is found\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::removeAllChildren (void )\fR [virtual]\fP" Do not manage the children anymore\&. Will dereference all children by 1 as they are removed\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::replaceChild (int index, \fBSoNode\fP * newchild)\fR [virtual]\fP" Replace child at \fIindex\fP with \fInewChild\fP\&. .PP Dereferences the child previously at \fIindex\fP, and increases the reference count of \fInewChild\fP by 1\&. .PP \fIindex\fP must be < this->\fBgetNumChildren()\fP .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::replaceChild (\fBSoNode\fP * oldchild, \fBSoNode\fP * newchild)\fR [virtual]\fP" Replace \fIoldchild\fP with \fInewchild\fP\&. .PP Dereferences \fIoldchild\fP by 1, and increases the reference count of \fInewchild\fP by 1\&. .PP This is a convenience method\&. It will simply call \fBfindChild()\fP with \fIoldchild\fP as argument, and call \fBreplaceChild(int, SoNode*)\fP if the child is found\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::doAction (\fBSoAction\fP * action)\fR [virtual]\fP" This function performs the typical operation of a node for any action\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoLevelOfDetail\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, \fBSoVRMLSwitch\fP, and \fBSoVRMLTransform\fP\&. .SS "void SoGroup::GLRender (\fBSoGLRenderAction\fP * action)\fR [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or want to throw geometry primitives at OpenGL override this method\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoAnnotation\fP, \fBSoArray\fP, \fBSoLevelOfDetail\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLCollision\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::callback (\fBSoCallbackAction\fP * action)\fR [virtual]\fP" Action method for \fBSoCallbackAction\fP\&. .PP Simply updates the state according to how the node behaves for the render action, so the application programmer can use the \fBSoCallbackAction\fP for extracting information about the scene graph\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoGeoSeparator\fP, \fBSoLevelOfDetail\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLSwitch\fP, and \fBSoVRMLTransform\fP\&. .SS "void SoGroup::getBoundingBox (\fBSoGetBoundingBoxAction\fP * action)\fR [virtual]\fP" Action method for the \fBSoGetBoundingBoxAction\fP\&. .PP Calculates bounding box and center coordinates for node and modifies the values of the \fIaction\fP to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node\&. .PP Nodes influencing how geometry nodes calculate their bounding box also override this method to change the relevant state variables\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoBlinker\fP, \fBSoGeoSeparator\fP, \fBSoLevelOfDetail\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLSwitch\fP, and \fBSoVRMLTransform\fP\&. .SS "void SoGroup::getMatrix (\fBSoGetMatrixAction\fP * action)\fR [virtual]\fP" Action method for \fBSoGetMatrixAction\fP\&. .PP Updates \fIaction\fP by accumulating with the transformation matrix of this node (if any)\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoGeoSeparator\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLGroup\fP, \fBSoVRMLSwitch\fP, and \fBSoVRMLTransform\fP\&. .SS "void SoGroup::handleEvent (\fBSoHandleEventAction\fP * action)\fR [virtual]\fP" Action method for \fBSoHandleEventAction\fP\&. .PP Inspects the event data from \fIaction\fP, and processes it if it is something which this node should react to\&. .PP Nodes influencing relevant state variables for how event handling is done also override this method\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoExtSelection\fP, \fBSoLocateHighlight\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSelection\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoVRMLAnchor\fP, \fBSoVRMLSwitch\fP, and \fBSoWWWAnchor\fP\&. .SS "void SoGroup::pick (\fBSoPickAction\fP * action)\fR [virtual]\fP" Action method for \fBSoPickAction\fP\&. .PP Does common processing for \fBSoPickAction\fP \fIaction\fP instances\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLBillboard\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::search (\fBSoSearchAction\fP * action)\fR [virtual]\fP" Action method for \fBSoSearchAction\fP\&. .PP Compares the search criteria from the \fIaction\fP to see if this node is a match\&. Searching is done by matching up \fIall\fP criteria set up in the \fBSoSearchAction\fP -- if \fIany\fP of the requested criteria is a miss, the search is not deemed successful for the node\&. .PP \fBSee also\fP .RS 4 \fBSoSearchAction\fP .RE .PP .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoVRMLBillboard\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::write (\fBSoWriteAction\fP * action)\fR [virtual]\fP" Action method for \fBSoWriteAction\fP\&. .PP Writes out a node object, and any connected nodes, engines etc, if necessary\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoBlinker\fP, \fBSoSwitch\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::getPrimitiveCount (\fBSoGetPrimitiveCountAction\fP * action)\fR [virtual]\fP" Action method for the \fBSoGetPrimitiveCountAction\fP\&. .PP Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the \fIaction\fP\&. .PP Nodes influencing how geometry nodes calculate their primitive count also override this method to change the relevant state variables\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoGeoSeparator\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLTransform\fP\&. .SS "void SoGroup::audioRender (\fBSoAudioRenderAction\fP * action)\fR [virtual]\fP" Action method for \fBSoAudioRenderAction\fP\&. .PP Does common processing for \fBSoAudioRenderAction\fP \fIaction\fP instances\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoArray\fP, \fBSoLevelOfDetail\fP, \fBSoLOD\fP, \fBSoMultipleCopy\fP, \fBSoPathSwitch\fP, \fBSoSeparator\fP, \fBSoSwitch\fP, \fBSoTransformSeparator\fP, \fBSoVRMLGroup\fP, \fBSoVRMLLOD\fP, \fBSoVRMLSwitch\fP, and \fBSoVRMLTransform\fP\&. .SS "\fBSoChildList\fP * SoGroup::getChildren (void ) const\fR [virtual]\fP" Returns list of children\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "void SoGroup::addWriteReference (\fBSoOutput\fP * out, SbBool isfromfield = \fRFALSE\fP)\fR [virtual]\fP" This method is used during the first write pass of a write action to count the number of references to this object in the scene graph\&. .PP Reimplemented from \fBSoFieldContainer\fP\&. .SS "SbBool SoGroup::readInstance (\fBSoInput\fP * in, unsigned short flags)\fR [protected]\fP, \fR [virtual]\fP" This method is mainly intended for internal use during file import operations\&. .PP It reads a definition of an instance from the input stream \fIin\fP\&. The input stream state points to the start of a serialized / persistent representation of an instance of this class type\&. .PP \fRTRUE\fP or \fRFALSE\fP is returned, depending on if the instantiation and configuration of the new object of this class type went OK or not\&. The import process should be robust and handle corrupted input streams by returning \fRFALSE\fP\&. .PP \fIflags\fP is used internally during binary import when reading user extension nodes, group nodes or engines\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoSeparator\fP, \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "SbBool SoGroup::readChildren (\fBSoInput\fP * in)\fR [protected]\fP, \fR [virtual]\fP" Read all children of this node from \fIin\fP and attach them below this group in left-to-right order\&. Returns \fRFALSE\fP upon read error\&. .SS "void SoGroup::copyContents (const \fBSoFieldContainer\fP * from, SbBool copyconnections)\fR [protected]\fP, \fR [virtual]\fP" Makes a deep copy of all data of \fIfrom\fP into this instance, \fIexcept\fP external scene graph references if \fIcopyconnections\fP is \fRFALSE\fP\&. .PP This is the method that should be overridden by extension node / engine / dragger / whatever subclasses which need to account for internal data that are not handled automatically\&. .PP For copying nodes from application code, you should not invoke this function directly, but rather call the \fBSoNode::copy()\fP function: .PP .PP .nf SoNode * mynewnode = templatenode\->copy(); .fi .PP .PP The same also goes for engines\&. .PP Make sure that when you override the \fBcopyContents()\fP method in your extension class that you also make it call upwards to its parent superclass in the inheritance hierarchy, as \fBcopyContents()\fP in for instance \fBSoNode\fP and \fBSoFieldContainer\fP does important work\&. It should go something like this: .PP .PP .nf void MyCoinExtensionNode::copyContents(const SoFieldContainer * from, SbBool copyconnections) { // let parent superclasses do their thing (copy fields, copy // instance name, etc\&.) SoNode::copyContents(from, copyconnections); // [\&.\&.then copy internal data\&.\&.] } .fi .PP .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoVRMLLOD\fP, \fBSoVRMLParent\fP, and \fBSoVRMLSwitch\fP\&. .SS "\fBSoNotRec\fP SoGroup::createNotRec (void )\fR [protected]\fP, \fR [virtual]\fP" Create a record entry for notification lists\&. .PP Reimplemented from \fBSoBase\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoChildList\fP* SoGroup::children\fR [protected]\fP" List of managed child nodes\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.