SOINDEXEDSHAPE(3iv)

πŸ’– NAME πŸ’–

SoIndexedShape β€” the abstract base class for all indexed vertex-based shapes. She's the blueprint, not the building, and honestly? Queen behavior. πŸ‘‘ This page is from manual section 3IV, and bestie, we're gonna get through every single line of it together.


πŸ¦‹ INHERITS FROM πŸ¦‹

SoBase > SoFieldContainer > SoNode > SoShape > SoVertexShape > SoIndexedShape

Look at that family tree, she comes from a long line of icons. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoIndexedShape.h>

Fields from class SoIndexedShape

SoMFInt32           coordIndex
SoMFInt32           materialIndex
SoMFInt32           normalIndex
SoMFInt32           textureCoordIndex

Fields from class SoVertexShape

SoSFNode            vertexProperty

Methods from class SoIndexedShape

static SoType       getClassTypeId()

Methods from class SoNode

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

Methods from class SoFieldContainer

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

Methods from class SoBase

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

🌸 DESCRIPTION 🌸

Okay so real talk: this node is the abstract base class for all vertex-based shapes that get constructed from indices. We're talking SoIndexedFaceSet, SoIndexedTriangleStripSet, and SoIndexedLineSet. And the way that SoIndexedShape defines fields that literally all of its subclasses use? It's giving "mom of the group". 🫢

Every subclass of SoNonIndexedShape constructs its objects using the coordinates specified by the vertexProperty field (which comes from SoVertexShape), or the current inherited coordinates. The coordIndex field that this class defines holds the indices into the current coordinates of the shape's vertices. Those same indices also get used for materials, normals, or texture coordinates when the appropriate binding is PER_VERTEX_INDEXED. Slay. πŸ’…

Material and normal bindings get interpreted like this for each subclass:

  • OVERALL β€” one material for the entire shape.
  • PER_PART β€” specific to the subclass.
  • PER_PART_INDEXED β€” same as PER_PART, using indices from the materialIndex or normalIndex field.
  • PER_FACE β€” specific to the subclass.
  • PER_FACE_INDEXED β€” same as PER_FACE, using indices from the materialIndex or normalIndex field.
  • PER_VERTEX β€” one material per vertex.
  • PER_VERTEX_INDEXED β€” one material per vertex, using indices from the materialIndex or normalIndex field.

When any _INDEXED binding is used for materials or normals, the materialIndex or normalIndex field is what determines the indices for the materials or normals. And if that field contains a single value of -1 (which is the default, bestie), then the coordinate indices from the coordIndex field get used for materials or normals too. When the binding is PER_VERTEX_INDEXED, indices in these fields that correspond to negative indices in coordIndex are skipped; for other index bindings, all the values in the fields are used, in order. No skipping, no drama.

Explicit texture coordinates (as defined by SoTextureCoordinate2) may be bound to the vertices of an indexed shape consecutively (if the texture coordinate binding is PER_VERTEX) or by using the indices in the textureCoordIndex field (if the binding is PER_VERTEX_INDEXED). And just like with all vertex-based shapes: if there's a current texture but no texture coordinates are specified, a default texture coordinate mapping gets calculated using the bounding box of the shape. ✨

⚠️ Okay this part is important, do NOT skip it: be sure that the indices contained in the coordIndex, materialIndex, normalIndex, and textureCoordIndex fields are valid with respect to the current state, or errors will occur. Not a vibe. Not a slay. Errors. 😭

πŸŽ€ FIELDS πŸŽ€

  • SoMFInt32 coordIndex β€” the indices of the coordinates that the shape uses as its vertices. Those coordinates connect to form faces, lines, or other shapes, and each subclass defines its own special negative indices to use to indicate separation between faces, lines, and so on. Think of it as the group chat where everyone's actually connected. πŸ’œ
  • SoMFInt32 materialIndex
  • SoMFInt32 normalIndex
  • SoMFInt32 textureCoordIndex

These three are the indices of the materials, normals, and texture coordinates that are used for the shape. They're only used when the appropriate binding is one of the _INDEXED bindings, okay? By default, the values of these fields indicate that the coordinate indices should be used for materials, normals, or texture coordinates as well. Default behavior, iconic behavior. πŸ‘‘


🧚 METHODS 🧚

  • static SoType getClassTypeId() β€” returns the type identifier for this class. That's it, that's the whole job, and she does it flawlessly. ⭐

🌈 FILE FORMAT/DEFAULTS 🌈

This is an abstract class, bestie. She doesn't have her own format or defaults β€” you gotta go see the reference page of a derived class for the format and default values. The main character doesn't do her own paperwork. πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

  • SoIndexedFaceSet
  • SoIndexedLineSet
  • SoIndexedTriangleStripSet
  • SoMaterialBinding
  • SoNonIndexedShape
  • SoNormalBinding
  • SoShapeHints
  • SoTextureCoordinateBinding

And that's the whole page, bestie!! 🫢 This was SoIndexedShape(3IV)() from the 3IV manual β€” abstract base class energy, no cap, and every single detail accounted for. Now go forth and make sure your indices are valid, or the errors will humble you. πŸ’€βœ¨ πŸŽ€