SoVRMLIndexedFaceSet(3)
π NAME π
Hey bestie, welcome to SoVRMLIndexedFaceSet(3) π
β yes that's the page we're on, that's the header, we're folding it in like a lil' name tag.
So: the SoVRMLIndexedFaceSet class is the whole entire moment when it comes to representing a generic 3D shape. Generic. 3D. Shape. That's it, that's the job description, and it eats every time. π₯
β¨ SYNOPSIS β¨
First, the β¨sacred incantationβ¨ β you gotta include the header, no cap:
#include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h>
Also super important: it Inherits SoVRMLIndexedShape. So everything cute that SoVRMLIndexedShape has going on? It's also hers now. Generational wealth of member functions. π
πΈ Public Member Functions πΈ
The ones this class owns outright:
virtual SoType getTypeId (void) constβ hands you back theSoTypeof this thing. classic type-id check energy, she knows who she is.SoVRMLIndexedFaceSet (void)β the constructor. birth. iconic. β¨virtual void GLRender (SoGLRenderAction *action)β does the actual GL render for the givenaction. the main character's main character moment.virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)β tallies up primitives for theactionyou hand it.virtual SbBool generateDefaultNormals (SoState *s, SoNormalBundle *nb)β generates default normals, takes anSoState *sand anSoNormalBundle *nb, returns anSbBool.virtual SbBool generateDefaultNormals (SoState *state, SoNormalCache *nc)β yeah it's the same name again but withSoState *stateandSoNormalCache *ncinstead. overloaded bestie, she contains multitudes. β¨
π¦ Public Member Functions inherited from SoVRMLVertexShape
Passed down like a family recipe:
virtual void doAction (SoAction *action)β runs theaction.virtual void getBoundingBox (SoGetBoundingBoxAction *action)β bounding box, delivered to theaction.virtual void callback (SoCallbackAction *action)β callback handling for theaction.virtual void pick (SoPickAction *action)β picking, for theaction.
π¦ Public Member Functions inherited from SoVRMLGeometry
virtual void search (SoSearchAction *action)β searching, with theaction.virtual void copyContents (const SoFieldContainer *from, SbBool copyConn)β copies contents over fromfrom, withcopyConndeciding the connection-copying situation.
π¦ Public Member Functions inherited from SoShape
virtual SbBool affectsState (void) constβ tells you whether this affects state, as anSbBool.virtual void rayPick (SoRayPickAction *action)β ray picking, for theaction.const SoBoundingBoxCache * getBoundingBoxCache (void) constβ returns a pointer to theSoBoundingBoxCache. const, because she's not gonna let you mess with her.
π¦ Public Member Functions inherited from SoNode
The whole squad:
void setOverride (const SbBool state)β sets override tostate.SbBool isOverride (void) constβ are we overriding? returnsSbBool.void setNodeType (const NodeType type)β sets the node type totype.NodeType getNodeType (void) constβ returns theNodeType.virtual SoNode * copy (SbBool copyconnections=0) constβ returns a copiedSoNode *, withcopyconnections=0by default.virtual void GLRenderBelowPath (SoGLRenderAction *action)β GL renders below the path.virtual void GLRenderInPath (SoGLRenderAction *action)β GL renders in the path.virtual void GLRenderOffPath (SoGLRenderAction *action)β GL renders off the path. three paths, three moods, all valid. πvirtual void getMatrix (SoGetMatrixAction *action)β grabs the matrix via theaction.virtual void handleEvent (SoHandleEventAction *action)β handles the event in theaction.virtual void write (SoWriteAction *action)β writes, using theaction.virtual void audioRender (SoAudioRenderAction *action)β audio render, with theaction.virtual void grabEventsSetup (void)β sets up event grabbing.virtual void grabEventsCleanup (void)β cleans up event grabbing.virtual void startNotify (void)β kicks off notification.uint32_t getNodeId (void) constβ returns the node id as auint32_t.virtual void writeInstance (SoOutput *out)β writes the instance out toout.virtual SoNode * addToCopyDict (void) constβ adds itself to the copy dict, returnsSoNode *.virtual SoFieldContainer * copyThroughConnection (void) constβ copies through the connection, returnsSoFieldContainer *.
π¦ Public Member Functions inherited from SoFieldContainer
void setToDefaults (void)β resets everything to defaults.SbBool hasDefaultValues (void) constβ does it have default values?SbBoolsays maybe.SbBool fieldsAreEqual (const SoFieldContainer *container) constβ are the fields equal tocontainer's?void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)β copies field values fromcontainer,copyconnections=0by default.SbBool set (const char *const fielddata)β sets fromfielddata.void get (SbString &fielddata)β gets intofielddata.virtual int getFields (SoFieldList &l) constβ fillslwith fields, returns anint.virtual int getAllFields (SoFieldList &l) constβ ALL the fields, intol.virtual SoField * getField (const SbName &name) constβ returns theSoField *namedname.virtual SoField * getEventIn (const SbName &name) constβ the event-in namedname.virtual SoField * getEventOut (const SbName &name) constβ the event-out namedname.SbBool getFieldName (const SoField *const field, SbName &name) constβ name offield, intoname.SbBool enableNotify (const SbBool flag)β turns notify on/off withflag.SbBool isNotifyEnabled (void) constβ is notify on?SbBool, bestie.SbBool set (const char *fielddata, SoInput *in)β theSoInput *inversion ofset.void get (SbString &fielddata, SoOutput *out)β theSoOutput *outversion ofget.virtual SbBool validateNewFieldValue (SoField *field, void *newval)β validatesnewvalforfield.virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)β adds a write reference,isfromfield=0by default.SbBool getIsBuiltIn (void) constβ is it built in? β¨void setUserData (void *userdata) constβ attachesuserdata.void * getUserData (void) constβ gives the user data back asvoid *.
π¦ Public Member Functions inherited from SoBase
void ref (void) constβ increments the ref count.void unref (void) constβ decrements the ref count.void unrefNoDelete (void) constβ decrements without deleting. spicy.int32_t getRefCount (void) constβ ref count asint32_t.void touch (void)β touch. πSbBool isOfType (SoType type) constβ is it oftype?virtual SbName getName (void) constβ returns theSbName.virtual void setName (const SbName &newname)β renames it tonewname.void addAuditor (void *const auditor, const SoNotRec::Type type)β addsauditoroftype.void removeAuditor (void *const auditor, const SoNotRec::Type type)β removesauditoroftype.const SoAuditorList & getAuditors (void) constβ returns theSoAuditorList &.SbBool shouldWrite (void)β should it write? bestie it depends.void assertAlive (void) constβ asserts it's alive. literally a wellness check. π
β Static Public Member Functions β
static SoType getClassTypeId (void)β the class type id, statically.static void initClass (void)β initializes the class. do not skip her.
π§ Static Public Member Functions inherited from SoVRMLIndexedShape
static SoType getClassTypeId (void)static void initClass (void)
π§ Static Public Member Functions inherited from SoVRMLVertexShape
static SoType getClassTypeId (void)static void initClass (void)
π§ Static Public Member Functions inherited from SoVRMLGeometry
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)β screen size fromstateandboundingbox, intorectsize.static float getDecimatedComplexity (SoState *state, float complexity)β decimated complexity, returns afloat.
π§ Static Public Member Functions inherited from SoNode
static uint32_t getCompatibilityTypes (const SoType &nodetype)β compatibility types fornodetype.static SoType getClassTypeId (void)static SoNode * getByName (const SbName &name)β node namedname.static int getByName (const SbName &name, SoNodeList &l)β fillslwith the ones namedname, returns anint.static void initClass (void)static void initClasses (void)β plural. the whole class family. πstatic uint32_t getNextNodeId (void)β next node id,uint32_t.static int getActionMethodIndex (const SoType type)β action method index fortype.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)
the little S at the end? that's the static-entry-point glow-up, bestie. β¨
π§ Static Public Member Functions inherited from SoFieldContainer
static void initClass (void)static SoType getClassTypeId (void)static void initCopyDict (void)β initializes the copy dict.static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)β registerscopyas a copy oforig.static SoFieldContainer * checkCopy (const SoFieldContainer *orig)β checks for a copy oforig.static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)β finds the copy oforig, withcopyconnectionsdeciding the vibe.static void copyDone (void)β copy's done. wrap it up. π
π§ 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)β addsnametobase.static void removeName (SoBase *const base, const char *const name)β takesnameoffbase.static void incrementCurrentWriteCounter (void)β bumps the current write counter.static void decrementCurrentWriteCounter (void)β lowers it back down.static SoBase * getNamedBase (const SbName &name, SoType type)β the base namednameoftype.static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)β all of them, intobaselist.static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)β reads frominintobase, expectingexpectedtype.static void setInstancePrefix (const SbString &c)β sets the instance prefix toc.static void setTraceRefs (SbBool trace)β toggles ref tracing withtrace.static SbBool getTraceRefs (void)β are refs being traced?static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)β connects a route fromfromnodename.fromfieldnametotonodename.tofieldname.static SbBool readRoute (SoInput *in)β reads a route fromin.
π Public Attributes π
SoSFBool ccwβ counter-clockwise flag, as anSoSFBool.SoSFBool solidβ solid flag.SoSFBool convexβ convex flag.SoSFFloat creaseAngleβ the crease angle, as anSoSFFloat.
π Public Attributes inherited from SoVRMLIndexedShape
SoMFInt32 coordIndexSoMFInt32 colorIndexSoMFInt32 normalIndexSoMFInt32 texCoordIndex
π Public Attributes inherited from SoVRMLVertexShape
SoSFNode coordSoSFNode texCoordSoSFNode normalSoSFNode colorSoSFBool colorPerVertexSoSFBool normalPerVertex
π Protected Member Functions π
For the inner circle only, bestie:
virtual const SoFieldData * getFieldData (void) constβ returns theSoFieldData *, const.virtual ~SoVRMLIndexedFaceSet ()β the destructor. she has to go sometime. πvirtual void generatePrimitives (SoAction *action)β generates primitives for theaction.
πΈ Protected Member Functions inherited from SoVRMLIndexedShape
SoVRMLIndexedShape (void)β constructor.virtual ~SoVRMLIndexedShape ()β destructor.virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er)β computes the bounding box intoboxandcenter.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)β the big one. grabs vertex data:state,coords,normals,cindices,nindices,tindices,mindices,numcindices,neednormals, andnormalcacheused. all of it. every crumb. π«Ά
πΈ Protected Member Functions inherited from SoVRMLVertexShape
SoVRMLVertexShape (void)β constructor.virtual ~SoVRMLVertexShape ()β destructor.virtual SbBool shouldGLRender (SoGLRenderAction *action)β should this GL render foraction?void setNormalCache (SoState *s, int numNormals, SbVec3f *normals)β sets the normal cache withnumNormalsandnormals.SoNormalCache * getNormalCache (void) constβ returns theSoNormalCache *.SoNormalCache * generateAndReadLockNormalCache (SoState *const state)β generates and read-locks the normal cache forstate.void getVertexData (SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const SbBool neednormals)β the shortergetVertexData, withstate,coords,normalsandneednormals.void readLockNormalCache (void)β read-locks the normal cache.void readUnlockNormalCache (void)β read-unlocks it. release her. π
πΈ Protected Member Functions inherited from SoVRMLGeometry
SoVRMLGeometry (void)β constructor.virtual ~SoVRMLGeometry ()β destructor.void setupShapeHints (SoState *state, const SbBool ccw, const SbBool solid)β sets up shape hints forstate,ccwandsolid.virtual SoChildList * getChildren (void) constβ returns theSoChildList *.
and that's part 1 of 4, so don't you dare close the tab β there's SO much more coming and it's only getting cuter πβ¨
π¦ Protected Member Functions (the inherited ones β SoShape edition)
okay so these aren't yours, bestie, they're inherited β you get them for free when you subclass. you don't call them from your app code, they're the plumbing your own overrides get to lean on. π
SoShape (void)β constructor. takes nothing, returns nothing, iconic behaviour honestly.virtual ~SoShape ()β destructor, and yeah it'svirtual, which is the correct and polite way to do destructors around here.float getComplexityValue (SoAction *action)β hands you back a complexity value as afloat, and it wants theSoAction *actionyou're running under.void beginSolidShape (SoGLRenderAction *action)β the "we're opening a solid shape now" opener, takes theSoGLRenderAction *action.void endSolidShape (SoGLRenderAction *action)β and this is the matching closer. bookends, we love them. β¨void GLRenderBoundingBox (SoGLRenderAction *action)β renders the bounding box,SoGLRenderAction *actionin hand.SbBool shouldPrimitiveCount (SoGetPrimitiveCountAction *action)β yes/no (SbBool) on whether to count primitives, given anSoGetPrimitiveCountAction *action.SbBool shouldRayPick (SoRayPickAction *const action)β yes/no on whether the ray pick happens. note the*conston that pointer, she's particular. πvoid computeObjectSpaceRay (SoRayPickAction *const action)β computes the object-space ray. this is the no-matrix version.void computeObjectSpaceRay (SoRayPickAction *const action, const SbMatrix &matrix)β the overload! same name, but now with aconst SbMatrix &matrixalong for the ride.virtual SoDetail * createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp)β builds and returns anSoDetail *for a triangle. takes the action, three verticesv1,v2,v3, and theSoPickedPoint *pp.virtual SoDetail * createLineSegmentDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, SoPickedPoint *pp)β same energy, but for a line segment: two vertices and the picked point.virtual SoDetail * createPointDetail (SoRayPickAction *action, const SoPrimitiveVertex *v, SoPickedPoint *pp)β and for a single point. one vertexv, oneSoPickedPoint *pp.void invokeTriangleCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2, const SoPrimitiveVertex *const v3)β fires off the triangle callbacks. threeconst SoPrimitiveVertex *constarguments, so muchconst, so much commitment. πvoid invokeLineSegmentCallbacks (SoAction *const action, const SoPrimitiveVertex *const v1, const SoPrimitiveVertex *const v2)β line segment callbacks, two vertices this time.void invokePointCallbacks (SoAction *const action, const SoPrimitiveVertex *const v)β point callbacks. one vertex. minimalism. πvoid beginShape (SoAction *const action, const TriangleShape shapetype, SoDetail *const detail=NULL)β opens a shape with aTriangleShape shapetype, and heads up,detaildefaults toNULL.void shapeVertex (const SoPrimitiveVertex *const v)β feeds a vertex in, as aconst SoPrimitiveVertex *const v.void endShape (void)β closes the shape. no arguments, just vibes and closure.void generateVertex (SoPrimitiveVertex *const pv, const SbVec3f &point, const SbBool useTexFunc, const SoTextureCoordinateElement *const tce, const float s, const float t, const SbVec3f &normal)β generates a vertex from a point, auseTexFuncflag, a texture coordinate element,sandt, and a normal. norhere.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 other overload, and the difference is that extraconst float r. that's it. that's the whole difference. π«ΆSbBool startVertexArray (SoGLRenderAction *action, const SoCoordinateElement *coords, const SbVec3f *pervertexnormals, const SbBool texpervertex, const SbBool colorpervertex)β kicks off the vertex array with coords, per-vertex normals, and thetexpervertex/colorpervertexflags.void finishVertexArray (SoGLRenderAction *action, const SbBool vbo, const SbBool normpervertex, const SbBool texpervertex, const SbBool colorpervertex)β wraps the vertex array up. note thevboflag sitting right there in the parameter list.
πΈ Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)β returns the field data pointer, as aconst SoFieldData **. static, so it's a class-level thing.
π Static Protected Member Functions inherited from SoVRMLIndexedShape
static const SoFieldData ** getFieldDataPtr (void)β same signature, different ancestor. she's in the family tree too. π
π Static Protected Member Functions inherited from SoVRMLVertexShape
static const SoFieldData ** getFieldDataPtr (void)β yep. same one again.
π Static Protected Member Functions inherited from SoVRMLGeometry
static const SoFieldData ** getFieldDataPtr (void)β and again, bestie, it goes all the way up.
π Static Protected Member Functions inherited from SoShape
static const SoFieldData ** getFieldDataPtr (void)β still the same signature, still static.
π Static Protected Member Functions inherited from SoNode
static const SoFieldData ** getFieldDataPtr (void)β the field data pointer, once more with feeling.static void setNextActionMethodIndex (int index)β sets the next action method index to anint index.static int getNextActionMethodIndex (void)β reads that index back out as anint.static void incNextActionMethodIndex (void)β increments it. no arguments, it just bumps the thing. β¨static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)β sets compatibility types from anSoTypeand auint32_t bitmask.
π Static Protected Member Functions inherited from SoBase
static uint32_t getCurrentWriteCounter (void)β gives you the current write counter as auint32_t.static void staticDataLock (void)β locks the static data. no args.static void staticDataUnlock (void)β and unlocks it. they come as a pair, always. π
π Protected Member Functions inherited from SoNode
SoNode (void)β constructor.virtual ~SoNode ()β virtual destructor, correct as always.virtual SbBool readInstance (SoInput *in, unsigned short flags)β reads an instance, takes anSoInput *inand anunsigned short flags, gives you back anSbBool.
π Protected Member Functions inherited from SoFieldContainer
SoFieldContainer (void)β constructor.~SoFieldContainer ()β destructor. (not virtual this time, just so you know. π)
π Protected Member Functions inherited from SoBase
SoBase (void)β constructor.virtual ~SoBase ()β virtual destructor.virtual void destroy (void)β the destroy hook, virtual, no arguments.SbBool hasMultipleWriteRefs (void) constβ aconstmember returning anSbBoolabout multiple write refs.SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constβ writes the header, takesout,isgroup,isengine, and yes it'sconst.void writeFooter (SoOutput *out) constβ writes the footer. alsoconst. balance. π§virtual const char * getFileFormatName (void) constβ hands back the file format name as aconst char *, and it'sconsttoo.
π Additional Inherited Members
π Public Types inherited from SoVRMLVertexShape
enum Binding { OVERALL = SoMaterialBindingElement::OVERALL, PER_PART = SoMaterialBindingElement::PER_PART, PER_PART_INDEXED = SoMaterialBindingElement::PER_PART_INDEXED, PER_FACE = SoMaterialBindingElement::PER_FACE, PER_FACE_INDEXED = SoMaterialBindingElement::PER_FACE_INDEXED, PER_VERTEX = SoMaterialBindingElement::PER_VERTEX, PER_VERTEX_INDEXED = SoMaterialBindingElement::PER_VERTEX_INDEXED }β seven binding modes, each one mapped straight onto itsSoMaterialBindingElementtwin. no cap. π
π Public Types inherited from SoShape
enum TriangleShape { TRIANGLE_STRIP, TRIANGLE_FAN, TRIANGLES, POLYGON, QUADS, QUAD_STRIP, POINTS, LINES, LINE_STRIP }β nine shapes, and yes,POLYGONis right there in the middle living her best life.
π 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 }β the whole node-type family tree as bit flags, from0x0000all the way up to0x4000. this one's giving β¨hexadecimalβ¨.
π Protected Types inherited from SoBase
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }β just two flags. small, but mighty. π
π Protected Attributes inherited from SoNode
uint32_t uniqueIdβ auint32_tcalleduniqueId. she's unique, obviously.
π Protected Attributes inherited from SoFieldContainer
SbBool isBuiltInβ anSbBoolnamedisBuiltIn.
β Static Protected Attributes inherited from SoNode
static uint32_t nextUniqueId = 0β static,uint32_t, and it starts at0.static int nextActionMethodIndex = 0β staticint, also starting at0. twins fr fr. π
Detailed Description β¨π
Okay bestie, listen up β the SoVRMLIndexedFaceSet class is THE blueprint for a generic 3D shape. It's giving "I contain multitudes" but make it polygons. π¦
The detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). It is copyright The Web3D Consortium, and is used by permission of the Consortium:
IndexedFaceSet {
eventIn MFInt32 set_colorIndex
eventIn MFInt32 set_coordIndex
eventIn MFInt32 set_normalIndex
eventIn MFInt32 set_texCoordIndex
exposedField SFNode color NULL
exposedField SFNode coord NULL
exposedField SFNode normal NULL
exposedField SFNode texCoord NULL
field SFBool ccw TRUE
field MFInt32 colorIndex [] # [-1,)
field SFBool colorPerVertex TRUE
field SFBool convex TRUE
field MFInt32 coordIndex [] # [-1,)
field SFFloat creaseAngle 0 # [0,)
field MFInt32 normalIndex [] # [-1,)
field SFBool normalPerVertex TRUE
field SFBool solid TRUE
field MFInt32 texCoordIndex [] # [-1,)
}
So the IndexedFaceSet node is literally a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field. The coord field contains a Coordinate node that defines the 3D vertices referenced by the coordIndex field. IndexedFaceSet uses the indices in its coordIndex field to specify the polygonal faces by indexing into the coordinates in the Coordinate node. An index of "-1" indicates that the current face has ended and the next one begins. The last face may be (but does not have to be) followed by a "-1" index. If the greatest index in the coordIndex field is N, the Coordinate node shall contain N+1 coordinates (indexed as 0 to N). Each face of the IndexedFaceSet shall have:
- at least three non-coincident vertices;
- vertices that define a planar polygon;
- vertices that define a non-self-intersecting polygon.
Otherwise, The results are undefined. π Not a vibe. Don't do it.
The IndexedFaceSet node is specified in the local coordinate system and is affected by the transformations of its ancestors. (Ancestry.com but for 3D transforms, periodt.)
Descriptions of the coord, normal, and texCoord fields are provided in the SoVRMLCoordinate, SoVRMLNormal, and SoVRMLTextureCoordinate nodes, respectively.
Details on lighting equations and the interaction between color field, normal field, textures, materials, and geometries are provided in 4.14, Lighting model.
If the color field is not NULL, it shall contain a Color node whose colours are applied to the vertices or faces of the IndexedFaceSet as follows:
- If
colorPerVertexisFALSE, colours are applied to each face, as follows:- If the
colorIndexfield is not empty, then one colour is used for each face of theIndexedFaceSet. There shall be at least as many indices in thecolorIndexfield as there are faces in theIndexedFaceSet. If the greatest index in thecolorIndexfield is N, then there shall be N+1 colours in theColornode. ThecolorIndexfield shall not contain any negative entries. - If the
colorIndexfield is empty, then the colours in theColornode are applied to each face of theIndexedFaceSetin order. There shall be at least as many colours in theColornode as there are faces.
- If the
- If
colorPerVertexisTRUE, colours are applied to each vertex, as follows:- If the
colorIndexfield is not empty, then colours are applied to each vertex of theIndexedFaceSetin exactly the same manner that thecoordIndexfield is used to choose coordinates for each vertex from theCoordinatenode. ThecolorIndexfield shall contain at least as many indices as thecoordIndexfield, and shall contain end-of-face markers (-1) in exactly the same places as thecoordIndexfield. If the greatest index in thecolorIndexfield is N, then there shall be N+1 colours in theColornode. - If the
colorIndexfield is empty, then thecoordIndexfield is used to choose colours from theColornode. If the greatest index in thecoordIndexfield is N, then there shall be N+1 colours in theColornode.
- If the
If the color field is NULL, the geometry shall be rendered normally using the Material and texture defined in the Appearance node (see 4.14, Lighting model, for details http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.5).
If the normal field is not NULL, it shall contain a Normal node whose normals are applied to the vertices or faces of the IndexedFaceSet in a manner exactly equivalent to that described above for applying colours to vertices/faces (where normalPerVertex corresponds to colorPerVertex and normalIndex corresponds to colorIndex). If the normal field is NULL, the browser shall automatically generate normals, using creaseAngle to determine if and how normals are smoothed across shared vertices (see 4.6.3.5, Crease angle field).
If the texCoord field is not NULL, it shall contain a TextureCoordinate node. The texture coordinates in that node are applied to the vertices of the IndexedFaceSet as follows: If the texCoordIndex field is not empty, then it is used to choose texture coordinates for each vertex of the IndexedFaceSet in exactly the same manner that the coordIndex field is used to choose coordinates for each vertex from the Coordinate node. The texCoordIndex field shall contain at least as many indices as the coordIndex field, and shall contain end-of-face markers (-1) in exactly the same places as the coordIndex field. If the greatest index in the texCoordIndex field is N, then there shall be N+1 texture coordinates in the TextureCoordinate node.
If the texCoordIndex field is empty, then the coordIndex array is used to choose texture coordinates from the TextureCoordinate node. If the greatest index in the coordIndex field is N, then there shall be N+1 texture coordinates in the TextureCoordinate node. If the texCoord field is NULL, a default texture coordinate mapping is calculated using the local coordinate system bounding box of the shape. The longest dimension of the bounding box defines the S coordinates, and the next longest defines the T coordinates. If two or all three dimensions of the bounding box are equal, ties shall be broken by choosing the X, Y, or Z dimension in that order of preference. The value of the S coordinate ranges from 0 to 1, from one end of the bounding box to the other. The T coordinate ranges between 0 and the ratio of the second greatest dimension of the bounding box to the greatest dimension. Figure 6.10 illustrates the default texture coordinates for a simple box shaped IndexedFaceSet with an X dimension twice as large as the Z dimension and four times as large as the Y dimension. Figure 6.11 illustrates the original texture image used on the IndexedFaceSet used in Figure 6.10.
Figure 6.10
Figure 6.11
Subclause 4.6.3, Shapes and geometry (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.5), provides a description of the ccw, solid, convex, and creaseAngle fields.
Constructor & Destructor Documentation ππ«Ά
SoVRMLIndexedFaceSet::SoVRMLIndexedFaceSet (void )
Constructor. β¨
References ccw, convex, creaseAngle, solid, and SoVRMLIndexedFaceSet().
Referenced by getFieldData(), and SoVRMLIndexedFaceSet().
SoVRMLIndexedFaceSet::~SoVRMLIndexedFaceSet () [protected], [virtual]
Destructor. π (She's protected and virtual β iconic behavior, no notes.)
π Member Function Documentation π
SoType SoVRMLIndexedFaceSet::getTypeId(void) const β [virtual] β¨
Okay so this hands you back the type identification of literally any object that inherits from SoBase. What's it for? Run-time type checking and "downward" casting, periodt. That's the whole vibe.
Usage example, bestie, take notes:
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 the application programmers out there who wanna extend the library with brand new nodes, engines, nodekits, draggers or whatever else: you have to override this method in all your subclasses. Not optional, no skipping. This usually happens as part of setting up the full type system for your extension classes, which you normally do by using the pre-defined macros available through, for instance, Inventor/nodes/SoSubNode.h (that's SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. π«Ά
Wanna know more about writing Coin extensions? Go read the class documentation of the toplevel superclasses for the various class groups. It's giving homework but it's giving useful homework.
Reimplemented from SoVRMLIndexedShape.
const SoFieldData * SoVRMLIndexedFaceSet::getFieldData(void) const β [protected], [virtual] π
Returns a pointer to the class-wide field data storage object for this instance. If there are no fields present, it hands you NULL. That's it, that's the function.
Reimplemented from SoVRMLIndexedShape.
π References: SoVRMLIndexedFaceSet().
void SoVRMLIndexedFaceSet::GLRender(SoGLRenderAction * action) β [virtual] π¨
This is the action method for the SoGLRenderAction, and it gets called during rendering traversals. Any node that influences the rendering state in any way, or that wants to yeet geometry primitives at OpenGL, overrides this method. That's the assignment. π
Reimplemented from SoVRMLVertexShape.
π References: ccw, SoVRMLIndexedShape::coordIndex, SoShape::finishVertexArray(), SoGLRenderAction::getCacheContext(), SoAction::getState(), SoVRMLIndexedShape::getVertexData(), SoVRMLVertexShape::GLRender(), SoState::pop(), SoState::push(), SoVRMLVertexShape::readUnlockNormalCache(), SoVRMLGeometry::setupShapeHints(), SoVRMLVertexShape::shouldGLRender(), and SoShape::startVertexArray().
void SoVRMLIndexedFaceSet::getPrimitiveCount(SoGetPrimitiveCountAction * action) β [virtual] π’
Action method for the SoGetPrimitiveCountAction.
It counts up the number of triangle, line segment and point primitives for the node and adds all of those to the counters of the action. Math girl summer. πΈ
Nodes that influence how geometry nodes calculate their primitive count also override this method, so they can change the relevant state variables.
Reimplemented from SoShape.
π References: SoGetPrimitiveCountAction::addNumTriangles(), SoGetPrimitiveCountAction::canApproximateCount(), SoVRMLIndexedShape::coordIndex, and SoShape::shouldPrimitiveCount().
SbBool SoVRMLIndexedFaceSet::generateDefaultNormals(SoState * s, SoNormalBundle * nb) β [virtual] π¦
Heads up: this API member is considered internal to the library, because it's not likely to be of interest to the application programmer. iykyk.
Subclasses should override this method to generate default normals using the SoNormalBundle class. Return TRUE if normals were generated, FALSE otherwise. Simple as.
Default method returns FALSE.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Reimplemented from SoVRMLVertexShape.
SbBool SoVRMLIndexedFaceSet::generateDefaultNormals(SoState * s, SoNormalCache * nc) β [virtual] π¦
Also internal to the library, so again, not likely to be of interest to the application programmer. π
Subclasses should override this method to generate default normals using the SoNormalCache class. This one is more effective than using SoNormalGenerator. Return TRUE if normals were generated, FALSE otherwise.
Default method just returns FALSE.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Reimplemented from SoVRMLVertexShape.
π References: SoVRMLVertexShape::coord, SoVRMLIndexedShape::coordIndex, SoMField::getNum(), SoMFVec3f::getValues(), and SoVRMLCoordinate::point.
void SoVRMLIndexedFaceSet::generatePrimitives(SoAction * action) β [protected], [virtual] π
This method implements action behavior for shape nodes for SoCallbackAction. It gets invoked from SoShape::callback(). (And listen: subclasses should not override SoNode::callback(). Don't do it. π«)
The subclass implementations use 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.
π References: SoShape::beginShape(), SoVRMLIndexedShape::coordIndex, SoVRMLVertexShape::doAction(), SoShape::endShape(), SoAction::getState(), SoVRMLIndexedShape::getVertexData(), SoFaceDetail::incFaceIndex(), SoState::pop(), SoState::push(), SoVRMLVertexShape::readUnlockNormalCache(), SoPointDetail::setCoordinateIndex(), SoPrimitiveVertex::setDetail(), SoPointDetail::setMaterialIndex(), SoPrimitiveVertex::setMaterialIndex(), SoPrimitiveVertex::setNormal(), SoPointDetail::setNormalIndex(), SoPrimitiveVertex::setPoint(), SoPointDetail::setTextureCoordIndex(), SoPrimitiveVertex::setTextureCoords(), and SoShape::shapeVertex().
π Member Data Documentation π
SoSFBool SoVRMLIndexedFaceSet::ccw π
Specifies if vertex ordering is counterclockwise. Default value is TRUE.
Referenced by GLRender(), and SoVRMLIndexedFaceSet().
SoSFBool SoVRMLIndexedFaceSet::solid π§
Can be used to enable backface culling. Default value is TRUE.
Referenced by SoVRMLIndexedFaceSet().
SoSFBool SoVRMLIndexedFaceSet::convex π₯
Specifies if all polygons are convex. Default value is TRUE.
Referenced by SoVRMLIndexedFaceSet().
SoSFFloat SoVRMLIndexedFaceSet::creaseAngle π
Specifies the crease angle for the generated normals. Default value is 0.0.
Referenced by SoVRMLIndexedFaceSet().
π Author π
Generated automatically by Doxygen for Coin from the source code. Not a human, not a girlie, just a doc generator doing its lil thing. β¨
And that's a wrap on SoVRMLIndexedFaceSet(3), bestie!! π«Ά This whole thing came out of Coin Version 2.5.0 and the page is filed under SoVRMLIndexedFaceSet(3). Go build something iconic with it, ily, bye!! πππ¦
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.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