SoGetPrimitiveCountAction(3)
π SoGetPrimitiveCountAction π β like, the Coin man page, section 3, bestie
okay so. welcome to SoGetPrimitiveCountAction(3), a Coin manual page, and yes we're doing this together, hand in hand, no cap. this is part 1 and there is more coming, so stay with me π«Ά
β¨ NAME β¨
SoGetPrimitiveCountAction β the class that counts the primitives in a scene. that's it. that's the whole job. it's giving census-taker but for your scene graph π
β¨ SYNOPSIS β¨
#include <Inventor/actions/SoGetPrimitiveCountAction.h>
Inherits SoAction.
πΈ Public Member Functions πΈ
virtual SoType getTypeId (void) const
SoGetPrimitiveCountAction (void)
SoGetPrimitiveCountAction (const SbViewportRegion &vp)
virtual ~SoGetPrimitiveCountAction (void)
int getTriangleCount (void) const
int getLineCount (void) const
int getPointCount (void) const
int getTextCount (void) const
int getImageCount (void) const
SbBool containsNoPrimitives (void)
SbBool containsNonTriangleShapes (void)
SbBool is3DTextCountedAsTriangles (void)
void setCount3DTextAsTriangles (const SbBool flag)
SbBool canApproximateCount (void)
void setCanApproximate (const SbBool flag)
void setDecimationValue (SoDecimationTypeElement::Type type, float
percentage=1.0)
SoDecimationTypeElement::Type getDecimationType (void)
float getDecimationPercentage (void)
void addNumTriangles (const int num)
void addNumLines (const int num)
void addNumPoints (const int num)
void addNumText (const int num)
void addNumImage (const int num)
void incNumTriangles (void)
void incNumLines (void)
void incNumPoints (void)
void incNumText (void)
void incNumImage (void)
π¦ Public Member Functions inherited from SoAction π¦
like, she got all of these from her parent class, main character inheritance moment:
virtual ~SoAction (void)
virtual SbBool isOfType (SoType type) const
virtual void apply (SoNode *root)
virtual void apply (SoPath *path)
virtual void apply (const SoPathList &pathlist, SbBool obeysrules=FALSE)
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 β¨
okay so the SoGetPrimitiveCountAction class counts the primitives in a scene. that's the vibe. that's the whole vibe π
apply this action to a scene if you need to know the number of primitives present in a scene graph, or parts of a scene graph. yes bestie, parts too. we love a flexible queen.
now here's the big one, the mistake everybody makes, the classic, the "not me thinkingβ¦" moment:
one common mistake to make when using this action is to think that it traverses just the parts currently in view, likeSoGLRenderActiondoes. (SoGLRenderActionculls away the scene graph parts outside the camera view volume and does not traverse those.) like most other action classes,SoGetPrimitiveCountActionactually traverses the complete scene graph, not just the parts currently in view.
so no, it does not care what your camera can see. it counts everything. it's giving thorough. it's giving completionist. it's giving "i read the whole syllabus" energy πβ¨
Since
- Coin 1.0
- TGS Inventor 2.5
β¨ Constructor & Destructor Documentation β¨
πΈ SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (void ) πΈ
constructor. hi hello, she's here π«Ά
π¦ SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (const SbViewportRegion & vp) π¦
constructor. supply the current viewport region to make SCREEN_SPACE counting correct. like, if you want screen-space numbers to actually be right, hand her the viewport, bestie, don't be shy π
β SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction (void ) [virtual] β
the destructor. bye bestie, thanks for the counts ππ
okay and there's still more to go, so don't go anywhereβ¦ π
π MEMBER FUNCTION DOCUMENTATION π
bestie. the functions. there are SO many. grab a snack π, we're going in.
getTypeId() β [virtual]
SoType SoGetPrimitiveCountAction::getTypeId (void ) const [virtual]
Hands you the type identification for any object derived from a class that inherits SoAction. this is the whole runtime type-checking situation, and it's also how you do "downward" casting. no cap.
Implements SoAction.
getClassTypeId() β [static]
SoType SoGetPrimitiveCountAction::getClassTypeId (void ) [static]
a static lil method that returns the SoType object linked to objects of this class. that's it, that's the function. iconic behavior tbh β¨
addMethod() β [static]
void SoGetPrimitiveCountAction::addMethod (const SoType type, SoActionMethod method) [static]
heads up: this API member is considered internal to the library, because it is not likely to be of interest to the application programmer. so likeβ¦ you can, but should you? π
enableElement() β [static]
void SoGetPrimitiveCountAction::enableElement (const SoType type, const int stackindex) [static]
same vibe check as above: this API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
getEnabledElements() β [protected], [virtual]
const SoEnabledElementsList & SoGetPrimitiveCountAction::getEnabledElements (void ) const [protected], [virtual]
returns the list of enabled elements. that's the whole job, she's simple like that π
Reimplemented from SoAction.
getClassEnabledElements() β [static], [protected]
SoEnabledElementsList * SoGetPrimitiveCountAction::getClassEnabledElements (void ) [static], [protected]
returns the list of enabled elements for this class.
okay so the tea: the enabledElements and methods variables are protected in the original OIV API. that wasβ¦ not a great idea, because exposed static class member variables are a major grievance when it comes to Win32 DLLs. π
this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
getClassActionMethods() β [static], [protected]
SoActionMethodList * SoGetPrimitiveCountAction::getClassActionMethods (void ) [static], [protected]
returns the list of action methods for this class.
and yes, same lore as the one right above: the enabledElements and methods variables are protected in the original OIV API, which is not such a good idea since exposed static class member variables is a major grievance with regard to Win32 DLLs. this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. π«Ά
initClass() β [static]
void SoGetPrimitiveCountAction::initClass (void ) [static]
wakes up the runtime type system for this class, and sets up the enabled elements and the action method list. the whole glow-up, in one call β¨
getTriangleCount()
int SoGetPrimitiveCountAction::getTriangleCount (void ) const
returns the number of triangles in the graph. count 'em, bestie πΊ
getLineCount()
int SoGetPrimitiveCountAction::getLineCount (void ) const
returns the number of lines in the graph. π
getPointCount()
int SoGetPrimitiveCountAction::getPointCount (void ) const
returns the number of points in the graph.
okay IMPORTANT clarification: by "point" here, we mean an actual point primitive (for rendering), like the one in theSoPointSetshape node β not a polygon vertex. those are different things!! if you actually want to count the total number of polygon vertices in a scene (sub)graph, use theSoCallbackActionwith the appropriate callback instead. iykyk π
getTextCount()
int SoGetPrimitiveCountAction::getTextCount (void ) const
returns the number of texts in the graph. π
getImageCount()
int SoGetPrimitiveCountAction::getImageCount (void ) const
returns the number of images in the graph. πΌοΈ
containsNoPrimitives()
SbBool SoGetPrimitiveCountAction::containsNoPrimitives (void )
returns whether there are any primitives in the graph or not. yes/no, that's the whole vibe.
containsNonTriangleShapes()
SbBool SoGetPrimitiveCountAction::containsNonTriangleShapes (void )
returns whether there are non-triangular primitives in the graph. slay detection π
is3DTextCountedAsTriangles()
SbBool SoGetPrimitiveCountAction::is3DTextCountedAsTriangles (void )
returns whether SoText3 nodes are counted as triangles or as text.
See also: is3DTextCountedAsTriangles()
setCount3DTextAsTriangles()
void SoGetPrimitiveCountAction::setCount3DTextAsTriangles (const SbBool flag)
sets whether SoText3 nodes get counted as the triangles of the fonts in the text strings, or as the text itself. the default is to count as triangles. periodt.
See also: is3DTextCountedAsTriangles()
canApproximateCount()
SbBool SoGetPrimitiveCountAction::canApproximateCount (void )
returns whether shapes are allowed to use an approximate value when counting primitives. that's faster than doing an accurate count. the default is to not approximate. (accuracy queen π)
See also: setCanApproximate()
setCanApproximate()
void SoGetPrimitiveCountAction::setCanApproximate (const SbBool flag)
sets whether shapes can do an approximate count. go fast or go precise, your call bestie β‘
See also: canApproximateCount()
setDecimationValue()
void SoGetPrimitiveCountAction::setDecimationValue (SoDecimationTypeElement::Type type, float percentage = 1.0)
sets up the decimation parameters for the traversal.
π¨ real talk: on-the-fly decimation is not supported in Coin yet, so this call will not have any effect until this feature has been implemented. it's giving "coming soon" energy. π
getDecimationType()
SoDecimationTypeElement::Type SoGetPrimitiveCountAction::getDecimationType (void )
returns the decimation type used during the traversal count.
getDecimationPercentage()
float SoGetPrimitiveCountAction::getDecimationPercentage (void )
returns the decimation percentage used during the traversal count.
addNumTriangles()
void SoGetPrimitiveCountAction::addNumTriangles (const int num)
adds num triangles to the total count. used by node instances in the scene graph during traversal.
addNumLines()
void SoGetPrimitiveCountAction::addNumLines (const int num)
adds num lines to the total count. used by node instances in the scene graph during traversal.
addNumPoints()
void SoGetPrimitiveCountAction::addNumPoints (const int num)
adds num points to the total count. used by node instances in the scene graph during traversal.
addNumText()
void SoGetPrimitiveCountAction::addNumText (const int num)
adds num texts to the total count. used by node instances in the scene graph during traversal.
addNumImage()
void SoGetPrimitiveCountAction::addNumImage (const int num)
adds num texture image maps to the total count. used by node instances in the scene graph during traversal.
incNumTriangles()
void SoGetPrimitiveCountAction::incNumTriangles (void )
adds a single triangle to the total count. used by node instances in the scene graph during traversal.
incNumLines()
void SoGetPrimitiveCountAction::incNumLines (void )
adds a single line to the total count. used by node instances in the scene graph during traversal.
incNumPoints()
void SoGetPrimitiveCountAction::incNumPoints (void )
adds a single point to the total count. used by node instances in the scene graph during traversal.
incNumText()
void SoGetPrimitiveCountAction::incNumText (void )
adds a single text to the total count. used by node instances in the scene graph during traversal.
incNumImage()
void SoGetPrimitiveCountAction::incNumImage (void )
adds a single texture image map to the total count. used by node instances in the scene graph during traversal.
beginTraversal() β [protected], [virtual]
void SoGetPrimitiveCountAction::beginTraversal (SoNode * node) [protected], [virtual]
this virtual method gets called from SoAction::apply(), and it is the entry point for the actual scene graph traversal. main character energy, honestly π
you can override it to initialize the action at traversal start, for specific initializations in the action subclasses that inherit SoAction.
β οΈ the default method just callstraverse(). so any overridden implementation of this method must do that too (or callSoAction::beginTraversal()) to actually trigger the scene graph traversal. don't skip it, bestie, nothing will happen and you'll be so confused π
Reimplemented from SoAction.
π AUTHOR π
generated automatically by Doxygen for Coin from the source code. so technically the author isβ¦ a robot? we stan an automated king π€β¨
that's the whole page, you made it to the end, so proud of you fr fr π«Ά
this was Coin Version 4.0.10, dated Thu Jun 25 2026 00:00:0 β and yes, that timestamp really does just get cut off like that at the end of SoGetPrimitiveCountAction(3). it's giving "the manpage generator ran out of characters" and honestly? iconic. slay. π
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms