Home

defeature_options Class Reference
[Defeaturing]

Options for local operations. More...

#include <acis_defeature_options.hxx>

Inheritance diagram for defeature_options:

Inheritance graph
[legend]
Collaboration diagram for defeature_options:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void clear_features ()
 Resets state of the options object to before recognize, clearing both recognized and failed feature lists.
defeature_optionsclone () const
 Returns a clone of the object.
 defeature_options ()
 C++ Default constructor requests memory for this object and assigns default values.
double get_blend_supports_max_angle () const
 Gets the value of the blend_supports_max_angle parameter.
double get_blends_max_radius () const
 Gets the value of the blends_max_radius parameter.
int get_blends_num_curvature_samples () const
 Gets the number of sample points used for testing blends as Constant Radius or Variable Radius blends.
double get_chamfer_supports_max_angle () const
 Gets the value of the chamfer_supports_max_angle parameter.
double get_chamfers_max_width () const
 Gets the value of the chamfers_max_width parameter.
outcome get_failed_feature (int feature_id, ENTITY_LIST &feature_faces, defeature_feature_type &type) const
 Returns the faces and feature type of a failed feature.
outcome get_feature (int feature_id, ENTITY_LIST &feature_faces, defeature_feature_type &type) const
 Returns the faces and feature type of a recognized feature.
double get_hole_max_diameter () const
 Gets the value of the hole_max_diameter parameter.
void get_kept_faces (ENTITY_LIST &kept_faces) const
 Returns a list of faces that were kept and not removed by the feature removal.
int get_num_failed_features () const
 Returns the number of failed features.
int get_num_features () const
 Returns the number of recognized features.
logical get_pause_after_recognize ()
 Gets the status of the pause_after_recognize flag.
logical get_recognize_blends () const
 Gets the status of the recognize_blends flag.
logical get_recognize_chamfers () const
 Gets the status of the recognize_chamfers flag.
logical get_recognize_holes () const
 Gets the status of the recognize_holes flag.
logical get_recognize_sphericalholes () const
 Gets the status of the recognize_spherical_holes flag.
void keep_face (FACE const *feature_face, logical keep_it=TRUE)
 Controls defeaturing by marking a face on a feature that is not to be removed.
logical kept_face (FACE const *feature_face) const
 Queries if a face was kept and not removed by the feature removal.
logical recognize_done () const
 Returns the status of the recognize_done flag.
logical remove_done () const
 Returns the status of the remove_done flag.
outcome set_blend_supports_max_angle (double diameter)
 Sets the value of the blend_supports_max_angle parameter to input value in degrees.
outcome set_blend_supports_max_angle ()
 Sets the value of the blend_supports_max_angle parameter to the default value of 175 degrees.
outcome set_blends_max_radius (double radius)
 Sets the value of the blends_max_radius parameter to the input value.
outcome set_blends_max_radius ()
 Sets the value of the blends_max_radius parameter to be the default value of 10.
outcome set_blends_num_curvature_samples (int numSamples)
 Sets the number of sample points used for testing blends as Constant Radius or Variable Radius blends to the given value.
outcome set_blends_num_curvature_samples ()
 Sets the number of sample points used for testing blends as Constant Radius or Variable Radius blends to the default value of 1.
outcome set_chamfer_supports_max_angle (double angle)
 Sets the value of the chamfer_supports_max_angle parameter to input value in degrees.
outcome set_chamfer_supports_max_angle ()
 Sets the value of the chamfer_supports_max_angle parameter to the default value of 105 degrees.
outcome set_chamfers_max_width (double width)
 Sets the value of the chamfers_max_width parameter to the input value.
outcome set_chamfers_max_width ()
 Sets the value of the chamfers_max_width parameter to the default value of 10.
outcome set_hole_max_diameter (double diameter)
 Sets the value of the hole_max_diameter parameter to the input value.
outcome set_hole_max_diameter ()
 Sets the value of the hole_max_diameter parameter to the default value of 10.
outcome set_pause_after_recognize (logical flag)
 Sets the status of the pause_after_recognize flag.
outcome set_recognize_blends (logical flag)
 Sets the status of the recognize_blends flag to the input value.
outcome set_recognize_blends ()
 Sets the status of the recognize_blends flag to the default value of TRUE.
outcome set_recognize_chamfers (logical flag)
 Sets the status of the recognize_chamfers flag to the input value.
outcome set_recognize_chamfers ()
 Sets the status of the recognize_chamfers flag to the default value of TRUE.
