SoIndexedShape(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸ’– SoIndexedShape(3) πŸ’–

okay bestie, this is the manual page for SoIndexedShape(3) from the Library Functions Manual, and it's giving main character energy for indexed vertex shapes. no cap.


🌸 NAME 🌸

SoIndexedShape β€” the superclass for all indexed vertex shapes. it's the blueprint, the mother, the moment. every indexed vertex shape is lowkey in its family tree. periodt. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoIndexedShape.h>

Inherits SoVertexShape.

Inherited by SoIndexedFaceSet, SoIndexedLineSet, and SoIndexedTriangleStripSet. so iconic, honestly. πŸ¦‹

🌈 Public Member Functions

  • virtual SoType getTypeId (void) const

πŸŽ€ Public Member Functions inherited from SoVertexShape

  • virtual void notify (SoNotList *nl)
  • virtual SbBool generateDefaultNormals (SoState *state, SoNormalBundle *bundle)
  • virtual SbBool generateDefaultNormals (SoState *state, SoNormalCache *cache)
  • virtual void write (SoWriteAction *action)

πŸ’œ Public Member Functions inherited from SoShape

  • virtual SbBool affectsState (void) const
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action)
  • virtual void GLRender (SoGLRenderAction *action)
  • virtual void rayPick (SoRayPickAction *action)
  • virtual void callback (SoCallbackAction *action)
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
  • const SoBoundingBoxCache * getBoundingBoxCache (void) const

🌸 Public Member Functions inherited from SoNode

  • void setOverride (const SbBool state)
  • SbBool isOverride (void) const
  • void setNodeType (const NodeType type)
  • NodeType getNodeType (void) const
  • virtual SoNode * copy (SbBool copyconnections=0) const
  • virtual void doAction (SoAction *action)
  • virtual void GLRenderBelowPath (SoGLRenderAction *action)
  • virtual void GLRenderInPath (SoGLRenderAction *action)
  • virtual void GLRenderOffPath (SoGLRenderAction *action)
  • virtual void getMatrix (SoGetMatrixAction *action)
  • virtual void handleEvent (SoHandleEventAction *action)
  • virtual void pick (SoPickAction *action)
  • virtual void search (SoSearchAction *action)
  • virtual void audioRender (SoAudioRenderAction *action)
  • virtual void grabEventsSetup (void)
  • virtual void grabEventsCleanup (void)
  • virtual void startNotify (void)
  • uint32_t getNodeId (void) const
  • virtual SoChildList * getChildren (void) const
  • virtual void writeInstance (SoOutput *out)
  • virtual SoNode * addToCopyDict (void) const
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)
  • virtual SoFieldContainer * copyThroughConnection (void) const

🫢 Public Member Functions inherited from SoFieldContainer

  • void setToDefaults (void)
  • SbBool hasDefaultValues (void) const
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)
  • SbBool set (const char *const fielddata)
  • void get (SbString &fielddata)
  • virtual int getFields (SoFieldList &l) const
  • virtual int getAllFields (SoFieldList &l) const
  • virtual SoField * getField (const SbName &name) const
  • virtual SoField * getEventIn (const SbName &name) const
  • virtual SoField * getEventOut (const SbName &name) const
  • SbBool getFieldName (const SoField *const field, SbName &name) const
  • SbBool enableNotify (const SbBool flag)
  • SbBool isNotifyEnabled (void) const
  • SbBool set (const char *fielddata, SoInput *in)
  • void get (SbString &fielddata, SoOutput *out)
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval)
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)
  • SbBool getIsBuiltIn (void) const
  • void setUserData (void *userdata) const
  • void * getUserData (void) const

πŸ‘‘ Public Member Functions inherited from SoBase

  • void ref (void) const
  • void unref (void) const
  • void unrefNoDelete (void) const
  • int32_t getRefCount (void) const
  • void touch (void)
  • SbBool isOfType (SoType type) const
  • virtual SbName getName (void) const
  • virtual void setName (const SbName &newname)
  • void addAuditor (void *const auditor, const SoNotRec::Type type)
  • void removeAuditor (void *const auditor, const SoNotRec::Type type)
  • const SoAuditorList & getAuditors (void) const
  • SbBool shouldWrite (void)
  • void assertAlive (void) const

