Random Number Tables
[Random Numbers]

Collaboration diagram for Random Number Tables:

Data Structures

struct  bn_table
struct  bn_tabdata
struct  bn_vlist
struct  bn_vlblock
struct  vert_root
struct  plane_specific
struct  tri_specific
struct  tri_float_specific

Files

file  rand.c
 

These are our tables of random numbers.


Defines

#define BN_RAND_TABSIZE   4096
#define BN_RAND_TABMASK   0xfff
#define BN_RANDSEED(_i, _seed)   _i = ((unsigned)_seed) % BN_RAND_TABSIZE
#define BN_RANDOM(_i)   bn_rand_table[ _i = (_i+1) % BN_RAND_TABSIZE ]
#define BN_RANDHALF(_i)   (bn_rand_table[ _i = (_i+1) % BN_RAND_TABSIZE ]-0.5)
#define BN_RANDHALF_INIT(_p)   _p = bn_rand_table
#define BN_RANDHALFTABSIZE   16535
#define bn_rand_half(_p)
#define bn_rand_init(_p, _seed)
#define bn_rand0to1(_q)   (bn_rand_half(_q)+0.5)
#define BN_SINTABSIZE   2048
#define bn_tab_sin(_a)
#define CK_POW_2(dimen)
#define BN_CK_TABLE(_p)   BU_CKMAG(_p, BN_TABLE_MAGIC, "bn_table")
#define BN_TABLE_NULL   ((struct bn_table *)NULL)
#define BN_GET_TABLE(_table, _nx)
#define BN_CK_TABDATA(_p)   BU_CKMAG(_p, BN_TABDATA_MAGIC, "bn_tabdata")
#define BN_TABDATA_NULL   ((struct bn_tabdata *)NULL)
#define BN_SIZEOF_TABDATA_Y(_tabdata)   sizeof(fastf_t)*((_tabdata)->ny)
#define BN_SIZEOF_TABDATA(_table)
#define BN_GET_TABDATA(_data, _table)
#define BN_VLIST_CHUNK   35
 32-bit mach => just less than 1k
#define BN_VLIST_NULL   ((struct bn_vlist *)0)
#define BN_CK_VLIST(_p)   BU_CKMAG((_p), BN_VLIST_MAGIC, "bn_vlist")
#define BN_VLIST_LINE_MOVE   0
#define BN_VLIST_LINE_DRAW   1
#define BN_VLIST_POLY_START   2
 pt[] has surface normal
#define BN_VLIST_POLY_MOVE   3
 move to first poly vertex
#define BN_VLIST_POLY_DRAW   4
 subsequent poly vertex
#define BN_VLIST_POLY_END   5
 last vert (repeats 1st), draw poly
#define BN_VLIST_POLY_VERTNORM   6
 per-vertex normal, for interpoloation
#define BN_VLIST_TRI_START   7
 pt[] has surface normal
#define BN_VLIST_TRI_MOVE   8
 move to first triangle vertex
#define BN_VLIST_TRI_DRAW   9
 subsequent triangle vertex
#define BN_VLIST_TRI_END   10
 last vert (repeats 1st), draw poly
#define BN_VLIST_TRI_VERTNORM   11
 per-vertex normal, for interpoloation
#define BN_VLIST_POINT_DRAW   12
 Draw a single point.
#define BN_VLIST_CMD_MAX   12
 Max command number.
#define BN_GET_VLIST(_free_hd, p)
#define BN_FREE_VLIST(_free_hd, hd)
#define BN_ADD_VLIST(_free_hd, _dest_hd, pnt, draw)
#define BN_CK_VLBLOCK(_p)   BU_CKMAG((_p), BN_VLBLOCK_MAGIC, "bn_vlblock")
#define TREE_TYPE_VERTS   1
#define TREE_TYPE_VERTS_AND_NORMS   2
#define VERT_BLOCK   512
 number of vertices to malloc per call when building the array
#define BN_CK_VERT_TREE(_p)   BU_CKMAG(_p, VERT_TREE_MAGIC, "vert_tree")
#define MAXPTS   4
 All we need are 4 points.
#define pl_A   pl_points[0]
 Synonym for A point.

Typedefs

typedef struct tri_specific tri_specific_double
typedef struct tri_float_specific tri_specific_float

Functions

void bn_mathtab_constant (void)
 For benchmarking purposes, make the random number table predictable. Setting to all zeros keeps dithered values at their original values.
