Class SoBevelAction
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.actions.SoAction
-
- com.openinventor.inventor.actions.SoBevelAction
-
public class SoBevelAction extends SoAction
Creates a scene graph containing beveled shapes. This action traverses a scene graph or paths, looking for shapes to bevel, then creating another scene graph containing the beveled shapes (in the form ofSoCoordinate3
andSoIndexedFaceSet
nodes). Typically it is applied to a subgraph that contains only a single shape.SoBevelAction
does not take into consideration PER_FACE or PER_VERTEX materials. Therefore, the shapes to be beveled should have a uniform material (SoMaterialBinding.OVERALL
).It works like other actions, but does not modify the source scene graph. The scene graph containing beveled shapes can be accessed by calling
getSceneGraph()
after applying the action.The methods
setAngle()
,setRadius()
, andenableAbsoluteRadius()
set the default behavior of the beveling of the shapes this action will be applied to. If bevel property values have been set by theSoBevelProperty
node, they are used. Otherwise, the values set by these methods are used.- See Also:
SoBevelProperty
,SoEdgeFlag
,SoVertexFlag
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoBevelAction()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableAbsoluteRadius()
Calls enableAbsoluteRadius(true).void
enableAbsoluteRadius(boolean flag)
Sets the absolute radius flag.void
enableCoplanarTest()
Calls enableCoplanarTest(true).void
enableCoplanarTest(boolean flag)
If true, a coplanar test is performed on each shape before beveling it.void
enableDuplicateTest()
Calls enableDuplicateTest(true).void
enableDuplicateTest(boolean flag)
If true, examine each shape to bevel, removing duplicate faces if found.static void
enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
void
enableOrderingTest()
Calls enableOrderingTest(true).void
enableOrderingTest(boolean flag)
If true, each shape to bevel is re-ordered so that each face is oriented like the first face of the shape.float
getAngle()
Returns the minimum angle (in radians) between two adjacent face normals required to bevel the edge common to these two faces.float
getRadius()
Returns the bevel radius.SoGroup
getSceneGraph()
This method returns the scene graph containing the beveled shapes created by the action.boolean
isAbsoluteRadiusEnabled()
Returns true if the radius is absolute, false if it is relative to the shape.boolean
isCoplanarTestEnabled()
Returns true if a coplanar test is performed before the beveling.boolean
isDuplicateTestEnabled()
If true, a test is performed to remove duplicate faces in the shapes being beveled.boolean
isOrderingTestEnabled()
Returns true if the shapes are re-ordered before being beveled.void
setAngle(float angle)
Sets the minimum angle (in radians) between two adjacent face normals required to bevel the edge common to these two faces.void
setRadius(float radius)
Sets the bevel radius.-
Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, apply, clearApplyResult, forwardTraversal, 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
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
enableAbsoluteRadius
public void enableAbsoluteRadius()
Calls enableAbsoluteRadius(true).
-
enableCoplanarTest
public void enableCoplanarTest()
Calls enableCoplanarTest(true).
-
enableDuplicateTest
public void enableDuplicateTest()
Calls enableDuplicateTest(true).
-
enableOrderingTest
public void enableOrderingTest()
Calls enableOrderingTest(true).
-
getAngle
public float getAngle()
Returns the minimum angle (in radians) between two adjacent face normals required to bevel the edge common to these two faces. The default value is 0.5.
-
setRadius
public void setRadius(float radius)
Sets the bevel radius. The default value is 0.05.
-
getRadius
public float getRadius()
Returns the bevel radius. The default value is 0.05.
-
enableElement
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
-
setAngle
public void setAngle(float angle)
Sets the minimum angle (in radians) between two adjacent face normals required to bevel the edge common to these two faces. The default value is 0.5.
-
enableAbsoluteRadius
public void enableAbsoluteRadius(boolean flag)
Sets the absolute radius flag. If true, the radius value is absolute. Otherwise the radius is a value between 0.0 and 1.0; the real radius corresponding is max * radius , where max is the length of the longest edge of the current shape to be beveled. The default is false.
-
enableDuplicateTest
public void enableDuplicateTest(boolean flag)
If true, examine each shape to bevel, removing duplicate faces if found. As this test is time consuming, it can be turned on/off depending on whether the shapes to be beveled contain duplicate faces or not. If a shape contains duplicate faces the test is off, no beveling will be performed on the shape. Default value is false.
-
enableCoplanarTest
public void enableCoplanarTest(boolean flag)
If true, a coplanar test is performed on each shape before beveling it. This test combines contiguous coplanar faces into one larger face because the bevel method will not work properly on contiguous coplanar faces.If false, each shape is assumed not to have contiguous coplanar faces. This provides better performance because the coplanar test is not performed.
It is recommended that you turn off this test only if the shapes to be beveled do not contain contiguous coplanar faces. Default value is true.
-
getSceneGraph
public SoGroup getSceneGraph()
This method returns the scene graph containing the beveled shapes created by the action.
-
enableOrderingTest
public void enableOrderingTest(boolean flag)
If true, each shape to bevel is re-ordered so that each face is oriented like the first face of the shape. This test is not time consuming. However, it may be desirable to disable this test when it is not needed. Default value is true.
-
isCoplanarTestEnabled
public boolean isCoplanarTestEnabled()
Returns true if a coplanar test is performed before the beveling.
-
isAbsoluteRadiusEnabled
public boolean isAbsoluteRadiusEnabled()
Returns true if the radius is absolute, false if it is relative to the shape.
-
isOrderingTestEnabled
public boolean isOrderingTestEnabled()
Returns true if the shapes are re-ordered before being beveled.
-
isDuplicateTestEnabled
public boolean isDuplicateTestEnabled()
If true, a test is performed to remove duplicate faces in the shapes being beveled.
-
-