.TH "SoBaseKit" 3 "Fri Sep 6 2024 15:32:06" "Version 4.0.3" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoBaseKit \- The \fBSoBaseKit\fP class is the top level superclass for nodekits\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBSoNode\fP\&. .PP Inherited by \fBSoAppearanceKit\fP, \fBSoCameraKit\fP, \fBSoForeignFileKit\fP, \fBSoInteractionKit\fP, \fBSoLightKit\fP, \fBSoNodeVisualize\fP, \fBSoProfilerOverlayKit\fP, \fBSoProfilerVisualizeKit\fP, \fBSoSceneKit\fP, \fBSoScrollingGraphKit\fP, and \fBSoSeparatorKit\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const" .br .ti -1c .RI "\fBSoBaseKit\fP (void)" .br .ti -1c .RI "virtual const \fBSoNodekitCatalog\fP * \fBgetNodekitCatalog\fP (void) const" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBgetPart\fP (const \fBSbName\fP &partname, SbBool makeifneeded)" .br .ti -1c .RI "\fBSbString\fP \fBgetPartString\fP (const \fBSoBase\fP *part)" .br .ti -1c .RI "virtual \fBSoNodeKitPath\fP * \fBcreatePathToPart\fP (const \fBSbName\fP &partname, SbBool makeifneeded, const \fBSoPath\fP *pathtoextend=NULL)" .br .ti -1c .RI "virtual SbBool \fBsetPart\fP (const \fBSbName\fP &partname, \fBSoNode\fP *from)" .br .ti -1c .RI "SbBool \fBset\fP (const char *namevaluepairliststring)" .br .ti -1c .RI "SbBool \fBset\fP (const char *partnamestring, const char *parameterstring)" .br .ti -1c .RI "virtual void \fBdoAction\fP (\fBSoAction\fP *action)" .br .ti -1c .RI "virtual void \fBcallback\fP (\fBSoCallbackAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\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 \fBrayPick\fP (\fBSoRayPickAction\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 \fBSoChildList\fP * \fBgetChildren\fP (void) const" .br .ti -1c .RI "void \fBprintDiagram\fP (void)" .br .ti -1c .RI "void \fBprintSubDiagram\fP (const \fBSbName\fP &rootname, int level)" .br .ti -1c .RI "void \fBprintTable\fP (void)" .br .ti -1c .RI "virtual void \fBaddWriteReference\fP (\fBSoOutput\fP *out, SbBool isfromfield=FALSE)" .br .ti -1c .RI "SbBool \fBforceChildDrivenWriteRefs\fP (\fBSoOutput\fP *out)" .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 \fBpick\fP (\fBSoPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBaudioRender\fP (\fBSoAudioRenderAction\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 \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 .ti -1c .RI "static const \fBSoNodekitCatalog\fP * \fBgetClassNodekitCatalog\fP (void)" .br .ti -1c .RI "static SbBool \fBisSearchingChildren\fP (void)" .br .ti -1c .RI "static void \fBsetSearchingChildren\fP (const SbBool newval)" .br .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~SoBaseKit\fP ()" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBaddToCopyDict\fP (void) const" .br .ti -1c .RI "virtual void \fBcopyContents\fP (const \fBSoFieldContainer\fP *fromfc, SbBool copyconnections)" .br .ti -1c .RI "\fBSoGroup\fP * \fBgetContainerNode\fP (const \fBSbName\fP &listname, SbBool makeifneeded=TRUE)" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBgetAnyPart\fP (const \fBSbName\fP &partname, SbBool makeifneeded, SbBool leafcheck=FALSE, SbBool publiccheck=FALSE)" .br .ti -1c .RI "virtual \fBSoNodeKitPath\fP * \fBcreatePathToAnyPart\fP (const \fBSbName\fP &partname, SbBool makeifneeded, SbBool leafcheck=FALSE, SbBool publiccheck=FALSE, const \fBSoPath\fP *pathtoextend=NULL)" .br .ti -1c .RI "virtual SbBool \fBsetAnyPart\fP (const \fBSbName\fP &partname, \fBSoNode\fP *from, SbBool anypart=TRUE)" .br .ti -1c .RI "void \fBcreateNodekitPartsList\fP (void)" .br .ti -1c .RI "void \fBcreateFieldList\fP (void)" .br .ti -1c .RI "virtual void \fBcreateDefaultParts\fP (void)" .br .ti -1c .RI "const SoNodekitParts * \fBgetNodekitPartsList\fP (void) const" .br .ti -1c .RI "const \fBSbList\fP< \fBSoSFNode\fP * > & \fBgetCatalogInstances\fP (void) const" .br .ti -1c .RI "void \fBcatalogError\fP (void)" .br .ti -1c .RI "virtual SbBool \fBsetUpConnections\fP (SbBool onoff, SbBool doitalways=FALSE)" .br .ti -1c .RI "virtual SbBool \fBreadInstance\fP (\fBSoInput\fP *in, unsigned short flags)" .br .ti -1c .RI "virtual void \fBsetDefaultOnNonWritingFields\fP (void)" .br .ti -1c .RI "void \fBcountMyFields\fP (\fBSoOutput\fP *out)" .br .ti -1c .RI "virtual SbBool \fBsetPart\fP (const int partNum, \fBSoNode\fP *node)" .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 .ti -1c .RI "virtual \fBSoNotRec\fP \fBcreateNotRec\fP (void)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .ti -1c .RI "static const \fBSoNodekitCatalog\fP ** \fBgetClassNodekitCatalogPtr\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 "\fBSoSFNode\fP \fBcallbackList\fP" .br .ti -1c .RI "\fBSoChildList\fP * \fBchildren\fP" .br .ti -1c .RI "SbBool \fBconnectionsSetUp\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 \fBSoBaseKit\fP class is the top level superclass for nodekits\&. Node kits are collections of nodes and other node kits (from here on node kits which are part of some other node kit, will only be referred to as nodes or parts, see catalogs and parts), organized in a way that is convenient for its use\&. A node kit inherits \fBSoNode\fP and can thus be inserted into a scene graph as any other node\&. .PP The organizing of the nodes and node kits of some node kit, is done through catalogs\&. A node kit's catalog describes the nodes that can be members of the node kit\&. These members are called parts\&. Thus a node kit has a catalog describing the parts that it offers to the user\&. .PP Each part in the catalog has some values saying something about the part itself and about the role the part plays in the scene graph\&. Those values are: .PP .PP .IP "\fBName .IP "" 1c The name of the part\&. .PP .IP "\fBType .IP "" 1c The part's node type\&. .PP .IP "\fBDefault Type .IP "" 1c If the part's type is an abstract superclass, this value will hold the default subclass used by this part\&. .PP .IP "\fBCreated by default? .IP "" 1c Holds \fRTRUE\fP if the part should be instantiated when the node kit is instantiated, otherwise the part is kept empty until it is set by some of the means applicable\&. .PP .IP "\fBParent Name .IP "" 1c The name of the part that is this part's parent\&. .PP .IP "\fBRight Sibling .IP "" 1c The name of the part that is the part immediately to the right of this part in the node kit scene graph\&. .PP .IP "\fBIs it a list? .IP "" 1c Holds \fRTRUE\fP if the part is a list, otherwise it is \fRFALSE\fP\&. See \fBSoNodeKitListPart\fP for more info on node kit lists\&. .PP .IP "\fBList Container Type .IP "" 1c The type of group node used to hold the items if the part is a list\&. .PP .IP "\fBList Element Type .IP "" 1c The types of nodes that is allowed to be held by this part if the part is a list\&. .PP .IP "\fBIs it public? .IP "" 1c Holds \fRTRUE\fP if the part should be publicly available, otherwise it holds \fRFALSE\fP\&. .PP .PP Node kits use lazy instantiation when it creates its parts\&. This means that the nodes making up the parts of the nodekit only are created when they are needed\&. If the 'Created by default?' holds TRUE, then the part is created when the node kit itself is instantiated\&. If not, parts are created when they are requested through \fBSoBaseKit::getPart()\fP or the SO_GET_PART() macro, or created with \fBSoBaseKit::set()\fP\&. Also, if a part is set with \fBSoBaseKit::setPart()\fP or the SO_SET_PART() macro, any previously uncreated parts above the set part in the hierarchy, are created automatically\&. .PP The advantages of using node kits to represent a scene graph are many\&. .PD 0 .IP "\(bu" 1 Since a node kit collects nodes into a single unit, it becomes an extra abstraction layer for the application programmer\&. Such a layer can represent a model of a human being as one unit where subunits as arms, legs, textures, etc\&. are contained within\&. Thus we can instantiate a model of a human by creating an instance of the node kit, instead of having to create a possibly large amount of nodes needed for such a model\&. .IP "\(bu" 1 A part of the node kit doesn't have one specific setup\&. A shape part can e\&.g\&. be swapped with any other shape, since they are of the same type\&. If the node kit of a human has a part called 'head' which is of type \fBSoShape\fP, it might default to a sphere\&. But if the programmer thinks that a cube might fit better, one can set the 'head' part to a cube instead, or maybe a face set representing a complex model of a head\&. .IP "\(bu" 1 Node kits can have as simple or as complex catalogs as needed\&. The nodes included in the node kit can, if needed, represent the whole range of Inventor features\&. One part can as easily be of a node kit type, making it possible to create hierarchies of node kits\&. Having a node kit of a human, it might be feasible to have sub node kits describing the different body parts\&. .IP "\(bu" 1 Node kits are an efficient way of creating scene graphs\&. If some part of it isn't needed at the moment of node kit instantiation, they aren't created\&. Thus parts are only created when needed, either by the application or some other part\&. .IP "\(bu" 1 The application code becomes smaller and easier to read, as the node kits provides simple routines for creating and setting parts\&. .IP "\(bu" 1 New node kits can be created through subclassing to obtain simple setups of scene graphs best fitted to the application\&. .PP The usage of a node kit is straightforward\&. Below follows a code example showing some simple \fBSoShapeKit\fP usage\&. .PP .PP .nf #include #include #include #include #include int main(int argc, char ** argv) { QWidget * window = SoQt::init(argv[0]); SoQtExaminerViewer * viewer = new SoQtExaminerViewer(window); // Instantiating a shape kit, by default creating a simple sphere\&. SoShapeKit * shapekit = new SoShapeKit; // Swapping the sphere with a cube\&. shapekit\->setPart("shape", new SoCube); // Setting the cube to be rendered in the color red\&. The shape kit // has a SoAppearanceKit as one of its parts\&. The "material" part // used to set the color of the shape, really belongs the // appearance kit\&. If the SoShapeKit::set() is used, it will // check if some of its sub kits have a part with the name given, // and delegate the setting to the correct kit\&. shapekit\->set("material", "diffuseColor 1 0 0"); SoSeparator * newroot = new SoSeparator; newroot\->ref(); newroot\->addChild(shapekit); viewer\->setSceneGraph(newroot); viewer\->show(); SoQt::show(window); SoQt::mainLoop(); delete viewer; newroot\->unref(); return 0; } .fi .PP .PP The above code snippet will produce a viewer with a side view to the scene shown below: .PP .PP Notice that the code needed for creating this simple shape using a shape kit, amounts to this: .PP .PP .nf SoShapeKit * shapekit = new SoShapeKit; shapekit\->setPart("shape", new SoCube); shapekit\->set("material", "diffuseColor 1 0 0"); .fi .PP .PP \&.\&.while doing it without shape kits amounts to this: .PP .PP .nf SoSeparator * root = new SoSeparator; SoMaterial * material = new SoMaterial; material\->diffuseColor\&.setValue(1,0,0); root\->addChild(material); root\->addChild(new SoCube); .fi .PP .PP \&.\&.so even for this minuscule mock-up example, you save on code verbosity and complexity\&. .PP For extending the Coin library with your own classes, we strongly recommend that you make yourself acquainted with the excellent The Inventor Toolmaker book (ISBN 0-201-62493-1), which describes the tasks involved in detail\&. This book was written by the original SGI Inventor designers and explains many of the underlying design ideas, as well as having lots of hands-on examples on how to extend the Coin toolkit in ways that are true to the fundamental design ideas\&. (The Inventor Toolmaker is also available at SGI's online library, at no cost\&. See \fRDownload The Inventor Toolmaker\fP\&.) Reading the source code of the built-in classes in Coin should also prove very helpful\&. .br .PP Following is a complete example of a node kit extension\&. The node kit is a kit which automatically scales a shape so it will be the same size in screen pixels, no matter which distance it is from the camera\&. This is useful for marker graphics\&. The shape defaults to a cube, but can be set by the programmer to any shape or scene subgraph\&. .PP The header file: .PP .PP .nf // Copyright (C) Kongsberg Oil & Gas Technologies\&. All rights reserved\&. #ifndef COIN_SHAPESCALE_H #define COIN_SHAPESCALE_H #include #include #include class SbViewport; class SoState; class SbColor; class SbVec2s; class ShapeScale : public SoBaseKit { typedef SoBaseKit inherited; SO_KIT_HEADER(ShapeScale); SO_KIT_CATALOG_ENTRY_HEADER(topSeparator); SO_KIT_CATALOG_ENTRY_HEADER(scale); SO_KIT_CATALOG_ENTRY_HEADER(shape); public: ShapeScale(void); static void initClass(void); SoSFFloat active; SoSFFloat projectedSize; protected: virtual void GLRender(SoGLRenderAction * action); virtual ~ShapeScale(); }; #endif // ! SHAPESCALE_H .fi .PP .PP The source code for the example: .PP .PP .nf // Copyright (C) Kongsberg Oil & Gas Technologies\&. All rights reserved\&. // The ShapeScale class is used for scaling a shape based on // projected size\&. // // This nodekit can be inserted in your scene graph to add for // instance 3D markers that will be of a constant projected size\&. // // The marker shape is stored in the "shape" part\&. Any kind of node // can be used, even group nodes with several shapes, but the // marker shape should be approximately of unit size, and with a // center position in (0, 0, 0)\&. // SoSFFloat ShapeScale::active // Turns the scaling on/off\&. Default value is TRUE\&. // SoSFFloat ShapeScale::projectedSize // The requested projected size of the shape\&. Default value is 5\&.0\&. #include "ShapeScale\&.h" #include #include #include #include #include #include #include #include SO_KIT_SOURCE(ShapeScale); // Constructor\&. ShapeScale::ShapeScale(void) { SO_KIT_CONSTRUCTOR(ShapeScale); SO_KIT_ADD_FIELD(active, (TRUE)); SO_KIT_ADD_FIELD(projectedSize, (5\&.0f)); SO_KIT_ADD_CATALOG_ENTRY(topSeparator, SoSeparator, FALSE, this, \\x0, FALSE); SO_KIT_ADD_CATALOG_ABSTRACT_ENTRY(shape, SoNode, SoCube, TRUE, topSeparator, \\x0, TRUE); SO_KIT_ADD_CATALOG_ENTRY(scale, SoScale, FALSE, topSeparator, shape, FALSE); SO_KIT_INIT_INSTANCE(); } // Destructor\&. ShapeScale::~ShapeScale() { } // Initializes this class\&. Call before using it\&. void ShapeScale::initClass(void) { SO_KIT_INIT_CLASS(ShapeScale, SoBaseKit, "BaseKit"); } static void update_scale(SoScale * scale, const SbVec3f & v) { // only write to field when scaling has changed\&. if (scale\->scaleFactor\&.getValue() != v) { scale\->scaleFactor = v; } } // Overridden to (re)initialize scaling before rendering marker\&. void ShapeScale::GLRender(SoGLRenderAction * action) { SoState * state = action\->getState(); SoScale * scale = (SoScale*) this\->getAnyPart(SbName("scale"), TRUE); if (!this\->active\&.getValue()) { update_scale(scale, SbVec3f(1\&.0f, 1\&.0f, 1\&.0f)); } else { const SbViewportRegion & vp = SoViewportRegionElement::get(state); const SbViewVolume & vv = SoViewVolumeElement::get(state); SbVec3f center(0\&.0f, 0\&.0f, 0\&.0f); float nsize = this\->projectedSize\&.getValue() / float(vp\&.getViewportSizePixels()[1]); SoModelMatrixElement::get(state)\&.multVecMatrix(center, center); // transform to WCS float scalefactor = vv\&.getWorldToScreenScale(center, nsize); update_scale(scale, SbVec3f(scalefactor, scalefactor, scalefactor)); } inherited::GLRender(action); } .fi .PP .PP And a complete example showing how one can use this node kit: .PP .PP .nf // Copyright (C) Kongsberg Oil & Gas Technologies\&. All rights reserved\&. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ShapeScale\&.h" // Returns random value between 0\&.0f and 1\&.0f\&. static float normalized_rand(void) { return float(rand())/float(RAND_MAX); } static SoSeparator * construct_new_marker(const SbVec3f & v) { SoSeparator * markerroot = new SoSeparator; SoTranslation * t = new SoTranslation; t\->translation = v; markerroot\->addChild(t); ShapeScale * kit = new ShapeScale; kit\->active = TRUE; kit\->projectedSize = 5\&.0f; // create the marker SoSeparator * markersep = new SoSeparator; SoBaseColor * mat = new SoBaseColor; mat\->rgb\&.setValue(normalized_rand(), normalized_rand(), normalized_rand()); markersep\->addChild(mat); // marker shape should be unit size, with center in (0\&.0f, 0\&.0f, 0\&.0f) SoCube * cube = new SoCube; cube\->width = 1\&.0f; cube\->height = 1\&.0f; cube\->depth = 1\&.0f; markersep\->addChild(cube); kit\->setPart("shape", markersep); markerroot\->addChild(kit); return markerroot; } static void event_cb(void * ud, SoEventCallback * n) { const SoMouseButtonEvent * mbe = (SoMouseButtonEvent *)n\->getEvent(); if (mbe\->getButton() == SoMouseButtonEvent::BUTTON1 && mbe\->getState() == SoButtonEvent::DOWN) { SoQtExaminerViewer * viewer = (SoQtExaminerViewer *)ud; SoRayPickAction rp(viewer\->getViewportRegion()); rp\&.setPoint(mbe\->getPosition()); rp\&.apply(viewer\->getSceneManager()\->getSceneGraph()); SoPickedPoint * point = rp\&.getPickedPoint(); if (point == NULL) { (void)fprintf(stderr, "\\n** miss! **\\n\\n"); return; } n\->setHandled(); const SoPath * p = rp\&.getCurPath(); for (int i = 0; i < p\->getLength(); i++) { SoNode * n = p\->getNodeFromTail(i); if (n\->isOfType(SoGroup::getClassTypeId())) { SoGroup * g = (SoGroup *)n; g\->addChild(construct_new_marker(point\->getPoint())); break; } } } } void show_instructions(void) { (void)fprintf(stdout, "\\nThis example program demonstrates the use of the ShapeScale nodekit\&.\\n" "\\nQuick instructions:\\n\\n" " * place the marker by clicking on a shape with the left mouse button\\n" " * hit ESC to toggle back and forth to view mode\\n" " * zoom back and forth to see how the markers stay the same size\\n\\n"); } int main(int argc, char ** argv) { if (argc != 2) { (void) fprintf(stderr,"\\nSpecify an Inventor file as argument\&.\\n"); return \-1; } QWidget * window = SoQt::init(argv[0]); ShapeScale::initClass(); // init our extension nodekit SoQtExaminerViewer * ex1 = new SoQtExaminerViewer(window); SoInput input; SbBool ok = input\&.openFile(argv[1]); if (!ok) { (void) fprintf(stderr, "Unable to open file: %s\\n", argv[1]); return \-1; } SoSeparator * root = SoDB::readAll(&input); if (root == NULL) { (void) fprintf(stderr, "Unable to read file: %s\\n", argv[1]); return \-1; } show_instructions(); SoSeparator * newroot = new SoSeparator; newroot\->ref(); newroot\->addChild(root); // create event callback and marker nodes SoSeparator * sep = new SoSeparator; newroot\->addChild(sep); SoEventCallback * ecb = new SoEventCallback; ecb\->addEventCallback(SoMouseButtonEvent::getClassTypeId(), event_cb, ex1); sep\->addChild(ecb); ex1\->setSceneGraph(newroot); ex1\->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); ex1\->setViewing(FALSE); ex1\->show(); SoQt::show(window); SoQt::mainLoop(); delete ex1; newroot\->unref(); return 0; } .fi .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoBaseKit::SoBaseKit (void )" Constructor\&. .PP This is the top-level superclass of all node kit and dragger classes\&. The catalog structure of \fBSoBaseKit\fP is as follows: .PP .PP .nf CLASS SoBaseKit -->'this' --> 'callbackList' .fi .PP .PP (See \fBSoBaseKit::printDiagram()\fP for information about the output formatting\&.) .PP Detailed information on catalog parts: .PP .PP .nf CLASS SoBaseKit PVT 'this', SoBaseKit --- 'callbackList', SoNodeKitListPart [ SoCallback, SoEventCallback ] .fi .PP .PP (See \fBSoBaseKit::printTable()\fP for information about the output formatting\&.) .PP As can be seen from the catalog, all node kits can have a callback node in front of all other nodes in the kit\&. This is handy for catching events that should go to application processing\&. .SS "SoBaseKit::~SoBaseKit ()\fR [protected]\fP, \fR [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoBaseKit::getClassTypeId (void )\fR [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .br .SS "\fBSoType\fP SoBaseKit::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 \fBSoAppearanceKit\fP, \fBSoCameraKit\fP, \fBSoCenterballDragger\fP, \fBSoDirectionalLightDragger\fP, \fBSoDragger\fP, \fBSoDragPointDragger\fP, \fBSoForeignFileKit\fP, \fBSoHandleBoxDragger\fP, \fBSoInteractionKit\fP, \fBSoJackDragger\fP, \fBSoLightKit\fP, \fBSoNodeVisualize\fP, \fBSoPointLightDragger\fP, \fBSoProfilerOverlayKit\fP, \fBSoProfilerTopKit\fP, \fBSoProfilerVisualizeKit\fP, \fBSoRotateCylindricalDragger\fP, \fBSoRotateDiscDragger\fP, \fBSoRotateSphericalDragger\fP, \fBSoScale1Dragger\fP, \fBSoScale2Dragger\fP, \fBSoScale2UniformDragger\fP, \fBSoScaleUniformDragger\fP, \fBSoSceneKit\fP, \fBSoScrollingGraphKit\fP, \fBSoSeparatorKit\fP, \fBSoShapeKit\fP, \fBSoSpotLightDragger\fP, \fBSoSTLFileKit\fP, \fBSoTabBoxDragger\fP, \fBSoTabPlaneDragger\fP, \fBSoTrackballDragger\fP, \fBSoTransformBoxDragger\fP, \fBSoTransformerDragger\fP, \fBSoTranslate1Dragger\fP, \fBSoTranslate2Dragger\fP, and \fBSoWrapperKit\fP\&. .SS "const \fBSoFieldData\fP ** SoBaseKit::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 * SoBaseKit::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 \fBSoAppearanceKit\fP, \fBSoCameraKit\fP, \fBSoCenterballDragger\fP, \fBSoDirectionalLightDragger\fP, \fBSoDragger\fP, \fBSoDragPointDragger\fP, \fBSoForeignFileKit\fP, \fBSoHandleBoxDragger\fP, \fBSoInteractionKit\fP, \fBSoJackDragger\fP, \fBSoLightKit\fP, \fBSoNodeVisualize\fP, \fBSoPointLightDragger\fP, \fBSoProfilerOverlayKit\fP, \fBSoProfilerTopKit\fP, \fBSoProfilerVisualizeKit\fP, \fBSoRotateCylindricalDragger\fP, \fBSoRotateDiscDragger\fP, \fBSoRotateSphericalDragger\fP, \fBSoScale1Dragger\fP, \fBSoScale2Dragger\fP, \fBSoScale2UniformDragger\fP, \fBSoScaleUniformDragger\fP, \fBSoSceneKit\fP, \fBSoScrollingGraphKit\fP, \fBSoSeparatorKit\fP, \fBSoShapeKit\fP, \fBSoSpotLightDragger\fP, \fBSoSTLFileKit\fP, \fBSoTabBoxDragger\fP, \fBSoTabPlaneDragger\fP, \fBSoTrackballDragger\fP, \fBSoTransformBoxDragger\fP, \fBSoTransformerDragger\fP, \fBSoTranslate1Dragger\fP, \fBSoTranslate2Dragger\fP, and \fBSoWrapperKit\fP\&. .SS "void SoBaseKit::initClass (void )\fR [static]\fP" .SS "const \fBSoNodekitCatalog\fP * SoBaseKit::getClassNodekitCatalog (void )\fR [static]\fP" Returns the nodekit catalog which defines the layout of this class' kit\&. .br .SS "const \fBSoNodekitCatalog\fP * SoBaseKit::getNodekitCatalog (void ) const\fR [virtual]\fP" Returns the nodekit catalog which defines the layout of this class' kit\&. .br .PP Reimplemented in \fBSoAppearanceKit\fP, \fBSoCameraKit\fP, \fBSoCenterballDragger\fP, \fBSoDirectionalLightDragger\fP, \fBSoDragger\fP, \fBSoDragPointDragger\fP, \fBSoForeignFileKit\fP, \fBSoHandleBoxDragger\fP, \fBSoInteractionKit\fP, \fBSoJackDragger\fP, \fBSoLightKit\fP, \fBSoNodeVisualize\fP, \fBSoPointLightDragger\fP, \fBSoProfilerOverlayKit\fP, \fBSoProfilerTopKit\fP, \fBSoProfilerVisualizeKit\fP, \fBSoRotateCylindricalDragger\fP, \fBSoRotateDiscDragger\fP, \fBSoRotateSphericalDragger\fP, \fBSoScale1Dragger\fP, \fBSoScale2Dragger\fP, \fBSoScale2UniformDragger\fP, \fBSoScaleUniformDragger\fP, \fBSoSceneKit\fP, \fBSoScrollingGraphKit\fP, \fBSoSeparatorKit\fP, \fBSoShapeKit\fP, \fBSoSpotLightDragger\fP, \fBSoSTLFileKit\fP, \fBSoTabBoxDragger\fP, \fBSoTabPlaneDragger\fP, \fBSoTrackballDragger\fP, \fBSoTransformBoxDragger\fP, \fBSoTransformerDragger\fP, \fBSoTranslate1Dragger\fP, \fBSoTranslate2Dragger\fP, and \fBSoWrapperKit\fP\&. .SS "\fBSoNode\fP * SoBaseKit::getPart (const \fBSbName\fP & partname, SbBool makeifneeded)\fR [virtual]\fP" Returns a pointer to the node part with \fIpartname\fP\&. .PP This method calls \fBSoBaseKit::getAnyPart()\fP with \fIleafcheck\fP and \fIpubliccheck\fP both set to \fRTRUE\fP\&. .PP See the documentation of \fBSoBaseKit::getAnyPart()\fP for information on how to use \fIpartname\fP and \fImakeifneeded\fP, and what you can expect to get returned from this method\&. .SS "\fBSbString\fP SoBaseKit::getPartString (const \fBSoBase\fP * part)" Returns the full path name to a catalog part, given the part's current item pointer\&. .SS "\fBSoNodeKitPath\fP * SoBaseKit::createPathToPart (const \fBSbName\fP & partname, SbBool makeifneeded, const \fBSoPath\fP * pathtoextend = \fRNULL\fP)\fR [virtual]\fP" Calls \fBSoBaseKit::createPathToAnyPart()\fP with \fIleafcheck\fP \fRTRUE\fP, and \fIpubliccheck\fP \fRTRUE\fP (and other arguments as given to this function)\&. .PP See \fBSoBaseKit::createPathToAnyPart()\fP for documentation\&. .SS "SbBool SoBaseKit::setPart (const \fBSbName\fP & partname, \fBSoNode\fP * from)\fR [virtual]\fP" Sets the catalog part given by \fIpartname\fP to the \fIfrom\fP node pointer\&. .PP Reimplemented in \fBSoInteractionKit\fP\&. .SS "SbBool SoBaseKit::set (const char * namevaluepairliststring)" Sets nodekit part field values\&. The input argument string is of the format: .PP .PP .nf partname { fieldname fieldval fieldname fieldval [\&.\&.\&.] } partname { fieldname fieldval fieldname fieldval [\&.\&.\&.] } [\&.\&.\&.] .fi .PP .PP (Whitespace layout is ignored, as always for Inventor format input strings\&.) .PP Here's an example, changing several values of the camera part of an \fBSoCameraKit\fP instance: .PP .PP .nf kit\->set("camera { heightAngle 0\&.3927 nearDistance 1\&.1 farDistance 999\&.9 }"); .fi .PP .SS "SbBool SoBaseKit::set (const char * partnamestring, const char * parameterstring)" This just overloads the other \fBSoBaseKit::set()\fP method, and provides a way to set a part value by using a separate input argument for the name of the part and the name of the field (i\&.e\&. parameter) settings\&. .SS "void SoBaseKit::doAction (\fBSoAction\fP * action)\fR [virtual]\fP" This function performs the typical operation of a node for any action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBaseKit::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 \fBSoDragger\fP\&. .SS "void SoBaseKit::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 \fBSoDragger\fP, and \fBSoTabPlaneDragger\fP\&. .SS "void SoBaseKit::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 \fBSoCenterballDragger\fP, and \fBSoDragger\fP\&. .SS "void SoBaseKit::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 \fBSoCenterballDragger\fP, and \fBSoDragger\fP\&. .SS "void SoBaseKit::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 \fBSoDragger\fP, and \fBSoNodeVisualize\fP\&. .SS "void SoBaseKit::rayPick (\fBSoRayPickAction\fP * action)\fR [virtual]\fP" Action method for \fBSoRayPickAction\fP\&. .PP Checks the ray specification of the \fIaction\fP and tests for intersection with the data of the node\&. .PP Nodes influencing relevant state variables for how picking is done also override this method\&. .PP Reimplemented from \fBSoNode\fP\&. .PP Reimplemented in \fBSoDragger\fP\&. .SS "void SoBaseKit::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 \fBSoDragger\fP\&. .SS "void SoBaseKit::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 \fBSoDragger\fP\&. .SS "void SoBaseKit::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 \fBSoDragger\fP\&. .SS "\fBSoChildList\fP * SoBaseKit::getChildren (void ) const\fR [virtual]\fP" Returns list of children for this node\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBaseKit::printDiagram (void )" Print out the full nodekit catalog structure\&. Just invokes \fBSoBaseKit::printSubDiagram()\fP on the catalog root\&. Useful for debugging\&. .PP Example output: .PP .PP .nf CLASS SoWrapperKit -->'this' 'callbackList' 'topSeparator' 'pickStyle' 'appearance' 'units' 'transform' 'texture2Transform' 'childList' --> 'localTransform' --> 'contents' .fi .PP .PP The arrows denote new entries in the catalog for the particular class versus its superclass\&. (Apart from the root entry, of course\&.) .PP For a more detailed catalog dump, see \fBSoBaseKit::printTable()\fP\&. .SS "void SoBaseKit::printSubDiagram (const \fBSbName\fP & rootname, int level)" Print out the nodekit catalog structure from \fIrootname\fP and downwards in the catalog tree, with indentation starting at \fIlevel\fP\&. .PP \fBSee also\fP .RS 4 \fBprintDiagram()\fP .RE .PP .SS "void SoBaseKit::printTable (void )" Write the complete nodekit catalog in table form\&. .PP Example output: .PP .PP .nf CLASS SoWrapperKit PVT 'this', SoWrapperKit --- 'callbackList', SoNodeKitListPart [ SoCallback, SoEventCallback ] PVT 'topSeparator', SoSeparator --- 'pickStyle', SoPickStyle --- 'appearance', SoAppearanceKit --- 'units', SoUnits --- 'transform', SoTransform --- 'texture2Transform', SoTexture2Transform --- 'childList', SoNodeKitListPart [ SoShapeKit, SoSeparatorKit ] 'localTransform', SoTransform --- 'contents', SoSeparator --- .fi .PP .PP \fRPVT\fP denotes that it is a private entry in the catalog, then follows the part name and the part type\&. If the part is a list, the allowed node types for the list is given in square brackets, and if not there's a triple hyphen\&. If the part type is abstract, the default part type will be listed last (not shown in the example output above)\&. .SS "void SoBaseKit::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 SoBaseKit::forceChildDrivenWriteRefs (\fBSoOutput\fP * out)" Returns \fRTRUE\fP if kit should write\&. This happens if \fBshouldWrite()\fP returns \fRTRUE\fP, or if any of the children (recursively) should write\&. .SS "SbBool SoBaseKit::isSearchingChildren (void )\fR [static]\fP" Returns the value of the flag indicating whether or not the kit parts are searched during \fBSoSearchAction\fP traversal\&. .PP \fBSee also\fP .RS 4 \fBSoBaseKit::setSearchingChildren()\fP .RE .PP .SS "void SoBaseKit::setSearchingChildren (const SbBool newval)\fR [static]\fP" Set whether or not the kit parts should be searched during \fBSoSearchAction\fP traversal\&. The default value is \fRFALSE\fP\&. .SS "const \fBSoNodekitCatalog\fP ** SoBaseKit::getClassNodekitCatalogPtr (void )\fR [static]\fP, \fR [protected]\fP" Returns the pointer to the pointer of the nodekit catalog for this class\&. .br .SS "\fBSoNode\fP * SoBaseKit::addToCopyDict (void ) const\fR [protected]\fP, \fR [virtual]\fP" Add a copy of this node and (recursively) all children to the copy dictionary of \fBSoFieldContainer\fP if this has not already been done\&. .PP Used internally during copy operations\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBaseKit::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 \fBSoInteractionKit\fP, \fBSoRotateCylindricalDragger\fP, and \fBSoRotateSphericalDragger\fP\&. .SS "\fBSoGroup\fP * SoBaseKit::getContainerNode (const \fBSbName\fP & listname, SbBool makeifneeded = \fRTRUE\fP)\fR [protected]\fP" Returns a pointer to the group node above an \fBSoNodeKitListPart\fP in the catalog given by \fIlistname\fP\&. .PP If the list part (and its container) was not yet constructed, they will be so if \fImakeifneeded\fP is \fRTRUE\fP (otherwise, \fRNULL\fP will be returned)\&. .SS "\fBSoNode\fP * SoBaseKit::getAnyPart (const \fBSbName\fP & partname, SbBool makeifneeded, SbBool leafcheck = \fRFALSE\fP, SbBool publiccheck = \fRFALSE\fP)\fR [protected]\fP, \fR [virtual]\fP" Returns catalog part of the given \fIpartname\fP\&. .PP If the \fIpartname\fP part is not in the nodekit's catalog, return \fRNULL\fP\&. .PP If the part is specified in the catalog, but has not yet been made, the function will either construct the part (if \fImakeifneeded\fP is \fRTRUE\fP) or just return \fRNULL\fP (if \fImakeifneeded\fP is \fRFALSE\fP)\&. .PP If \fIleafcheck\fP is \fRTRUE\fP, a pointer to the part will only be returned if it is a leaf in the catalog (otherwise \fRNULL\fP is returned)\&. .PP If \fIpubliccheck\fP is \fRTRUE\fP, a pointer to the part will only be returned if it is a public catalog part (otherwise \fRNULL\fP is returned)\&. .PP The \fIpartname\fP input argument should be given as a \fI'path'\fP of catalog part names down to the wanted leaf part\&. The syntax for specifying \fIpartname\fP 'paths' is as follows (given in Backus-Naur Form (BNF)): .PP .PP .nf BNF: partname = singlename | compoundname compoundname = singlename | compoundname\&.singlename singlename = singlepartname | singlelistelementname singlelistelementname = singlelistname[idx] singlepartname is name of a part ('ordinary', nodekit or list) singlelistname is name of a part which is a list idx is an integer value .fi .PP .SS "\fBSoNodeKitPath\fP * SoBaseKit::createPathToAnyPart (const \fBSbName\fP & partname, SbBool makeifneeded, SbBool leafcheck = \fRFALSE\fP, SbBool publiccheck = \fRFALSE\fP, const \fBSoPath\fP * pathtoextend = \fRNULL\fP)\fR [protected]\fP, \fR [virtual]\fP" Return path with nested \fBSoNodeKit\fP instances down in the catalog hierarchy given by \fIpartname\fP\&. .PP If the trailing part has not been made and \fImakeifneeded\fP is \fRTRUE\fP, make an instance of the part type and insert into the catalog, as done in \fBsetAnyPart()\fP\&. .PP If \fIleafcheck\fP is \fRTRUE\fP, ignore non-leaf catalog node entries\&. If \fIpubliccheck\fP is \fRTRUE\fP, ignore private catalog entries\&. .PP \fIpathtoextend\fP is a path through the nodekit instance catalog hierarchy, where we should pick up and continue to create the path from where \fIpathtoextend\fP terminates\&. If \fIpathtoextend\fP is \fRNULL\fP, we simply start at the 'this' top level node\&. .PP Returns \fRNULL\fP on failure, for any of the possible reasons described above (part ends in non-leaf or private catalog entry, part is not syntactically valid or refers to non-existing catalog entries)\&. .SS "SbBool SoBaseKit::setAnyPart (const \fBSbName\fP & partname, \fBSoNode\fP * from, SbBool anypart = \fRTRUE\fP)\fR [protected]\fP, \fR [virtual]\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 .SS "void SoBaseKit::createNodekitPartsList (void )\fR [protected]\fP" Not part of the Coin API\&. .PP It is supposed to create the SoNodekitParts class instance\&. Since this class can only be used by \fBSoBaseKit\fP (all members are private, with \fBSoBaseKit\fP as friend), we decided to not support this class, and solve the problem of recording which parts are created in an alternative way\&. .SS "void SoBaseKit::createFieldList (void )\fR [protected]\fP" Replaces the \fBcreateNodekitPartsList()\fP method\&. .PP Sets up the list of \fBSoSFNode\fP fields with node pointers to the instances in our catalog\&. .SS "void SoBaseKit::createDefaultParts (void )\fR [protected]\fP, \fR [virtual]\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 .SS "const SoNodekitParts * SoBaseKit::getNodekitPartsList (void ) const\fR [protected]\fP" In Open Inventor, this method returns a pointer to a private class\&. It will always return \fRNULL\fP in Coin\&. .PP \fBSee also\fP .RS 4 \fBcreateNodekitPartsList()\fP .RE .PP .SS "const \fBSbList\fP< \fBSoSFNode\fP * > & SoBaseKit::getCatalogInstances (void ) const\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 .SS "void SoBaseKit::catalogError (void )\fR [protected]\fP" Obsoleted from the API in Coin\&. .SS "SbBool SoBaseKit::setUpConnections (SbBool onoff, SbBool doitalways = \fRFALSE\fP)\fR [protected]\fP, \fR [virtual]\fP" Sets up all internal connections for instances of this class\&. .PP (This method will usually not be of interest to the application programmer, unless you want to extend the library with new custom nodekits or dragger classes\&. If so, see the \fBSoBaseKit\fP class documentation\&.) .PP Reimplemented in \fBSoCenterballDragger\fP, \fBSoDirectionalLightDragger\fP, \fBSoDragPointDragger\fP, \fBSoHandleBoxDragger\fP, \fBSoInteractionKit\fP, \fBSoJackDragger\fP, \fBSoPointLightDragger\fP, \fBSoRotateCylindricalDragger\fP, \fBSoRotateDiscDragger\fP, \fBSoRotateSphericalDragger\fP, \fBSoScale1Dragger\fP, \fBSoScale2Dragger\fP, \fBSoScale2UniformDragger\fP, \fBSoScaleUniformDragger\fP, \fBSoSeparatorKit\fP, \fBSoSpotLightDragger\fP, \fBSoTabBoxDragger\fP, \fBSoTabPlaneDragger\fP, \fBSoTrackballDragger\fP, \fBSoTransformBoxDragger\fP, \fBSoTransformerDragger\fP, \fBSoTranslate1Dragger\fP, and \fBSoTranslate2Dragger\fP\&. .SS "SbBool SoBaseKit::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 \fBSoInteractionKit\fP\&. .SS "void SoBaseKit::setDefaultOnNonWritingFields (void )\fR [protected]\fP, \fR [virtual]\fP" (Be aware that this method is unlikely to be of interest to the application programmer who does not want to extend the library with new custom nodekits or draggers\&. If you indeed \fIare\fP writing extensions, see the information in the \fBSoBaseKit\fP class documentation\&.) .PP This is a virtual method, and the code in it should call \fBSoField::setDefault()\fP with argument \fRTRUE\fP on part fields that should not be written upon scene graph export operations\&. .PP This is typically done when: .PP .PD 0 .IP "1." 4 field value is \fRNULL\fP and part is \fRNULL\fP by default .PP .IP "2." 4 it is a leaf \fBSoGroup\fP or \fBSoSeparator\fP node with no children .PP .IP "3." 4 it is a leaf listpart with no children and an \fBSoGroup\fP or \fBSoSeparator\fP container .PP .IP "4." 4 it is a non-leaf part and it is of \fBSoGroup\fP type and all fields are at their default values .PP .PP .PP Subclasses should usually override this to do additional settings for new member fields\&. From the subclass, do remember to call 'upwards' to your superclass' \fBsetDefaultOnNonWritingFields()\fP method\&. .PP Reimplemented in \fBSoCenterballDragger\fP, \fBSoDirectionalLightDragger\fP, \fBSoDragger\fP, \fBSoDragPointDragger\fP, \fBSoHandleBoxDragger\fP, \fBSoInteractionKit\fP, \fBSoJackDragger\fP, \fBSoPointLightDragger\fP, \fBSoSeparatorKit\fP, \fBSoShapeKit\fP, \fBSoSpotLightDragger\fP, \fBSoTabBoxDragger\fP, \fBSoTabPlaneDragger\fP, \fBSoTrackballDragger\fP, \fBSoTransformBoxDragger\fP, and \fBSoTransformerDragger\fP\&. .SS "void SoBaseKit::countMyFields (\fBSoOutput\fP * out)\fR [protected]\fP" Reference count the write connections to nodes in the catalog\&. .SS "SbBool SoBaseKit::setPart (const int partnum, \fBSoNode\fP * node)\fR [protected]\fP, \fR [virtual]\fP" Sets parts, updates nodekit scene graph, and makes sure graph is valid with respect to right siblings and parent\&. This method is virtual to enable subclasses to detect when a part changes value\&. .PP This method is not part of the original SGI Open Inventor API, but is an extension specific to Coin\&. .PP Reimplemented in \fBSoInteractionKit\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoChildList\fP* SoBaseKit::children\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 .SS "SbBool SoBaseKit::connectionsSetUp\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 .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.