SOGETPRIMITIVECOUNTACTION(3coin2)

๐Ÿ“ฆ version 2.5.0, in fedora 43, fedora 44

๐Ÿ’– SoGetPrimitiveCountAction(3) ๐Ÿ’–

okay bestie, welcome to the Library Functions Manual page for SoGetPrimitiveCountAction โ€” yes the name is long, yes the man page abbreviated it to SoGetPrimi...CountAction(3) up top, and no, we are not gonna let that stop us. she's an icon, she's a counter, she counts things. let's GO ๐Ÿฆ‹


โœจ NAME โœจ

SoGetPrimitiveCountAction โ€” the class that counts the primitives in a scene. that's it. that's her whole job. and she ate ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <Inventor/actions/SoGetPrimitiveCountAction.h>

Inherits SoAction. yes, she's a nepo baby, but like, a talented one. ๐Ÿ‘‘


๐ŸŒธ Public Member Functions ๐ŸŒธ

  • virtual SoType getTypeId (void) const โ€” grabs her type id, standard icon behaviour
  • SoGetPrimitiveCountAction (void) โ€” the constructor, the origin story โœจ
  • virtual ~SoGetPrimitiveCountAction () โ€” the destructor, she exits gracefully
  • int getTriangleCount (void) const โ€” how many triangles we got? ๐Ÿ”บ
  • int getLineCount (void) const โ€” line count, get it
  • int getPointCount (void) const โ€” point count, we love a point
  • int getTextCount (void) const โ€” how much text
  • int getImageCount (void) const โ€” how many images
  • SbBool containsNoPrimitives (void) โ€” does this thing have literally zero primitives? vibe check
  • SbBool containsNonTriangleShapes (void) โ€” are there shapes that are NOT triangles in here? ๐Ÿ‘€
  • SbBool is3DTextCountedAsTriangles (void) โ€” is the 3D text being counted as triangles, yes or no
  • void setCount3DTextAsTriangles (const SbBool flag) โ€” flip that flag, make 3D text count as triangles
  • SbBool canApproximateCount (void) โ€” can we do the approximate count thing?
  • void setCanApproximate (const SbBool flag) โ€” turn approximation on/off
  • void setDecimationValue (SoDecimationTypeElement::Type type, float percentage=1.0) โ€” sets the decimation value, with percentage defaulting to 1.0
  • SoDecimationTypeElement::Type getDecimationType (void) โ€” what kind of decimation are we doing
  • float getDecimationPercentage (void) โ€” the decimation percentage, as a float
  • void addNumTriangles (const int num) โ€” add num triangles to the tally
  • void addNumLines (const int num) โ€” add num lines
  • void addNumPoints (const int num) โ€” add num points
  • void addNumText (const int num) โ€” add num texts
  • void addNumImage (const int num) โ€” add num images
  • void incNumTriangles (void) โ€” increment triangles by one, baby steps
  • void incNumLines (void) โ€” increment lines by one
  • void incNumPoints (void) โ€” increment points by one
  • void incNumText (void) โ€” increment text by one
  • void incNumImage (void) โ€” increment image by one

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

she didn't come alone, she brought the whole family:

  • virtual ~SoAction ()
  • virtual SbBool isOfType (SoType type) const
  • virtual void apply (SoNode *root)
  • virtual void apply (SoPath *path)
  • virtual void apply (const SoPathList &pathlist, SbBool obeysrules=0)
  • void apply (SoAction *beingApplied)
  • virtual void invalidateState (void)
  • AppliedCode getWhatAppliedTo (void) const
  • SoNode * getNodeAppliedTo (void) const
  • SoPath * getPathAppliedTo (void) const
  • const SoPathList * getPathListAppliedTo (void) const
  • const SoPathList * getOriginalPathListAppliedTo (void) const
  • SbBool isLastPathListAppliedTo (void) const
  • PathCode getPathCode (int &numindices, const int *&indices)
  • void traverse (SoNode *const node)
  • SbBool hasTerminated (void) const
  • const SoPath * getCurPath (void)
  • SoState * getState (void) const
  • PathCode getCurPathCode (void) const
  • virtual SoNode * getCurPathTail (void)
  • void usePathCode (int &numindices, const int *&indices)
  • void pushCurPath (const int childindex, SoNode *node=NULL)
  • void popCurPath (const PathCode prevpathcode)
  • void pushCurPath (void)
  • void popPushCurPath (const int childindex, SoNode *node=NULL)
  • void popCurPath (void)
  • void switchToPathTraversal (SoPath *path)
  • void switchToNodeTraversal (SoNode *node)

