SoGetPrimitiveCountAction Class Reference

VSG extension Counts number of primitives in scene. More...

#include <Inventor/actions/SoGetPrimitiveCountAction.h>

Inheritance diagram for SoGetPrimitiveCountAction:
SoAction SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoGetPrimitiveCountAction ()
virtual ~SoGetPrimitiveCountAction ()
int32_t getTriangleCount () const
int32_t getLineCount () const
int32_t getPointCount () const
int32_t getTextCount () const
int32_t getImageCount () const
SbBool containsNoPrimitives ()
SbBool containsNonTriangleShapes ()
void setDecimationValue (SoDecimationTypeElement::Type type, float percentage=1.0)
SoDecimationTypeElement::Type getDecimationType ()
float getDecimationPercentage ()
void setCount3DTextAsTriangles (SbBool treatAsTris)
SbBool is3DTextCountedAsTriangles ()
void setCanApproximate (SbBool onOff)
SbBool canApproximateCount ()

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

VSG extension Counts number of primitives in scene.

This class counts the number of rendering primitives a scene would use to render. This can be used as an approximation of how long the scene would take to render. The primitives are divided into five categories: triangles, lines, points, text objects, and images.

After applying the action to a path or scene graph, the results can be obtained with the functions getTriangleCount(), getLineCount(), etc. The decimation value can be altered before applying, which is useful for finding the minimum and maximum number of primitives the scene requires (use LOWEST and HIGHEST).

3D Text, such as SoText3 can be counted as either text or triangles. The function setCount3DTextAsTriangles() will determine how these objects are counted.

Polygonal geometry nodes, for example SoIndexedFaceSet, are always counted as triangles even if the draw style (SoDrawStyle) is set to LINES or POINTS.

Some shapes, such as trimmed NURBS surfaces, can answer quicker if they are allowed to approximate how many primitives they will use instead of calculating an exact answer. If an exact answer is not required, passing TRUE to setCanApproximate() will speed the action.

Sets: SoDecimationTypeElement, SoDecimationPercentageElement



SoAction, SoLevelOfSimplification, SoOctreeOrdering, SoRenderList, SoValueOrdering

See related examples:


Constructor & Destructor Documentation

SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (  ) 


virtual SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction (  )  [virtual]


Member Function Documentation

SbBool SoGetPrimitiveCountAction::canApproximateCount (  )  [inline]

Returns whether shapes are allowed to approximate their count.

SbBool SoGetPrimitiveCountAction::containsNonTriangleShapes (  ) 

Returns TRUE if scene contains some primitives that are not triangles.

SbBool SoGetPrimitiveCountAction::containsNoPrimitives (  ) 

Returns TRUE if scene contains no primitives of any kind.

static SoType SoGetPrimitiveCountAction::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoAction.

float SoGetPrimitiveCountAction::getDecimationPercentage (  )  [inline]

Gets decimation percentage.

SoDecimationTypeElement::Type SoGetPrimitiveCountAction::getDecimationType (  )  [inline]

Gets decimation type.

int32_t SoGetPrimitiveCountAction::getImageCount (  )  const [inline]

Returns counted number of primitives (images).

int32_t SoGetPrimitiveCountAction::getLineCount (  )  const [inline]

Returns counted number of primitives (lines).

int32_t SoGetPrimitiveCountAction::getPointCount (  )  const [inline]

Returns counted number of primitives (points).

int32_t SoGetPrimitiveCountAction::getTextCount (  )  const [inline]

Returns counted number of primitives (text).

int32_t SoGetPrimitiveCountAction::getTriangleCount (  )  const [inline]

Returns counted number of primitives (triangles).

virtual SoType SoGetPrimitiveCountAction::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Implements SoTypedObject.

SbBool SoGetPrimitiveCountAction::is3DTextCountedAsTriangles (  )  [inline]

Returns how SoText3 should be counted: as a triangle-based shape (TRUE) or as a text-based shape (FALSE).

void SoGetPrimitiveCountAction::setCanApproximate ( SbBool  onOff  )  [inline]

Some shapes may be able to guess an approximate number of triangles without actually counting.

In the interests of speed, and depending on how the results are used, a flag is available to allow shapes to approximate their count. The default is FALSE.

void SoGetPrimitiveCountAction::setCount3DTextAsTriangles ( SbBool  treatAsTris  )  [inline]

SoText3 can be counted two ways: as a triangle-based shape or as a text-based shape.

This routine specifies how SoText3 should be counted. The default is TRUE (SoText3 adds to the triangle count, not the text count).

void SoGetPrimitiveCountAction::setDecimationValue ( SoDecimationTypeElement::Type  type,
float  percentage = 1.0 

Sets decimation type and percentage.

Percentage should be a number between 0.0 and 1.0 (1.0 is full complexity).

Type is one of:

Lowest complexity possible for scene.

Highest complexity possible for scene.

Scene uses decimation percentage; LODs calculate range value and then adjust them with percentage.

Scene uses decimation percentage; LODs use child based solely on decimation without looking at camera position.

The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Sep 2022
Copyright © Thermo Fisher Scientific All rights reserved.