Click or drag to resize
SoGetPrimitiveCountAction Class

Counts number of primitives in scene.

Inheritance Hierarchy

Namespace: OIV.Inventor.Actions
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 9.9.13.0 (9.9.13.0)
Syntax
public class SoGetPrimitiveCountAction : SoAction

The SoGetPrimitiveCountAction type exposes the following members.

Constructors
  NameDescription
Public methodSoGetPrimitiveCountAction

Constructor.

Top
Methods
  NameDescription
Public methodAddNumImage
Public methodAddNumLines
Public methodAddNumPoints
Public methodAddNumText
Public methodAddNumTriangles
Public methodApply(SoNode)

Initiates an action on the graph defined by a node.

(Inherited from SoAction.)
Public methodApply(SoPath)

Initiates an action on the graph defined by a path.

(Inherited from SoAction.)
Public methodApply(SoPathList)
Calls Apply(pathList, false).
(Inherited from SoAction.)
Public methodApply(SoPathList, Boolean)

Initiates an action on the graph defined by a list of paths.

(Inherited from SoAction.)
Public methodCanApproximateCount

Returns whether shapes are allowed to approximate their count.

Public methodClearApplyResult

When applied, an action may reference nodes or create objects (e.g.

(Inherited from SoAction.)
Public methodContainsNonTriangleShapes

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

Public methodContainsNoPrimitives

Returns true if scene contains no primitives of any kind.

Public methodStatic memberEnableElement
Public methodEnableElements

(Overrides SoActionEnableElements.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodForwardTraversal

Traverse a node that is not part of the current scenegraph.

(Inherited from SoAction.)
Public methodGetContinueActionInBranchFlag

This function indicates if the action must stop in the current branch.

(Inherited from SoAction.)
Public methodGetCurPath
(Inherited from SoAction.)
Public methodGetDecimationPercentage

Gets decimation percentage.

Public methodGetDecimationType

Gets decimation type.

Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetImageCount

Returns counted number of primitives (images).

Public methodGetLineCount

Returns counted number of primitives (lines).

Public methodGetNodeAppliedTo
(Inherited from SoAction.)
Public methodGetOriginalPathListAppliedTo
(Inherited from SoAction.)
Public methodGetPathAppliedTo
(Inherited from SoAction.)
Public methodGetPathCode(SbNativeArrayInt32)

Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to.

(Inherited from SoAction.)
Public methodGetPathCode(SbNativeInt32Array) Obsolete.

Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to.

(Inherited from SoAction.)
Public methodGetPathListAppliedTo
(Inherited from SoAction.)
Public methodGetPipeId

Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.

(Inherited from SoAction.)
Public methodGetPointCount

Returns counted number of primitives (points).

Public methodGetSceneManager

Return the SoSceneManager associated with this action.

(Inherited from SoAction.)
Public methodGetState
(Inherited from SoAction.)
Public methodGetTextCount

Returns counted number of primitives (text).

Public methodGetTriangleCount

Returns counted number of primitives (triangles).

Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWhatAppliedTo
(Inherited from SoAction.)
Public methodHasTerminated
(Inherited from SoAction.)
Public methodIncNumImage
Public methodIncNumLines
Public methodIncNumPoints
Public methodIncNumText
Public methodIncNumTriangles
Public methodInvalidateState

Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied.

(Inherited from SoAction.)
Public methodIs3DTextCountedAsTriangles

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

Public methodIsBeingApplied

Returns true if this action is currently being applied.

(Inherited from SoAction.)
Public methodIsLastPathListAppliedTo
(Inherited from SoAction.)
Public methodIsUsingAlternateRep

Returns true if current action is using alternate representations.

(Inherited from SoAction.)
Public methodPostDelayedTraversal

Method called by SoMultiPassManager after delayed pass traversals.

(Inherited from SoAction.)
Public methodPreDelayedTraversal

Method called by SoMultiPassManager before delayed pass traversals.

(Inherited from SoAction.)
Public methodResetContinueActionInBranchFlag

This function resets the continue action flag.

(Inherited from SoAction.)
Public methodSetCanApproximate

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

Public methodSetCount3DTextAsTriangles

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

Public methodSetDecimationValue(SoDecimationTypeElementTypes)
Calls SetDecimationValue(type, 1.0).
Public methodSetDecimationValue(SoDecimationTypeElementTypes, Single)

Sets decimation type and percentage.

Public methodSetPipeId

Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.

(Inherited from SoAction.)
Public methodSetSceneManager

Set the scene manager associated with this action (if any ).

(Inherited from SoAction.)
Public methodSetUpState
(Inherited from SoAction.)
Public methodStopActionInBranch

This function stops the action in the current Scene Graph branch.

(Inherited from SoAction.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTraverse
(Inherited from SoAction.)
Public methodUseAlternateRep

Tell the action to use alternate representations during traversal when available.

(Inherited from SoAction.)
Top
Remarks

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

SoGetPrimitiveCountAction gpca = new SoGetPrimitiveCountAction();
gpca.Apply( root );
int numTris = gpca.GetTriangleCount();

See Also