BRL-CAD
shape_recognition.cpp File Reference
#include "common.h"
#include <set>
#include <map>
#include "bu/log.h"
#include "bu/str.h"
#include "bu/malloc.h"
#include "shape_recognition.h"
Include dependency graph for shape_recognition.cpp:

Go to the source code of this file.

Functions

curve_t GetCurveType (ON_Curve *curve)
 
surface_t GetSurfaceType (const ON_Surface *in_surface, struct filter_obj *obj)
 
surface_t highest_order_face (ON_Brep *brep)
 
void filter_obj_init (struct filter_obj *obj)
 
void filter_obj_free (struct filter_obj *obj)
 
volume_t subbrep_shape_recognize (struct subbrep_object_data *data)
 
void subbrep_object_init (struct subbrep_object_data *obj, ON_Brep *brep)
 
void subbrep_object_free (struct subbrep_object_data *obj)
 
std::string face_set_key (std::set< int > fset)
 
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 map_to_array (int **array, int *array_cnt, std::map< int, int > *map)
 
void array_to_map (std::map< int, int > *map, int *array, int array_cnt)
 
struct bu_ptblfind_subbreps (ON_Brep *brep)
 
void print_subbrep_object (struct subbrep_object_data *data, const char *offset)
 
void set_filter_obj (ON_BrepFace *face, struct filter_obj *obj)
 
int apply_filter_obj (ON_BrepFace *face, int loop_index, struct filter_obj *obj)
 
void add_loops_from_face (ON_BrepFace *face, struct subbrep_object_data *data, std::set< int > *loops, std::queue< int > *local_loops, std::set< int > *processed_loops)
 
int subbrep_split (struct subbrep_object_data *data)
 
int subbrep_make_brep (struct subbrep_object_data *data)
 
int subbreps_boolean_tree (struct bu_ptbl *subbreps)
 

Function Documentation

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 *  in_surface,
struct filter_obj obj 
)
surface_t highest_order_face ( ON_Brep brep)

Definition at line 113 of file shape_recognition.cpp.

References bu_vls_addr(), data, GetSurfaceType(), SURFACE_CONE, SURFACE_CYLINDER, SURFACE_GENERAL, SURFACE_PLANE, SURFACE_SPHERE, and SURFACE_TORUS.

Referenced by subbrep_split().

Here is the call graph for this function:

void filter_obj_init ( struct filter_obj obj)
void filter_obj_free ( struct filter_obj obj)
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:

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:

std::string face_set_key ( std::set< int >  fset)

Definition at line 265 of file shape_recognition.cpp.

References bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, and bu_vls_printf().

Referenced by find_subbreps(), and subbrep_split().

Here is the call graph for this function:

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 map_to_array ( int **  array,
int *  array_cnt,
std::map< int, int > *  map 
)

Definition at line 307 of file shape_recognition.cpp.

References bu_calloc().

Referenced by subbrep_make_brep().

Here is the call graph for this function:

void array_to_map ( std::map< int, int > *  map,
int *  array,
int  array_cnt 
)

Definition at line 323 of file shape_recognition.cpp.

void set_filter_obj ( ON_BrepFace *  face,
struct filter_obj obj 
)

Definition at line 489 of file shape_recognition.cpp.

References BREP, CONE, CYLINDER, filter_obj_init(), GetSurfaceType(), SPHERE, filter_obj::stype, SURFACE_CONE, SURFACE_CYLINDER, SURFACE_CYLINDRICAL_SECTION, SURFACE_GENERAL, SURFACE_PLANE, SURFACE_SPHERE, SURFACE_SPHERICAL_SECTION, SURFACE_TORUS, TORUS, and filter_obj::type.

Referenced by subbrep_split().

Here is the call graph for this function:

int apply_filter_obj ( ON_BrepFace *  face,
int  loop_index,
struct filter_obj obj 
)

Definition at line 512 of file shape_recognition.cpp.

References BREP_CYLINDRICAL_TOL, BREP_PLANAR_TOL, BU_GET, BU_PUT, CONE, CYLINDER, filter_obj::cylinder, filter_obj_free(), GetSurfaceType(), filter_obj::plane, SPHERE, SURFACE_CONE, SURFACE_CYLINDER, SURFACE_CYLINDRICAL_SECTION, SURFACE_PLANE, SURFACE_SPHERE, SURFACE_SPHERICAL_SECTION, SURFACE_TORUS, TORUS, and filter_obj::type.

Referenced by subbrep_split().

Here is the call graph for this function:

void add_loops_from_face ( ON_BrepFace *  face,
struct subbrep_object_data data,
std::set< int > *  loops,
std::queue< int > *  local_loops,
std::set< int > *  processed_loops 
)

Definition at line 580 of file shape_recognition.cpp.

References subbrep_object_data::loops.

Referenced by subbrep_split().

int subbreps_boolean_tree ( struct bu_ptbl subbreps)

Definition at line 968 of file shape_recognition.cpp.

References bu_log(), BU_PTBL_GET, BU_PTBL_LEN, subbrep_object_data::fil_cnt, and subbrep_object_data::parent.

Here is the call graph for this function: