BRL-CAD
Collaboration diagram for Display Lists:

Files

file  font.c
 

Data Structures

struct  bn_vlist
 
struct  bn_vlblock
 

Macros

#define BN_VLIST_CHUNK   35
 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 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 More...
 
#define BN_VLIST_POLY_MOVE   3
 move to first poly vertex More...
 
#define BN_VLIST_POLY_DRAW   4
 subsequent poly vertex More...
 
#define BN_VLIST_POLY_END   5
 last vert (repeats 1st), draw poly More...
 
#define BN_VLIST_POLY_VERTNORM   6
 per-vertex normal, for interpolation More...
 
#define BN_VLIST_TRI_START   7
 pt[] has surface normal More...
 
#define BN_VLIST_TRI_MOVE   8
 move to first triangle vertex More...
 
#define BN_VLIST_TRI_DRAW   9
 subsequent triangle vertex More...
 
#define BN_VLIST_TRI_END   10
 last vert (repeats 1st), draw poly More...
 
#define BN_VLIST_TRI_VERTNORM   11
 per-vertex normal, for interpolation More...
 
#define BN_VLIST_POINT_DRAW   12
 Draw a single point. More...
 
#define BN_VLIST_POINT_SIZE   13
 specify point pixel size More...
 
#define BN_VLIST_LINE_WIDTH   14
 specify line pixel width More...
 
#define BN_VLIST_CMD_MAX   14
 Max command number. More...
 
#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_VLIST_SET_POINT_SIZE(_free_hd, _dest_hd, _size)
 
#define BN_VLIST_SET_LINE_WIDTH(_free_hd, _dest_hd, _width)
 
#define BN_CK_VLBLOCK(_p)   BU_CKMAG((_p), BN_VLBLOCK_MAGIC, "bn_vlblock")
 

Functions

int bn_vlist_cmd_cnt (struct bn_vlist *vlist)
 
int bn_vlist_bbox (struct bn_vlist *vp, point_t *bmin, point_t *bmax)
 
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)
 
void bn_vlist_2string (struct bu_list *vhead, struct bu_list *free_hd, const char *string, double x, double y, double scale, double theta)
 

Detailed Description

Macro Definition Documentation

#define BN_VLIST_CHUNK   35

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.

32-bit mach => just less than 1k

Definition at line 45 of file vlist.h.

Referenced by rt_extrude_plot(), vdraw_delete(), and vdraw_insert().

#define BN_VLIST_NULL   ((struct bn_vlist *)0)

Definition at line 77 of file vlist.h.

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

Definition at line 78 of file vlist.h.

Referenced by bn_vlist_cleanup(), dl_print_schain(), dmo_drawVList_tcl(), and rt_ck_vlist().

#define BN_VLIST_LINE_MOVE   0

Definition at line 82 of file vlist.h.