outcome set_recognize_holes (logical flag)
 Sets the status of the recognize_holes flag to the input value.
outcome set_recognize_holes ()
 Sets the status of the recognize_holes flag to the default value of TRUE.
outcome set_recognize_sphericalholes (logical flag)
 Sets the status of the recognize_spherical_holes flag to the input value.
outcome set_recognize_sphericalholes ()
 Sets the status of the recognize_spherical_holes flag to the default value of TRUE.
 ~defeature_options ()
 C++ Default destructor.

Protected Member Functions

 defeature_options (const defeature_options &copy)
 Copy constructor.
defeature_optionsoperator= (const defeature_options &copy)
 Assignment operator.

Private Attributes

double blend_max_radius
 Maximum radius of blends to recognize.
int blend_num_curvature_samples
 The number of sample points used for testing the blend as Constant Radius or Variable Radius blend.
double blend_supports_max_angle
 Maximum angle between blend supports.
double cham_max_width
 Maximum width of chamfers to recognize.
double chamfer_supports_max_angle
 Maximum angle between chamfer supports.
logical do_blends
 Recognize blends flag.
logical do_chamfers
 Recognize chamfers flag.
logical do_holes
 Recognize holes flag.
FRSFeatureData * feature_data
 Holds all the feature list info set by FR.
double hole_max_dia
 Maximum diameter of holes to recognize.
logical include_spherical_holes
 Include spherical holes.
ENTITY_LIST keep_faces
 Holds list of faces to keep.
logical pause_after_recognize
 Flag that specifies if processing stops after feature recognition.

Friends

outcome api_find_and_remove_features (const ENTITY_LIST &input_bodies, defeature_options *dfopts, AcisOptions *aopts)
 Recognizes and/or removes features (holes, chamfers, and blends) in the input bodies.


Detailed Description

Options for local operations.


Role: The defeature_options object fulfills three roles:

In general, the parameters managed by the options object are managed through get_* and set_* methods. For example, the hole_max_diameter parameter is controlled by the methods get_hole_max_diameter and set_hole_max_diameter. Calling a set_* method without any arguments resets the parameter to its default value.
The parameters of the defeature_options class are listed in the following table. Each of these parameters has a set and get method.
blends_max_radius Specifies the maximum radius of blends to recognize. The default value is 10.
blends_num_curvature_samples Specifies the number of sample points used for testing the blend as Constant Radius or Variable Radius blend. The default value is 1.
blend_supports_max_angle Specifies the maximum angle (in degrees) between blend supports. The default value is 175.
chamfers_max_width Specifies the maximum width of chamfers to recognize. The default value is 10.
chamfer_supports_max_angle Specifies the maximum angle (in degrees) between chamfer supports. The default value is 105.
recognize_blends Specifies that blend recognition should be done. The default value is TRUE.
recognize_chamfers Specifies that chamfer recognition should be done. The default value is TRUE.
recognize_holes Specifies that hole recognition should be done. The default value is TRUE.
hole_max_diameter Specifies the maximum diameter of holes to recognize. The default value is 10.
recognize_spherical_holes Specifies that spherical hole recognition should be done. The default value is TRUE.
keep_faces Specifies list of faces that are to be kept and not removed by the feature removal. The default value is an empty list.
pause_after_recognize Specifies that processing stops after the feature recognition stage. The default value is FALSE.


Constructor & Destructor Documentation

defeature_options::defeature_options ( const defeature_options copy  )  [protected]

Copy constructor.

defeature_options::defeature_options (  ) 

C++ Default constructor requests memory for this object and assigns default values.

defeature_options::~defeature_options (  ) 

C++ Default destructor.


Member Function Documentation

void defeature_options::clear_features (  ) 

Resets state of the options object to before recognize, clearing both recognized and failed feature lists.

defeature_options* defeature_options::clone (  )  const

Returns a clone of the object.

The feature data of the defeature_options object is not cloned.

double defeature_options::get_blend_supports_max_angle (  )  const

Gets the value of the blend_supports_max_angle parameter.

This is the maximum angle (in degrees) between supports of blends that are recognized and removed.

double defeature_options::get_blends_max_radius (  )  const

Gets the value of the blends_max_radius parameter.

This value is the maximum radius of the blends that are recognized and removed.

int defeature_options::get_blends_num_curvature_samples (  )  const

Gets the number of sample points used for testing blends as Constant Radius or Variable Radius blends.

double defeature_options::get_chamfer_supports_max_angle (  )  const

Gets the value of the chamfer_supports_max_angle parameter.