โญ Static Public Member Functions โญ

  • static SoType getClassTypeId (void)
  • static void addMethod (const SoType type, SoActionMethod method)
  • static void enableElement (const SoType type, const int stackindex)
  • static void initClass (void)

๐ŸŒˆ Static Public Member Functions inherited from SoAction ๐ŸŒˆ

  • static void initClass (void)
  • static void initClasses (void)
  • static SoType getClassTypeId (void)
  • static void nullAction (SoAction *action, SoNode *node)

๐Ÿซถ Protected Member Functions ๐Ÿซถ

  • virtual const SoEnabledElementsList & getEnabledElements (void) const
  • virtual void beginTraversal (SoNode *node)

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

  • SoAction (void)
  • virtual void endTraversal (SoNode *node)
  • void setTerminated (const SbBool flag)
  • virtual SbBool shouldCompactPathList (void) const

๐Ÿ“ Static Protected Member Functions ๐Ÿ“

  • static SoEnabledElementsList * getClassEnabledElements (void)
  • static SoActionMethodList * getClassActionMethods (void)

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

  • static SoEnabledElementsList * getClassEnabledElements (void)
  • static SoActionMethodList * getClassActionMethods (void)

๐Ÿ‘‘ Additional Inherited Members ๐Ÿ‘‘

๐Ÿ’ซ Public Types inherited from SoAction ๐Ÿ’ซ

enum AppliedCode { NODE = 0, PATH = 1, PATH_LIST = 2 }
enum PathCode { NO_PATH = 0, IN_PATH = 1, BELOW_PATH = 2, OFF_PATH = 3 }

๐Ÿ”ฅ Protected Attributes inherited from SoAction ๐Ÿ”ฅ

SoState * state
SoActionMethodList * traversalMethods

๐Ÿ’… Detailed Description ๐Ÿ’…

The SoGetPrimitiveCountAction class counts the primitives in a scene. say it with me now: counts. the. primitives. in. a. scene. periodt ๐Ÿ’–

Apply this action to a scene if you need to know the number of primitives present in a scenegraph, or parts of a scenegraph. yes, parts. she's flexible like that.

okay so here's the thing โ€” one common mistake to make when using this action is to think that it traverses just the parts currently in view, like SoGLRenderAction does. (and just so we're clear: SoGLRenderAction culls away the scenegraph parts outside the camera view volume and does not traverse those.) but like most other action classes, SoGetPrimitiveCountAction actually traverses the complete scenegraph, not just the parts currently in view. so don't come for her when your count is bigger than you expected, bestie, she's just being thorough ๐Ÿ˜ญ

Since

  • Coin 1.0
  • TGS Inventor 2.5

๐ŸŒŸ Constructor & Destructor Documentation ๐ŸŒŸ

SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (void )

Constructor. the birth of a legend โœจ

References SoGetPrimitiveCountAction().

Referenced by addMethod(), and SoGetPrimitiveCountAction().

SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction () [virtual]

The destructor. she's leaving, but she's leaving the count behind ๐ŸŽ€


๐ŸŽ€ Member Function Documentation ๐ŸŽ€

okay bestie this is the big one โ€” every single method, every single detail, we're getting through it together. hydrate. ๐Ÿ’ง


SoType SoGetPrimitiveCountAction::getTypeId (void ) const [virtual]

This hands you the type identification of an action that derives from a class inheriting SoAction. What's it for? Run-time type checking, and "downward" casting. iykyk. ๐Ÿ”

Usage example, verbatim, no cap:

void bar(SoAction * action)
{
  if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
    // safe downward cast, know the type
    SoGLRenderAction * glrender = (SoGLRenderAction *)action;
  }
  return; // ignore if not renderaction
}

Application programmers who wanna extend the library with new actions: this method needs to be overridden in all subclasses. Not optional, babe. 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 Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR.

For more info on writing Coin extensions, go read the SoAction class documentation. ๐Ÿ“š

Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses.