Referenced by _osgLoadSolid(), add_vlist_to_geom(), bn_vlist_3string(), bn_vlist_bbox(), bn_vlist_rpp(), brep_surface_uv_plot(), dl_plot(), dl_polybinout(), dl_select(), dl_select_partial(), draw_pipe_arc(), drawisoU(), drawisoUCheckForTrim(), drawisoV(), drawisoVCheckForTrim(), ged_cm_end(), nmg_eu_to_vlist(), nmg_lu_to_vlist(), nmg_snurb_fu_to_vlist(), nmg_snurb_to_vlist(), nmg_vlblock_e(), nmg_vlblock_eu(), nmg_vlblock_euleft(), nmg_vlblock_v(), nmg_vlist_to_eu(), nmg_vlist_to_wire_edges(), nmg_vu_to_vlist(), overlap(), plot_bbnode(), plot_drawVList(), plot_ellipse(), plot_face_trim(), plot_sum_surface(), plotcurve(), plotcurveonsurface(), plotFace(), plotisoU(), plotisoUCheckForTrim(), plotisoV(), plotisoVCheckForTrim(), plotsurface(), plotsurfaceknots(), plotsurfaceleafs(), plotsurfacenormals(), plottrim(), plottrim2d(), plottrimdirection(), plottrimleafs(), plotUVDomain2d(), poly2tri_CDT(), ps_drawVList(), qray_data_to_vlist(), rt_arbn_plot(), rt_ars_plot(), rt_bot_adaptive_plot(), rt_bot_plot(), rt_brep_adaptive_plot(), rt_brep_plot(), rt_cline_plot(), rt_ebm_plate(), rt_ehy_plot(), rt_ell_plot(), rt_epa_plot(), rt_eto_plot(), rt_extrude_plot(), rt_grp_plot(), rt_hf_plot(), rt_hlf_plot(), rt_hrt_plot(), rt_hyp_plot(), rt_joint_plot(), rt_metaball_plot_sph(), rt_nurb_plot(), rt_part_plot(), rt_pg_plot(), rt_pnts_plot(), rt_process_uplot_value(), rt_revolve_plot(), rt_rhc_adaptive_plot(), rt_rhc_plot(), rt_rpc_adaptive_plot(), rt_rpc_plot(), rt_superell_plot(), rt_tgc_adaptive_plot(), rt_tgc_plot(), rt_tor_plot(), rt_vlist_to_uplot(), rt_vol_plate(), seg_to_vlist(), shoot_and_plot(), show_broken_e(), and show_broken_vu().

#define BN_VLIST_LINE_DRAW   1

Definition at line 83 of file vlist.h.

Referenced by _osgLoadSolid(), add_vlist_to_geom(), bn_vlist_3string(), bn_vlist_bbox(), bn_vlist_rpp(), brep_surface_uv_plot(), dl_plot(), dl_polybinout(), dl_select(), dl_select_partial(), draw_pipe_arc(), drawisoU(), drawisoUCheckForTrim(), drawisoV(), drawisoVCheckForTrim(), ged_cm_end(), nmg_eu_to_vlist(), nmg_lu_to_vlist(), nmg_snurb_fu_to_vlist(), nmg_snurb_to_vlist(), nmg_vlblock_e(), nmg_vlblock_eu(), nmg_vlblock_euleft(), nmg_vlblock_v(), nmg_vlist_to_eu(), nmg_vlist_to_wire_edges(), nmg_vu_to_vlist(), overlap(), plot_bbnode(), plot_drawVList(), plot_ellipse(), plot_face_trim(), plot_sum_surface(), plotcurve(), plotcurveonsurface(), plotFace(), plotisoU(), plotisoUCheckForTrim(), plotisoV(), plotisoVCheckForTrim(), plotsurface(), plotsurfaceknots(), plotsurfacenormals(), plottrim(), plottrim2d(), plottrimdirection(), plotUVDomain2d(), poly2tri_CDT(), ps_drawVList(), qray_data_to_vlist(), rt_arbn_plot(), rt_ars_plot(), rt_bot_adaptive_plot(), rt_bot_plot(), rt_brep_adaptive_plot(), rt_brep_plot(), rt_cline_plot(), rt_ebm_plate(), rt_ehy_plot(), rt_ell_plot(), rt_epa_plot(), rt_eto_plot(), rt_extrude_plot(), rt_extrude_tess(), rt_grp_plot(), rt_hf_plot(), rt_hlf_plot(), rt_hrt_plot(), rt_hyp_plot(), rt_joint_plot(), rt_metaball_plot_sph(), rt_nurb_plot(), rt_part_plot(), rt_pg_plot(), rt_pnts_plot(), rt_process_uplot_value(), rt_revolve_plot(), rt_rhc_adaptive_plot(), rt_rhc_plot(), rt_rpc_adaptive_plot(), rt_rpc_plot(), rt_superell_plot(), rt_tgc_adaptive_plot(), rt_tgc_plot(), rt_tor_plot(), rt_vlist_to_uplot(), rt_vol_plate(), seg_to_vlist(), shoot_and_plot(), show_broken_e(), and show_broken_vu().