🌟 Static Public Member Functions

  • static SoType getClassTypeId (void)
  • static void initClass (void)

✨ Static Public Member Functions inherited from SoVertexShape

  • static SoType getClassTypeId (void)
  • static void initClass (void)

🌸 Static Public Member Functions inherited from SoShape

  • static SoType getClassTypeId (void)
  • static void initClass (void)
  • static void getScreenSize (SoState *const state, const SbBox3f &boundingbox, SbVec2s &rectsize)
  • static float getDecimatedComplexity (SoState *state, float complexity)

πŸ¦‹ Static Public Member Functions inherited from SoNode

  • static uint32_t getCompatibilityTypes (const SoType &nodetype)
  • static SoType getClassTypeId (void)
  • static SoNode * getByName (const SbName &name)
  • static int getByName (const SbName &name, SoNodeList &l)
  • static void initClass (void)
  • static void initClasses (void)
  • static uint32_t getNextNodeId (void)
  • static int getActionMethodIndex (const SoType type)
  • static void getBoundingBoxS (SoAction *action, SoNode *node)
  • static void GLRenderS (SoAction *action, SoNode *node)
  • static void callbackS (SoAction *action, SoNode *node)
  • static void getMatrixS (SoAction *action, SoNode *node)
  • static void handleEventS (SoAction *action, SoNode *node)
  • static void pickS (SoAction *action, SoNode *node)
  • static void rayPickS (SoAction *action, SoNode *node)
  • static void searchS (SoAction *action, SoNode *node)
  • static void writeS (SoAction *action, SoNode *node)
  • static void audioRenderS (SoAction *action, SoNode *node)
  • static void getPrimitiveCountS (SoAction *action, SoNode *node)

πŸŽ€ Static Public Member Functions inherited from SoFieldContainer

  • static void initClass (void)
  • static SoType getClassTypeId (void)
  • static void initCopyDict (void)
  • static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)
  • static SoFieldContainer * checkCopy (const SoFieldContainer *orig)
  • static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)
  • static void copyDone (void)

πŸ’œ Static Public Member Functions inherited from SoBase

  • static void initClass (void)
  • static SoType getClassTypeId (void)
  • static void addName (SoBase *const base, const char *const name)
  • static void removeName (SoBase *const base, const char *const name)
  • static void incrementCurrentWriteCounter (void)
  • static void decrementCurrentWriteCounter (void)
  • static SoBase * getNamedBase (const SbName &name, SoType type)
  • static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)
  • static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)
  • static void setInstancePrefix (const SbString &c)
  • static void setTraceRefs (SbBool trace)
  • static SbBool getTraceRefs (void)
  • static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)
  • static SbBool readRoute (SoInput *in)

πŸ“ Public Attributes

  • SoMFInt32 coordIndex
  • SoMFInt32 materialIndex
  • SoMFInt32 normalIndex
  • SoMFInt32 textureCoordIndex

🌈 Public Attributes inherited from SoVertexShape

  • SoSFNode vertexProperty

πŸ’… Protected Member Functions

  • virtual const SoFieldData * getFieldData (void) const
  • SoIndexedShape (void)
  • virtual ~SoIndexedShape ()
  • virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
  • int getNumVerts (const int startCoord)
  • void setupIndices (const int numParts, const int numFaces, const SbBool needNormals, const SbBool needTexCoords)
  • const int32_t * getNormalIndices (void)
  • const int32_t * getColorIndices (void)
  • const int32_t * getTexCoordIndices (void)
  • SbBool getVertexData (SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const int32_t *&cindices, const int32_t *&nindices, const int32_t *&tindices, const int32_t *&mindices, int &numcindices, const SbBool needNormals, SbBool &normalCacheUsed)

✨ Protected Member Functions inherited from SoVertexShape

  • SoVertexShape (void)
  • virtual ~SoVertexShape ()
  • virtual SbBool shouldGLRender (SoGLRenderAction *action)
  • void setNormalCache (SoState *const state, const int num, const SbVec3f *normals)
  • SoNormalCache * getNormalCache (void) const
  • SoNormalCache * generateAndReadLockNormalCache (SoState *const state)
  • void getVertexData (SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const SbBool neednormals)
  • void readLockNormalCache (void)
  • void readUnlockNormalCache (void)

