SoSphere(3)

๐Ÿ“ฆ
version 4.0.10 ยท 4 versions
, in fedora 43, fedora 44

๐ŸŽ€ SoSphere(3) โ€” the Coin manual, bestie edition ๐ŸŽ€

okay so you opened the SoSphere page and it's giving long. Deep breath. We're doing this together. Also hi, this is from the Coin manual, and heads up: this page is so big it comes in two parts, so buckle up. ๐Ÿ’–


โœจ NAME โœจ

SoSphere โ€” the class that renders sphere shapes. That's it. That's the whole vibe. A ball. Iconic, lowkey. ๐Ÿ”ฎ


๐Ÿ“œ SYNOPSIS ๐Ÿ“œ

First things first, you gotta pull the header in, like so:

#include <Inventor/nodes/SoSphere.h>

And it Inherits SoShape. So everything SoShape can do, SoSphere can do too. Family line, no cap. ๐Ÿซถ


๐Ÿ‘‘ Public Member Functions ๐Ÿ‘‘

These are the ones that are hers, the main character moves:

  • virtual SoType getTypeId (void) const โ€” tells you what type she is. ๐Ÿ’…
  • SoSphere (void) โ€” the constructor. She's born. โœจ
  • virtual void GLRender (SoGLRenderAction *action) โ€” handles the actual GL rendering, i.e. the part where the sphere shows up on your screen. ๐Ÿ”ฅ
  • virtual void rayPick (SoRayPickAction *action) โ€” ray picking, for when you wanna click on the sphere and have it notice you. ๐ŸŽฏ
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action) โ€” reports how many primitives it's working with. ๐Ÿ“Š

๐ŸŒธ Public Member Functions inherited from SoShape ๐ŸŒธ

These are the hand-me-downs, and honestly they ate:

  • virtual SbBool affectsState (void) const โ€” does this thing mess with the state? ๐ŸŒˆ
  • virtual void notify (SoNotList *nl) โ€” the notification pipeline. ๐Ÿ“ข
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action) โ€” grabs the bounding box. ๐Ÿ“ฆ
  • virtual void callback (SoCallbackAction *action) โ€” the callback action hookup. ๐ŸŽ€
  • const SoBoundingBoxCache * getBoundingBoxCache (void) const โ€” returns the cached bounding box. ๐Ÿ’พ

๐Ÿฆ‹ Public Member Functions inherited from SoNode ๐Ÿฆ‹

The whole node squad. All of these are yours too:

  • void setOverride (const SbBool state) โ€” flip the override state on or off. ๐ŸŽš๏ธ
  • SbBool isOverride (void) const โ€” are we overriding? asking for a friend. ๐Ÿ™ˆ
  • void setNodeType (const NodeType type) โ€” set the node type. ๐Ÿท๏ธ
  • NodeType getNodeType (void) const โ€” get the node type. ๐Ÿ”
  • virtual SoNode * copy (SbBool copyconnections=FALSE) const โ€” make a copy, and by default copyconnections=FALSE. ๐Ÿ“‹
  • virtual void doAction (SoAction *action) โ€” run an action on it. โšก
  • virtual void GLRenderBelowPath (SoGLRenderAction *action) โ€” GL render, below-path flavor. ๐ŸŒŠ
  • virtual void GLRenderInPath (SoGLRenderAction *action) โ€” GL render, in-path flavor. ๐Ÿ›ค๏ธ
  • virtual void GLRenderOffPath (SoGLRenderAction *action) โ€” GL render, off-path flavor. ๐Ÿš€
  • virtual void getMatrix (SoGetMatrixAction *action) โ€” matrix time. ๐Ÿงฎ
  • virtual void handleEvent (SoHandleEventAction *action) โ€” handles events. ๐Ÿ–ฑ๏ธ
  • virtual void pick (SoPickAction *action) โ€” pick action. ๐Ÿ‘†
  • virtual void search (SoSearchAction *action) โ€” search action. ๐Ÿ”Ž
  • virtual void write (SoWriteAction *action) โ€” write action. โœ๏ธ
  • virtual void audioRender (SoAudioRenderAction *action) โ€” audio render, yes really. ๐Ÿ”Š
  • virtual void grabEventsSetup (void) โ€” set up event grabbing. ๐Ÿซณ
  • virtual void grabEventsCleanup (void) โ€” clean up after grabbing events. ๐Ÿงน
  • virtual void startNotify (void) โ€” kick off the notification. ๐Ÿ“ฃ
  • SbUniqueId getNodeId (void) const โ€” this node's unique id. ๐Ÿ†”
  • virtual SoChildList * getChildren (void) const โ€” get the children list. ๐Ÿ‘ถ
  • virtual void writeInstance (SoOutput *out) โ€” write out this instance. ๐Ÿ“
  • virtual SoNode * addToCopyDict (void) const โ€” toss it in the copy dictionary. ๐Ÿ—‚๏ธ
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections) โ€” copy the contents over. ๐Ÿ“ฅ
  • virtual SoFieldContainer * copyThroughConnection (void) const โ€” copy through a connection. ๐Ÿ”—