#define BN_VLIST_POLY_VERTNORM   6

per-vertex normal, for interpolation

Definition at line 88 of file vlist.h.

Referenced by _osgLoadSolid(), bn_vlist_bbox(), dl_plot(), dl_polybinout(), dl_select(), dl_select_partial(), nmg_lu_to_vlist(), plot_drawVList(), and ps_drawVList().

#define BN_VLIST_TRI_START   7
#define BN_VLIST_TRI_MOVE   8
#define BN_VLIST_TRI_DRAW   9
#define BN_VLIST_TRI_END   10
#define BN_VLIST_TRI_VERTNORM   11

per-vertex normal, for interpolation

Definition at line 93 of file vlist.h.

Referenced by bn_vlist_bbox(), dl_plot(), dl_polybinout(), dl_select(), dl_select_partial(), plot_drawVList(), poly2tri_CDT(), ps_drawVList(), and rt_bot_plot_poly().

#define BN_VLIST_POINT_DRAW   12

Draw a single point.

Definition at line 94 of file vlist.h.

Referenced by add_vlist_to_geom(), bn_vlist_bbox(), plotpoint(), plotsurfaceknots(), poly2tri_CDT(), and rt_ell_adaptive_plot().

#define BN_VLIST_POINT_SIZE   13

specify point pixel size

Definition at line 95 of file vlist.h.

Referenced by bn_vlist_bbox(), dl_select(), and plotpoint().

#define BN_VLIST_LINE_WIDTH   14

specify line pixel width

Definition at line 96 of file vlist.h.

Referenced by bn_vlist_bbox(), and dl_select().

#define BN_VLIST_CMD_MAX   14

Max command number.

Definition at line 97 of file vlist.h.

Referenced by rt_ck_vlist().

#define BN_GET_VLIST (   _free_hd,
 
)
Value:
{\
(p) = BU_LIST_FIRST(bn_vlist, (_free_hd)); \
if (BU_LIST_IS_HEAD((p), (_free_hd))) { \
BU_ALLOC((p), struct bn_vlist); \
(p)->l.magic = BN_VLIST_MAGIC; \
} else { \
BU_LIST_DEQUEUE(&((p)->l)); \
} \
(p)->nused = 0; \
}
if(share_geom)
Definition: nmg_mod.c:3829
#define BU_LIST_IS_HEAD(p, hp)
Definition: list.h:322
#define BU_ALLOC(_ptr, _type)
Definition: malloc.h:223
#define BN_VLIST_MAGIC
Definition: magic.h:77
Definition: vlist.h:71
#define BU_LIST_DEQUEUE(cur)
Definition: list.h:209
#define BU_LIST_FIRST(structure, hp)
Definition: list.h:312

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 106 of file vlist.h.

#define BN_FREE_VLIST (   _free_hd,
  hd 
)
Value:
{ \
BU_LIST_APPEND_LIST((_free_hd), (hd)); \
}
#define BU_CK_LIST_HEAD(_p)
Definition: list.h:142
#define BU_LIST_APPEND_LIST(dest_hp, src_hp)
Definition: list.h:281

Place an entire chain of bn_vlist structs on the freelist _free_hd

Definition at line 118 of file vlist.h.

Referenced by rt_extrude_tess(), and rt_vlblock_free().

#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); \
}
size_t nused
elements 0..nused active
Definition: vlist.h:73
#define BU_LIST_INSERT(old, new)
Definition: list.h:183
struct bu_list l
magic, forw, back
Definition: vlist.h:72
#define BU_LIST_LAST(structure, hp)
Definition: list.h:306
if(share_geom)
Definition: nmg_mod.c:3829
#define BU_LIST_IS_HEAD(p, hp)
Definition: list.h:322
#define BN_GET_VLIST(_free_hd, p)
Definition: vlist.h:106
Definition: vlist.h:71
#define BU_CK_LIST_HEAD(_p)
Definition: list.h:142
#define BN_VLIST_CHUNK
Definitions for handling lists of vectors (really vertices, or points) and polygons in 3-space...
Definition: vlist.h:45
point_t pt[BN_VLIST_CHUNK]
associated 3-point/vect
Definition: vlist.h:75