part 2 is gonna be even more iconic, so don't go anywhere πŸ’–

…and the rest of the SoShape family keeps going, bestie, don't worry, we're almost through the inheritance receipts πŸ’…

  • SoShape (void) β€” the constructor, protected as always.
  • virtual ~SoShape () β€” virtual destructor, doing its cleanup thing.
  • float getComplexityValue (SoAction *action) β€” hands back the complexity value for an action.
  • virtual void generatePrimitives (SoAction *action)=0 β€” pure virtual, so every subclass must bring its own.
  • void beginSolidShape (SoGLRenderAction *action) β€” starts the solid-shape block.
  • void endSolidShape (SoGLRenderAction *action) β€” closes it back up.
  • void GLRenderBoundingBox (SoGLRenderAction *action) β€” renders the bounding box, GL style.
  • SbBool shouldPrimitiveCount (SoGetPrimitiveCountAction *action) β€” yes/no on whether primitive counting applies.
  • SbBool shouldRayPick (SoRayPickAction *const action) β€” decides if a ray pick should even happen.
  • void computeObjectSpaceRay (SoRayPickAction *const action) β€” works out the object-space ray.
  • void computeObjectSpaceRay (SoRayPickAction *const action, const SbMatrix &matrix) β€” same deal, but with a matrix in the mix.
  • virtual SoDetail * createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp) β€” builds the detail object for a picked triangle.
  • virtual SoDetail * createLineSegmentDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, SoPickedPoint *pp) β€” same energy, but for a line segment.
  • virtual SoDetail * createPointDetail (SoRayPickAction *action, const SoPrimitiveVertex *v, SoPickedPoint *pp) β€” and for a single point.
  • void invokeTriangleCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2, const SoPrimitiveVertex *const v3) β€” fires off the triangle callbacks.
  • void invokeLineSegmentCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2) β€” fires off the line-segment callbacks.
  • void invokePointCallbacks (SoAction *const action, const SoPrimitiveVertex *const v) β€” fires off the point callbacks.
  • void beginShape (SoAction *const action, const TriangleShape shapetype, SoDetail *const detail=NULL) β€” kicks off a shape of the given type, with detail defaulting to NULL.
  • void shapeVertex (const SoPrimitiveVertex *const v) β€” feeds one vertex into the shape being built.
  • void endShape (void) β€” wraps that shape up.
  • void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoTextureCoordinateElement *const tce, const float s, const float t, const SbVec3f &normal) β€” fills in a primitive vertex from a point, texture-coordinate info and a normal.
  • void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoTextureCoordinateElement *const tce, const float s, const float t, const float r, const SbVec3f &normal) β€” the same thing, except this one takes an extra r coordinate too. 3D texture coords said hi ✨
  • SbBool startVertexArray (SoGLRenderAction *action, const SoCoordinateElement *coords, const SbVec3f *pervertexnormals, const SbBool texpervertex, const SbBool colorpervertex) β€” opens up a vertex array for rendering.
  • void finishVertexArray (SoGLRenderAction *action, const SbBool vbo, const SbBool normpervertex, const SbBool texpervertex, const SbBool colorpervertex) β€” and closes it. Say bye πŸ‘‹

✨ Static Protected Member Functions ✨

  • static const SoFieldData ** getFieldDataPtr (void) β€” grabs the pointer to the field data.
  • static SbBool areTexCoordsIndexed (SoAction *action) β€” tells you whether texture coordinates are indexed for this action.

Static Protected Member Functions inherited from SoVertexShape

  • static const SoFieldData ** getFieldDataPtr (void)

Static Protected Member Functions inherited from SoShape

  • static const SoFieldData ** getFieldDataPtr (void)

Static Protected Member Functions inherited from SoNode

  • static const SoFieldData ** getFieldDataPtr (void)
  • static void setNextActionMethodIndex (int index)
  • static int getNextActionMethodIndex (void)
  • static void incNextActionMethodIndex (void)
  • static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)

Static Protected Member Functions inherited from SoBase

  • static uint32_t getCurrentWriteCounter (void)
  • static void staticDataLock (void)
  • static void staticDataUnlock (void)

🌈 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 }

Protected Types inherited from SoBase

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

Protected Attributes inherited from SoNode

  • uint32_t uniqueId

