BRL-CAD
vert_tree.c File Reference

Routines to manage a binary search tree of vertices. More...

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "vmath.h"
#include "bu/malloc.h"
#include "bu/log.h"
#include "bn/vert_tree.h"
Include dependency graph for vert_tree.c:

Go to the source code of this file.

Data Structures

union  vert_tree
 
struct  vert_tree::vert_leaf
 
struct  vert_tree::vert_node
 

Macros

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

Functions

struct vert_rootcreate_vert_tree (void)
 routine to create a vertex tree. More...
 
struct vert_rootcreate_vert_tree_w_norms (void)
 routine to create a vertex tree. More...
 
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. More...
 
void free_vert_tree (struct vert_root *tree_root)
 Routine to free a vertex tree and all associated dynamic memory. More...
 
int Add_vert (double x, double y, double z, struct vert_root *tree_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. More...
 
int Add_vert_and_norm (double x, double y, double z, double nx, double ny, double nz, struct vert_root *tree_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. 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.

Definition in file vert_tree.c.