SoShapeKit(3)
π SoShapeKit π
okay bestie, so you opened SoShapeKit(3) β that's the Library Functions Manual entry, and it's giving very important, very structural, very "we built you a whole kit" energy. π Let's get into it, no cap.
πΈ NAME πΈ
SoShapeKit β the class that provides templates to insert what is usually needed for shape nodes. That's the whole job. That's the mission. That's the moment. β¨
β¨ SYNOPSIS β¨
#include <Inventor/nodekits/SoShapeKit.h>
Inherits SoSeparatorKit. π
π«Ά Public Member Functions
virtual SoType getTypeId (void) constβ the type-checking glow-up, const edition πvirtual const SoNodekitCatalog * getNodekitCatalog (void) constβ hand it over, bestie, we need the catalogSoShapeKit (void)β the constructor, the main character entrance π¦
π Public Member Functions inherited from SoSeparatorKit
SoSeparatorKit (void)β the parent's constructor, doing its thing in the background
π Public Member Functions inherited from SoBaseKit
SoBaseKit (void)β constructor, but make it base-classvirtual SoNode * getPart (const SbName &partname, SbBool makeifneeded)β fetch a part by name, and tell it whether to make it if it's not there yetSbString getPartString (const SoBase *part)β gimme the name string for a partvirtual SoNodeKitPath * createPathToPart (const SbName &partname, SbBool makeifneeded, const SoPath *pathtoextend=NULL)β build a whole path to a part, optionally extending an existing onevirtual SbBool setPart (const SbName &partname, SoNode *from)β assign a node to a named partSbBool set (const char *namevaluepairliststring)β set stuff from a name/value pair stringSbBool set (const char *partnamestring, const char *parameterstring)β same vibe, part-name + parameter-string flavourvirtual void doAction (SoAction *action)β run an action, the generalistvirtual void callback (SoCallbackAction *action)β callback action, specificallyvirtual void GLRender (SoGLRenderAction *action)β render it, iconic π₯virtual void getBoundingBox (SoGetBoundingBoxAction *action)β bounding box, get itvirtual void getMatrix (SoGetMatrixAction *action)β matrix, get itvirtual void handleEvent (SoHandleEventAction *action)β events? handled.virtual void rayPick (SoRayPickAction *action)β ray pick, periodtvirtual void search (SoSearchAction *action)β search, bestievirtual void write (SoWriteAction *action)β write it outvirtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)β count those primitivesvirtual SoChildList * getChildren (void) constβ the children list, const and proudvoid printDiagram (void)β print the diagram, we love a visual π«Άvoid printSubDiagram (const SbName &rootname, int level)β sub-diagram, with a root name and a levelvoid printTable (void)β print the tablevirtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)β add a write reference, with the from-field flag defaulting toFALSESbBool forceChildDrivenWriteRefs (SoOutput *out)β force those child-driven write refs
π Public Member Functions inherited from SoNode
void setOverride (const SbBool state)β set the override stateSbBool isOverride (void) constβ are we overriding? enquire withinvoid setNodeType (const NodeType type)β set that node typeNodeType getNodeType (void) constβ get that node typevirtual SoNode * copy (SbBool copyconnections=FALSE) constβ copy it,copyconnectionsdefaults toFALSEvirtual SbBool affectsState (void) constβ does it affect state? ask itvirtual void GLRenderBelowPath (SoGLRenderAction *action)β render below pathvirtual void GLRenderInPath (SoGLRenderAction *action)β render in pathvirtual void GLRenderOffPath (SoGLRenderAction *action)β render off pathvirtual void pick (SoPickAction *action)β pick, the classicvirtual void audioRender (SoAudioRenderAction *action)β audio render, sound on πvirtual void grabEventsSetup (void)β grab events, setup phasevirtual void grabEventsCleanup (void)β grab events, cleanup phasevirtual void startNotify (void)β start the notifyvirtual void notify (SoNotList *l)β notify, with the listuint32_t getNodeId (void) constβ node ID, as auint32_tvirtual void writeInstance (SoOutput *out)β write the instancevirtual SoFieldContainer * copyThroughConnection (void) constβ copy through connection, const-style
π Public Member Functions inherited from SoFieldContainer
void setToDefaults (void)β reset to defaults, clean slate β¨SbBool hasDefaultValues (void) constβ does it have default values? find outSbBool fieldsAreEqual (const SoFieldContainer *container) constβ compare fields with another containervoid copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE)β copy field values over,copyconnectionsdefaulting toFALSESbBool set (const char *const fielddata)β set from field datavoid get (SbString &fielddata)β get into anSbStringvirtual int getFields (SoFieldList &l) constβ get the fields into a listvirtual int getAllFields (SoFieldList &l) constβ get all the fields into a list, no skipping πvirtual SoField * getField (const SbName &name) constβ get one field by namevirtual SoField * getEventIn (const SbName &name) constβ get an event invirtual SoField * getEventOut (const SbName &name) constβ get an event outSbBool getFieldName (const SoField *const field, SbName &name) constβ field β name, reverse lookupSbBool enableNotify (const SbBool flag)β toggle notify with a flagSbBool isNotifyEnabled (void) constβ is notify on tho?SbBool set (const char *fielddata, SoInput *input)β set with field data and an inputvoid get (SbString &fielddata, SoOutput *out)β get with an outputvirtual SbBool validateNewFieldValue (SoField *field, void *newval)β validate that new field valueSbBool getIsBuiltIn (void) constβ is it built in?virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) constβ memory size of fields, split into managed and unmanagedvoid setUserData (void *userdata) constβ stash your user datavoid * getUserData (void) constβ retrieve your user data
π Public Member Functions inherited from SoBase
void ref (void) constβ ref it upvoid unref (void) constβ unref itvoid unrefNoDelete (void) constβ unref but don't delete, the sneaky oneint32_t getRefCount (void) constβ ref count, as anint32_tvoid touch (void)β touch it, wake it upSbBool isOfType (SoType type) constβ is it of this type?virtual SbName getName (void) constβ get the namevirtual void setName (const SbName &newname)β set a new namevoid addAuditor (void *const auditor, const SoNotRec::Type type)β add an auditorvoid removeAuditor (void *const auditor, const SoNotRec::Type type)β remove an auditorconst SoAuditorList & getAuditors (void) constβ get the auditors listSbBool shouldWrite (void)β should it write? the moment of truthvoid assertAlive (void) constβ assert that it's alive, dramatic but necessary π
π Static Public Member Functions
static SoType getClassTypeId (void)β class type ID, static and slayingstatic const SoNodekitCatalog * getClassNodekitCatalog (void)β the class-level catalogstatic void initClass (void)β init the class, do it
π Static Public Member Functions inherited from SoSeparatorKit
static SoType getClassTypeId (void)β same name, parent editionstatic const SoNodekitCatalog * getClassNodekitCatalog (void)β parent catalogstatic void initClass (void)β parent init
π Static Public Member Functions inherited from SoBaseKit
static SoType getClassTypeId (void)β type ID againstatic void initClass (void)β init againstatic const SoNodekitCatalog * getClassNodekitCatalog (void)β catalog againstatic SbBool isSearchingChildren (void)β is it searching children?static void setSearchingChildren (const SbBool newval)β set searching children to a new value
π Static Public Member Functions inherited from SoNode
static uint32_t getCompatibilityTypes (const SoType &nodetype)β compatibility types for a node typestatic SoType getClassTypeId (void)β type ID, obviouslystatic SoNode * getByName (const SbName &name)β look up a node by namestatic int getByName (const SbName &name, SoNodeList &l)β look up by name into aSoNodeListstatic void initClass (void)β initstatic void initClasses (void)β init all the classes, plural energystatic uint32_t getNextNodeId (void)β next node ID, as auint32_tstatic int getActionMethodIndex (const SoType type)β action method index for a typestatic void getBoundingBoxS (SoAction *action, SoNode *node)β the static bounding-box onestatic void GLRenderS (SoAction *action, SoNode *node)β the static GL render onestatic void callbackS (SoAction *action, SoNode *node)β the static callback onestatic void getMatrixS (SoAction *action, SoNode *node)β the static matrix onestatic void handleEventS (SoAction *action, SoNode *node)β the static handle-event onestatic void pickS (SoAction *action, SoNode *node)β the static pick onestatic void rayPickS (SoAction *action, SoNode *node)β the static ray-pick onestatic void searchS (SoAction *action, SoNode *node)β the static search onestatic void writeS (SoAction *action, SoNode *node)β the static write onestatic void audioRenderS (SoAction *action, SoNode *node)β the static audio-render onestatic void getPrimitiveCountS (SoAction *action, SoNode *node)β the static primitive-count one
π Static Public Member Functions inherited from SoFieldContainer
static void initClass (void)β init the classstatic SoType getClassTypeId (void)β class type IDstatic void cleanupClass (void)β cleanup the class, we love a tidy queen π§static void initCopyDict (void)β init the copy dictstatic void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)β add a copy: original and copystatic SoFieldContainer * checkCopy (const SoFieldContainer *orig)β check a copystatic SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)β find a copy, with the copy-connections flagstatic void copyDone (void)β copy done, wrap it up
π Static Public Member Functions inherited from SoBase
static void initClass (void)β initstatic SoType getClassTypeId (void)β type IDstatic void addName (SoBase *const base, const char *const name)β add a name to a basestatic void removeName (SoBase *const base, const char *const name)β remove a name from a basestatic void incrementCurrentWriteCounter (void)β increment the current write counterstatic void decrementCurrentWriteCounter (void)β decrement the current write counterstatic SoBase * getNamedBase (const SbName &name, SoType type)β get a named base of a typestatic int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)β get named bases into aSoBaseListstatic SbBool read (SoInput *input, SoBase *&base, SoType expectedtype)β read it in, with an expected typestatic void setInstancePrefix (const SbString &c)β set the instance prefixstatic void setTraceRefs (SbBool trace)β set trace refsstatic SbBool getTraceRefs (void)β get trace refsstatic SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)β connect a route from node/field to node/field, all those namesstatic SbBool readRoute (SoInput *input)β read a route
π Protected Member Functions
virtual const SoFieldData * getFieldData (void) constβ get the field data, protected and preciousvirtual ~SoShapeKit ()β the destructor, RIP bestie πvirtual void setDefaultOnNonWritingFields (void)β set the default on non-writing fields
π Protected Member Functions inherited from SoSeparatorKit
virtual ~SoSeparatorKit ()β parent destructorvirtual SbBool setUpConnections (SbBool onoff, SbBool doitalways=FALSE)β set up connections,doitalwaysdefaulting toFALSE
π Protected Member Functions inherited from SoBaseKit
virtual ~SoBaseKit ()β base destructorvirtual SoNode * addToCopyDict (void) constβ add to the copy dictvirtual void copyContents (const SoFieldContainer *fromfc, SbBool copyconnections)β copy the contents overSoGroup * getContainerNode (const SbName &listname, SbBool makeifneeded=TRUE)β get the container node,makeifneededdefaults toTRUEvirtual SoNode * getAnyPart (const SbName &partname, SbBool makeifneeded, SbBool leafcheck=FALSE, SbBool publiccheck=FALSE)β get any part, withleafcheckandpubliccheckboth defaulting toFALSEvirtual SoNodeKitPath * createPathToAnyPart (const SbName &partname, SbBool makeifneeded, SbBool leafcheck=FALSE, SbBool publiccheck=FALSE, const SoPath *pathtoextend=NULL)β create a path to any part, andpathtoextenddefaults toNULLvirtual SbBool setAnyPart (const SbName &partname, SoNode *from, SbBool anypart=TRUE)β set any part,anypartdefaults toTRUEvoid createNodekitPartsList (void)β create the nodekit parts listvoid createFieldList (void)β create the field listvirtual void createDefaultParts (void)β create the default partsconst SoNodekitParts * getNodekitPartsList (void) constβ get the nodekit parts listconst SbList< SoSFNode * > & getCatalogInstances (void) constβ get the catalog instancesvoid catalogError (void)β catalog error, uh oh πvirtual SbBool readInstance (SoInput *in, unsigned short flags)β read the instance, with flagsvoid countMyFields (SoOutput *out)β count my fieldsvirtual SbBool setPart (const int partNum, SoNode *node)β set a part by number
π Protected Member Functions inherited from SoNode
SoNode (void)β protected constructorvirtual ~SoNode ()β protected destructor
π Protected Member Functions inherited from SoFieldContainer
SoFieldContainer (void)β protected constructorvirtual ~SoFieldContainer ()β protected destructor
π Protected Member Functions inherited from SoBase
SoBase (void)β protected constructorvirtual ~SoBase ()β protected destructorvirtual void destroy (void)β destroy itSbBool hasMultipleWriteRefs (void) constβ does it have multiple write refs?SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constβ write the header, with is-group and is-engine flagsvoid writeFooter (SoOutput *out) constβ write the footervirtual const char * getFileFormatName (void) constβ get the file format name
π Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)β pointer to the field data pointer, yes reallystatic const SoNodekitCatalog ** getClassNodekitCatalogPtr (void)β pointer to the class catalog pointer
π Static Protected Member Functions inherited from SoSeparatorKit
static const SoFieldData ** getFieldDataPtr (void)β parent field data ptrstatic const SoNodekitCatalog ** getClassNodekitCatalogPtr (void)β parent catalog ptr
π Static Protected Member Functions inherited from SoBaseKit
static const SoFieldData ** getFieldDataPtr (void)β field data ptrstatic const SoNodekitCatalog ** getClassNodekitCatalogPtr (void)β catalog ptr
π Static Protected Member Functions inherited from SoNode
static const SoFieldData ** getFieldDataPtr (void)β field data ptrstatic void setNextActionMethodIndex (int index)β set the next action method indexstatic int getNextActionMethodIndex (void)β get the next action method indexstatic void incNextActionMethodIndex (void)β increment the next action method indexstatic void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)β set compatibility types with a bitmask
π Static Protected Member Functions inherited from SoBase
static uint32_t getCurrentWriteCounter (void)β get the current write counterstatic void staticDataLock (void)β lock the static data πstatic void staticDataUnlock (void)β unlock the static data π
part 1 done bestie, do not leave yet β there's more of this page coming and it's only gonna get better π¦
π‘οΈ Protected Attributes π‘οΈ
okay bestie, these are the protected attributes β they're like the backstage pass ποΈ. only subclasses and the class itself can touch them, but we're gonna list every single one because we don't gatekeep here π.
SoSFNode coordinate3SoSFNode coordinate4SoSFNode localTransformSoSFNode materialBindingSoSFNode normalSoSFNode normalBindingSoSFNode profileCoordinate2SoSFNode profileCoordinate3SoSFNode profileListSoSFNode shapeSoSFNode shapeHintsSoSFNode shapeSeparatorSoSFNode textureCoordinate2SoSFNode textureCoordinateBindingSoSFNode textureCoordinateFunction
β¨ Protected Attributes inherited from SoSeparatorKit β¨
these are the ones you get from the parent, no extra work required:
SoSFNode appearanceSoSFNode childListSoSFNode pickStyleSoSFNode texture2TransformSoSFNode topSeparatorSoSFNode transformSoSFNode units
π« Protected Attributes inherited from SoBaseKit π«
SoSFNode callbackListSoChildList * childrenSbBool connectionsSetUp
πΈ Protected Attributes inherited from SoNode πΈ
uint32_t uniqueId
π Protected Attributes inherited from SoFieldContainer π
SbBool isBuiltIn
π Additional Inherited Members π
π Public Types inherited from SoSeparatorKit
enum CacheEnabled { OFF, ON, AUTO }
β Public Types inherited from SoNode
enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000,
COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000 }
π
Public Attributes inherited from SoSeparatorKit
SoSFEnum renderCachingSoSFEnum boundingBoxCachingSoSFEnum renderCullingSoSFEnum pickCulling
π§ Protected Types inherited from SoBase
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
π Static Protected Attributes inherited from SoNode
static uint32_t nextUniqueId = 1static int nextActionMethodIndex = 0
π Detailed Description π
so SoShapeKit is literally the template queen π. it provides templates to insert what is usually needed for shape nodes. periodt.
here's the node kit structure β new entries versus the parent class are marked with an arrow prefix π:
CLASS SoShapeKit
-->"this"
"callbackList"
"topSeparator"
"pickStyle"
"appearance"
"units"
"transform"
"texture2Transform"
--> "materialBinding"
--> "normalBinding"
--> "textureCoordinateBinding"
--> "shapeHints"
--> "coordinate3"
--> "coordinate4"
--> "normal"
--> "textureCoordinate2"
--> "profileCoordinate2"
--> "profileCoordinate3"
--> "profileList"
"childList"
--> "textureCoordinateFunction"
--> "localTransform"
--> "shapeSeparator"
--> "shape"
(see SoBaseKit::printDiagram() for information about the output formatting.)
and here's the detailed tea β on the catalog parts:
CLASS SoShapeKit
PVT "this", SoShapeKit ---
"callbackList", SoNodeKitListPart [ SoCallback, SoEventCallback ]
PVT "topSeparator", SoSeparator ---
"pickStyle", SoPickStyle ---
"appearance", SoAppearanceKit ---
"units", SoUnits ---
"transform", SoTransform ---
"texture2Transform", SoTexture2Transform ---
"materialBinding", SoMaterialBinding ---
"normalBinding", SoNormalBinding ---
"textureCoordinateBinding", SoTextureCoordinateBinding ---
"shapeHints", SoShapeHints ---
"coordinate3", SoCoordinate3 ---
"coordinate4", SoCoordinate4 ---
"normal", SoNormal ---
"textureCoordinate2", SoTextureCoordinate2 ---
"profileCoordinate2", SoProfileCoordinate2 ---
"profileCoordinate3", SoProfileCoordinate3 ---
"profileList", SoNodeKitListPart [ SoProfile ]
"childList", SoNodeKitListPart [ SoShapeKit, SoSeparatorKit ]
"textureCoordinateFunction", SoTextureCoordinateFunction --- , (default type = SoTextureCoordinateDefault)
"localTransform", SoTransform ---
PVT "shapeSeparator", SoSeparator ---
"shape", SoShape --- , (default type = SoCube)
(see SoBaseKit::printTable() for information about the output formatting.)
π οΈ Constructor & Destructor Documentation π οΈ
SoShapeKit::SoShapeKit (void )
Constructor. bestie, this is how you birth a new SoShapeKit β¨.
SoShapeKit::~SoShapeKit () [protected], [virtual]
Destructor. and this is the cleanup crew π§Ή, protected and virtual.
π Member Function Documentation π
SoType SoShapeKit::getTypeId (void ) const [virtual]
so getTypeId() gives you the type identification of any object derived from a class that inherits SoBase. it's used for run-time type checking and for doing "downward" casts (iykyk). here's a usage example:
void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
}
and for all my application programmers out there who wanna extend the library with new nodes, engines, nodekits, draggers, or whatever: you need to override this method in all subclasses. it's usually part of setting up the full type system for extension classes, which you do with the pre-defined macros from Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes), and so on.
want more tea on writing Coin extensions? check the class documentation of the toplevel superclasses for the various class groups.
Reimplemented from SoSeparatorKit.
const SoFieldData * SoShapeKit::getFieldData (void ) const [protected], [virtual]
this one hands you a pointer to the class-wide field data storage object for this instance. if there are no fields, it returns NULL (rip).
Reimplemented from SoSeparatorKit.
const SoNodekitCatalog * SoShapeKit::getNodekitCatalog (void ) const [virtual]
returns the nodekit catalog that defines the layout of this class' kit. basically the blueprint πΊοΈ.
Reimplemented from SoSeparatorKit.
void SoShapeKit::setDefaultOnNonWritingFields (void ) [protected], [virtual]
(ngl, this method is probably not for you if you're just using the library and not writing custom nodekits or draggers. but if you are writing extensions, check the SoBaseKit class documentation for the full scoop.)
it's a virtual method, and the code inside should call SoField::setDefault() with argument TRUE on part fields that shouldn't be written when you export the scenegraph.
this is typically done when:
- field value is
NULLand part isNULLby default - it's a leaf
SoGrouporSoSeparatornode with no children - it's a leaf listpart with no children and an
SoGrouporSoSeparatorcontainer - it's a non-leaf part and it's of
SoGrouptype and all fields are at their default values
subclasses should usually override this to do extra settings for new member fields. and from the subclass, don't forget to call "upwards" to your superclass' setDefaultOnNonWritingFields() method. π
Reimplemented from SoSeparatorKit.
π Author π
Generated automatically by Doxygen for Coin from the source code. no cap, it's a robot's work but we made it cute π.
and that's the whole vibe! this was Coin Version 3.1.3, and the page is SoShapeKit(3). slay, bestie, go forth and build shapes β¨π¦
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms