public class SoSplitGeometryAction extends SoAction
This action splits a large object into multiple geometry nodes, without changing the appearance of the object. Culling can then applied to the new nodes individually.
The scene does not need to be subdivided into a large number of parts. Usually, 5 by 5 is enough to reasonably divide work between the threads. The new objects use the same vertex coordinates (and normals, materials,... if specified) as the original geometry. No triangles are added, removed, or split. A small amount of additional memory is required for the coordinate indices in the new objects.
Note: Currently this action applies only to SoIndexedFaceSet
and SoIndexedTriangleStripSet
nodes. The new object is the same type of node as the original.
Texture Mapping: If the original geometry has explicit texture coordinates, the result will be correct. If texture coordinates are computed by Open Inventor, the texture will be applied separately to each new object.
See also:
SoOctreeOrdering, SoIndexedFaceSet
, SoIndexedTriangleStripSet
, SoShapeHints
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoSplitGeometryAction(int divAlongX,
int divAlongY)
Constructor for splitting geometry along 2 dimensions.
|
SoSplitGeometryAction(int divAlongX,
int divAlongY,
int divAlongZ)
Constructor for splitting geometry along 3 dimensions.
|
Modifier and Type | Method and Description |
---|---|
static void |
enableElement(java.lang.Class<? extends Inventor> t,
int stkIndex) |
int[] |
getNumDivisions()
Returns the current division values to split an object in 3D.
|
int |
getNumObjFound()
Returns how many objects the action has split.
|
boolean |
isDistinguishSplitParts()
Returns true if distinguish split parts is enabled.
|
boolean |
isKeepOriginalGeometry()
Returns true if keep original geometry is enabled.
|
boolean |
isMaintainVertexOrdering()
Returns true if the option to maintain initial vertex ordering is on.
|
boolean |
isSmartSplitting()
Returns true if smart splitting is enabled.
|
int |
isTraverseAllSoSwitchChildren()
Returns true if traverse all
SoSwitch children is enabled. |
void |
setDistinguishSplitParts(boolean enable)
Calling this method before applying the action allows you to see how the action has split the objects.
|
void |
setKeepOriginalGeometry(boolean enable)
By default, the action modifies the scene graph by replacing the original node it has split with a new separator containing all the new nodes.
|
void |
setMaintainVertexOrdering(boolean enable)
If the initial geometry is composed of
SoIndexedTriangleStripSet and uses an SoShapeHints with a known vertex ordering (SoShapeHints.CLOCKWISE or SoShapeHints.COUNTERCLOCKWISE ), the action has to maintain the initial vertex ordering or problems with normals will appear. |
void |
setMaximumDivisionWarning(boolean enable)
There is a maximum number of division to divide an object because this object is composed by some primitives (triangles) that cannot be split without changing the geometry.
|
void |
setNumDivisions(int numX,
int numY)
Specifies the number of divisions for splitting an object in 2D.
|
void |
setNumDivisions(int numX,
int numY,
int numZ)
Specifies the number of divisions for splitting an object in 3D.
|
void |
setSmartSplitting(boolean enable)
If this option is set before the action is applied, objects will be split by dividing the greatest bounding box side into the largest number of divisions, the next largest side by the next largest number of divisions, and so on.
|
void |
setTraverseAllSoSwitchChildren(boolean enable)
By default the action will only traverse the active child of
SoSwitch nodes. |
apply, apply, clearApplyResult, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
dispose, getNativeResourceHandle
public SoSplitGeometryAction(int divAlongX, int divAlongY)
public SoSplitGeometryAction(int divAlongX, int divAlongY, int divAlongZ)
public int[] getNumDivisions()
public boolean isDistinguishSplitParts()
public void setDistinguishSplitParts(boolean enable)
SoIndexedShape
is assigned a unique material. Default is false.public void setNumDivisions(int numX, int numY, int numZ)
public void setMaintainVertexOrdering(boolean enable)
SoIndexedTriangleStripSet
and uses an SoShapeHints
with a known vertex ordering (SoShapeHints.CLOCKWISE
or SoShapeHints.COUNTERCLOCKWISE
), the action has to maintain the initial vertex ordering or problems with normals will appear.
A call to this function will maintain initial vertex ordering. Default is true.public void setNumDivisions(int numX, int numY)
public int isTraverseAllSoSwitchChildren()
SoSwitch
children is enabled.public void setTraverseAllSoSwitchChildren(boolean enable)
SoSwitch
nodes.
A call to this method tells the action to traverse all children. Default is false.public void setMaximumDivisionWarning(boolean enable)
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
public boolean isMaintainVertexOrdering()
public void setKeepOriginalGeometry(boolean enable)
SoSwitch
node containing the original node and the separator containing all the new nodes. Each new SoSwitch
node added in the scene graph is named "switchX" where X is the Xth object split. For instance, the first object split by the action will have a corresponding switch node named "switch0". Default is false.public int getNumObjFound()
public boolean isKeepOriginalGeometry()
public boolean isSmartSplitting()
public void setSmartSplitting(boolean enable)
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com