SoGetPrimitiveCountAction Class Reference
[Actions]

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

#include <Inventor/actions/SoGetPrimitiveCountAction.h>

Inheritance diagram for SoGetPrimitiveCountAction:
SoAction SoTypedObject ScGetPrimitiveCountAction

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, SoVRMLText and SoAsciiText, 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.

Elements
Sets: SoDecimationTypeElement, SoDecimationPercentageElement

EXAMPLE

SEE ALSO

SoAction, SoLevelOfSimplification, SoOctreeOrdering, SoRenderList, SoValueOrdering

See related examples:

RenderToTexture


Constructor & Destructor Documentation

SoGetPrimitiveCountAction::SoGetPrimitiveCountAction (  ) 

Constructor.

virtual SoGetPrimitiveCountAction::~SoGetPrimitiveCountAction (  )  [virtual]

Destructor.


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.

Reimplemented in ScGetPrimitiveCountAction.

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.

Reimplemented in ScGetPrimitiveCountAction.

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:

SoDecimationTypeElement::LOWEST
Lowest complexity possible for scene.

SoDecimationTypeElement::HIGHEST
Highest complexity possible for scene.

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

SoDecimationTypeElement::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 11 Nov 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/