SoGetPrimitiveCountAction Class |
Counts number of primitives in scene.
Namespace: OIV.Inventor.Actions
The SoGetPrimitiveCountAction type exposes the following members.
Name | Description | |
---|---|---|
SoGetPrimitiveCountAction | Constructor. |
Name | Description | |
---|---|---|
AddNumImage | ||
AddNumLines | ||
AddNumPoints | ||
AddNumText | ||
AddNumTriangles | ||
Apply(SoNode) | Initiates an action on the graph defined by a node. | |
Apply(SoPath) | Initiates an action on the graph defined by a path. | |
Apply(SoPathList) | Calls Apply(pathList, false). (Inherited from SoAction.) | |
Apply(SoPathList, Boolean) | Initiates an action on the graph defined by a list of paths. | |
CanApproximateCount | Returns whether shapes are allowed to approximate their count. | |
ClearApplyResult | When applied, an action may reference nodes or create objects (e.g. | |
ContainsNonTriangleShapes | Returns true if scene contains some primitives that are not triangles. | |
ContainsNoPrimitives | Returns true if scene contains no primitives of any kind. | |
EnableElement | ||
EnableElements | (Overrides SoActionEnableElements.) | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
ForwardTraversal(SoNode) | Traverse a node that is not part of the current scenegraph. | |
ForwardTraversal(SoPath) | Traverse a path that is not part of the current scenegraph. | |
GetContinueActionInBranchFlag | This function indicates if the action must stop in the current branch. | |
GetCurPath | Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. | |
GetDecimationPercentage | Gets decimation percentage. | |
GetDecimationType | Gets decimation type. | |
GetDistribMode | Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only). | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetImageCount | Returns counted number of primitives (images). | |
GetLineCount | Returns counted number of primitives (lines). | |
GetNodeAppliedTo | Returns the node the action is being applied to. | |
GetOriginalPathListAppliedTo | Returns the original path list the action is being applied to. | |
GetPathAppliedTo | Returns the path the action is being applied to. | |
GetPathCode | 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. | |
GetPathListAppliedTo | Returns the path list the action is being applied to. | |
GetPipeId | Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
GetPointCount | Returns counted number of primitives (points). | |
GetSceneManager | Return the OIV.Inventor.SoSceneManager associated with this action. | |
GetState | Gets the state from the action. | |
GetTextCount | Returns counted number of primitives (text). | |
GetTriangleCount | Returns counted number of primitives (triangles). | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetWhatAppliedTo | Returns code indicating what action is being applied to. | |
HasTerminated | Returns true if the traversal has reached a termination condition. | |
IncNumImage | ||
IncNumLines | ||
IncNumPoints | ||
IncNumText | ||
IncNumTriangles | ||
InvalidateState | Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. | |
Is3DTextCountedAsTriangles | Returns how OIV.Inventor.Nodes.SoText3 should be counted: as a triangle-based shape (true) or as a text-based shape (false). | |
IsBeingApplied | Returns true if this action is currently being applied. | |
IsLastPathListAppliedTo | Returns true if the current list is the last one from the original. | |
IsUsingAlternateRep | Returns true if current action is using alternate representations. | |
PostDelayedTraversal | Method called by SoMultiPassManager after delayed pass traversals. | |
PreDelayedTraversal | Method called by SoMultiPassManager before delayed pass traversals. | |
ResetContinueActionInBranchFlag | This function resets the continue action flag. | |
SetCanApproximate | Some shapes may be able to guess an approximate number of triangles without actually counting. | |
SetCount3DTextAsTriangles | OIV.Inventor.Nodes.SoText3 can be counted two ways: as a triangle-based shape or as a text-based shape. | |
SetDecimationValue(SoDecimationTypeElementTypes) | Calls SetDecimationValue(type, 1.0). | |
SetDecimationValue(SoDecimationTypeElementTypes, Single) | Sets decimation type and percentage. | |
SetPipeId | Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
SetSceneManager | Set the scene manager associated with this action (if any ). | |
SetUpState | Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created. | |
StopActionInBranch | This function stops the action in the current Scene Graph branch. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Traverse | Does traversal of a graph rooted by a node. | |
UseAlternateRep | Tell the action to use alternate representations during traversal when available. |
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 OIV.Inventor.Actions.SoGetPrimitiveCountAction.GetTriangleCount(), OIV.Inventor.Actions.SoGetPrimitiveCountAction.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 OIV.Inventor.Nodes.SoText3 can be counted as either text or triangles. The function OIV.Inventor.Actions.SoGetPrimitiveCountAction.SetCount3DTextAsTriangles(System.Boolean) will determine how these objects are counted.
Polygonal geometry nodes, for example OIV.Inventor.Nodes.SoIndexedFaceSet, are always counted as triangles even if the draw style (OIV.Inventor.Nodes.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 OIV.Inventor.Actions.SoGetPrimitiveCountAction.SetCanApproximate(System.Boolean) will speed the action.
Elements Sets: OIV.Inventor.Elements.SoDecimationTypeElement, OIV.Inventor.Elements.SoDecimationPercentageElement
SoGetPrimitiveCountAction gpca = new SoGetPrimitiveCountAction(); gpca.Apply( root ); int numTris = gpca.GetTriangleCount();