Definition at line 123 of file vlist.h.

Referenced by bn_vlist_3string(), bn_vlist_rpp(), overlap(), rt_process_uplot_value(), rt_vlist_copy(), and rt_vlist_import().

#define BN_VLIST_SET_POINT_SIZE (   _free_hd,
  _dest_hd,
  _size 
)
Value:
{ \
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)); \
} \
_vp->pt[_vp->nused][0] = (_size); \
_vp->cmd[_vp->nused++] = BN_VLIST_POINT_SIZE; \
}
#define BU_LIST_INSERT(old, new)
Definition: list.h:183
#define BU_LIST_LAST(structure, hp)
Definition: list.h:306
if(share_geom)
Definition: nmg_mod.c:3829
#define BU_LIST_IS_HEAD(p, hp)
Definition: list.h:322
#define BN_GET_VLIST(_free_hd, p)
Definition: vlist.h:106
#define BN_VLIST_POINT_SIZE
specify point pixel size
Definition: vlist.h:95
Definition: vlist.h:71
#define BU_CK_LIST_HEAD(_p)
Definition: list.h:142
#define BN_VLIST_CHUNK
Definitions for handling lists of vectors (really vertices, or points) and polygons in 3-space...
Definition: vlist.h:45

Set a point size to apply to the vlist elements that follow.

Definition at line 136 of file vlist.h.

#define BN_VLIST_SET_LINE_WIDTH (   _free_hd,
  _dest_hd,
  _width 
)
Value:
{ \
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)); \
} \
_vp->pt[_vp->nused][0] = (_width); \
_vp->cmd[_vp->nused++] = BN_VLIST_LINE_WIDTH; \
}
#define BU_LIST_INSERT(old, new)
Definition: list.h:183
#define BU_LIST_LAST(structure, hp)
Definition: list.h:306
if(share_geom)
Definition: nmg_mod.c:3829
#define BU_LIST_IS_HEAD(p, hp)
Definition: list.h:322
#define BN_GET_VLIST(_free_hd, p)
Definition: vlist.h:106
Definition: vlist.h:71
#define BU_CK_LIST_HEAD(_p)
Definition: list.h:142
#define BN_VLIST_CHUNK
Definitions for handling lists of vectors (really vertices, or points) and polygons in 3-space...
Definition: vlist.h:45
#define BN_VLIST_LINE_WIDTH
specify line pixel width
Definition: vlist.h:96

Set a line width to apply to the vlist elements that follow.

Definition at line 149 of file vlist.h.

Function Documentation

int bn_vlist_cmd_cnt ( struct bn_vlist vlist)

Definition at line 34 of file vlist.c.

References BU_LIST_FOR, bn_vlist::l, bn_vlist::nused, and UNLIKELY.

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.

'scale' is the width, in mm, of one character.

Parameters
vhead
free_hdsource of free vlists
stringstring of chars to be plotted
originlower left corner of 1st char
rotTransform matrix (WARNING: may xlate)
scalescale factor to change 1x1 char sz

Referenced by nmg_vlblock_euleft(), rt_label_vlist_verts(), and rt_process_uplot_value().

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

A simpler interface, for those cases where the text lies in the X-Y plane.

Parameters
vhead
free_hdsource of free vlists
stringstring of chars to be plotted
xlower left corner of 1st char
ylower left corner of 1st char
scalescale factor to change 1x1 char sz
thetadegrees ccw from X-axis

Definition at line 111 of file font.c.

References bn_mat_angles(), bn_vlist_3string(), chull3d_data::p, and VSET.

Here is the call graph for this function: