BRL-CAD
Vertex binary search tree
Collaboration diagram for Vertex binary search tree:

Files

file  vert_tree.h
 

Data Structures

struct  bg_vert_tree
 

Macros

#define BN_VERT_TREE_TYPE_VERTS   1
 
#define BN_VERT_TREE_TYPE_VERTS_AND_NORMS   2
 
#define BN_CK_VERT_TREE(_p)   BU_CKMAG(_p, BN_VERT_TREE_MAGIC, "vert_tree")
 

Functions

struct bg_vert_treebg_vert_tree_create (void)
 routine to create a vertex tree. More...
 
struct bg_vert_treebg_vert_tree_create_w_norms (void)
 routine to create a vertex tree. More...
 
void bg_vert_tree_destroy (struct bg_vert_tree *tree)
 Routine to free a vertex tree and all associated dynamic memory. More...
 
size_t bg_vert_tree_add (struct bg_vert_tree *tree, double x, double y, double z, 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. More...
 
size_t bg_vert_tree_add_w_norm (struct bg_vert_tree *tree, double x, double y, double z, double nx, double ny, double nz, 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. More...
 
void bg_vert_tree_clean (struct bg_vert_tree *tree)
 Routine to free the binary search tree and reset the current number of vertices. The vertex array is left untouched, for reuse later. More...
 

Detailed Description

Routines to manage a binary search tree of vertices.

The actual vertices are stored in an array for convenient use by routines such as "mk_bot". The binary search tree stores indices into the array.

Macro Definition Documentation

◆ BN_VERT_TREE_TYPE_VERTS

#define BN_VERT_TREE_TYPE_VERTS   1

Definition at line 59 of file vert_tree.h.

◆ BN_VERT_TREE_TYPE_VERTS_AND_NORMS

#define BN_VERT_TREE_TYPE_VERTS_AND_NORMS   2

Definition at line 60 of file vert_tree.h.

◆ BN_CK_VERT_TREE

#define BN_CK_VERT_TREE (   _p)    BU_CKMAG(_p, BN_VERT_TREE_MAGIC, "vert_tree")

Definition at line 62 of file vert_tree.h.

Function Documentation

◆ bg_vert_tree_create()

struct bg_vert_tree* bg_vert_tree_create ( void  )

routine to create a vertex tree.

Possible refinements include specifying an initial size

◆ bg_vert_tree_create_w_norms()

struct bg_vert_tree* bg_vert_tree_create_w_norms ( void  )

routine to create a vertex tree.

Possible refinements include specifying an initial size

◆ bg_vert_tree_destroy()

void bg_vert_tree_destroy ( struct bg_vert_tree tree)

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

◆ bg_vert_tree_add()

size_t bg_vert_tree_add ( struct bg_vert_tree tree,
double  x,
double  y,
double  z,
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.

◆ bg_vert_tree_add_w_norm()

size_t bg_vert_tree_add_w_norm ( struct bg_vert_tree tree,
double  x,
double  y,
double  z,
double  nx,
double  ny,
double  nz,
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.

◆ bg_vert_tree_clean()

void bg_vert_tree_clean ( struct bg_vert_tree tree)

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