Protected Attributes inherited from SoFieldContainer

  • SbBool isBuiltIn

Static Protected Attributes inherited from SoNode

  • static uint32_t nextUniqueId = 0
  • static int nextActionMethodIndex = 0

πŸ’– Detailed Description πŸ’–

The SoIndexedShape class is the superclass for all indexed vertex shapes. Mother of the indexed shapes, fr. πŸ‘‘

It's an abstract class, and what it's carrying is storage for four fields β€” indices to coordinates, normals, materials and texture coordinates β€” all for its subclasses to use. So it's not out here rendering anything itself, it's just holding the index storage so its children can pop off. Periodt. πŸ’…


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

SoIndexedShape::SoIndexedShape (void ) [protected]

Constructor.

References coordIndex, materialIndex, normalIndex, SoIndexedShape(), and textureCoordIndex.

Referenced by getFieldData(), and SoIndexedShape().

SoIndexedShape::~SoIndexedShape () [protected], [virtual]

Destructor. Cleanup era, we love to see it. πŸ¦‹

πŸ‘‘ Member Function Documentation πŸ‘‘


🌟 SoType SoIndexedShape::getTypeId (void ) const [virtual]

Ok so bestie, this one gives you the type identification of any object that derives from SoBase. What's it for? run-time type checking and doing "downward" casts without tripping. It's giving bouncer-at-the-club energy: you check the ID before you let the pointer in.

Usage example, and yes you're gonna wanna screenshot this:

void foo(SoNode * node)
{
  if (node->getTypeId() == SoFile::getClassTypeId()) {
    SoFile * filenode = (SoFile *)node;  // safe downward cast, knows the type
  }
  else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
    SoGroup * group = (SoGroup *)node;  // safe downward cast, knows the type
  }
}

Now, for all my application programmers out there who wanna extend the library with new nodes, engines, nodekits, draggers or whatever else: this method needs to be overridden in all subclasses. No skipping, no shortcuts, periodt. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through, for instance:

  • Inventor/nodes/SoSubNode.h β€” with SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes
  • Inventor/engines/SoSubEngine.h β€” for engine classes
  • and so on, you get the vibe πŸ’…

For more info on writing Coin extensions, go read the class documentation of the toplevel superclasses for the various class groups. It's there, it's thorough, it ate.

Reimplemented from SoVertexShape.

Reimplemented in SoIndexedFaceSet, SoIndexedLineSet, and SoIndexedTriangleStripSet.


πŸŽ€ const SoFieldData * SoIndexedShape::getFieldData (void ) const [protected], [virtual]

Hands you a pointer to the class-wide field data storage object for this instance. And if there are literally no fields present? It returns NULL. That's it, that's the whole function, she's simple and she knows it.

Reimplemented from SoVertexShape.

Reimplemented in SoIndexedFaceSet, SoIndexedLineSet, and SoIndexedTriangleStripSet.

References SoIndexedShape().


πŸ¦‹ void SoIndexedShape::computeBBox (SoAction * action, SbBox3f & box, SbVec3f & center) [protected], [virtual]

This is the one SoShape subclasses implement so the SoShape superclass can find out the exact size and the weighted center point of the shape's bounding box. Lowkey the most important info the parent class is ever gonna need about you.

⚠️ Both the bounding box and the center point need to be calculated and returned in the local coordinate system. Not world. Local. Don't make it weird.

This method implements action behavior for shape nodes for SoGetBoundingBoxAction. It gets invoked from SoShape::getBoundingBox(). And listen β€” subclasses should not override SoNode::getBoundingBox(). That's not your business, bestie, stay in your lane 🫢

Two little guarantees about the arguments you receive:

  • box is guaranteed to be an empty box when it's sent in.
  • center is undefined upon function entry. So don't assume anything about it, she's a mystery until you fill her in.

Implements SoShape.

References coordIndex, SbBox3f::extendBy(), SoMField::getNum(), SbVec4f::getReal(), SoAction::getState(), SoMFVec3f::getValues(), SbBox3f::isEmpty(), SoBase::isOfType(), SbVec3f::setValue(), SoNode::SoNode(), SoVertexProperty::vertex, and SoVertexShape::vertexProperty.


✨ int SoIndexedShape::getNumVerts (const int startCoord) [protected]