double bn_randmt ()
void bn_randmt_seed (unsigned long seed)
void bn_wlt_haar_1d_double_decompose (double *tbuf, double *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_1d_double_reconstruct (double *tbuf, double *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_1d_float_decompose (float *tbuf, float *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_1d_float_reconstruct (float *tbuf, float *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_1d_char_decompose (char *tbuf, char *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_1d_char_reconstruct (char *tbuf, char *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_1d_short_decompose (short *tbuf, short *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_1d_short_reconstruct (short *tbuf, short *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_1d_int_decompose (int *tbuf, int *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_1d_int_reconstruct (int *tbuf, int *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_1d_long_decompose (long *tbuf, long *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_1d_long_reconstruct (long *tbuf, long *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_double_decompose (double *tbuf, double *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_2d_double_reconstruct (double *tbuf, double *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_float_decompose (float *tbuf, float *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_2d_float_reconstruct (float *tbuf, float *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_char_decompose (char *tbuf, char *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_2d_char_reconstruct (char *tbuf, char *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_short_decompose (short *tbuf, short *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_2d_short_reconstruct (short *tbuf, short *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_int_decompose (int *tbuf, int *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_2d_int_reconstruct (int *tbuf, int *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_long_decompose (long *tbuf, long *buf, unsigned long dimen, unsigned long depth, unsigned long limit)
void bn_wlt_haar_2d_long_reconstruct (long *tbuf, long *buf, unsigned long dimen, unsigned long depth, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_double_decompose2 (double *tbuf, double *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long limit)
void bn_wlt_haar_2d_double_reconstruct2 (double *tbuf, double *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_float_decompose2 (float *tbuf, float *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long limit)
void bn_wlt_haar_2d_float_reconstruct2 (float *tbuf, float *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_char_decompose2 (char *tbuf, char *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long limit)
void bn_wlt_haar_2d_char_reconstruct2 (char *tbuf, char *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_short_decompose2 (short *tbuf, short *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long limit)
void bn_wlt_haar_2d_short_reconstruct2 (short *tbuf, short *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_int_decompose2 (int *tbuf, int *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long limit)
void bn_wlt_haar_2d_int_reconstruct2 (int *tbuf, int *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long subimage_size, unsigned long limit)
void bn_wlt_haar_2d_long_decompose2 (long *tbuf, long *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long limit)
void bn_wlt_haar_2d_long_reconstruct2 (long *tbuf, long *buf, unsigned long dimen, unsigned long width, unsigned long height, unsigned long subimage_size, unsigned long limit)
void bn_table_free (struct bn_table *tabp)
void bn_tabdata_free (struct bn_tabdata *data)
void bn_ck_table (const struct bn_table *tabp)
struct bn_tablebn_table_make_uniform (size_t num, double first, double last)
void bn_tabdata_add (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2)
void bn_tabdata_mul (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2)
void bn_tabdata_mul3 (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, const struct bn_tabdata *in3)
void bn_tabdata_incr_mul3_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, const struct bn_tabdata *in3, double scale)
void bn_tabdata_incr_mul2_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, const struct bn_tabdata *in2, double scale)
void bn_tabdata_scale (struct bn_tabdata *out, const struct bn_tabdata *in1, double scale)
void bn_table_scale (struct bn_table *tabp, double scale)
void bn_tabdata_join1 (struct bn_tabdata *out, const struct bn_tabdata *in1, double scale, const struct bn_tabdata *in2)
void bn_tabdata_join2 (struct bn_tabdata *out, const struct bn_tabdata *in1, double scale2, const struct bn_tabdata *in2, double scale3, const struct bn_tabdata *in3)
void bn_tabdata_blend2 (struct bn_tabdata *out, double scale1, const struct bn_tabdata *in1, double scale2, const struct bn_tabdata *in2)
void bn_tabdata_blend3 (struct bn_tabdata *out, double scale1, const struct bn_tabdata *in1, double scale2, const struct bn_tabdata *in2, double scale3, const struct bn_tabdata *in3)
double bn_tabdata_area1 (const struct bn_tabdata *in)
double bn_tabdata_area2 (const struct bn_tabdata *in)
double bn_tabdata_mul_area1 (const struct bn_tabdata *in1, const struct bn_tabdata *in2)
double bn_tabdata_mul_area2 (const struct bn_tabdata *in1, const struct bn_tabdata *in2)
fastf_t bn_table_lin_interp (const struct bn_tabdata *samp, double wl)
struct bn_tabdatabn_tabdata_resample_max (const struct bn_table *newtable, const struct bn_tabdata *olddata)
struct bn_tabdatabn_tabdata_resample_avg (const struct bn_table *newtable, const struct bn_tabdata *olddata)
int bn_table_write (const char *filename, const struct bn_table *tabp)
struct bn_tablebn_table_read (const char *filename)
void bn_pr_table (const char *title, const struct bn_table *tabp)
void bn_pr_tabdata (const char *title, const struct bn_tabdata *data)
int bn_print_table_and_tabdata (const char *filename, const struct bn_tabdata *data)
struct bn_tabdatabn_read_table_and_tabdata (const char *filename)
struct bn_tabdatabn_tabdata_binary_read (const char *filename, size_t num, const struct bn_table *tabp)
struct bn_tabdatabn_tabdata_malloc_array (const struct bn_table *tabp, size_t num)
void bn_tabdata_copy (struct bn_tabdata *out, const struct bn_tabdata *in)
struct bn_tabdatabn_tabdata_dup (const struct bn_tabdata *in)
struct bn_tabdatabn_tabdata_get_constval (double val, const struct bn_table *tabp)
void bn_tabdata_constval (struct bn_tabdata *data, double val)
void bn_tabdata_to_tcl (struct bu_vls *vp, const struct bn_tabdata *data)
struct bn_tabdatabn_tabdata_from_array (const double *array)
void bn_tabdata_freq_shift (struct bn_tabdata *out, const struct bn_tabdata *in, double offset)
int bn_table_interval_num_samples (const struct bn_table *tabp, double low, double hi)
int bn_table_delete_sample_pts (struct bn_table *tabp, unsigned int i, unsigned int j)
struct bn_tablebn_table_merge2 (const struct bn_table *a, const struct bn_table *b)
struct bn_tabdatabn_tabdata_mk_linear_filter (const struct bn_table *spectrum, double lower_wavelen, double upper_wavelen)
void bn_vlist_3string (struct bu_list *vhead, struct bu_list *free_hd, const char *string, const point_t origin, const mat_t rot, double scale)
 Convert a string to a vlist.
void bn_vlist_2string (struct bu_list *vhead, struct bu_list *free_hd, const char *string, double x, double y, double scale, double theta)
 Convert string to vlist in 2D.
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 free_vert_tree (struct vert_root *tree_root)
 Routine to free a vertex tree and all associated dynamic memory.
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.
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.
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 tp_setup ()
 Once-only setup routine Used by libplot3/symbol.c, so it can't be static.
const char * bn_version (void)

Variables

const float bn_rand_table [BN_RAND_TABSIZE]
int bn_randhalftabsize
float bn_rand_halftab [BN_RANDHALFTABSIZE]
double bn_sin_scale
const float bn_sin_table [BN_SINTABSIZE]
const double bn_pi
const double bn_twopi
const double bn_halfpi
const double bn_invpi
const double bn_inv2pi
const double bn_inv255
const double bn_degtorad
const double bn_radtodeg
const float bn_rand_table [BN_RAND_TABSIZE]
double bn_sin_scale = BN_SINTABSIZE / (2.0 * M_PI)
const float bn_sin_table [BN_SINTABSIZE]
int bn_randhalftabsize = BN_RANDHALFTABSIZE
float bn_rand_halftab [BN_RANDHALFTABSIZE]
float bn_rand_poison_ []

Detailed Description


Define Documentation

#define BN_RAND_TABSIZE   4096

A supply of fast pseudo-random numbers from table in bn/rand.c. The values are in the open interval (i.e. exclusive) of 0.0 to 1.0 range with a period of 4096.

Usage:
 unsigned idx;
 float f;

 BN_RANDSEED(idx, integer_seed);

 while (NEED_MORE_RAND_NUMBERS) {
 f = BN_RANDOM(idx);
 }

Note that the values from bn_rand_half() become all 0.0 when the benchmark flag is set (bn_rand_halftab is set to all 0's). The numbers from bn_rand_table do not change, because the procedural noise would cease to exist.

Definition at line 1146 of file bn.h.

Referenced by bn_noise_init().

#define BN_RAND_TABMASK   0xfff

Definition at line 1147 of file bn.h.

#define BN_RANDSEED ( _i,
_seed   )     _i = ((unsigned)_seed) % BN_RAND_TABSIZE

Definition at line 1148 of file bn.h.

Referenced by bn_noise_init().

#define BN_RANDOM ( _i   )     bn_rand_table[ _i = (_i+1) % BN_RAND_TABSIZE ]

BN_RANDOM always gives numbers between the open interval 0.0 to 1.0

Definition at line 1152 of file bn.h.

Referenced by bn_cmd_random(), and bn_noise_init().

#define BN_RANDHALF ( _i   )     (bn_rand_table[ _i = (_i+1) % BN_RAND_TABSIZE ]-0.5)

BN_RANDHALF always gives numbers between the open interval -0.5 and 0.5

Definition at line 1155 of file bn.h.

#define BN_RANDHALF_INIT ( _p   )     _p = bn_rand_table

Definition at line 1156 of file bn.h.

#define BN_RANDHALFTABSIZE   16535

Powers of two give streaking

Definition at line 1158 of file bn.h.

#define bn_rand_half ( _p   ) 
Value:
((++(_p) >= &bn_rand_halftab[bn_randhalftabsize] || \
      (_p) < bn_rand_halftab) ? \
     *((_p) = bn_rand_halftab) : *(_p))

random numbers between the closed interval -0.5 to 0.5 inclusive, except when benchmark flag is set, when this becomes a constant 0.0

Definition at line 1166 of file bn.h.

#define bn_rand_init ( _p,
_seed   ) 
Value:
(_p) = &bn_rand_halftab[ \
        (int)(\
            (bn_rand_halftab[(_seed)%bn_randhalftabsize] + 0.5) * \
            (bn_randhalftabsize-1)) ]

initialize the seed for the large random number table (halftab)

Definition at line 1174 of file bn.h.

#define bn_rand0to1 ( _q   )     (bn_rand_half(_q)+0.5)

random numbers in the closed interval 0.0 to 1.0 range (inclusive) except when benchmarking, when this is always 0.5

Definition at line 1184 of file bn.h.

#define BN_SINTABSIZE   2048

Definition at line 1186 of file bn.h.

#define bn_tab_sin ( _a   ) 
Value:
(((_a) > 0) ? \
                         (bn_sin_table[(int)((0.5+ (_a)*bn_sin_scale))&(BN_SINTABSIZE-1)]) :\
                         (-bn_sin_table[(int)((0.5- (_a)*bn_sin_scale))&(BN_SINTABSIZE-1)]))

Definition at line 1188 of file bn.h.

#define CK_POW_2 ( dimen   ) 
Value:
{ \
        register unsigned long j; \
        register int ok; \
        for (ok=0, j=0; j < sizeof(unsigned long) * 8; j++) { \
            if ((unsigned long)(1<<j) == dimen) { ok = 1;  break; } \
        } \
        if (! ok) { \
            bu_log("%s:%d value %ld should be power of 2 (2^%ld)\n", \
                   __FILE__, __LINE__, (long)dimen, (long)j); \
            bu_bomb("CK_POW_2"); \
        } \
    }

Definition at line 1226 of file bn.h.

#define BN_CK_TABLE ( _p   )     BU_CKMAG(_p, BN_TABLE_MAGIC, "bn_table")
#define BN_TABLE_NULL   ((struct bn_table *)NULL)

Definition at line 1522 of file bn.h.

#define BN_GET_TABLE ( _table,
_nx   ) 
Value:
{ \
        if ((_nx) < 1)  bu_bomb("RT_GET_TABLE() _nx < 1\n"); \
        _table = (struct bn_table *)bu_calloc(1, \
                                              sizeof(struct bn_table) + sizeof(fastf_t)*(_nx), \
                                              "struct bn_table"); \
        _table->magic = BN_TABLE_MAGIC; \
        _table->nx = (_nx);  }

Gets an bn_table, with x[] having size _nx+1

Definition at line 1526 of file bn.h.

Referenced by bn_read_table_and_tabdata(), bn_tabdata_from_array(), bn_table_make_uniform(), bn_table_merge2(), and bn_table_read().

#define BN_CK_TABDATA ( _p   )     BU_CKMAG(_p, BN_TABDATA_MAGIC, "bn_tabdata")
#define BN_TABDATA_NULL   ((struct bn_tabdata *)NULL)

Definition at line 1549 of file bn.h.

#define BN_SIZEOF_TABDATA_Y ( _tabdata   )     sizeof(fastf_t)*((_tabdata)->ny)

Definition at line 1551 of file bn.h.

Referenced by bn_tabdata_copy(), and bn_tabdata_dup().

#define BN_SIZEOF_TABDATA ( _table   ) 
Value:
(sizeof(struct bn_tabdata) + \
                                         sizeof(fastf_t)*((_table)->nx-1))

Definition at line 1552 of file bn.h.

Referenced by bn_tabdata_binary_read(), and bn_tabdata_malloc_array().

#define BN_GET_TABDATA ( _data,
_table   ) 
Value:
{ \
        BN_CK_TABLE(_table);\
        _data = (struct bn_tabdata *)bu_calloc(1, \
                                               BN_SIZEOF_TABDATA(_table), "struct bn_tabdata"); \
        _data->magic = BN_TABDATA_MAGIC; \
        _data->ny = (_table)->nx; \
        _data->table = (_table); }

Gets an bn_tabdata, with y[] having size _ny

Definition at line 1556 of file bn.h.

Referenced by bn_read_table_and_tabdata(), bn_tabdata_dup(), bn_tabdata_from_array(), bn_tabdata_get_constval(), bn_tabdata_mk_linear_filter(), bn_tabdata_resample_avg(), and bn_tabdata_resample_max().

#define BN_VLIST_CHUNK   35

32-bit mach => just less than 1k

Definition at line 1674 of file bn.h.

#define BN_VLIST_NULL   ((struct bn_vlist *)0)

Definition at line 1707 of file bn.h.

#define BN_CK_VLIST ( _p   )     BU_CKMAG((_p), BN_VLIST_MAGIC, "bn_vlist")

Definition at line 1708 of file bn.h.

#define BN_VLIST_LINE_MOVE   0

Definition at line 1712 of file bn.h.

Referenced by bn_vlist_3string().

#define BN_VLIST_LINE_DRAW   1

Definition at line 1713 of file bn.h.

Referenced by bn_vlist_3string().

#define BN_VLIST_POLY_START   2

pt[] has surface normal

Definition at line 1714 of file bn.h.

#define BN_VLIST_POLY_MOVE   3

move to first poly vertex

Definition at line 1715 of file bn.h.

#define BN_VLIST_POLY_DRAW   4

subsequent poly vertex

Definition at line 1716 of file bn.h.

#define BN_VLIST_POLY_END   5

last vert (repeats 1st), draw poly

Definition at line 1717 of file bn.h.

#define BN_VLIST_POLY_VERTNORM   6

per-vertex normal, for interpoloation

Definition at line 1718 of file bn.h.

#define BN_VLIST_TRI_START   7

pt[] has surface normal

Definition at line 1719 of file bn.h.

#define BN_VLIST_TRI_MOVE   8

move to first triangle vertex

Definition at line 1720 of file bn.h.

#define BN_VLIST_TRI_DRAW   9

subsequent triangle vertex

Definition at line 1721 of file bn.h.

#define BN_VLIST_TRI_END   10

last vert (repeats 1st), draw poly

Definition at line 1722 of file bn.h.

#define BN_VLIST_TRI_VERTNORM   11

per-vertex normal, for interpoloation

Definition at line 1723 of file bn.h.

#define BN_VLIST_POINT_DRAW   12

Draw a single point.

Definition at line 1724 of file bn.h.

#define BN_VLIST_CMD_MAX   12

Max command number.

Definition at line 1725 of file bn.h.

#define BN_GET_VLIST ( _free_hd,
 ) 
Value:
{\
        (p) = BU_LIST_FIRST(bn_vlist, (_free_hd)); \
        if (BU_LIST_IS_HEAD((p), (_free_hd))) { \
            (p) = (struct bn_vlist *)bu_malloc(sizeof(struct bn_vlist), "bn_vlist"); \
            (p)->l.magic = BN_VLIST_MAGIC; \
        } else { \
            BU_LIST_DEQUEUE(&((p)->l)); \
        } \
        (p)->nused = 0; \
    }

Applications that are going to use BN_ADD_VLIST and BN_GET_VLIST are required to execute this macro once, on their _free_hd: BU_LIST_INIT(&_free_hd);

Note that BN_GET_VLIST and BN_FREE_VLIST are non-PARALLEL.

Definition at line 1734 of file bn.h.

#define BN_FREE_VLIST ( _free_hd,
hd   ) 
Value:
{ \
        BU_CK_LIST_HEAD((hd)); \
        BU_LIST_APPEND_LIST((_free_hd), (hd)); \
    }

Place an entire chain of bn_vlist structs on the freelist _free_hd

Definition at line 1746 of file bn.h.

#define BN_ADD_VLIST ( _free_hd,
_dest_hd,
pnt,
draw   ) 
Value:
{ \
        register struct bn_vlist *_vp; \
        BU_CK_LIST_HEAD(_dest_hd); \
        _vp = BU_LIST_LAST(bn_vlist, (_dest_hd)); \
        if (BU_LIST_IS_HEAD(_vp, (_dest_hd)) || _vp->nused >= BN_VLIST_CHUNK) { \
            BN_GET_VLIST(_free_hd, _vp); \
            BU_LIST_INSERT((_dest_hd), &(_vp->l)); \
        } \
        VMOVE(_vp->pt[_vp->nused], (pnt)); \
        _vp->cmd[_vp->nused++] = (draw); \
    }

Definition at line 1751 of file bn.h.

Referenced by bn_vlist_3string().

#define BN_CK_VLBLOCK ( _p   )     BU_CKMAG((_p), BN_VLBLOCK_MAGIC, "bn_vlblock")

Definition at line 1777 of file bn.h.

#define TREE_TYPE_VERTS   1

Definition at line 1812 of file bn.h.

Referenced by Add_vert(), and create_vert_tree().

#define TREE_TYPE_VERTS_AND_NORMS   2

Definition at line 1813 of file bn.h.

Referenced by Add_vert_and_norm(), and create_vert_tree_w_norms().

#define VERT_BLOCK   512

number of vertices to malloc per call when building the array

Definition at line 1815 of file bn.h.

Referenced by Add_vert(), Add_vert_and_norm(), create_vert_tree(), and create_vert_tree_w_norms().

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

Definition at line 1817 of file bn.h.

Referenced by Add_vert(), Add_vert_and_norm(), clean_vert_tree(), and free_vert_tree().

#define MAXPTS   4

All we need are 4 points.

Plane structures holds all the required info for geometric planes.

Definition at line 1859 of file bn.h.

#define pl_A   pl_points[0]

Synonym for A point.

Definition at line 1860 of file bn.h.


Typedef Documentation

Definition at line 1890 of file bn.h.

Definition at line 1906 of file bn.h.


Function Documentation

void bn_mathtab_constant ( void   ) 

For benchmarking purposes, make the random number table predictable. Setting to all zeros keeps dithered values at their original values.

M A T H T A B _ C O N S T A N T

Definition at line 3644 of file rand.c.

References bn_rand_halftab.

double bn_randmt (  ) 

Mersenne Twister random number generation as defined by MT19937.

Generates one pseudorandom real number (double) which is uniformly distributed on [0, 1]-interval, for each call.

Usage:
 double d;

 bn_randmt_seed(integer_seed);

 while (NEED_MORE_RAND_NUMBERS) {
 d = bn_randmt();
 }

Definition at line 156 of file randmt.c.

References bn_randmt_state().

Here is the call graph for this function:

void bn_randmt_seed ( unsigned long  seed  ) 

Definition at line 151 of file randmt.c.

References bn_randmt_state_seed().

Referenced by bn_randmt_state().

Here is the call graph for this function:

void bn_wlt_haar_1d_double_decompose ( double *  tbuf,
double *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_1d_double_reconstruct ( double *  tbuf,
double *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_1d_float_decompose ( float *  tbuf,
float *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_1d_float_reconstruct ( float *  tbuf,
float *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_1d_char_decompose ( char *  tbuf,
char *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_1d_char_reconstruct ( char *  tbuf,
char *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_1d_short_decompose ( short *  tbuf,
short *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_1d_short_reconstruct ( short *  tbuf,
short *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_1d_int_decompose ( int *  tbuf,
int *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_1d_int_reconstruct ( int *  tbuf,
int *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_1d_long_decompose ( long *  tbuf,
long *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_1d_long_reconstruct ( long *  tbuf,
long *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_double_decompose ( double *  tbuf,
double *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_2d_double_reconstruct ( double *  tbuf,
double *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_float_decompose ( float *  tbuf,
float *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_2d_float_reconstruct ( float *  tbuf,
float *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_char_decompose ( char *  tbuf,
char *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_2d_char_reconstruct ( char *  tbuf,
char *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_short_decompose ( short *  tbuf,
short *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_2d_short_reconstruct ( short *  tbuf,
short *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_int_decompose ( int *  tbuf,
int *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_2d_int_reconstruct ( int *  tbuf,
int *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_long_decompose ( long *  tbuf,
long *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  limit 
)
void bn_wlt_haar_2d_long_reconstruct ( long *  tbuf,
long *  buf,
unsigned long  dimen,
unsigned long  depth,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_double_decompose2 ( double *  tbuf,
double *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  limit 
)
void bn_wlt_haar_2d_double_reconstruct2 ( double *  tbuf,
double *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_float_decompose2 ( float *  tbuf,
float *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  limit 
)
void bn_wlt_haar_2d_float_reconstruct2 ( float *  tbuf,
float *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_char_decompose2 ( char *  tbuf,
char *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  limit 
)
void bn_wlt_haar_2d_char_reconstruct2 ( char *  tbuf,
char *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_short_decompose2 ( short *  tbuf,
short *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  limit 
)
void bn_wlt_haar_2d_short_reconstruct2 ( short *  tbuf,
short *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_int_decompose2 ( int *  tbuf,
int *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  limit 
)
void bn_wlt_haar_2d_int_reconstruct2 ( int *  tbuf,
int *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_wlt_haar_2d_long_decompose2 ( long *  tbuf,
long *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  limit 
)
void bn_wlt_haar_2d_long_reconstruct2 ( long *  tbuf,
long *  buf,
unsigned long  dimen,
unsigned long  width,
unsigned long  height,
unsigned long  subimage_size,
unsigned long  limit 
)
void bn_table_free ( struct bn_table tabp  ) 

Definition at line 56 of file tabdata.c.

References BN_CK_TABLE.

void bn_tabdata_free ( struct bn_tabdata data  ) 

Definition at line 69 of file tabdata.c.

References BN_CK_TABDATA, and BN_CK_TABLE.

void bn_ck_table ( const struct bn_table tabp  ) 

Definition at line 85 of file tabdata.c.

References BN_CK_TABLE.

Referenced by bn_read_table_and_tabdata(), and bn_table_read().

struct bn_table* bn_table_make_uniform ( size_t  num,
double  first,
double  last 
) [read]

Definition at line 109 of file tabdata.c.

References BN_GET_TABLE, and bn_table::x.

void bn_tabdata_add ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 139 of file tabdata.c.

References BN_CK_TABDATA.

void bn_tabdata_mul ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 170 of file tabdata.c.

References BN_CK_TABDATA.

void bn_tabdata_mul3 ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2,
const struct bn_tabdata in3 
)

Definition at line 201 of file tabdata.c.

References BN_CK_TABDATA.

void bn_tabdata_incr_mul3_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2,
const struct bn_tabdata in3,
double  scale 
)
void bn_tabdata_incr_mul2_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
const struct bn_tabdata in2,
double  scale 
)
void bn_tabdata_scale ( struct bn_tabdata out,
const struct bn_tabdata in1,
double  scale 
)
void bn_table_scale ( struct bn_table tabp,
double  scale 
)
void bn_tabdata_join1 ( struct bn_tabdata out,
const struct bn_tabdata in1,
double  scale,
const struct bn_tabdata in2 
)
void bn_tabdata_join2 ( struct bn_tabdata out,
const struct bn_tabdata in1,
double  scale2,
const struct bn_tabdata in2,
double  scale3,
const struct bn_tabdata in3 
)
void bn_tabdata_blend2 ( struct bn_tabdata out,
double  scale1,
const struct bn_tabdata in1,
double  scale2,
const struct bn_tabdata in2 
)
void bn_tabdata_blend3 ( struct bn_tabdata out,
double  scale1,
const struct bn_tabdata in1,
double  scale2,
const struct bn_tabdata in2,
double  scale3,
const struct bn_tabdata in3 
)
double bn_tabdata_area1 ( const struct bn_tabdata in  ) 

Definition at line 492 of file tabdata.c.

References BN_CK_TABDATA, bn_tabdata::ny, and bn_tabdata::y.

double bn_tabdata_area2 ( const struct bn_tabdata in  ) 
double bn_tabdata_mul_area1 ( const struct bn_tabdata in1,
const struct bn_tabdata in2 
)

Definition at line 550 of file tabdata.c.

References BN_CK_TABDATA, bn_tabdata::ny, and bn_tabdata::y.

double bn_tabdata_mul_area2 ( const struct bn_tabdata in1,
const struct bn_tabdata in2 
)
fastf_t bn_table_lin_interp ( const struct bn_tabdata samp,
double  wl 
)
struct bn_tabdata* bn_tabdata_resample_max ( const struct bn_table newtable,
const struct bn_tabdata olddata 
) [read]

Definition at line 696 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BN_GET_TABDATA, bn_table_find_x(), bn_table_lin_interp(), n, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_resample_avg ( const struct bn_table newtable,
const struct bn_tabdata olddata 
) [read]

Definition at line 776 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BN_GET_TABDATA, bn_table_find_x(), bn_table_lin_interp(), bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

int bn_table_write ( const char *  filename,
const struct bn_table tabp 
)

Definition at line 858 of file tabdata.c.

References BN_CK_TABLE.

struct bn_table* bn_table_read ( const char *  filename  )  [read]

Definition at line 895 of file tabdata.c.

References bn_ck_table(), BN_GET_TABLE, bn_table::nx, and bn_table::x.

Here is the call graph for this function:

void bn_pr_table ( const char *  title,
const struct bn_table tabp 
)

Definition at line 953 of file tabdata.c.

References BN_CK_TABLE, bn_table::nx, and bn_table::x.

void bn_pr_tabdata ( const char *  title,
const struct bn_tabdata data 
)

Definition at line 969 of file tabdata.c.

References BN_CK_TABDATA, bn_tabdata::ny, and bn_tabdata::y.

int bn_print_table_and_tabdata ( const char *  filename,
const struct bn_tabdata data 
)

Definition at line 993 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bn_table::nx, and bn_table::x.

struct bn_tabdata* bn_read_table_and_tabdata ( const char *  filename  )  [read]

Definition at line 1037 of file tabdata.c.

References bn_ck_table(), BN_GET_TABDATA, BN_GET_TABLE, bn_table::x, and bn_tabdata::y.

Here is the call graph for this function:

struct bn_tabdata* bn_tabdata_binary_read ( const char *  filename,
size_t  num,
const struct bn_table tabp 
) [read]

Definition at line 1102 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, BN_SIZEOF_TABDATA, and bn_tabdata::table.

struct bn_tabdata* bn_tabdata_malloc_array ( const struct bn_table tabp,
size_t  num 
) [read]
void bn_tabdata_copy ( struct bn_tabdata out,
const struct bn_tabdata in 
)

Definition at line 1204 of file tabdata.c.

References BN_CK_TABDATA, and BN_SIZEOF_TABDATA_Y.

struct bn_tabdata* bn_tabdata_dup ( const struct bn_tabdata in  )  [read]
struct bn_tabdata* bn_tabdata_get_constval ( double  val,
const struct bn_table tabp 
) [read]

Definition at line 1242 of file tabdata.c.

References BN_CK_TABLE, BN_GET_TABDATA, bn_tabdata::ny, and bn_tabdata::y.

void bn_tabdata_constval ( struct bn_tabdata data,
double  val 
)

Definition at line 1265 of file tabdata.c.

References BN_CK_TABDATA.

void bn_tabdata_to_tcl ( struct bu_vls *  vp,
const struct bn_tabdata data 
)

Definition at line 1287 of file tabdata.c.

References BN_CK_TABDATA, BN_CK_TABLE, bn_table::nx, and bn_table::x.

struct bn_tabdata* bn_tabdata_from_array ( const double *  array  )  [read]

Definition at line 1326 of file tabdata.c.

References BN_GET_TABDATA, BN_GET_TABLE, bn_table::x, and bn_tabdata::y.

void bn_tabdata_freq_shift ( struct bn_tabdata out,
const struct bn_tabdata in,
double  offset 
)

Definition at line 1362 of file tabdata.c.

References BN_CK_TABDATA, bn_table_lin_interp(), and bn_table::x.

Here is the call graph for this function:

int bn_table_interval_num_samples ( const struct bn_table tabp,
double  low,
double  hi 
)

Definition at line 1389 of file tabdata.c.

References BN_CK_TABLE, bn_table::nx, and bn_table::x.

int bn_table_delete_sample_pts ( struct bn_table tabp,
unsigned int  i,
unsigned int  j 
)

Definition at line 1412 of file tabdata.c.

References BN_CK_TABLE.

struct bn_table* bn_table_merge2 ( const struct bn_table a,
const struct bn_table b 
) [read]

Definition at line 1443 of file tabdata.c.

References BN_CK_TABLE, BN_GET_TABLE, bn_table::nx, bn_table::x, and ZERO.

struct bn_tabdata* bn_tabdata_mk_linear_filter ( const struct bn_table spectrum,
double  lower_wavelen,
double  upper_wavelen 
) [read]

Definition at line 1497 of file tabdata.c.

References BN_CK_TABLE, BN_GET_TABDATA, bn_table_find_x(), x, and bn_tabdata::y.

Here is the call graph for this function:

void bn_vlist_3string ( struct bu_list *  vhead,
struct bu_list *  free_hd,
const char *  string,
const vect_t  origin,
const mat_t  rot,
double  scale 
)

Convert a string to a vlist.

B N _ V L I S T _ 3 S T R I N G 'scale' is the width, in mm, of one character.

Parameters:
vhead 
free_hd source of free vlists
string string of chars to be plotted
origin lower left corner of 1st char
rot Transform matrix (WARNING: may xlate)
scale scale factor to change 1x1 char sz
Parameters:
free_hd source of free vlists
string string of chars to be plotted
origin lower left corner of 1st char
rot Transform matrix (WARNING: may xlate)
scale scale factor to change 1x1 char sz

Definition at line 55 of file font.c.

References BN_ADD_VLIST, bn_mat_mul(), BN_VLIST_LINE_DRAW, BN_VLIST_LINE_MOVE, MAT4X3PNT, MAT_DELTAS_VEC, MAT_IDN, tp_cindex, tp_setup(), and VSET.

Referenced by bn_vlist_2string().

Here is the call graph for this function:

void bn_vlist_2string ( struct bu_list *  vhead,
struct bu_list *  free_hd,
const char *  string,
double  x,
double  y,
double  scale,
double  theta 
)

Convert string to vlist in 2D.

B N _ V L I S T _ 2 S T R I N G A simpler interface, for those cases where the text lies in the X-Y plane.

Parameters:
vhead 
free_hd source of free vlists
string string of chars to be plotted
x lower left corner of 1st char
y lower left corner of 1st char
scale scale factor to change 1x1 char sz
theta degrees ccw from X-axis

Definition at line 150 of file font.c.

References bn_mat_angles(), bn_vlist_3string(), and VSET.

Here is the call graph for this function:

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 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.

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 tp_setup (  ) 

Once-only setup routine Used by libplot3/symbol.c, so it can't be static.

Definition at line 65 of file vectfont.c.

References NUM_SYMBOLS, tp_cindex, and tp_ctable.

Referenced by bn_vlist_3string(), and tp_3symbol().

const char* bn_version ( void   ) 

report version information about LIBBN

returns the compile-time version of libbn

Definition at line 36 of file vers.c.


Variable Documentation

const float bn_rand_table[BN_RAND_TABSIZE]

This is our table of random numbers. Rather than calling drand48() or random() or rand() we just pick numbers out of this table. This table has 4096 unique entries with floating point values ranging from the open interval (i.e. exclusive) 0.0 to 1.0 range.

There are convenience macros for access in the bn.h header.

Definition at line 43 of file rand.c.

Definition at line 1251 of file rand.c.

float bn_rand_halftab[BN_RANDHALFTABSIZE]

The actual table of random floating point numbers with values in the closed interval (i.e. inclusive) -0.5 to +0.5 range.

For benchmarking purposes, this table is zeroed.

Definition at line 1259 of file rand.c.

Referenced by bn_mathtab_constant().

double bn_sin_scale

Definition at line 730 of file rand.c.

const float bn_sin_table[BN_SINTABSIZE]

table of floating point sine values in the closed (i.e. inclusive) interval -1.0 to 1.0 range.

Definition at line 736 of file rand.c.

const double bn_pi

pi

Definition at line 54 of file globals.c.

Referenced by bn_angle_measure().

const double bn_twopi

pi*2

Definition at line 58 of file globals.c.

Referenced by bn_angle_measure(), and bn_spm_init().

const double bn_halfpi

pi/2

Definition at line 63 of file globals.c.

const double bn_invpi

1/pi

Definition at line 72 of file globals.c.

const double bn_inv2pi

1/(pi*2)

Definition at line 76 of file globals.c.

const double bn_inv255

1.0/255.0

Definition at line 85 of file globals.c.

const double bn_degtorad

(pi*2)/360

Definition at line 90 of file globals.c.

Referenced by bn_mat_ae(), and bn_mat_angles().

const double bn_radtodeg

360/(pi*2)

Definition at line 94 of file globals.c.

Referenced by bn_ae_vec(), and bn_aet_vec().

const float bn_rand_table[BN_RAND_TABSIZE]

This is our table of random numbers. Rather than calling drand48() or random() or rand() we just pick numbers out of this table. This table has 4096 unique entries with floating point values ranging from the open interval (i.e. exclusive) 0.0 to 1.0 range.

There are convenience macros for access in the bn.h header.

Definition at line 43 of file rand.c.

double bn_sin_scale = BN_SINTABSIZE / (2.0 * M_PI)

Definition at line 730 of file rand.c.

const float bn_sin_table[BN_SINTABSIZE]

table of floating point sine values in the closed (i.e. inclusive) interval -1.0 to 1.0 range.

Definition at line 736 of file rand.c.

int bn_randhalftabsize = BN_RANDHALFTABSIZE

Definition at line 1251 of file rand.c.

float bn_rand_halftab[BN_RANDHALFTABSIZE]

The actual table of random floating point numbers with values in the closed interval (i.e. inclusive) -0.5 to +0.5 range.

For benchmarking purposes, this table is zeroed.

Definition at line 1259 of file rand.c.

Referenced by bn_mathtab_constant().

float bn_rand_poison_[]
Initial value:
 {
    9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f,
    9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f,
    9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f,
    9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f, 9e20f
}

Immediately after the random number table, some "poison" floating point numbers, intended to cause noticable difficulties if these are used.

Definition at line 3630 of file rand.c.

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