SOGETPRIMITIVECOUNTACTION(3coin2)
๐ 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 behaviourSoGetPrimitiveCountAction (void)โ the constructor, the origin story โจvirtual ~SoGetPrimitiveCountAction ()โ the destructor, she exits gracefullyint getTriangleCount (void) constโ how many triangles we got? ๐บint getLineCount (void) constโ line count, get itint getPointCount (void) constโ point count, we love a pointint getTextCount (void) constโ how much textint getImageCount (void) constโ how many imagesSbBool containsNoPrimitives (void)โ does this thing have literally zero primitives? vibe checkSbBool containsNonTriangleShapes (void)โ are there shapes that are NOT triangles in here? ๐SbBool is3DTextCountedAsTriangles (void)โ is the 3D text being counted as triangles, yes or novoid setCount3DTextAsTriangles (const SbBool flag)โ flip that flag, make 3D text count as trianglesSbBool canApproximateCount (void)โ can we do the approximate count thing?void setCanApproximate (const SbBool flag)โ turn approximation on/offvoid setDecimationValue (SoDecimationTypeElement::Type type, float percentage=1.0)โ sets the decimation value, withpercentagedefaulting to1.0SoDecimationTypeElement::Type getDecimationType (void)โ what kind of decimation are we doingfloat getDecimationPercentage (void)โ the decimation percentage, as a floatvoid addNumTriangles (const int num)โ addnumtriangles to the tallyvoid addNumLines (const int num)โ addnumlinesvoid addNumPoints (const int num)โ addnumpointsvoid addNumText (const int num)โ addnumtextsvoid addNumImage (const int num)โ addnumimagesvoid incNumTriangles (void)โ increment triangles by one, baby stepsvoid incNumLines (void)โ increment lines by onevoid incNumPoints (void)โ increment points by onevoid incNumText (void)โ increment text by onevoid 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) constvirtual 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) constSoNode * getNodeAppliedTo (void) constSoPath * getPathAppliedTo (void) constconst SoPathList * getPathListAppliedTo (void) constconst SoPathList * getOriginalPathListAppliedTo (void) constSbBool isLastPathListAppliedTo (void) constPathCode getPathCode (int &numindices, const int *&indices)void traverse (SoNode *const node)SbBool hasTerminated (void) constconst SoPath * getCurPath (void)SoState * getState (void) constPathCode getCurPathCode (void) constvirtual 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) constvirtual 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 theSoPointSetshape node โ not a polygon vertice. For counting the total number of polygon vertices in a scene (sub) graph, use instead theSoCallbackActionwith 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 callstraverse(), which any overridden implementation of the method must do too (or callSoAction::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
- 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