Definitions for handling lists of vectors (really vertices, or points) and polygons in 3-space. Intended for common handling of wireframe display information, in the full resolution that is calculated in.
More...
|
#define | BV_VLIST_CHUNK 35 |
| 32-bit mach => just less than 1k
|
|
#define | BV_VLIST_NULL ((struct bv_vlist *)0) |
|
#define | BV_CK_VLIST(_p) BU_CKMAG((_p), BV_VLIST_MAGIC, "bv_vlist") |
|
#define | BV_VLIST_LINE_MOVE 0 |
| specify new line
|
|
#define | BV_VLIST_LINE_DRAW 1 |
| subsequent line vertex
|
|
#define | BV_VLIST_POLY_START 2 |
| pt[] has surface normal
|
|
#define | BV_VLIST_POLY_MOVE 3 |
| move to first poly vertex
|
|
#define | BV_VLIST_POLY_DRAW 4 |
| subsequent poly vertex
|
|
#define | BV_VLIST_POLY_END 5 |
| last vert (repeats 1st), draw poly
|
|
#define | BV_VLIST_POLY_VERTNORM 6 |
| per-vertex normal, for interpolation
|
|
#define | BV_VLIST_TRI_START 7 |
| pt[] has surface normal
|
|
#define | BV_VLIST_TRI_MOVE 8 |
| move to first triangle vertex
|
|
#define | BV_VLIST_TRI_DRAW 9 |
| subsequent triangle vertex
|
|
#define | BV_VLIST_TRI_END 10 |
| last vert (repeats 1st), draw poly
|
|
#define | BV_VLIST_TRI_VERTNORM 11 |
| per-vertex normal, for interpolation
|
|
#define | BV_VLIST_POINT_DRAW 12 |
| Draw a single point.
|
|
#define | BV_VLIST_POINT_SIZE 13 |
| specify point pixel size
|
|
#define | BV_VLIST_LINE_WIDTH 14 |
| specify line pixel width
|
|
#define | BV_VLIST_DISPLAY_MAT 15 |
| specify the model matrix
|
|
#define | BV_VLIST_MODEL_MAT 16 |
| specify the display matrix
|
|
#define | BV_VLIST_CMD_MAX 16 |
| Max command number.
|
|
#define | BV_GET_VLIST(_free_hd, p) |
|
#define | BV_FREE_VLIST(_free_hd, hd) |
|
#define | BV_ADD_VLIST(_free_hd, _dest_hd, pnt, draw) |
|
#define | BV_VLIST_SET_DISP_MAT(_free_hd, _dest_hd, _ref_pt) |
|
#define | BV_VLIST_SET_MODEL_MAT(_free_hd, _dest_hd) |
|
#define | BV_VLIST_SET_POINT_SIZE(_free_hd, _dest_hd, _size) |
|
#define | BV_VLIST_SET_LINE_WIDTH(_free_hd, _dest_hd, _width) |
|
#define | BV_CK_VLBLOCK(_p) BU_CKMAG((_p), BV_VLBLOCK_MAGIC, "bv_vlblock") |
|
|
size_t | bv_vlist_cmd_cnt (struct bv_vlist *vlist) |
|
int | bv_vlist_bbox (struct bu_list *vlistp, point_t *bmin, point_t *bmax, size_t *length, int *dispmode) |
|
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_vlist_2string (struct bu_list *vhead, struct bu_list *free_hd, const char *string, double x, double y, double scale, double theta) |
|
const char * | bv_vlist_get_cmd_description (int cmd) |
|
size_t | bv_ck_vlist (const struct bu_list *vhead) |
|
void | bv_vlist_copy (struct bu_list *vlists, struct bu_list *dest, const struct bu_list *src) |
|
void | bv_vlist_export (struct bu_vls *vls, struct bu_list *hp, const char *name) |
|
void | bv_vlist_import (struct bu_list *vlists, struct bu_list *hp, struct bu_vls *namevls, const unsigned char *buf) |
|
void | bv_vlist_cleanup (struct bu_list *hd) |
|
struct bv_vlblock * | bv_vlblock_init (struct bu_list *free_vlist_hd, int max_ent) |
|
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_rpp (struct bu_list *vlists, struct bu_list *hd, const point_t minn, const point_t maxx) |
|
void | bv_plot_vlblock (FILE *fp, const struct bv_vlblock *vbp) |
|
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) |
|
struct bv_scene_obj * | bv_vlblock_obj (struct bv_vlblock *vbp, struct bview *v, const char *name) |
|
void | bv_vlist_to_uplot (FILE *fp, const struct bu_list *vhead) |
|
Definitions for handling lists of vectors (really vertices, or points) and polygons in 3-space. Intended for common handling of wireframe display information, in the full resolution that is calculated in.
On 32-bit machines, BV_VLIST_CHUNK of 35 results in bv_vlist structures just less than 1k bytes.
The head of the doubly linked list can be just a "struct bu_list" head.
To visit all the elements in the vlist: for (BU_LIST_FOR(vp, bv_vlist, hp)) { int i; int nused = vp->nused; int *cmd = vp->cmd; point_t *pt = vp->pt; for (i = 0; i < nused; i++, cmd++, pt++) { access(*cmd, *pt); access(vp->cmd[i], vp->pt[i]); } }
◆ BV_VLIST_CHUNK
32-bit mach => just less than 1k
Definition at line 63 of file vlist.h.
◆ BV_VLIST_NULL
◆ BV_CK_VLIST
◆ BV_VLIST_LINE_MOVE
specify new line
Definition at line 76 of file vlist.h.
◆ BV_VLIST_LINE_DRAW
subsequent line vertex
Definition at line 77 of file vlist.h.
◆ BV_VLIST_POLY_START
pt[] has surface normal
Definition at line 78 of file vlist.h.
◆ BV_VLIST_POLY_MOVE
move to first poly vertex
Definition at line 79 of file vlist.h.
◆ BV_VLIST_POLY_DRAW
subsequent poly vertex
Definition at line 80 of file vlist.h.
◆ BV_VLIST_POLY_END
last vert (repeats 1st), draw poly
Definition at line 81 of file vlist.h.
◆ BV_VLIST_POLY_VERTNORM
#define BV_VLIST_POLY_VERTNORM 6 |
per-vertex normal, for interpolation
Definition at line 82 of file vlist.h.
◆ BV_VLIST_TRI_START
pt[] has surface normal
Definition at line 83 of file vlist.h.
◆ BV_VLIST_TRI_MOVE
move to first triangle vertex
Definition at line 84 of file vlist.h.
◆ BV_VLIST_TRI_DRAW
subsequent triangle vertex
Definition at line 85 of file vlist.h.
◆ BV_VLIST_TRI_END
last vert (repeats 1st), draw poly
Definition at line 86 of file vlist.h.
◆ BV_VLIST_TRI_VERTNORM
#define BV_VLIST_TRI_VERTNORM 11 |
per-vertex normal, for interpolation
Definition at line 87 of file vlist.h.
◆ BV_VLIST_POINT_DRAW
#define BV_VLIST_POINT_DRAW 12 |
Draw a single point.
Definition at line 88 of file vlist.h.
◆ BV_VLIST_POINT_SIZE
#define BV_VLIST_POINT_SIZE 13 |
specify point pixel size
Definition at line 89 of file vlist.h.
◆ BV_VLIST_LINE_WIDTH
#define BV_VLIST_LINE_WIDTH 14 |
specify line pixel width
Definition at line 90 of file vlist.h.
◆ BV_VLIST_DISPLAY_MAT
#define BV_VLIST_DISPLAY_MAT 15 |
specify the model matrix
Definition at line 91 of file vlist.h.
◆ BV_VLIST_MODEL_MAT
specify the display matrix
Definition at line 92 of file vlist.h.
◆ BV_VLIST_CMD_MAX
Max command number.
Definition at line 93 of file vlist.h.
◆ BV_GET_VLIST
Value: do {\
} \
(p)->nused = 0; \
} while (0)
#define BU_LIST_FIRST(structure, headp)
#define BU_LIST_IS_HEAD(p, headp)
Applications that are going to use BV_ADD_VLIST and BV_GET_VLIST are required to execute this macro once, on their _free_hd: BU_LIST_INIT(&_free_hd);
Note that BV_GET_VLIST and BV_FREE_VLIST are non-PARALLEL.
Definition at line 101 of file vlist.h.
◆ BV_FREE_VLIST
Value:Place an entire chain of bv_vlist structs on the freelist _free_hd
Definition at line 113 of file vlist.h.
◆ BV_ADD_VLIST
Value: do { \
_vp->cmd[
_vp->nused++] = (draw); \
} while (0)
#define BU_LIST_LAST(structure, headp)
#define BV_VLIST_CHUNK
32-bit mach => just less than 1k
Definition at line 118 of file vlist.h.
◆ BV_VLIST_SET_DISP_MAT
Value: do { \
} while (0)
#define BV_VLIST_DISPLAY_MAT
specify the model matrix
Change the transformation matrix to display
Definition at line 131 of file vlist.h.
◆ BV_VLIST_SET_MODEL_MAT
Value: do { \
} \
} while (0)
#define BV_VLIST_MODEL_MAT
specify the display matrix
Change the transformation matrix to model
Definition at line 144 of file vlist.h.
◆ BV_VLIST_SET_POINT_SIZE
Value: do { \
} \
} while (0)
#define BV_VLIST_POINT_SIZE
specify point pixel size
Set a point size to apply to the vlist elements that follow.
Definition at line 156 of file vlist.h.
◆ BV_VLIST_SET_LINE_WIDTH
Value: do { \
} \
} while (0)
#define BV_VLIST_LINE_WIDTH
specify line pixel width
Set a line width to apply to the vlist elements that follow.
Definition at line 169 of file vlist.h.
◆ BV_CK_VLBLOCK
◆ bv_vlist_cmd_cnt()
◆ bv_vlist_bbox()
◆ bv_vlist_3string()
Convert a string to a vlist.
'scale' is the width, in mm, of one character.
- Parameters
-
vhead | 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 |
◆ bv_vlist_2string()
Convert string to vlist in 2D
A simpler interface, for those cases where the text lies in the X-Y plane.
- Parameters
-
vhead | 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 |
◆ bv_vlist_get_cmd_description()
const char * bv_vlist_get_cmd_description |
( |
int |
cmd | ) |
|
|
extern |
Returns the description of a vlist cmd. Caller is responsible for freeing the returned string.
◆ bv_ck_vlist()
Validate an bv_vlist chain for having reasonable values inside. Calls bu_bomb() if not.
Returns - npts Number of point/command sets in use.
◆ bv_vlist_copy()
Duplicate the contents of a vlist. Note that the copy may be more densely packed than the source.
◆ bv_vlist_export()
Convert a vlist chain into a blob of network-independent binary, for transmission to another machine.
The result is stored in a vls string, so that both the address and length are available conveniently.
◆ bv_vlist_import()
Convert a blob of network-independent binary prepared by vls_vlist() and received from another machine, into a vlist chain.
◆ bv_vlist_cleanup()
◆ bv_vlblock_init()
◆ bv_vlblock_free()
◆ bv_vlblock_find()
◆ bv_vlist_rpp()
◆ bv_plot_vlblock()
Output a bv_vlblock object in extended UNIX-plot format, including color.
◆ bv_vlblock_to_objs()
◆ bv_vlblock_obj()
◆ bv_vlist_to_uplot()
Output a vlist as an extended 3-D floating point UNIX-Plot file. You provide the file. Uses libplot3 routines to create the UNIX-Plot output.