Vertex Trees
[libbn (numerical functions)]

Collaboration diagram for Vertex Trees:

Data Structures

union  vert_tree

Files

file  vert_tree.c
 

Routines to manage a binary search tree of vertices.


Defines

#define VERT_LEAF   'l'
#define VERT_NODE   'n'

Functions

struct vert_rootcreate_vert_tree ()
 routine to create a vertex tree.
struct vert_rootcreate_vert_tree_w_norms ()
 routine to create a vertex tree.
void clean_vert_tree (struct vert_root *tree_root)
 Routine to free the binary search tree and reset the current number of vertices. The vertex array is left untouched, for re-use later.
void free_vert_tree (struct vert_root *vert_root)
 Routine to free a vertex tree and all associated dynamic memory.
int Add_vert (double x, double y, double z, struct vert_root *vert_root, fastf_t local_tol_sq)
 Routine to add a vertex to the current list of part vertices. The array is re-alloc'd if needed. Returns index into the array of vertices where this vertex is stored.
int Add_vert_and_norm (double x, double y, double z, double nx, double ny, double nz, struct vert_root *vert_root, fastf_t local_tol_sq)
 Routine to add a vertex and a normal to the current list of part vertices. The array is re-alloc'd if needed. Returns index into the array of vertices where this vertex and normal is stored.

Detailed Description


Define Documentation

#define VERT_LEAF   'l'

Definition at line 72 of file vert_tree.c.

Referenced by Add_vert(), and Add_vert_and_norm().

#define VERT_NODE   'n'

Definition at line 73 of file vert_tree.c.

Referenced by Add_vert(), and Add_vert_and_norm().


Function Documentation

struct vert_root* create_vert_tree (  )  [read]

routine to create a vertex tree.

C R E A T E _ V E R T _ T R E E Possible refinements include specifying an initial size

Definition at line 83 of file vert_tree.c.

References vert_root::curr_vert, vert_root::magic, vert_root::max_vert, vert_root::the_array, vert_root::the_tree, vert_root::tree_type, TREE_TYPE_VERTS, and VERT_BLOCK.

struct vert_root* create_vert_tree_w_norms (  )  [read]

routine to create a vertex tree.

C R E A T E _ V E R T _ T R E E _ W _ N O R M S Possible refinements include specifying an initial size

Definition at line 105 of file vert_tree.c.

References vert_root::curr_vert, vert_root::magic, vert_root::max_vert, vert_root::the_array, vert_root::the_tree, vert_root::tree_type, TREE_TYPE_VERTS_AND_NORMS, and VERT_BLOCK.

void clean_vert_tree ( struct vert_root tree_root  ) 

Routine to free the binary search tree and reset the current number of vertices. The vertex array is left untouched, for re-use later.

C L E A N _ V E R T _ T R E E

Definition at line 142 of file vert_tree.c.

References BN_CK_VERT_TREE, vert_root::curr_vert, and vert_root::the_tree.

void free_vert_tree ( struct vert_root vert_root  ) 

Routine to free a vertex tree and all associated dynamic memory.

F R E E _ V E R T_ T R E E

Definition at line 175 of file vert_tree.c.

References BN_CK_VERT_TREE, vert_root::curr_vert, vert_root::max_vert, vert_root::the_array, and vert_root::the_tree.

int Add_vert ( double  x,
double  y,
double  z,
struct vert_root vert_root,
fastf_t  local_tol_sq 
)

Routine to add a vertex to the current list of part vertices. The array is re-alloc'd if needed. Returns index into the array of vertices where this vertex is stored.

A D D _ V E R T

Definition at line 207 of file vert_tree.c.

References BN_CK_VERT_TREE, vert_node::coord, vert_root::curr_vert, vert_node::cut_val, vert_node::higher, vert_leaf::index, vert_node::lower, vert_root::max_vert, vert_root::the_array, vert_root::the_tree, vert_root::tree_type, TREE_TYPE_VERTS, vert_node::type, vert_tree::type, VERT_BLOCK, VERT_LEAF, VERT_NODE, VINIT_ZERO, vert_tree::vleaf, VMOVE, vert_tree::vnode, and VSET.

int Add_vert_and_norm ( double  x,
double  y,
double  z,
double  nx,
double  ny,
double  nz,
struct vert_root vert_root,
fastf_t  local_tol_sq 
)

Routine to add a vertex and a normal to the current list of part vertices. The array is re-alloc'd if needed. Returns index into the array of vertices where this vertex and normal is stored.

A D D _ V E R T _ A N D _ N O R M

Definition at line 332 of file vert_tree.c.

References BN_CK_VERT_TREE, vert_node::coord, vert_root::curr_vert, vert_node::cut_val, vert_node::higher, vert_leaf::index, vert_node::lower, vert_root::max_vert, vert_root::the_array, vert_root::the_tree, vert_root::tree_type, TREE_TYPE_VERTS_AND_NORMS, vert_node::type, vert_tree::type, VDOT, VERT_BLOCK, VERT_LEAF, VERT_NODE, vert_tree::vleaf, VMOVE, vert_tree::vnode, and VSET.

Generated on Tue Dec 11 13:14:30 2012 for LIBBN by  doxygen 1.6.3