Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoBevelAction Class Reference

VSG extension Creates a scene graph containing beveled shapes. More...

#include <Inventor/actions/SoBevelAction.h>

+ Inheritance diagram for SoBevelAction:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoBevelAction ()
 Constructor.
 
virtual ~SoBevelAction ()
 Destructor.
 
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.
 
float getAngle () const
 Returns 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.
 
float getRadius () const
 Returns the bevel radius.
 
void enableAbsoluteRadius (SbBool flag=TRUE)
 Sets the absolute radius flag.
 
SbBool isAbsoluteRadiusEnabled () const
 Returns TRUE if the radius is absolute, FALSE if it is relative to the shape.
 
SbBool isCoplanarTestEnabled () const
 Returns TRUE if a coplanar test is performed before the beveling.
 
SbBool isDuplicateTestEnabled () const
 If TRUE, a test is performed to remove duplicate faces in the shapes being beveled.
 
SbBool isOrderingTestEnabled () const
 Returns TRUE if the shapes are re-ordered before being beveled.
 
void enableCoplanarTest (SbBool flag=TRUE)
 If TRUE, a coplanar test is performed on each shape before beveling it.
 
void enableDuplicateTest (SbBool flag=TRUE)
 If TRUE, examine each shape to bevel, removing duplicate faces if found.
 
void 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.
 
virtual void apply (SoNode *node)
 Initiates an action on the graph defined by a node.
 
virtual void apply (SoPath *path)
 Initiates an action on the graph defined by a path.
 
virtual void apply (const SoPathList &pathList, SbBool obeysRules=FALSE)
 Initiates an action on the graph defined by a list of paths.
 
SoGroupgetSceneGraph ()
 This method returns the scene graph containing the beveled shapes created by the action.
 
- Public Member Functions inherited from SoAction
virtual ~SoAction ()
 Destructor.
 
virtual void clearApplyResult ()
 When applied, an action may reference nodes or create objects (e.g.
 
virtual void invalidateState ()
 Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied.
 
void stopActionInBranch ()
 This function stops the action in the current Scene Graph branch.
 
SbBool getContinueActionInBranchFlag () const
 This function indicates if the action must stop in the current branch.
 
void resetContinueActionInBranchFlag ()
 This function resets the continue action flag.
 
void useAlternateRep (const SbBool enable)
 Tell the action to use alternate representations during traversal when available.
 
SbBool isUsingAlternateRep () const
 Returns TRUE if current action is using alternate representations.
 
void setSceneManager (SoSceneManager *mgr)
 Set the scene manager associated with this action (if any ).
 
SoSceneManagergetSceneManager () const
 Return the SoSceneManager associated with this action.
 
virtual void forwardTraversal (SoNode *node)
 Traverse a node that is not part of the current scenegraph.
 
virtual void forwardTraversal (SoPath *path)
 Traverse a path that is not part of the current scenegraph.
 
DistribMode getDistribMode () const
 Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only).
 
AppliedCode getWhatAppliedTo () const
 Returns code indicating what action is being applied to.
 
SoNodegetNodeAppliedTo () const
 Returns the node the action is being applied to.
 
SoPathgetPathAppliedTo () const
 Returns the path the action is being applied to.
 
const SoPathListgetPathListAppliedTo () const
 Returns the path list the action is being applied to.
 
const SoPathListgetOriginalPathListAppliedTo () const
 Returns the original path list the action is being applied to.
 
SbBool isLastPathListAppliedTo () const
 Returns TRUE if the current list is the last one from the original.
 
PathCode getPathCode (int &numIndices, const int *&indices)
 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.
 
PathCode getPathCodeMI (int &numIndices, const int *&indices, const int *&instanceIndices)
 Extender API: available to programmers who wish to extend the toolkit
 
void traverse (SoNode *node)
 Does traversal of a graph rooted by a node.
 
SbBool hasTerminated () const
 Returns TRUE if the traversal has reached a termination condition.
 
const SoPathgetCurPath ()
 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.
 
SoStategetState () const
 Gets the state from the action.
 
virtual void setUpState ()
 Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created.
 
void setPipeId (int id)
 Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
 
int getPipeId () const
 Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
 
bool isBeingApplied ()
 Returns TRUE if this action is currently being applied.
 
virtual bool preDelayedTraversal ()
 Method called by SoMultiPassManager before delayed pass traversals.
 
virtual void postDelayedTraversal ()
 Method called by SoMultiPassManager after delayed pass traversals.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoAction
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void nullAction (SoAction *, SoNode *)
 Null action method that can be stored in lookup table when desired.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Additional Inherited Members

- Public Types inherited from SoAction
enum  DistribMode {
  LOCAL_ONLY ,
  CLUSTER_ONLY ,
  ALL
}
 This is used to define the way an action is distributed across a cluster. More...
 
enum  AppliedCode {
  NODE ,
  PATH ,
  PATH_LIST
}
 This enum is used to determine what the action is being applied to. More...
 
enum  PathCode {
  NO_PATH ,
  IN_PATH ,
  BELOW_PATH ,
  OFF_PATH
}
 This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed. More...
 

Detailed Description

VSG extension 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 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.

SEE ALSO

SoBevelProperty, SoEdgeFlag, SoVertexFlag

Definition at line 94 of file SoBevelAction.h.

Constructor & Destructor Documentation

◆ SoBevelAction()

SoBevelAction::SoBevelAction ( )

Constructor.

◆ ~SoBevelAction()

virtual SoBevelAction::~SoBevelAction ( )
virtual

Destructor.

Member Function Documentation

◆ apply() [1/3]

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:

  1. All paths have the same head node.
  2. Paths are sorted in traversal order.
  3. If one path ends at node A, no other path continues through A.
  4. No two paths are the same.

These rules will be obeyed by path lists returned by picking and by searches for non-group nodes.

Reimplemented from SoAction.

◆ apply() [2/3]

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.

◆ apply() [3/3]

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.

◆ enableAbsoluteRadius()

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.

◆ enableCoplanarTest()

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.

◆ enableDuplicateTest()

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.

◆ enableOrderingTest()

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.

◆ getAngle()

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.

◆ getClassTypeId()

static SoType SoBevelAction::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getRadius()

float SoBevelAction::getRadius ( ) const

Returns the bevel radius.

The default value is 0.05.

◆ getSceneGraph()

SoGroup * SoBevelAction::getSceneGraph ( )

This method returns the scene graph containing the beveled shapes created by the action.

◆ getTypeId()

virtual SoType SoBevelAction::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Implements SoTypedObject.

◆ isAbsoluteRadiusEnabled()

SbBool SoBevelAction::isAbsoluteRadiusEnabled ( ) const

Returns TRUE if the radius is absolute, FALSE if it is relative to the shape.

◆ isCoplanarTestEnabled()

SbBool SoBevelAction::isCoplanarTestEnabled ( ) const

Returns TRUE if a coplanar test is performed before the beveling.

◆ isDuplicateTestEnabled()

SbBool SoBevelAction::isDuplicateTestEnabled ( ) const

If TRUE, a test is performed to remove duplicate faces in the shapes being beveled.

◆ isOrderingTestEnabled()

SbBool SoBevelAction::isOrderingTestEnabled ( ) const

Returns TRUE if the shapes are re-ordered before being beveled.

◆ setAngle()

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.

◆ setRadius()

void SoBevelAction::setRadius ( float  radius)

Sets the bevel radius.

The default value is 0.05.


The documentation for this class was generated from the following file: