.TH "SoGetPrimitiveCountAction" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoGetPrimitiveCountAction \- The \fBSoGetPrimitiveCountAction\fP class counts the primitives in a scene\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoAction\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBvirtual\fP \fBSoType\fP \fBgetTypeId\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSoGetPrimitiveCountAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoGetPrimitiveCountAction\fP (\fBconst\fP \fBSbViewportRegion\fP &\fBvp\fP)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoGetPrimitiveCountAction\fP (\fBvoid\fP)" .br .ti -1c .RI "int \fBgetTriangleCount\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetLineCount\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetPointCount\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetTextCount\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "int \fBgetImageCount\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBcontainsNoPrimitives\fP (\fBvoid\fP)" .br .ti -1c .RI "SbBool \fBcontainsNonTriangleShapes\fP (\fBvoid\fP)" .br .ti -1c .RI "SbBool \fBis3DTextCountedAsTriangles\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetCount3DTextAsTriangles\fP (\fBconst\fP SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBcanApproximateCount\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetCanApproximate\fP (\fBconst\fP SbBool \fBflag\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetDecimationValue\fP (\fBSoDecimationTypeElement::Type\fP type, float \fBpercentage\fP=1\&.0)" .br .ti -1c .RI "\fBSoDecimationTypeElement::Type\fP \fBgetDecimationType\fP (\fBvoid\fP)" .br .ti -1c .RI "float \fBgetDecimationPercentage\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBaddNumTriangles\fP (\fBconst\fP int num)" .br .ti -1c .RI "\fBvoid\fP \fBaddNumLines\fP (\fBconst\fP int num)" .br .ti -1c .RI "\fBvoid\fP \fBaddNumPoints\fP (\fBconst\fP int num)" .br .ti -1c .RI "\fBvoid\fP \fBaddNumText\fP (\fBconst\fP int num)" .br .ti -1c .RI "\fBvoid\fP \fBaddNumImage\fP (\fBconst\fP int num)" .br .ti -1c .RI "\fBvoid\fP \fBincNumTriangles\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBincNumLines\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBincNumPoints\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBincNumText\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBincNumImage\fP (\fBvoid\fP)" .br .in -1c Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBvirtual\fP \fB~SoAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisOfType\fP (\fBSoType\fP type) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBapply\fP (\fBSoNode\fP *root)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBapply\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBapply\fP (\fBconst\fP \fBSoPathList\fP &\fBpathlist\fP, SbBool \fBobeysrules\fP=FALSE)" .br .ti -1c .RI "\fBvoid\fP \fBapply\fP (\fBSoAction\fP *\fBbeingApplied\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBinvalidateState\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBAppliedCode\fP \fBgetWhatAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSoNode\fP * \fBgetNodeAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSoPath\fP * \fBgetPathAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoPathList\fP * \fBgetPathListAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoPathList\fP * \fBgetOriginalPathListAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBisLastPathListAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBPathCode\fP \fBgetPathCode\fP (int &\fBnumindices\fP, \fBconst\fP int *&indices)" .br .ti -1c .RI "\fBvoid\fP \fBtraverse\fP (\fBSoNode\fP *\fBconst\fP node)" .br .ti -1c .RI "SbBool \fBhasTerminated\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoPath\fP * \fBgetCurPath\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoState\fP * \fBgetState\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBPathCode\fP \fBgetCurPathCode\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBSoNode\fP * \fBgetCurPathTail\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBusePathCode\fP (int &\fBnumindices\fP, \fBconst\fP int *&indices)" .br .ti -1c .RI "\fBvoid\fP \fBpushCurPath\fP (\fBconst\fP int \fBchildindex\fP, \fBSoNode\fP *node=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpopCurPath\fP (\fBconst\fP \fBPathCode\fP \fBprevpathcode\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpushCurPath\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpopPushCurPath\fP (\fBconst\fP int \fBchildindex\fP, \fBSoNode\fP *node=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpopCurPath\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBswitchToPathTraversal\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "\fBvoid\fP \fBswitchToNodeTraversal\fP (\fBSoNode\fP *node)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBaddMethod\fP (\fBconst\fP \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBenableElement\fP (\fBconst\fP \fBSoType\fP type, \fBconst\fP int \fBstackindex\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .in -1c Static Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClasses\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBnullAction\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBvirtual\fP \fBconst\fP \fBSoEnabledElementsList\fP & \fBgetEnabledElements\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBbeginTraversal\fP (\fBSoNode\fP *node)" .br .in -1c Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBendTraversal\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "\fBvoid\fP \fBsetTerminated\fP (\fBconst\fP SbBool \fBflag\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBshouldCompactPathList\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (\fBvoid\fP)" .br .in -1c Static Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (\fBvoid\fP)" .br .in -1c .SS "Additional Inherited Members" Public Types inherited from \fBSoAction\fP .in +1c .ti -1c .RI "enum \fBAppliedCode\fP { \fBNODE\fP = 0, \fBPATH\fP = 1, \fBPATH_LIST\fP = 2 }" .br .ti -1c .RI "enum \fBPathCode\fP { \fBNO_PATH\fP = 0, \fBIN_PATH\fP = 1, \fBBELOW_PATH\fP = 2, \fBOFF_PATH\fP = 3 }" .br .in -1c Protected Attributes inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoState\fP * \fBstate\fP" .br .ti -1c .RI "\fBSoActionMethodList\fP * \fBtraversalMethods\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoGetPrimitiveCountAction\fP class counts the primitives in a scene\&. 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\&. .PP One common mistake to make when using this action is to think that it traverses just the parts currently in view, like \fBSoGLRenderAction\fP does\&. (\fBSoGLRenderAction\fP culls away the scene graph parts outside the camera view volume and does not traverse those\&.) Like most other action classes, \fBSoGetPrimitiveCountAction\fP actually traverses the complete scene graph, not just the parts currently in view\&. .PP \fBSince\fP .RS 4 Coin \fB1\&.0\fP .PP TGS Inventor \fB2\&.5\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (\fBvoid\fP)" Constructor\&. .SS "SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (\fBconst\fP \fBSbViewportRegion\fP & vp)" Constructor\&. Supply the current viewport region to make SCREEN_SPACE counting correct\&. .SS "SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction (\fBvoid\fP)\fC [virtual]\fP" The destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoGetPrimitiveCountAction::getTypeId (\fBvoid\fP) const\fC [virtual]\fP" Returns the type identification of an object derived from a class inheriting \fBSoAction\fP\&. This is used for runtime type checking and 'downward' casting\&. .br .PP Implements \fBSoAction\fP\&. .SS "\fBSoType\fP SoGetPrimitiveCountAction::getClassTypeId (\fBvoid\fP)\fC [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .br .SS "\fBvoid\fP SoGetPrimitiveCountAction::addMethod (\fBconst\fP \fBSoType\fP type, SoActionMethod method)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br .SS "\fBvoid\fP SoGetPrimitiveCountAction::enableElement (\fBconst\fP \fBSoType\fP type, \fBconst\fP int stackindex)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br .SS "\fBconst\fP \fBSoEnabledElementsList\fP & SoGetPrimitiveCountAction::getEnabledElements (\fBvoid\fP) const\fC [protected]\fP, \fC [virtual]\fP" Returns list of enabled elements\&. .br .PP Reimplemented from \fBSoAction\fP\&. .SS "\fBSoEnabledElementsList\fP * SoGetPrimitiveCountAction::getClassEnabledElements (\fBvoid\fP)\fC [static]\fP, \fC [protected]\fP" Returns list of enabled elements for this class\&. The enabledElements and methods variables are protected in the original OIV API\&. This 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 \fBv2\&.1\fP API\&. .br .br .SS "\fBSoActionMethodList\fP * SoGetPrimitiveCountAction::getClassActionMethods (\fBvoid\fP)\fC [static]\fP, \fC [protected]\fP" Returns list of action methods for this class\&. The enabledElements and methods variables are protected in the original OIV API\&. This 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 \fBv2\&.1\fP API\&. .br .br .SS "\fBvoid\fP SoGetPrimitiveCountAction::initClass (\fBvoid\fP)\fC [static]\fP" Initializes the runtime type system for this class, and sets up the enabled elements and action method list\&. .SS "int SoGetPrimitiveCountAction::getTriangleCount (\fBvoid\fP) const" Returns number of triangles in graph\&. .SS "int SoGetPrimitiveCountAction::getLineCount (\fBvoid\fP) const" Returns number of lines in graph\&. .SS "int SoGetPrimitiveCountAction::getPointCount (\fBvoid\fP) const" Returns number of points in graph\&. .PP Note that by 'point', it is meant an actual point primitive (for rendering), such as in the \fBSoPointSet\fP shape node, not a polygon vertex\&. For counting the total number of polygon vertices in a scene (sub) graph, use instead the \fBSoCallbackAction\fP with the appropriate callback\&. .SS "int SoGetPrimitiveCountAction::getTextCount (\fBvoid\fP) const" Returns number of texts in the graph\&. .SS "int SoGetPrimitiveCountAction::getImageCount (\fBvoid\fP) const" Returns the number of images in the graph\&. .SS "SbBool SoGetPrimitiveCountAction::containsNoPrimitives (\fBvoid\fP)" Returns whether there are any primitives in graph or not\&. .SS "SbBool SoGetPrimitiveCountAction::containsNonTriangleShapes (\fBvoid\fP)" Returns whether there are non-triangular primitives in graph\&. .SS "SbBool SoGetPrimitiveCountAction::is3DTextCountedAsTriangles (\fBvoid\fP)" Returns whether \fBSoText3\fP nodes is counted as triangles or text\&. .PP \fBSee also\fP .RS 4 \fBis3DTextCountedAsTriangles()\fP .RE .PP .SS "\fBvoid\fP SoGetPrimitiveCountAction::setCount3DTextAsTriangles (\fBconst\fP SbBool flag)" Sets whether \fBSoText3\fP nodes are counted as the triangles of the fonts in the text strings or the text itself\&. The default is to count as triangles\&. .PP \fBSee also\fP .RS 4 \fBis3DTextCountedAsTriangles()\fP .RE .PP .SS "SbBool SoGetPrimitiveCountAction::canApproximateCount (\fBvoid\fP)" 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\&. .PP \fBSee also\fP .RS 4 \fBsetCanApproximate()\fP .RE .PP .SS "\fBvoid\fP SoGetPrimitiveCountAction::setCanApproximate (\fBconst\fP SbBool flag)" Sets whether shapes can do an approximate count\&. .PP \fBSee also\fP .RS 4 \fBcanApproximateCount()\fP .RE .PP .SS "\fBvoid\fP SoGetPrimitiveCountAction::setDecimationValue (\fBSoDecimationTypeElement::Type\fP type, float percentage = \fC1\&.0\fP)" Set up the decimation parameters for the traversal\&. .PP On-the-fly decimation is supported in Coin yet, so this call will not have any effect until this feature has been implemented\&. .SS "\fBSoDecimationTypeElement::Type\fP SoGetPrimitiveCountAction::getDecimationType (\fBvoid\fP)" Returns decimation type used during the traversal count\&. .SS "float SoGetPrimitiveCountAction::getDecimationPercentage (\fBvoid\fP)" Returns decimation percentage used during the traversal count\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::addNumTriangles (\fBconst\fP int num)" Adds \fInum\fP triangles to total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::addNumLines (\fBconst\fP int num)" Adds \fInum\fP lines to total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::addNumPoints (\fBconst\fP int num)" Adds \fInum\fP points to total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::addNumText (\fBconst\fP int num)" Adds \fInum\fP texts to total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::addNumImage (\fBconst\fP int num)" Adds \fInum\fP texture image maps to total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::incNumTriangles (\fBvoid\fP)" Adds a single triangle to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::incNumLines (\fBvoid\fP)" Adds a single line to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::incNumPoints (\fBvoid\fP)" Adds a single point to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::incNumText (\fBvoid\fP)" Adds a single text to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::incNumImage (\fBvoid\fP)" Adds a single texture image map to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "\fBvoid\fP SoGetPrimitiveCountAction::beginTraversal (\fBSoNode\fP * node)\fC [protected]\fP, \fC [virtual]\fP" This virtual method is called from \fBSoAction::apply()\fP, and is the entry point for the actual scene graph traversal\&. .PP It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting \fBSoAction\fP\&. .PP Default method just calls \fBtraverse()\fP, which any overridden implementation of the method must do too (or call \fBSoAction::beginTraversal()\fP) to trigger the scene graph traversal\&. .PP Reimplemented from \fBSoAction\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.