.TH "SoGetPrimitiveCountAction" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoGetPrimitiveCountAction \- .PP The \fBSoGetPrimitiveCountAction\fP class counts the primitives in a scene\&. .PP Apply this action to a scene if you need to know the number of primitives present in a scenegraph, or parts of a scenegraph\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoAction\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .ti -1c .RI "\fBSoGetPrimitiveCountAction\fP (void)" .br .ti -1c .RI "\fBSoGetPrimitiveCountAction\fP (const \fBSbViewportRegion\fP &vp)" .br .ti -1c .RI "virtual \fB~SoGetPrimitiveCountAction\fP (void)" .br .ti -1c .RI "int \fBgetTriangleCount\fP (void) const " .br .ti -1c .RI "int \fBgetLineCount\fP (void) const " .br .ti -1c .RI "int \fBgetPointCount\fP (void) const " .br .ti -1c .RI "int \fBgetTextCount\fP (void) const " .br .ti -1c .RI "int \fBgetImageCount\fP (void) const " .br .ti -1c .RI "SbBool \fBcontainsNoPrimitives\fP (void)" .br .ti -1c .RI "SbBool \fBcontainsNonTriangleShapes\fP (void)" .br .ti -1c .RI "SbBool \fBis3DTextCountedAsTriangles\fP (void)" .br .ti -1c .RI "void \fBsetCount3DTextAsTriangles\fP (const SbBool flag)" .br .ti -1c .RI "SbBool \fBcanApproximateCount\fP (void)" .br .ti -1c .RI "void \fBsetCanApproximate\fP (const SbBool flag)" .br .ti -1c .RI "void \fBsetDecimationValue\fP (\fBSoDecimationTypeElement::Type\fP type, float percentage=1\&.0)" .br .ti -1c .RI "\fBSoDecimationTypeElement::Type\fP \fBgetDecimationType\fP (void)" .br .ti -1c .RI "float \fBgetDecimationPercentage\fP (void)" .br .ti -1c .RI "void \fBaddNumTriangles\fP (const int num)" .br .ti -1c .RI "void \fBaddNumLines\fP (const int num)" .br .ti -1c .RI "void \fBaddNumPoints\fP (const int num)" .br .ti -1c .RI "void \fBaddNumText\fP (const int num)" .br .ti -1c .RI "void \fBaddNumImage\fP (const int num)" .br .ti -1c .RI "void \fBincNumTriangles\fP (void)" .br .ti -1c .RI "void \fBincNumLines\fP (void)" .br .ti -1c .RI "void \fBincNumPoints\fP (void)" .br .ti -1c .RI "void \fBincNumText\fP (void)" .br .ti -1c .RI "void \fBincNumImage\fP (void)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBaddMethod\fP (const \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "static void \fBenableElement\fP (const \fBSoType\fP type, const int stackindex)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const .br \fBSoEnabledElementsList\fP & \fBgetEnabledElements\fP (void) const " .br .ti -1c .RI "virtual void \fBbeginTraversal\fP (\fBSoNode\fP *node)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (void)" .br .ti -1c .RI "static \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoGetPrimitiveCountAction\fP class counts the primitives in a scene\&. .PP Apply this action to a scene if you need to know the number of primitives present in a scenegraph, or parts of a scenegraph\&. 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 scenegraph parts outside the camera view volume and does not traverse those\&.) Like most other action classes, \fBSoGetPrimitiveCountAction\fP actually traverses the complete scenegraph, not just the parts currently in view\&. .PP \fBSince:\fP .RS 4 Coin 1\&.0 .PP TGS Inventor 2\&.5 .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (void)" Constructor\&. .SS "SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (const \fBSbViewportRegion\fP &vp)" Constructor\&. Supply the current viewport region to make SCREEN_SPACE counting correct\&. .SS "SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction (void)\fC [virtual]\fP" The destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoGetPrimitiveCountAction::getTypeId (void) const\fC [virtual]\fP" Returns the type identification of an action derived from a class inheriting \fBSoAction\fP\&. This is used for run-time type checking and 'downward' casting\&. .PP Usage example: .PP .PP .nf void bar(SoAction * action) { if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) { // safe downward cast, know the type SoGLRenderAction * glrender = (SoGLRenderAction *)action; } return; // ignore if not renderaction } .fi .PP .PP For application programmers wanting to extend the library with new actions: this method needs to be overridden in \fIall\fP subclasses\&. 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\&. .PP For more information on writing Coin extensions, see the \fBSoAction\fP class documentation\&. .PP Returns the actual type id of an object derived from a class inheriting \fBSoAction\fP\&. Needs to be overridden in \fIall\fP subclasses\&. .PP Implements \fBSoAction\fP\&. .SS "\fBSoType\fP SoGetPrimitiveCountAction::getClassTypeId (void)\fC [static]\fP" Returns the run-time type object associated with instances of this class\&. .PP Reimplemented from \fBSoAction\fP\&. .SS "void SoGetPrimitiveCountAction::addMethod (const \fBSoType\fPtype, SoActionMethodmethod)\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 .SS "void SoGetPrimitiveCountAction::enableElement (const \fBSoType\fPtype, const intstackindex)\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 .SS "const \fBSoEnabledElementsList\fP & SoGetPrimitiveCountAction::getEnabledElements (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a list of the elements used by action instances of this class upon traversal operations\&. .PP Reimplemented from \fBSoAction\fP\&. .SS "\fBSoEnabledElementsList\fP * SoGetPrimitiveCountAction::getClassEnabledElements (void)\fC [static]\fP, \fC [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP This method not available in the original OIV API, see \fBSoSubAction\&.h\fP for explanation\&. .PP Reimplemented from \fBSoAction\fP\&. .SS "\fBSoActionMethodList\fP * SoGetPrimitiveCountAction::getClassActionMethods (void)\fC [static]\fP, \fC [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP This method not available in the original OIV API, see \fBSoSubAction\&.h\fP for explanation\&. .PP Reimplemented from \fBSoAction\fP\&. .SS "void SoGetPrimitiveCountAction::initClass (void)\fC [static]\fP" Initializes the run-time type system for this class, and sets up the enabled elements and action method list\&. .PP Reimplemented from \fBSoAction\fP\&. .SS "int SoGetPrimitiveCountAction::getTriangleCount (void) const" Returns number of triangles in graph\&. .SS "int SoGetPrimitiveCountAction::getLineCount (void) const" Returns number of lines in graph\&. .SS "int SoGetPrimitiveCountAction::getPointCount (void) 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 vertice\&. 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 (void) const" Returns number of texts in the graph\&. .SS "int SoGetPrimitiveCountAction::getImageCount (void) const" Returns the number of images in the graph\&. .SS "SbBool SoGetPrimitiveCountAction::containsNoPrimitives (void)" Returns whether there are any primitives in graph or not\&. .SS "SbBool SoGetPrimitiveCountAction::containsNonTriangleShapes (void)" Returns whether there are non-triangular primitives in graph\&. .SS "SbBool SoGetPrimitiveCountAction::is3DTextCountedAsTriangles (void)" Returns whether \fBSoText3\fP nodes is counted as triangles or text\&. .PP \fBSee Also:\fP .RS 4 \fBis3DTextCountedAsTriangles()\fP .RE .PP .SS "void SoGetPrimitiveCountAction::setCount3DTextAsTriangles (const SbBoolflag)" 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 (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\&. .PP \fBSee Also:\fP .RS 4 \fBsetCanApproximate()\fP .RE .PP .SS "void SoGetPrimitiveCountAction::setCanApproximate (const SbBoolflag)" Sets whether shapes can do an approximate count\&. .PP \fBSee Also:\fP .RS 4 \fBcanApproximateCount()\fP .RE .PP .SS "void SoGetPrimitiveCountAction::setDecimationValue (\fBSoDecimationTypeElement::Type\fPtype, floatpercentage = \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 (void)" Returns decimation type used during the traversal count\&. .SS "float SoGetPrimitiveCountAction::getDecimationPercentage (void)" Returns decimation percentage used during the traversal count\&. .SS "void SoGetPrimitiveCountAction::addNumTriangles (const intnum)" Adds \fInum\fP triangles to total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::addNumLines (const intnum)" Adds \fInum\fP lines to total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::addNumPoints (const intnum)" Adds \fInum\fP points to total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::addNumText (const intnum)" Adds \fInum\fP texts to total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::addNumImage (const intnum)" Adds \fInum\fP texture image maps to total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::incNumTriangles (void)" Adds a single triangle to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::incNumLines (void)" Adds a single line to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::incNumPoints (void)" Adds a single point to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::incNumText (void)" Adds a single text to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "void SoGetPrimitiveCountAction::incNumImage (void)" Adds a single texture image map to the total count\&. Used by node instances in the scene graph during traversal\&. .SS "void 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 scenegraph 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 scenegraph traversal\&. .PP Reimplemented from \fBSoAction\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.