This is the maximum angle (in degrees) between supports of chamfer that are recognized and removed.

double defeature_options::get_chamfers_max_width (  )  const

Gets the value of the chamfers_max_width parameter.

This is the maximum width of the chamfers that are recognized and removed.

outcome defeature_options::get_failed_feature ( int  feature_id,
ENTITY_LIST feature_faces,
defeature_feature_type type 
) const

Returns the faces and feature type of a failed feature.

This method is valid when feature removal has been completed (remove_done is TRUE).

Parameters:
feature_id index into the list of failed features.
feature_faces ENTITY_LIST that will be populated with the list of faces for the feature.
type defeature_feature_type that will be populated with the type of feature.

outcome defeature_options::get_feature ( int  feature_id,
ENTITY_LIST feature_faces,
defeature_feature_type type 
) const

Returns the faces and feature type of a recognized feature.

This method is valid when feature recognition has been completed (recognize_done is TRUE) and feature removal has not been completed (remove_done is FALSE).

Parameters:
feature_id index into the list of features that were recognized.
feature_faces ENTITY_LIST that will be populated with the list of faces.
type defeature_feature_type that will be populated with the type of feature.

double defeature_options::get_hole_max_diameter (  )  const

Gets the value of the hole_max_diameter parameter.

This is the maximum diameter of the holes that are recognized and removed.

void defeature_options::get_kept_faces ( ENTITY_LIST kept_faces  )  const

Returns a list of faces that were kept and not removed by the feature removal.

Parameters:
kept_faces ENTITY_LIST that will be populated with the list of kept faces.

int defeature_options::get_num_failed_features (  )  const

Returns the number of failed features.

This method is valid when feature removal has been completed (remove_done is TRUE).

int defeature_options::get_num_features (  )  const

Returns the number of recognized features.

This method is valid when feature recognition has been completed (recognize_done is TRUE) and feature removal has not been completed (remove_done is FALSE).

logical defeature_options::get_pause_after_recognize (  ) 

Gets the status of the pause_after_recognize flag.

logical defeature_options::get_recognize_blends (  )  const

Gets the status of the recognize_blends flag.

logical defeature_options::get_recognize_chamfers (  )  const

Gets the status of the recognize_chamfers flag.

logical defeature_options::get_recognize_holes (  )  const

Gets the status of the recognize_holes flag.

logical defeature_options::get_recognize_sphericalholes (  )  const

Gets the status of the recognize_spherical_holes flag.

void defeature_options::keep_face ( FACE const *  feature_face,
logical  keep_it = TRUE 
)

Controls defeaturing by marking a face on a feature that is not to be removed.

Parameters:
feature_face the face on which you would like to set the keep_it flag.
keep_it logical parameter that tells the defeaturing process to keep a face during feature removal. Default is TRUE.

logical defeature_options::kept_face ( FACE const *  feature_face  )  const

Queries if a face was kept and not removed by the feature removal.

Parameters:
feature_face face for which the query is to be performed.

defeature_options& defeature_options::operator= ( const defeature_options copy  )  [protected]

Assignment operator.

logical defeature_options::recognize_done (  )  const

Returns the status of the recognize_done flag.

logical defeature_options::remove_done (  )  const

Returns the status of the remove_done flag.

outcome defeature_options::set_blend_supports_max_angle ( double  diameter  ) 

Sets the value of the blend_supports_max_angle parameter to input value in degrees.

Can be called only before feature recognition.

outcome defeature_options::set_blend_supports_max_angle (  ) 

Sets the value of the blend_supports_max_angle parameter to the default value of 175 degrees.

Can be called only before feature recognition.

outcome defeature_options::set_blends_max_radius ( double  radius  ) 

Sets the value of the blends_max_radius parameter to the input value.

Can be called only before feature recognition.

Parameters:
radius new value

outcome defeature_options::set_blends_max_radius (  ) 

Sets the value of the blends_max_radius parameter to be the default value of 10.

Can be called only before feature recognition.

outcome defeature_options::set_blends_num_curvature_samples ( int  numSamples  ) 

Sets the number of sample points used for testing blends as Constant Radius or Variable Radius blends to the given value.

Can be called only before feature recognition.

Parameters:
numSamples new value

outcome defeature_options::set_blends_num_curvature_samples (  ) 

Sets the number of sample points used for testing blends as Constant Radius or Variable Radius blends to the default value of 1.

Can be called only before feature recognition.

outcome defeature_options::set_chamfer_supports_max_angle ( double  angle  ) 

Sets the value of the chamfer_supports_max_angle parameter to input value in degrees.

Can be called only before feature recognition.

outcome defeature_options::set_chamfer_supports_max_angle (  ) 

Sets the value of the chamfer_supports_max_angle parameter to the default value of 105 degrees.

Can be called only before feature recognition.

outcome defeature_options::set_chamfers_max_width ( double  width  ) 

Sets the value of the chamfers_max_width parameter to the input value.

Can be called only before feature recognition.

Parameters:
width new value.

outcome defeature_options::set_chamfers_max_width (  ) 

Sets the value of the chamfers_max_width parameter to the default value of 10.

Can be called only before feature recognition.

outcome defeature_options::set_hole_max_diameter ( double  diameter  ) 

Sets the value of the hole_max_diameter parameter to the input value.

Can be called only before feature recognition.

Parameters:
diameter new value.

outcome defeature_options::set_hole_max_diameter (  ) 

Sets the value of the hole_max_diameter parameter to the default value of 10.

Can be called only before feature recognition.

outcome defeature_options::set_pause_after_recognize ( logical  flag  ) 

Sets the status of the pause_after_recognize flag.

Can be called only before feature recognition.

Parameters:
flag new value

outcome defeature_options::set_recognize_blends ( logical  flag  ) 

Sets the status of the recognize_blends flag to the input value.

Can be called only before feature recognition.

Parameters:
flag new value

outcome defeature_options::set_recognize_blends (  ) 

Sets the status of the recognize_blends flag to the default value of TRUE.

Can be called only before feature recognition.

outcome defeature_options::set_recognize_chamfers ( logical  flag  ) 

Sets the status of the recognize_chamfers flag to the input value.

Parameters:
flag new value

outcome defeature_options::set_recognize_chamfers (  ) 

Sets the status of the recognize_chamfers flag to the default value of TRUE.

outcome defeature_options::set_recognize_holes ( logical  flag  ) 

Sets the status of the recognize_holes flag to the input value.

This method can be called only before feature recognition.

Parameters:
flag new value.

outcome defeature_options::set_recognize_holes (  ) 

Sets the status of the recognize_holes flag to the default value of TRUE.

This method can be called only before feature recognition.

outcome defeature_options::set_recognize_sphericalholes ( logical  flag  ) 

Sets the status of the recognize_spherical_holes flag to the input value.

Parameters:
flag new value

outcome defeature_options::set_recognize_sphericalholes (  ) 

Sets the status of the recognize_spherical_holes flag to the default value of TRUE.


Friends And Related Function Documentation

outcome api_find_and_remove_features ( const ENTITY_LIST input_bodies,
defeature_options dfopts,
AcisOptions aopts 
) [friend]

Recognizes and/or removes features (holes, chamfers, and blends) in the input bodies.


Role: This API function takes an ENTITY_LIST of bodies and as per the defeature_options object passed in, recognizes and/or removes features.

The behavior of this API function is controlled using the defeature_options object. The defeature_options object controls the actions of the API function. If a call is made with pause_after_recognize as FALSE, feature recognition is done but feature removal is not done. The defeature_options object controls the type of features removed as well as specify parameters about the features. The types of features that can be removed are:

  • Holes
  • Blends
  • Chamfers
The removal of these features can be controlled using the parameters in the defeature_options object. For example, if only blends are to be removed, then the do_holes and do_chamfers parameters are set to FALSE. Further, the blends that are removed can be controlled by setting the blend_max_radius parameter to the appropriate value. Similarly, the behavior of the hole and chamfer removal can be controlled by setting the appropriate parameters on the defeature_options object.

Errors: None

Limitations: The input bodies must be manifold.

Library: SPADefeature

Effect: Changes model

Parameters:
input_bodies ENTITY_LIST of bodies that need to be defeatured
dfopts defeature_options object that specifies the behavior of the API function.
aopts AcisOptions General ACIS Options


Member Data Documentation

Maximum radius of blends to recognize.

The number of sample points used for testing the blend as Constant Radius or Variable Radius blend.

Maximum angle between blend supports.

Maximum width of chamfers to recognize.

Maximum angle between chamfer supports.

logical defeature_options::do_blends [private]

Recognize blends flag.

logical defeature_options::do_chamfers [private]

Recognize chamfers flag.

logical defeature_options::do_holes [private]

Recognize holes flag.

FRSFeatureData* defeature_options::feature_data [private]

Holds all the feature list info set by FR.

Maximum diameter of holes to recognize.

Include spherical holes.

Holds list of faces to keep.

Flag that specifies if processing stops after feature recognition.