๐Ÿ’œ Public Member Functions inherited from SoFieldContainer ๐Ÿ’œ

Field container behavior, all inherited, all available:

  • void setToDefaults (void) โ€” reset everything to defaults. ๐Ÿ”„
  • SbBool hasDefaultValues (void) const โ€” are all the values still default? ๐Ÿค”
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const โ€” compare fields with another container. โš–๏ธ
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE) โ€” copy field values over, copyconnections=FALSE by default. ๐Ÿ“Ž
  • SbBool set (const char *const fielddata) โ€” set from field data. ๐ŸŽฏ
  • void get (SbString &fielddata) โ€” get the field data out. ๐Ÿ“ค
  • virtual int getFields (SoFieldList &l) const โ€” grab the fields. ๐Ÿงบ
  • virtual int getAllFields (SoFieldList &l) const โ€” grab all the fields. ๐Ÿงบ๐Ÿงบ
  • virtual SoField * getField (const SbName &name) const โ€” get one field by name. ๐Ÿ”–
  • virtual SoField * getEventIn (const SbName &name) const โ€” get an event-in by name. ๐Ÿ“จ
  • virtual SoField * getEventOut (const SbName &name) const โ€” get an event-out by name. ๐Ÿ“ฎ
  • SbBool getFieldName (const SoField *const field, SbName &name) const โ€” get the name of a given field. ๐Ÿท๏ธ
  • SbBool enableNotify (const SbBool flag) โ€” turn notifications on or off. ๐Ÿ””
  • SbBool isNotifyEnabled (void) const โ€” is notification on? ๐Ÿ›Ž๏ธ
  • SbBool set (const char *fielddata, SoInput *input) โ€” set from field data using an SoInput. โŒจ๏ธ
  • void get (SbString &fielddata, SoOutput *out) โ€” get the field data into an SoOutput. ๐Ÿ–จ๏ธ
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval) โ€” check a new value before it lands. โœ…
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE) โ€” add a write reference, isfromfield=FALSE by default. ๐Ÿงพ
  • SbBool getIsBuiltIn (void) const โ€” is it built in? ๐Ÿ›๏ธ
  • virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) const โ€” reports memory size for fields, split into managed and unmanaged. ๐Ÿง 
  • void setUserData (void *userdata) const โ€” stash your own user data. ๐ŸŽ’
  • void * getUserData (void) const โ€” get your user data back out. ๐ŸŽ’โžก๏ธ

๐ŸŒˆ Public Member Functions inherited from SoBase ๐ŸŒˆ

The root of it all, fr fr:

  • void ref (void) const โ€” bump the reference count. โฌ†๏ธ
  • void unref (void) const โ€” drop the reference count. โฌ‡๏ธ
  • void unrefNoDelete (void) const โ€” drop the count but do not delete. ๐Ÿšซ๐Ÿ—‘๏ธ
  • int32_t getRefCount (void) const โ€” what's the ref count at? ๐Ÿ”ข
  • void touch (void) โ€” touch it, so it knows it changed. ๐Ÿ‘‰
  • SbBool isOfType (SoType type) const โ€” Returns TRUE if the type of this object is either of the same type or inherited from type. โœ…
  • virtual SbName getName (void) const โ€” get the name. ๐Ÿ“›
  • virtual void setName (const SbName &newname) โ€” set the name. โœ๏ธ
  • void addAuditor (void *const auditor, const SoNotRec::Type type) โ€” add an auditor of the given SoNotRec::Type. ๐Ÿ‘€
  • void removeAuditor (void *const auditor, const SoNotRec::Type type) โ€” remove that auditor. ๐Ÿšช
  • const SoAuditorList & getAuditors (void) const โ€” get the whole auditor list. ๐Ÿ“ƒ
  • SbBool shouldWrite (void) โ€” should this be written out? ๐Ÿคท
  • void assertAlive (void) const โ€” assert that it's still alive. ๐Ÿ’€โžก๏ธ๐Ÿ’–

โญ Static Public Member Functions โญ

The static ones that belong to SoSphere itself:

  • static SoType getClassTypeId (void) โ€” the class's SoType. ๐Ÿชช
  • static void initClass (void) โ€” initialize the class. ๐Ÿš€

๐Ÿ“ Static Public Member Functions inherited from SoShape ๐Ÿ“

  • static SoType getClassTypeId (void) โ€” the SoType for SoShape. ๐Ÿชช
  • static void initClass (void) โ€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. ๐Ÿงฌ
  • static void getScreenSize (SoState *const state, const SbBox3f &boundingbox, SbVec2s &rectsize) โ€” computes the screen size from a bounding box. ๐Ÿ–ฅ๏ธ
  • static float getDecimatedComplexity (SoState *state, float complexity) โ€” returns the decimated complexity as a float. ๐Ÿ“‰
  • static SoType getClassTypeId (void) โ€” (yes, it's listed again in the source, and we keep it, because every single detail stays, periodt). ๐Ÿ’ฏ

๐Ÿงš Static Public Member Functions inherited from SoNode ๐Ÿงš

  • static uint32_t getCompatibilityTypes (const SoType &nodetype) โ€” compatibility types for a node type. ๐Ÿค
  • static SoType getClassTypeId (void) โ€” the SoType for SoNode. ๐Ÿชช
  • static SoNode * getByName (const SbName &name) โ€” look up a node by name. ๐Ÿ”
  • static int getByName (const SbName &name, SoNodeList &l) โ€” look up by name, collect into an SoNodeList. ๐Ÿ—ƒ๏ธ
  • static void initClass (void) โ€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. ๐Ÿงฌ
  • static void initClasses (void) โ€” plural. initializes the classes. ๐Ÿงฌ๐Ÿงฌ
  • static SbUniqueId getNextNodeId (void) โ€” the next node id in line. ๐Ÿ”ข
  • static int getActionMethodIndex (const SoType type) โ€” action method index for a type. ๐Ÿ—บ๏ธ
  • static void getBoundingBoxS (SoAction *action, SoNode *node) โ€” the static bounding box handler. ๐Ÿ“ฆ
  • static void GLRenderS (SoAction *action, SoNode *node) โ€” the static GL render handler. ๐Ÿ–Œ๏ธ
  • static void callbackS (SoAction *action, SoNode *node) โ€” the static callback handler. ๐Ÿ“ž
  • static void getMatrixS (SoAction *action, SoNode *node) โ€” the static matrix handler. ๐Ÿงฎ
  • static void handleEventS (SoAction *action, SoNode *node) โ€” the static event handler. ๐Ÿ–ฑ๏ธ
  • static void pickS (SoAction *action, SoNode *node) โ€” the static pick handler. ๐Ÿ‘†
  • static void rayPickS (SoAction *action, SoNode *node) โ€” the static ray pick handler. ๐ŸŽฏ
  • static void searchS (SoAction *action, SoNode *node) โ€” the static search handler. ๐Ÿ”Ž
  • static void writeS (SoAction *action, SoNode *node) โ€” the static write handler. โœ๏ธ
  • static void audioRenderS (SoAction *action, SoNode *node) โ€” the static audio render handler. ๐Ÿ”Š
  • static void getPrimitiveCountS (SoAction *action, SoNode *node) โ€” the static primitive count handler. ๐Ÿ“Š

๐Ÿ’– Static Public Member Functions inherited from SoFieldContainer ๐Ÿ’–

  • static void initClass (void) โ€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. ๐Ÿงฌ
  • static SoType getClassTypeId (void) โ€” This static method returns the SoType object associated with objects of this class. ๐Ÿชช
  • static void cleanupClass (void) โ€” clean up the class. ๐Ÿงผ
  • static void initCopyDict (void) โ€” set up the copy dictionary. ๐Ÿ—‚๏ธ
  • static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy) โ€” register an original/copy pair. ๐Ÿ“‘
  • static SoFieldContainer * checkCopy (const SoFieldContainer *orig) โ€” check the copy for an original. ๐Ÿ”Ž
  • static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections) โ€” find a copy, with the copyconnections flag. ๐Ÿ”
  • static void copyDone (void) โ€” copying is done, wrap it up. ๐Ÿ

๐ŸŽ€ Static Public Member Functions inherited from SoBase ๐ŸŽ€

  • static void initClass (void) โ€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. ๐Ÿงฌ
  • static SoType getClassTypeId (void) โ€” This static method returns the SoType object associated with objects of this class. ๐Ÿชช
  • static void addName (SoBase *const base, const char *const name) โ€” give a base a name. ๐Ÿท๏ธ
  • static void removeName (SoBase *const base, const char *const name) โ€” take that name away. ๐Ÿงฝ
  • static void incrementCurrentWriteCounter (void) โ€” bump the write counter. โฌ†๏ธ
  • static void decrementCurrentWriteCounter (void) โ€” drop the write counter. โฌ‡๏ธ
  • static SoBase * getNamedBase (const SbName &name, SoType type) โ€” find a named base of a type. ๐Ÿ”
  • static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type) โ€” find named bases into an SoBaseList. ๐Ÿ—ƒ๏ธ
  • static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype) โ€” read a base from input. ๐Ÿ“–
  • static void setInstancePrefix (const SbString &c) โ€” set the instance prefix string. ๐Ÿ”ค
  • static void setTraceRefs (SbBool trace) โ€” turn ref tracing on or off. ๐Ÿ•ต๏ธ
  • static SbBool getTraceRefs (void) โ€” is ref tracing on? ๐Ÿ•ต๏ธโ€โ™€๏ธ
  • static SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname) โ€” wire up a route from one node/field to another. ๐Ÿ”Œ
  • static SbBool readRoute (SoInput *input) โ€” read a route from input. ๐Ÿ“–๐Ÿ”Œ

๐Ÿ‘‘ Public Attributes ๐Ÿ‘‘

One (1) public attribute and she is carrying the whole shape on her back:

  • SoSFFloat radius โ€” the radius, as an SoSFFloat. ๐Ÿ“

๐Ÿ™ˆ Protected Member Functions ๐Ÿ™ˆ

The behind-the-scenes girlies. You don't call these directly, but they're doing the work:

  • virtual const SoFieldData * getFieldData (void) const โ€” returns the field data. ๐Ÿ—„๏ธ
  • virtual ~SoSphere () โ€” the destructor. ๐Ÿ˜ญ
  • virtual void generatePrimitives (SoAction *action) โ€” generates the primitives. ๐Ÿงฑ
  • virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center) โ€” computes the bounding box and center. ๐Ÿ“ฆ๐Ÿ“

