BRL-CAD
shape_recognition.h File Reference
#include "common.h"
#include "bu/ptbl.h"
#include "brep.h"
Include dependency graph for shape_recognition.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  filter_obj
 
struct  csg_object_params
 
struct  subbrep_object_data
 

Macros

#define BREP_PLANAR_TOL   0.05
 
#define BREP_CYLINDRICAL_TOL   0.05
 
#define BREP_CONIC_TOL   0.05
 
#define BREP_SPHERICAL_TOL   0.05
 
#define BREP_ELLIPSOIDAL_TOL   0.05
 
#define BREP_TOROIDAL_TOL   0.05
 

Enumerations

enum  curve_t {
  CURVE_POINT = 0, CURVE_LINE, CURVE_ARC, CURVE_CIRCLE,
  CURVE_PARABOLA, CURVE_ELLIPSE, CURVE_GENERAL
}
 
enum  surface_t {
  SURFACE_PLANE = 0, SURFACE_CYLINDRICAL_SECTION, SURFACE_CYLINDER, SURFACE_CONE,
  SURFACE_SPHERICAL_SECTION, SURFACE_SPHERE, SURFACE_ELLIPSOIDAL_SECTION, SURFACE_ELLIPSOID,
  SURFACE_TORUS, SURFACE_GENERAL
}
 
enum  volume_t {
  COMB = 0, PLANAR_VOLUME, CYLINDER, CONE,
  SPHERE, ELLIPSOID, TORUS, BREP
}
 

Functions

void filter_obj_init (struct filter_obj *)
 
void filter_obj_free (struct filter_obj *)
 
curve_t GetCurveType (ON_Curve *curve)
 
surface_t GetSurfaceType (const ON_Surface *surface, struct filter_obj *obj)
 
void set_to_array (int **array, int *array_cnt, std::set< int > *set)
 
void array_to_set (std::set< int > *set, int *array, int array_cnt)
 
void subbrep_object_init (struct subbrep_object_data *obj, ON_Brep *brep)
 
void subbrep_object_free (struct subbrep_object_data *obj)
 
int subbrep_split (struct subbrep_object_data *data)
 
int subbrep_make_brep (struct subbrep_object_data *data)
 
struct bu_ptblfind_subbreps (ON_Brep *brep)
 
void print_subbrep_object (struct subbrep_object_data *data, const char *offset)
 
volume_t subbrep_shape_recognize (struct subbrep_object_data *data)
 
int subbrep_is_planar (struct subbrep_object_data *data)
 
int cylindrical_loop_planar_vertices (ON_BrepFace *face, int loop_index)
 
int subbrep_is_cylinder (struct subbrep_object_data *data, fastf_t cyl_tol)
 
int cylinder_csg (struct subbrep_object_data *data, fastf_t cyl_tol)
 
int subbrep_is_cone (struct subbrep_object_data *data, fastf_t cone_tol)
 
int cone_csg (struct subbrep_object_data *data, fastf_t cone_tol)
 

Macro Definition Documentation

#define BREP_PLANAR_TOL   0.05
#define BREP_CYLINDRICAL_TOL   0.05
#define BREP_CONIC_TOL   0.05

Definition at line 10 of file shape_recognition.h.

Referenced by GetSurfaceType(), subbrep_shape_recognize(), and subbrep_split().

#define BREP_SPHERICAL_TOL   0.05

Definition at line 11 of file shape_recognition.h.

Referenced by GetSurfaceType().

#define BREP_ELLIPSOIDAL_TOL   0.05

Definition at line 12 of file shape_recognition.h.

Referenced by GetCurveType().

#define BREP_TOROIDAL_TOL   0.05

Definition at line 13 of file shape_recognition.h.

Referenced by GetSurfaceType().

Enumeration Type Documentation

enum curve_t
Enumerator
CURVE_POINT 
CURVE_LINE 
CURVE_ARC 
CURVE_CIRCLE 
CURVE_PARABOLA 
CURVE_ELLIPSE 
CURVE_GENERAL 

Definition at line 15 of file shape_recognition.h.

enum surface_t
Enumerator
SURFACE_PLANE 
SURFACE_CYLINDRICAL_SECTION 
SURFACE_CYLINDER 
SURFACE_CONE 
SURFACE_SPHERICAL_SECTION 
SURFACE_SPHERE 
SURFACE_ELLIPSOIDAL_SECTION 
SURFACE_ELLIPSOID 
SURFACE_TORUS 
SURFACE_GENERAL 

Definition at line 26 of file shape_recognition.h.

enum volume_t
Enumerator
COMB 
PLANAR_VOLUME 
CYLINDER 
CONE 
SPHERE 
ELLIPSOID 
TORUS 
BREP 

Definition at line 40 of file shape_recognition.h.

Function Documentation

void filter_obj_init ( struct filter_obj )
void filter_obj_free ( struct filter_obj )
curve_t GetCurveType ( ON_Curve *  curve)

Definition at line 12 of file shape_recognition.cpp.

References BREP_CYLINDRICAL_TOL, BREP_ELLIPSOIDAL_TOL, bu_log(), CURVE_ARC, CURVE_CIRCLE, CURVE_ELLIPSE, CURVE_GENERAL, CURVE_LINE, and CURVE_POINT.

Here is the call graph for this function:

surface_t GetSurfaceType ( const ON_Surface *  surface,
struct filter_obj obj 
)
void set_to_array ( int **  array,
int *  array_cnt,
std::set< int > *  set 
)

Definition at line 284 of file shape_recognition.cpp.

References bu_calloc().

Referenced by find_subbreps(), and subbrep_split().

Here is the call graph for this function:

void array_to_set ( std::set< int > *  set,
int *  array,
int  array_cnt 
)
void subbrep_object_init ( struct subbrep_object_data obj,
ON_Brep brep 
)

Definition at line 219 of file shape_recognition.cpp.

References BREP, subbrep_object_data::brep, BU_GET, bu_ptbl_init(), bu_vls_init(), subbrep_object_data::children, subbrep_object_data::key, subbrep_object_data::local_brep, subbrep_object_data::params, subbrep_object_data::parent, and subbrep_object_data::type.

Referenced by find_subbreps(), and subbrep_split().

Here is the call graph for this function:

volume_t subbrep_shape_recognize ( struct subbrep_object_data data)

Definition at line 210 of file shape_recognition.cpp.

References BREP, BREP_CONIC_TOL, BREP_CYLINDRICAL_TOL, CONE, CYLINDER, PLANAR_VOLUME, subbrep_is_cone(), subbrep_is_cylinder(), and subbrep_is_planar().

Referenced by find_subbreps().

Here is the call graph for this function:

int subbrep_is_planar ( struct subbrep_object_data data)

Definition at line 13 of file shape_recognition_planar.cpp.

References subbrep_object_data::brep, subbrep_object_data::faces, subbrep_object_data::faces_cnt, GetSurfaceType(), PLANAR_VOLUME, SURFACE_PLANE, and subbrep_object_data::type.

Referenced by subbrep_shape_recognize().

Here is the call graph for this function:

int cylindrical_loop_planar_vertices ( ON_BrepFace *  face,
int  loop_index 
)

Definition at line 184 of file shape_recognition_cylinder.cpp.

References BREP_PLANAR_TOL, and NEAR_ZERO.

Referenced by cylindrical_planar_vertices().

int cylinder_csg ( struct subbrep_object_data data,
fastf_t  cyl_tol 
)
int subbrep_is_cone ( struct subbrep_object_data data,
fastf_t  cone_tol 
)
int cone_csg ( struct subbrep_object_data data,
fastf_t  cone_tol 
)