Implements SoAction.


void SoGetPrimitiveCountAction::addMethod (const SoType type, SoActionMethod method) [static]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. (bestie, this one's not for you, it's for the library itself ๐Ÿ’…)

References SoAction::SoAction(), and SoGetPrimitiveCountAction().


void SoGetPrimitiveCountAction::enableElement (const SoType type, const int stackindex) [static]

Same energy as above: this API member is considered internal to the library, as it is not likely to be of interest to the application programmer. ๐Ÿซฃ


const SoEnabledElementsList & SoGetPrimitiveCountAction::getEnabledElements (void ) const [protected], [virtual]

Returns a list of the elements used by action instances of this class upon traversal operations. that's it, that's the whole vibe. โœจ

Reimplemented from SoAction.


int SoGetPrimitiveCountAction::getTriangleCount (void ) const

Returns number of triangles in graph. ๐Ÿ”บ

Referenced by SoIntersectionDetectionAction::apply().


int SoGetPrimitiveCountAction::getLineCount (void ) const

Returns number of lines in graph. ๐Ÿ“


int SoGetPrimitiveCountAction::getPointCount (void ) const

Returns number of points in graph.

Heads up bestie, this is important: by "point", it is meant an actual point primitive (for rendering), such as in the SoPointSet shape node โ€” not a polygon vertice. For counting the total number of polygon vertices in a scene (sub) graph, use instead the SoCallbackAction with the appropriate callback.

int SoGetPrimitiveCountAction::getTextCount (void ) const

Returns number of texts in the graph. ๐Ÿ”ค


int SoGetPrimitiveCountAction::getImageCount (void ) const

Returns the number of images in the graph. ๐Ÿ–ผ๏ธ


SbBool SoGetPrimitiveCountAction::containsNoPrimitives (void )

Returns whether there are any primitives in graph or not. yes/no, that's the whole thing. ๐Ÿ™ˆ


SbBool SoGetPrimitiveCountAction::containsNonTriangleShapes (void )

Returns whether there are non-triangular primitives in graph. โš ๏ธ


SbBool SoGetPrimitiveCountAction::is3DTextCountedAsTriangles (void )

Returns whether SoText3 nodes is counted as triangles or text. ๐Ÿ…ฐ๏ธ

See also

  • is3DTextCountedAsTriangles()

Referenced by SoAsciiText::getPrimitiveCount(), SoText3::getPrimitiveCount(), and SoVRMLText::getPrimitiveCount().


void SoGetPrimitiveCountAction::setCount3DTextAsTriangles (const SbBool flag)

Sets whether SoText3 nodes are counted as the triangles of the fonts in the text strings, or the text itself. The default is to count as triangles. ๐ŸŽฏ

See also

  • is3DTextCountedAsTriangles()

SbBool SoGetPrimitiveCountAction::canApproximateCount (void )

Returns whether shapes can use an approximate value when counting primitives. This is faster than doing an accurate count. The default is to not approximate. โšก

See also

  • setCanApproximate()

Referenced by SoFaceSet::getPrimitiveCount(), SoIndexedFaceSet::getPrimitiveCount(), SoIndexedLineSet::getPrimitiveCount(), SoIndexedTriangleStripSet::getPrimitiveCount(), SoLineSet::getPrimitiveCount(), SoTriangleStripSet::getPrimitiveCount(), SoVRMLIndexedFaceSet::getPrimitiveCount(), and SoVRMLIndexedLineSet::getPrimitiveCount().


void SoGetPrimitiveCountAction::setCanApproximate (const SbBool flag)

Sets whether shapes can do an approximate count. ๐Ÿงฎ

See also

  • canApproximateCount()

void SoGetPrimitiveCountAction::setDecimationValue (SoDecimationTypeElement::Type type, float percentage = 1.0)

Set up the decimation parameters for the traversal. ๐Ÿช“

okay so listen: on-the-fly decimation... this call will not have any effect until that feature has been implemented. don't come for me, I'm just the messenger. ๐Ÿ’€

SoDecimationTypeElement::Type SoGetPrimitiveCountAction::getDecimationType (void )

Returns decimation type used during the traversal count. ๐Ÿ”Ž


float SoGetPrimitiveCountAction::getDecimationPercentage (void )