๐ŸŒธ Protected Member Functions inherited from SoShape ๐ŸŒธ

  • SoShape (void) โ€” constructor. โœจ
  • virtual ~SoShape () โ€” destructor. ๐Ÿ˜ญ
  • float getComplexityValue (SoAction *action) โ€” the complexity value, as a float. ๐Ÿ“ˆ
  • virtual SbBool shouldGLRender (SoGLRenderAction *action) โ€” should this actually GL render? ๐Ÿค”
  • void beginSolidShape (SoGLRenderAction *action) โ€” begin a solid shape. ๐ŸŸฃ
  • void endSolidShape (SoGLRenderAction *action) โ€” end a solid shape. ๐Ÿ”š
  • void GLRenderBoundingBox (SoGLRenderAction *action) โ€” GL render the bounding box. ๐Ÿ“ฆ
  • SbBool shouldPrimitiveCount (SoGetPrimitiveCountAction *action) โ€” should it count primitives? ๐Ÿ”ข
  • SbBool shouldRayPick (SoRayPickAction *const action) โ€” should it ray pick? ๐ŸŽฏ
  • void computeObjectSpaceRay (SoRayPickAction *const action) โ€” compute the ray in object space. ๐Ÿ“
  • void computeObjectSpaceRay (SoRayPickAction *const action, const SbMatrix &matrix) โ€” same thing, but with a matrix. ๐Ÿ“๐Ÿงฎ
  • virtual SoDetail * createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp) โ€” makes the detail for a picked triangle. ๐Ÿ”บ
  • virtual SoDetail * createLineSegmentDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, SoPickedPoint *pp) โ€” makes the detail for a picked line segment. โž–
  • virtual SoDetail * createPointDetail (SoRayPickAction *action, const SoPrimitiveVertex *v, SoPickedPoint *pp) โ€” makes the detail for a picked point. โšซ
  • void invokeTriangleCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2, const SoPrimitiveVertex *const v3) โ€” fire off the triangle callbacks. ๐Ÿ”บ๐Ÿ“ฃ
  • void invokeLineSegmentCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2) โ€” fire off the line segment callbacks. โž–๐Ÿ“ฃ
  • void invokePointCallbacks (SoAction *const action, const SoPrimitiveVertex *const v) โ€” fire off the point callbacks. โšซ๐Ÿ“ฃ
  • void beginShape (SoAction *const action, const TriangleShape shapetype, SoDetail *const detail=NULL) โ€” begin a shape; detail defaults to NULL. ๐ŸŸข
  • void shapeVertex (const SoPrimitiveVertex *const v) โ€” feed in a shape vertex. ๐Ÿ”ท
  • void endShape (void) โ€” end the shape. ๐Ÿ”ด
  • void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoMultiTextureCoordinateElement *const tce, const float s, const float t, const SbVec3f &normal) โ€” generate a vertex with s, t and a normal. โœจ
  • void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoMultiTextureCoordinateElement *const tce, const float s, const float t, const float r, const SbVec3f &normal) โ€” the other overload: s, t, r, and a normal. โœจโœจ
  • SbBool startVertexArray (SoGLRenderAction *action, const SoCoordinateElement *coords, const SbVec3f *pervertexnormals, const SbBool texpervertex, const SbBool colorpervertex) โ€” start the vertex array. ๐ŸŸฉ
  • void finishVertexArray (SoGLRenderAction *action, const SbBool vbo, const SbBool normpervertex, const SbBool texpervertex, const SbBool colorpervertex) โ€” finish the vertex array. ๐Ÿ

๐Ÿงš Protected Member Functions inherited from SoNode ๐Ÿงš

  • SoNode (void) โ€” constructor. โœจ
  • virtual ~SoNode () โ€” destructor. ๐Ÿ˜ญ
  • virtual SbBool readInstance (SoInput *in, unsigned short flags) โ€” read an instance from input, with flags. ๐Ÿ“–

๐Ÿ’œ Protected Member Functions inherited from SoFieldContainer ๐Ÿ’œ

  • SoFieldContainer (void) โ€” constructor. โœจ
  • virtual ~SoFieldContainer () โ€” destructor. ๐Ÿ˜ญ