Starting at index position startCoord, this returns the number of indices until either the end of the index array or a separator index (-1). Whichever comes first, she stops counting. Simple as.

References coordIndex.


πŸ’€ void SoIndexedShape::setupIndices (const int numParts, const int numFaces, const SbBool needNormals, const SbBool needTexCoords) [protected]

Not implemented. Probably only used for internal purposes in SGI's original Open Inventor, which means it should have been private. The audacity honestly 😭

Let us know if you need this method for any code you are porting and we'll look into implement it properly.

πŸ™ˆ const int32_t * SoIndexedShape::getNormalIndices (void ) [protected]

Not implemented. Probably only used for internal purposes in SGI's original Open Inventor, which means it should have been private.

Let us know if you need this method for any code you are porting and we'll look into implement it properly.

πŸ’œ const int32_t * SoIndexedShape::getColorIndices (void ) [protected]

Not implemented. Probably only used for internal purposes in SGI's original Open Inventor, which means it should have been private.

Let us know if you need this method for any code you are porting and we'll look into implement it properly.

πŸ“ const int32_t * SoIndexedShape::getTexCoordIndices (void ) [protected]

Not implemented. Probably only used for internal purposes in SGI's original Open Inventor, which means it should have been private.

Let us know if you need this method for any code you are porting and we'll look into implement it properly.

🌈 SbBool SoIndexedShape::areTexCoordsIndexed (SoAction * action) [static], [protected]

Returns whether texture coordinates should be indexed or not. That's the whole plot.

See also: SoTextureCoordinateBinding

References SoAction::getState().


⭐ SbBool SoIndexedShape::getVertexData (SoState * state, const SoCoordinateElement *& coords, const SbVec3f *& normals, const int32_t *& cindices, const int32_t *& nindices, const int32_t *& tindices, const int32_t *& mindices, int & numcindices, const SbBool needNormals, SbBool & normalCacheUsed) [protected]

A convenience method that fetches all the data you need for rendering or generating primitives. And the best part? She takes care of the normal cache for you. Iconic behavior, no notes πŸ‘‘

Heads up: this method was not part of the original SGI Open Inventor API β€” it's an extension specific for Coin. So don't go looking for it in the vintage docs.

References coordIndex, SoVertexShape::generateAndReadLockNormalCache(), SoVertexShape::getVertexData(), materialIndex, normalIndex, SoVertexShape::readUnlockNormalCache(), and textureCoordIndex.

Referenced by SoIndexedFaceSet::generatePrimitives(), SoIndexedTriangleStripSet::generatePrimitives(), SoIndexedFaceSet::GLRender(), SoIndexedLineSet::GLRender(), and SoIndexedTriangleStripSet::GLRender().


🧚 Member Data Documentation 🧚


🌸 SoMFInt32 SoIndexedShape::coordIndex

Coordinate indices. The main character of this whole class, honestly.

Referenced by computeBBox(), SoIndexedFaceSet::generateDefaultNormals(), SoIndexedTriangleStripSet::generateDefaultNormals(), SoIndexedFaceSet::generatePrimitives(), SoIndexedTriangleStripSet::generatePrimitives(), getNumVerts(), SoIndexedFaceSet::getPrimitiveCount(), SoIndexedLineSet::getPrimitiveCount(), SoIndexedTriangleStripSet::getPrimitiveCount(), getVertexData(), SoIndexedFaceSet::GLRender(), SoIndexedLineSet::GLRender(), SoIndexedTriangleStripSet::GLRender(), and SoIndexedShape().


πŸŽ€ SoMFInt32 SoIndexedShape::materialIndex

Material indices.

Referenced by getVertexData(), and SoIndexedShape().


πŸ’– SoMFInt32 SoIndexedShape::normalIndex

Normal indices.

Referenced by getVertexData(), and SoIndexedShape().


πŸ¦‹ SoMFInt32 SoIndexedShape::textureCoordIndex

Texture coordinate indices.

Referenced by getVertexData(), and SoIndexedShape().


πŸ‘‘ Author

Generated automatically by Doxygen for Coin from the source code. So you know a robot wrote it, but a robot with taste πŸ’…βœ¨


And that's a wrap on SoIndexedShape(3) bestie!! This page came to you courtesy of Coin, Version 2.5.0 β€” go forth and index your shapes responsibly, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from