Returns decimation percentage used during the traversal count. ๐Ÿ“Š


void SoGetPrimitiveCountAction::addNumTriangles (const int num)

Adds num triangles to total count. Used by node instances in the scene graph during traversal. โž•๐Ÿ”บ

Referenced by SoAsciiText::getPrimitiveCount(), SoCone::getPrimitiveCount(), SoCube::getPrimitiveCount(), SoCylinder::getPrimitiveCount(), SoFaceSet::getPrimitiveCount(), SoIndexedFaceSet::getPrimitiveCount(), SoIndexedTriangleStripSet::getPrimitiveCount(), SoQuadMesh::getPrimitiveCount(), SoSphere::getPrimitiveCount(), SoTriangleStripSet::getPrimitiveCount(), SoVRMLBox::getPrimitiveCount(), SoVRMLCone::getPrimitiveCount(), SoVRMLCylinder::getPrimitiveCount(), SoVRMLElevationGrid::getPrimitiveCount(), SoVRMLExtrusion::getPrimitiveCount(), SoVRMLIndexedFaceSet::getPrimitiveCount(), SoVRMLSphere::getPrimitiveCount(), and SoVRMLText::getPrimitiveCount().


void SoGetPrimitiveCountAction::addNumLines (const int num)

Adds num lines to total count. Used by node instances in the scene graph during traversal. โž•๐Ÿ“

Referenced by SoIndexedLineSet::getPrimitiveCount(), SoLineSet::getPrimitiveCount(), and SoVRMLIndexedLineSet::getPrimitiveCount().


void SoGetPrimitiveCountAction::addNumPoints (const int num)

Adds num points to total count. Used by node instances in the scene graph during traversal. โž•๐Ÿ“

Referenced by SoPointSet::getPrimitiveCount(), and SoVRMLVertexPoint::getPrimitiveCount().


void SoGetPrimitiveCountAction::addNumText (const int num)

Adds num texts to total count. Used by node instances in the scene graph during traversal. โž•๐Ÿ”ค

Referenced by SoAsciiText::getPrimitiveCount(), SoText2::getPrimitiveCount(), SoText3::getPrimitiveCount(), and SoVRMLText::getPrimitiveCount().


void SoGetPrimitiveCountAction::addNumImage (const int num)

Adds num texture image maps to total count. Used by node instances in the scene graph during traversal. โž•๐Ÿ–ผ๏ธ

Referenced by SoMarkerSet::getPrimitiveCount().


void SoGetPrimitiveCountAction::incNumTriangles (void )

Adds a single triangle to the total count. Used by node instances in the scene graph during traversal. ๐Ÿ”บ

Referenced by SoShape::invokeTriangleCallbacks().


void SoGetPrimitiveCountAction::incNumLines (void )

Adds a single line to the total count. Used by node instances in the scene graph during traversal. ๐Ÿ“

Referenced by SoShape::invokeLineSegmentCallbacks().


void SoGetPrimitiveCountAction::incNumPoints (void )

Adds a single point to the total count. Used by node instances in the scene graph during traversal. ๐Ÿ“

Referenced by SoShape::invokePointCallbacks().


void SoGetPrimitiveCountAction::incNumText (void )

Adds a single text to the total count. Used by node instances in the scene graph during traversal. ๐Ÿ”ค


void SoGetPrimitiveCountAction::incNumImage (void )

Adds a single texture image map to the total count. Used by node instances in the scene graph during traversal. ๐Ÿ–ผ๏ธ

Referenced by SoImage::getPrimitiveCount().


void SoGetPrimitiveCountAction::beginTraversal (SoNode * node) [protected], [virtual]

This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal. ๐Ÿšชโœจ

It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.

Default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal. don't forget it bestie, fr fr.

Reimplemented from SoAction.

References SoAction::traverse().


๐Ÿ‘‘ Author ๐Ÿ‘‘

Generated automatically by Doxygen for Coin from the source code. (yes the robots wrote it, and they ate ๐Ÿ’…)


okay and that's the whole page!! this was SoGetPrimitiveCountAction(3), from Coin, Version 2.5.0 โ€” go forth and count your primitives, bestie, you're gonna slay. ๐Ÿฆ‹๐ŸŒธ๐Ÿ’–

๐Ÿ“ฆ where this page comes from