and bestie, that is genuinely only part one of this page ๐Ÿ’…

๐Ÿซถ Protected Member Functions inherited from SoBase ๐Ÿซถ

these are the freebies, bestie โ€” inherited straight from SoBase, zero extra lore attached:

  • SoBase (void) โ€” the constructor, gifted to you ๐Ÿ’…
  • virtual ~SoBase () โ€” the destructor, also gifted
  • virtual void destroy (void) โ€” no description in the docs, just vibes โœจ
  • SbBool hasMultipleWriteRefs (void) const โ€” signature only, no tea
  • SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const โ€” yep, that's the whole signature
  • void writeFooter (SoOutput *out) const โ€” again, just the signature
  • virtual const char * getFileFormatName (void) const โ€” no blurb given
  • virtual SoNotRec createNotRec (void) โ€” same, no blurb

โœจ Static Protected Member Functions โœจ

  • static const SoFieldData ** getFieldDataPtr (void) โ€” the class's own one, no description provided

๐ŸŒธ Static Protected Member Functions inherited from SoShape ๐ŸŒธ

  • static const SoFieldData ** getFieldDataPtr (void) โ€” same name, different ancestor, still no description

๐Ÿฆ‹ Static Protected Member Functions inherited from SoNode ๐Ÿฆ‹

  • static const SoFieldData ** getFieldDataPtr (void) โ€” yes, another one, the docs stay silent
  • static void setNextActionMethodIndex (int index) โ€” no description given
  • static int getNextActionMethodIndex (void) โ€” no description given
  • static void incNextActionMethodIndex (void) โ€” no description given
  • static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask) โ€” no description given

๐Ÿ’œ Static Protected Member Functions inherited from SoBase ๐Ÿ’œ

  • static uint32_t getCurrentWriteCounter (void) โ€” no description given
  • static void staticDataLock (void) โ€” no description given
  • static void staticDataUnlock (void) โ€” no description given

๐ŸŒˆ Additional Inherited Members ๐ŸŒˆ

๐ŸŽ€ Public Types inherited from SoShape ๐ŸŽ€

enum TriangleShape { TRIANGLE_STRIP, TRIANGLE_FAN, TRIANGLES, POLYGON,
    QUADS, QUAD_STRIP, POINTS, LINES, LINE_STRIP }

๐ŸŽ€ 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, COIN_4_0 = 0x20000 }

๐ŸŽ€ Protected Types inherited from SoBase ๐ŸŽ€

  • enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }

๐ŸŽ€ Protected Attributes inherited from SoNode ๐ŸŽ€

  • SbUniqueId uniqueId

๐ŸŽ€ Protected Attributes inherited from SoFieldContainer ๐ŸŽ€

  • SbBool isBuiltIn

๐ŸŽ€ Static Protected Attributes inherited from SoNode ๐ŸŽ€

  • static SbUniqueId nextUniqueId = 1
  • static int nextActionMethodIndex = 0

๐Ÿ’– Detailed Description ๐Ÿ’–

so like, SoSphere is the class for rendering sphere shapes. that's the whole job, and it does it gorgeously ๐Ÿซถ

it renders a sphere with the size given by the SoSphere::radius field. and it's rendered with the current material, texture and draw style settings โ€” if any exist, that is; otherwise the default settings get used instead โœจ

the SoSphere node class exists as a convenient abstraction so you, the application programmer, can use "complex" shapes of this type without having to do the tessellation to polygons and other low level programming herself. periodt, that's the gift ๐ŸŽ

๐Ÿ’ก a good trick for rendering ellipsoidal 3D shapes: use an SoSphere prefixed with an SoScale transformation to "flatten" it along one or more of the principal axes. (I.e., use for instance an SoScale node with SoScale::scaleFactor equal to [1, 1, 0.1] to flatten it along the Z direction.) slay ๐Ÿฆ‹

a sphere gets visualized by the underlying rendering system by first tessellating the conceptual sphere into a set of polygons. to control the trade-off between an as much as possible correct visual appearance of the sphere versus fast rendering, use an SoComplexity node to influence the number of polygons generated from the tessellation process. (the higher the complexity value, the more polygons will be generated, the more rounded the sphere will look.) so set the SoComplexity::value field to whatever you believe would be a good trade-off between correctness and speed for your particular application ๐Ÿ‘‘

FILE FORMAT/DEFAULTS:

Sphere {
    radius 1
}

๐Ÿ‘€ See also ๐Ÿ‘€

  • SoCone
  • SoCylinder
  • SoCube

๐ŸŽ€ Constructor & Destructor Documentation ๐ŸŽ€

โญ SoSphere::SoSphere (void )

Constructor. that's it, that's the note ๐Ÿ’…

โญ SoSphere::~SoSphere () [protected], [virtual]

Destructor. also that's the whole note ๐Ÿซถ


๐Ÿ”ฅ Member Function Documentation ๐Ÿ”ฅ

โญ SoType SoSphere::getClassTypeId (void ) [static]

This static method returns the SoType object associated with objects of this class.

โญ SoType SoSphere::getTypeId (void ) const [virtual]

Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and "downward" casting.

Reimplemented from SoShape.

โญ const SoFieldData ** SoSphere::getFieldDataPtr (void ) [static], [protected]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.

Returns the SoFieldData class which holds information about fields in this node.

โญ const SoFieldData * SoSphere::getFieldData (void ) const [protected], [virtual]

Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoShape.

โญ void SoSphere::initClass (void ) [static]

no description in the docs for this one, bestie โ€” the signature is the whole story ๐Ÿ™ˆ

โญ void SoSphere::GLRender (SoGLRenderAction * action) [virtual]

Action method for the SoGLRenderAction.

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.

Reimplemented from SoShape.

โญ void SoSphere::rayPick (SoRayPickAction * action) [virtual]

Calculates picked point based on primitives generated by subclasses.

Reimplemented from SoShape.

โญ void SoSphere::getPrimitiveCount (SoGetPrimitiveCountAction * action) [virtual]

Action method for the SoGetPrimitiveCountAction.

Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action.

Nodes influencing how geometry nodes calculate their primitive count also override this method to change the relevant state variables.

Reimplemented from SoShape.

โญ void SoSphere::generatePrimitives (SoAction * action) [protected], [virtual]

The method implements action behavior for shape nodes for SoCallbackAction. It is invoked from SoShape::callback(). (Subclasses should not override SoNode::callback().)

The subclass implementations uses the convenience methods SoShape::beginShape(), SoShape::shapeVertex(), and SoShape::endShape(), with SoDetail instances, to pass the primitives making up the shape back to the caller.

Implements SoShape.

โญ void SoSphere::computeBBox (SoAction * action, SbBox3f & box, SbVec3f & center) [protected], [virtual]

Implemented by SoShape subclasses to let the SoShape superclass know the exact size and weighted center point of the shape's bounding box.

The bounding box and center point should be calculated and returned in the local coordinate system.

The method implements action behavior for shape nodes for SoGetBoundingBoxAction. It is invoked from SoShape::getBoundingBox(). (Subclasses should not override SoNode::getBoundingBox().)

The box parameter sent in is guaranteed to be an empty box, while center is undefined upon function entry. ๐Ÿ’€

Implements SoShape.


๐Ÿ“ Member Data Documentation ๐Ÿ“

โญ SoSFFloat SoSphere::radius

Radius of sphere. Default value is 1.0.


๐Ÿ‘‘ Author ๐Ÿ‘‘

Generated automatically by Doxygen for Coin from the source code.


and that's the whole page, bestie ๐Ÿซถ version 4.0.10, dated Thu Jun 25 2026 00:00:00, and you're reading SoSphere(3) โœจ mwah ๐Ÿ’–

๐Ÿ“ฆ where this page comes from