63#define BV_VLIST_CHUNK 35
71#define BV_VLIST_NULL ((struct bv_vlist *)0)
72#define BV_CK_VLIST(_p) BU_CKMAG((_p), BV_VLIST_MAGIC, "bv_vlist")
76#define BV_VLIST_LINE_MOVE 0
77#define BV_VLIST_LINE_DRAW 1
78#define BV_VLIST_POLY_START 2
79#define BV_VLIST_POLY_MOVE 3
80#define BV_VLIST_POLY_DRAW 4
81#define BV_VLIST_POLY_END 5
82#define BV_VLIST_POLY_VERTNORM 6
83#define BV_VLIST_TRI_START 7
84#define BV_VLIST_TRI_MOVE 8
85#define BV_VLIST_TRI_DRAW 9
86#define BV_VLIST_TRI_END 10
87#define BV_VLIST_TRI_VERTNORM 11
88#define BV_VLIST_POINT_DRAW 12
89#define BV_VLIST_POINT_SIZE 13
90#define BV_VLIST_LINE_WIDTH 14
91#define BV_VLIST_DISPLAY_MAT 15
92#define BV_VLIST_MODEL_MAT 16
93#define BV_VLIST_CMD_MAX 16
101#define BV_GET_VLIST(_free_hd, p) do {\
102 (p) = BU_LIST_FIRST(bv_vlist, (_free_hd)); \
103 if (BU_LIST_IS_HEAD((p), (_free_hd))) { \
104 BU_ALLOC((p), struct bv_vlist); \
105 (p)->l.magic = BV_VLIST_MAGIC; \
107 BU_LIST_DEQUEUE(&((p)->l)); \
113#define BV_FREE_VLIST(_free_hd, hd) do { \
114 BU_CK_LIST_HEAD((hd)); \
115 BU_LIST_APPEND_LIST((_free_hd), (hd)); \
118#define BV_ADD_VLIST(_free_hd, _dest_hd, pnt, draw) do { \
119 struct bv_vlist *_vp; \
120 BU_CK_LIST_HEAD(_dest_hd); \
121 _vp = BU_LIST_LAST(bv_vlist, (_dest_hd)); \
122 if (BU_LIST_IS_HEAD(_vp, (_dest_hd)) || _vp->nused >= BV_VLIST_CHUNK) { \
123 BV_GET_VLIST(_free_hd, _vp); \
124 BU_LIST_INSERT((_dest_hd), &(_vp->l)); \
126 VMOVE(_vp->pt[_vp->nused], (pnt)); \
127 _vp->cmd[_vp->nused++] = (draw); \
131#define BV_VLIST_SET_DISP_MAT(_free_hd, _dest_hd, _ref_pt) do { \
132 struct bv_vlist *_vp; \
133 BU_CK_LIST_HEAD(_dest_hd); \
134 _vp = BU_LIST_LAST(bv_vlist, (_dest_hd)); \
135 if (BU_LIST_IS_HEAD(_vp, (_dest_hd)) || _vp->nused >= BV_VLIST_CHUNK) { \
136 BV_GET_VLIST(_free_hd, _vp); \
137 BU_LIST_INSERT((_dest_hd), &(_vp->l)); \
139 VMOVE(_vp->pt[_vp->nused], (_ref_pt)); \
140 _vp->cmd[_vp->nused++] = BV_VLIST_DISPLAY_MAT; \
144#define BV_VLIST_SET_MODEL_MAT(_free_hd, _dest_hd) do { \
145 struct bv_vlist *_vp; \
146 BU_CK_LIST_HEAD(_dest_hd); \
147 _vp = BU_LIST_LAST(bv_vlist, (_dest_hd)); \
148 if (BU_LIST_IS_HEAD(_vp, (_dest_hd)) || _vp->nused >= BV_VLIST_CHUNK) { \
149 BV_GET_VLIST(_free_hd, _vp); \
150 BU_LIST_INSERT((_dest_hd), &(_vp->l)); \
152 _vp->cmd[_vp->nused++] = BV_VLIST_MODEL_MAT; \
156#define BV_VLIST_SET_POINT_SIZE(_free_hd, _dest_hd, _size) do { \
157 struct bv_vlist *_vp; \
158 BU_CK_LIST_HEAD(_dest_hd); \
159 _vp = BU_LIST_LAST(bv_vlist, (_dest_hd)); \
160 if (BU_LIST_IS_HEAD(_vp, (_dest_hd)) || _vp->nused >= BV_VLIST_CHUNK) { \
161 BV_GET_VLIST(_free_hd, _vp); \
162 BU_LIST_INSERT((_dest_hd), &(_vp->l)); \
164 _vp->pt[_vp->nused][0] = (_size); \
165 _vp->cmd[_vp->nused++] = BV_VLIST_POINT_SIZE; \
169#define BV_VLIST_SET_LINE_WIDTH(_free_hd, _dest_hd, _width) do { \
170 struct bv_vlist *_vp; \
171 BU_CK_LIST_HEAD(_dest_hd); \
172 _vp = BU_LIST_LAST(bv_vlist, (_dest_hd)); \
173 if (BU_LIST_IS_HEAD(_vp, (_dest_hd)) || _vp->nused >= BV_VLIST_CHUNK) { \
174 BV_GET_VLIST(_free_hd, _vp); \
175 BU_LIST_INSERT((_dest_hd), &(_vp->l)); \
177 _vp->pt[_vp->nused][0] = (_width); \
178 _vp->cmd[_vp->nused++] = BV_VLIST_LINE_WIDTH; \
199#define BV_CK_VLBLOCK(_p) BU_CKMAG((_p), BV_VLBLOCK_MAGIC, "bv_vlblock")
289 const unsigned char *buf);
Header file for the BRL-CAD common definitions.
void float int int float float * theta
void int float float float * scale
void int char int * length
void bv_vlist_export(struct bu_vls *vls, struct bu_list *hp, const char *name)
#define BV_VLIST_CHUNK
32-bit mach => just less than 1k
size_t bv_ck_vlist(const struct bu_list *vhead)
void bv_vlist_cleanup(struct bu_list *hd)
const char * bv_vlist_get_cmd_description(int cmd)
void bv_vlist_3string(struct bu_list *vhead, struct bu_list *free_hd, const char *string, const point_t origin, const mat_t rot, double scale)
void bv_vlblock_to_objs(struct bu_ptbl *out, const char *name_root, struct bv_vlblock *vbp, struct bview *v, struct bv_scene_obj *f, struct bu_list *vlfree)
size_t bv_vlist_cmd_cnt(struct bv_vlist *vlist)
void bv_plot_vlblock(FILE *fp, const struct bv_vlblock *vbp)
struct bv_scene_obj * bv_vlblock_obj(struct bv_vlblock *vbp, struct bview *v, const char *name)
int bv_vlist_bbox(struct bu_list *vlistp, point_t *bmin, point_t *bmax, size_t *length, int *dispmode)
void bv_vlist_rpp(struct bu_list *vlists, struct bu_list *hd, const point_t minn, const point_t maxx)
struct bv_vlblock * bv_vlblock_init(struct bu_list *free_vlist_hd, int max_ent)
void bv_vlist_to_uplot(FILE *fp, const struct bu_list *vhead)
void bv_vlist_import(struct bu_list *vlists, struct bu_list *hp, struct bu_vls *namevls, const unsigned char *buf)
void bv_vlblock_free(struct bv_vlblock *vbp)
struct bu_list * bv_vlblock_find(struct bv_vlblock *vbp, int r, int g, int b)
void bv_vlist_2string(struct bu_list *vhead, struct bu_list *free_hd, const char *string, double x, double y, double scale, double theta)
void bv_vlist_copy(struct bu_list *vlists, struct bu_list *dest, const struct bu_list *src)
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Global registry of recognized magic numbers.
long * rgb
rgb[max] variable size array
struct bu_list * free_vlist_hd
where to get/put free vlists
struct bu_list * head
head[max] variable size array
size_t nused
elements 0..nused active
struct bu_list l
magic, forw, back
int cmd[BV_VLIST_CHUNK]
VL_CMD_*.
point_t pt[BV_VLIST_CHUNK]
associated 3-point/vect
fundamental vector, matrix, quaternion math macros