SOGETPRIMITIVECOUNTACTION(3coin3)
๐ SoGetPrimitiveCountAction(3) ๐
Library Functions Manual โจ SoGetPrimitiveCountAction(3)
ok bestie sit down, hydrate, and let me tell you about the action that literally counts things for you ๐งฎ๐
๐ธ NAME ๐ธ
SoGetPrimitiveCountAction โ the SoGetPrimitiveCountAction class counts the primitives in a scene. no cap, that's the whole job ๐
โจ SYNOPSIS โจ
#include <Inventor/actions/SoGetPrimitiveCountAction.h>
Inherits SoAction.
๐ฆ Public Member Functions ๐ฆ
virtual SoType getTypeId (void) const
SoGetPrimitiveCountAction (void)
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 ๐
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 ๐ซถ
The SoGetPrimitiveCountAction class counts the primitives in a scene. that's it, that's the vibe ๐ซ
ok so apply this action to a scene if you need to know the number of primitives present in a scenegraph, or parts of a scenegraph. like, if you gotta know, you gotta know ๐ฅ
๐ 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 scenegraph parts outside the camera view volume and does not traverse those.) Like most other action classes,SoGetPrimitiveCountActionactually traverses the complete scenegraph, not just the parts currently in view. so no, bestie, it's not doing the camera-view thing. it sees everything. main character energy, zero culling ๐
๐ Since ๐
- Coin
1.0 - TGS Inventor
2.5
๐ Constructor & Destructor Documentation ๐
SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (void )
Constructor. it constructs ๐ iconic behavior honestly
SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction (void ) [virtual]
The destructor. it destroys ๐ฆ the circle of life fr fr
๐ซถ Member Function Documentation ๐ซถ
SoType SoGetPrimitiveCountAction::getTypeId (void ) const [virtual]
Bestie, this one hands you the type identification of an action derived from a class that inherits SoAction. It's what you use for run-time type checking and "downward" casting. Like, the classic "am I actually talking to the object I think I am" moment. โจ
Usage example:
void bar(SoAction * action)
{
if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
// safe downward cast, know the type
SoGLRenderAction * glrender = (SoGLRenderAction *)action;
}
return; // ignore if not renderaction
}
So if you're an application programmer who wants to extend the library with brand new actions: this method needs to be overridden in all subclasses. No skipping, no exceptions, periodt. ๐
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 peek at the SoAction class documentation. It's giving homework but it's good homework. ๐
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, since it is not likely to be of interest to the application programmer. ๐ Like, it's backstage. You don't need to be here unless you're building the stage itself.
void SoGetPrimitiveCountAction::enableElement (const SoType type, const int stackindex) [static]
Same energy as the one above: this API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Internal business, bestie. ๐คซ
const SoEnabledElementsList & SoGetPrimitiveCountAction::getEnabledElements (void ) const [protected], [virtual]
Returns a list of the elements used by action instances of this class upon traversal operations. Think of it as the guest list for the traversal party. ๐
Reimplemented from SoAction.
int SoGetPrimitiveCountAction::getTriangleCount (void ) const
Returns number of triangles in graph. That's the whole job. Slay. ๐บ
int SoGetPrimitiveCountAction::getLineCount (void ) const
Returns number of lines in graph. Lines, lines, lines. ๐
int SoGetPrimitiveCountAction::getPointCount (void ) const
Returns number of points in graph.
โ ๏ธ Heads up bestie: by "point", it is meant an actual point primitive (for rendering), such as in theSoPointSetshape node, not a polygon vertice. So if you wanna count the total number of polygon vertices in a scene (sub) graph, use instead theSoCallbackActionwith the appropriate callback. Different tool, different job. ๐
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. Basically: is this graph empty of primitives, yes or no. ๐
SbBool SoGetPrimitiveCountAction::containsNonTriangleShapes (void )
Returns whether there are non-triangular primitives in graph. Shapes that are not triangles, fr fr. ๐
SbBool SoGetPrimitiveCountAction::is3DTextCountedAsTriangles (void )
Returns whether SoText3 nodes is counted as triangles or text.
See also: is3DTextCountedAsTriangles()
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. So if you don't touch anything, triangles it is. ๐บโจ
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. (Fast and loose vs. slow and exact โ pick your vibe.)
See also: setCanApproximate()
void SoGetPrimitiveCountAction::setCanApproximate (const SbBool flag)
Sets whether shapes can do an approximate count. Go fast if you want, bestie. ๐โโ๏ธ
See also: canApproximateCount()
void SoGetPrimitiveCountAction::setDecimationValue (SoDecimationTypeElement::Type type, float percentage = 1.0)
Set 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. Not me calling a function that does absolutely nothing yet, iconic behaviour honestly. ๐
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. โ๐บ
void SoGetPrimitiveCountAction::addNumLines (const int num)
Adds num lines to total count. Used by node instances in the scene graph during traversal.
void SoGetPrimitiveCountAction::addNumPoints (const int num)
Adds num points to total count. Used by node instances in the scene graph during traversal.
void SoGetPrimitiveCountAction::addNumText (const int num)
Adds num texts to total count. Used by node instances in the scene graph during traversal.
void SoGetPrimitiveCountAction::addNumImage (const int num)
Adds num texture image maps to total count. Used by node instances in the scene graph during traversal. ๐ผ๏ธโ
void SoGetPrimitiveCountAction::incNumTriangles (void )
Adds a single triangle to the total count. Used by node instances in the scene graph during traversal. One at a time, one at a time. ๐บ
void SoGetPrimitiveCountAction::incNumLines (void )
Adds a single line to the total count. Used by node instances in the scene graph during traversal.
void SoGetPrimitiveCountAction::incNumPoints (void )
Adds a single point to the total count. Used by node instances in the scene graph during traversal.
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. โจ
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. Like, this is the front door of the whole operation. ๐ชโจ
It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.
The 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, bestie, or nothing happens at all and you'll be staring at your screen like ๐ญ.
Reimplemented from SoAction.
๐ Author
Generated automatically by Doxygen for Coin from the source code. (Not a human, just a very diligent robot doing its little documentation dance. ๐)
okay that's the whole page, you're officially a SoGetPrimitiveCountAction expert now, no cap ๐ and for the receipts: this is from Coin, Version 3.1.3, SoGetPrimi...CountAction(3), auto-generated from the source code by Doxygen. Go count some primitives, you ate. ๐
๐
๐ฆ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 ยท GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 ยท GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 ยท GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.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