Creates a scene graph containing beveled shapes. More...
#include <Inventor/actions/SoBevelAction.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoBevelAction () | |
virtual | ~SoBevelAction () |
void | setAngle (float angle) |
float | getAngle () const |
void | setRadius (float radius) |
float | getRadius () const |
void | enableAbsoluteRadius (SbBool flag=TRUE) |
SbBool | isAbsoluteRadiusEnabled () const |
SbBool | isCoplanarTestEnabled () const |
SbBool | isDuplicateTestEnabled () const |
SbBool | isOrderingTestEnabled () const |
void | enableCoplanarTest (SbBool flag=TRUE) |
void | enableDuplicateTest (SbBool flag=TRUE) |
void | enableOrderingTest (SbBool flag=TRUE) |
virtual void | apply (SoNode *node) |
virtual void | apply (SoPath *path) |
virtual void | apply (const SoPathList &pathList, SbBool obeysRules=FALSE) |
SoGroup * | getSceneGraph () |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Deprecated | |
| |
SoDEPRECATED SbBool | isOutputVRML () const |
SoDEPRECATED void | setOutputVRML (SbBool flag=TRUE) |
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 of SoCoordinate3 and SoIndexedFaceSet 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(), and enableAbsoluteRadius() set the default behavior of the beveling of the shapes this action will be applied to. If bevel property values have been set by the SoBevelProperty node, they are used. Otherwise, the values set by these methods are used.
SoBevelProperty, SoEdgeFlag, SoVertexFlag
SoBevelAction::SoBevelAction | ( | ) |
Constructor.
virtual SoBevelAction::~SoBevelAction | ( | ) | [virtual] |
Destructor.
virtual void SoBevelAction::apply | ( | const SoPathList & | pathList, | |
SbBool | obeysRules = FALSE | |||
) | [virtual] |
Initiates an action on the graph defined by a list of paths.
TRUE can be passed for the obeysRules flag if the given path list has the following 4 properties:
These rules will be obeyed by path lists returned by picking and by searches for non-group nodes.
Reimplemented from SoAction.
virtual void SoBevelAction::apply | ( | SoPath * | path | ) | [virtual] |
Initiates an action on the graph defined by a path.
Warning: Most actions call ref() on the path before traversing the scene graph, then call unref() after traversal. If the path's reference count was zero (the default), the call to apply() will cause it to be destroyed.
Reimplemented from SoAction.
virtual void SoBevelAction::apply | ( | SoNode * | node | ) | [virtual] |
Initiates an action on the graph defined by a node.
Warning: Most actions call ref() on the node before traversing the scene graph, then call unref() after traversal. If the node's reference count was zero (the default), the call to apply() will cause it to be destroyed.
Reimplemented from SoAction.
void SoBevelAction::enableAbsoluteRadius | ( | SbBool | flag = TRUE |
) |
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.
void SoBevelAction::enableCoplanarTest | ( | SbBool | flag = TRUE |
) |
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.
void SoBevelAction::enableDuplicateTest | ( | SbBool | flag = TRUE |
) |
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.
void SoBevelAction::enableOrderingTest | ( | SbBool | flag = TRUE |
) |
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.
float SoBevelAction::getAngle | ( | ) | const |
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.
static SoType SoBevelAction::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoAction.
float SoBevelAction::getRadius | ( | ) | const |
Returns the bevel radius.
The default value is 0.05.
SoGroup* SoBevelAction::getSceneGraph | ( | ) |
This method returns the scene graph containing the beveled shapes created by the action.
virtual SoType SoBevelAction::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Implements SoTypedObject.
SbBool SoBevelAction::isAbsoluteRadiusEnabled | ( | ) | const |
Returns TRUE if the radius is absolute, FALSE if it is relative to the shape.
SbBool SoBevelAction::isCoplanarTestEnabled | ( | ) | const |
Returns TRUE if a coplanar test is performed before the beveling.
SbBool SoBevelAction::isDuplicateTestEnabled | ( | ) | const |
If TRUE, a test is performed to remove duplicate faces in the shapes being beveled.
SbBool SoBevelAction::isOrderingTestEnabled | ( | ) | const |
Returns TRUE if the shapes are re-ordered before being beveled.
SoDEPRECATED SbBool SoBevelAction::isOutputVRML | ( | ) | const |
Returns TRUE if the shapes created by the bevel action are VRML shapes.
void SoBevelAction::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.
SoDEPRECATED void SoBevelAction::setOutputVRML | ( | SbBool | flag = TRUE |
) |
If TRUE, each beveled shape is generated as a VRML indexed face set.
Otherwise the beveled shapes are generated as "classic" indexed face sets. Default value is FALSE.
void SoBevelAction::setRadius | ( | float | radius | ) |
Sets the bevel radius.
The default value is 0.05.