BRL-CAD
dm.h File Reference
#include "common.h"
#include "vmath.h"
#include "bn.h"
#include "raytrace.h"
#include "fbserv_obj.h"
#include "./dm/defines.h"
Include dependency graph for dm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dm_hook_data
 

Macros

#define USE_FBSERV   1
 
#define DM_NULL   (dm *)NULL
 
#define DM_MIN   (-2048)
 
#define DM_MAX   (2047)
 
#define DM_O(_m)   offsetof(dm, _m)
 
#define GED_MAX   2047.0
 
#define GED_MIN   -2048.0
 
#define GED_RANGE   4095.0
 
#define INV_GED   0.00048828125
 
#define INV_4096   0.000244140625
 
#define DIVBY4096(x)   (((double)(x))*INV_4096)
 
#define GED_TO_Xx(_dmp, x)   ((int)((DIVBY4096(x)+0.5)*_dmp->dm_width))
 
#define GED_TO_Xy(_dmp, x)   ((int)((0.5-DIVBY4096(x))*_dmp->dm_height))
 
#define Xx_TO_GED(_dmp, x)   ((int)(((x)/(double)_dmp->dm_width - 0.5) * GED_RANGE))
 
#define Xy_TO_GED(_dmp, x)   ((int)((0.5 - (x)/(double)_dmp->dm_height) * GED_RANGE))
 
#define GED_TO_PM1(x)   (((fastf_t)(x))*INV_GED)
 
#define FONTBACK   "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1"
 
#define FONT5   "5x7"
 
#define FONT6   "6x10"
 
#define FONT7   "7x13"
 
#define FONT8   "8x13"
 
#define FONT9   "9x15"
 
#define FONT10   "10x20"
 
#define FONT12   "12x24"
 
#define DM_VALID_FONT_SIZE(_size)   (5 <= (_size) && (_size) <= 12 && (_size) != 11)
 
#define DM_FONT_SIZE_TO_NAME(_size)   (((_size) == 5) ? FONT5 : (((_size) == 6) ? FONT6 : (((_size) == 7) ? FONT7 : (((_size) == 8) ? FONT8 : (((_size) == 9) ? FONT9 : (((_size) == 10) ? FONT10 : FONT12))))))
 
#define DM_TYPE_BAD   -1
 
#define DM_TYPE_NULL   0
 
#define DM_TYPE_PLOT   1
 
#define DM_TYPE_PS   2
 
#define DM_TYPE_X   3
 
#define DM_TYPE_OGL   4
 
#define DM_TYPE_GLX   5
 
#define DM_TYPE_PEX   6
 
#define DM_TYPE_WGL   7
 
#define DM_TYPE_TK   8
 
#define DM_TYPE_RTGL   9
 
#define DM_TYPE_TXT   10
 
#define DM_TYPE_QT   11
 
#define DM_TYPE_OSG   12
 
#define DM_TYPE_OSGL   13
 
#define DM_SOLID_LINE   0
 
#define DM_DASHED_LINE   1
 
#define IS_DM_TYPE_NULL(_t)   ((_t) == DM_TYPE_NULL)
 
#define IS_DM_TYPE_PLOT(_t)   ((_t) == DM_TYPE_PLOT)
 
#define IS_DM_TYPE_PS(_t)   ((_t) == DM_TYPE_PS)
 
#define IS_DM_TYPE_X(_t)   ((_t) == DM_TYPE_X)
 
#define IS_DM_TYPE_TK(_t)   ((_t) == DM_TYPE_TK)
 
#define IS_DM_TYPE_OGL(_t)   ((_t) == DM_TYPE_OGL)
 
#define IS_DM_TYPE_GLX(_t)   ((_t) == DM_TYPE_GLX)
 
#define IS_DM_TYPE_PEX(_t)   ((_t) == DM_TYPE_PEX)
 
#define IS_DM_TYPE_WGL(_t)   ((_t) == DM_TYPE_WGL)
 
#define IS_DM_TYPE_RTGL(_t)   ((_t) == DM_TYPE_RTGL)
 
#define IS_DM_TYPE_TXT(_t)   ((_t) == DM_TYPE_TXT)
 
#define IS_DM_TYPE_QT(_t)   ((_t) == DM_TYPE_QT)
 
#define IS_DM_TYPE_OSG(_t)   ((_t) == DM_TYPE_OSG)
 
#define IS_DM_TYPE_OSGL(_t)   ((_t) == DM_TYPE_OSGL)
 
#define GET_DM(p, structure, w, hp)
 
#define DM_COLOR_HI   ((short)230)
 
#define DM_COLOR_LOW   ((short)0)
 
#define DM_BLACK_R   DM_COLOR_LOW
 
#define DM_BLACK_G   DM_COLOR_LOW
 
#define DM_BLACK_B   DM_COLOR_LOW
 
#define DM_RED_R   DM_COLOR_HI
 
#define DM_RED_G   DM_COLOR_LOW
 
#define DM_RED_B   DM_COLOR_LOW
 
#define DM_BLUE_R   DM_COLOR_LOW
 
#define DM_BLUE_G   DM_COLOR_LOW
 
#define DM_BLUE_B   DM_COLOR_HI
 
#define DM_YELLOW_R   DM_COLOR_HI
 
#define DM_YELLOW_G   DM_COLOR_HI
 
#define DM_YELLOW_B   DM_COLOR_LOW
 
#define DM_WHITE_R   DM_COLOR_HI
 
#define DM_WHITE_G   DM_COLOR_HI
 
#define DM_WHITE_B   DM_COLOR_HI
 
#define DM_BLACK   DM_BLACK_R, DM_BLACK_G, DM_BLACK_B
 
#define DM_RED   DM_RED_R, DM_RED_G, DM_RED_B
 
#define DM_BLUE   DM_BLUE_R, DM_BLUE_G, DM_BLUE_B
 
#define DM_YELLOW   DM_YELLOW_R, DM_YELLOW_G, DM_YELLOW_B
 
#define DM_WHITE   DM_WHITE_R, DM_WHITE_G, DM_WHITE_B
 
#define DM_COPY_COLOR(_dr, _dg, _db, _sr, _sg, _sb)
 
#define DM_SAME_COLOR(_dr, _dg, _db, _sr, _sg, _sb)
 
#define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask)
 
#define DM_CHGV_REDO   0 /* Display has changed substantially */
 
#define DM_CHGV_ADD   1 /* Add an object to the display */
 
#define DM_CHGV_DEL   2 /* Delete an object from the display */
 
#define DM_CHGV_REPL   3 /* Replace an object */
 
#define DM_CHGV_ILLUM   4 /* Make new object the illuminated object */
 
#define LIGHT_OFF   0
 
#define LIGHT_ON   1
 
#define LIGHT_RESET   2 /* all lights out */
 
#define DM_OPEN(_interp, _type, _argc, _argv)   dm_open(_interp, _type, _argc, _argv)
 
#define DM_OPEN(_interp, _type, _argc, _argv)   dm_open(_interp, _type, _argc, _argv)
 
#define DM_CLOSE(_dmp)   _dmp->dm_close(_dmp)
 
#define DM_DRAW_BEGIN(_dmp)   _dmp->dm_drawBegin(_dmp)
 
#define DM_DRAW_END(_dmp)   _dmp->dm_drawEnd(_dmp)
 
#define DM_NORMAL(_dmp)   _dmp->dm_normal(_dmp)
 
#define DM_LOADMATRIX(_dmp, _mat, _eye)   _dmp->dm_loadMatrix(_dmp, _mat, _eye)
 
#define DM_LOADPMATRIX(_dmp, _mat)   _dmp->dm_loadPMatrix(_dmp, _mat)
 
#define DM_DRAW_STRING_2D(_dmp, _str, _x, _y, _size, _use_aspect)   _dmp->dm_drawString2D(_dmp, _str, _x, _y, _size, _use_aspect)
 
#define DM_DRAW_LINE_2D(_dmp, _x1, _y1, _x2, _y2)   _dmp->dm_drawLine2D(_dmp, _x1, _y1, _x2, _y2)
 
#define DM_DRAW_LINE_3D(_dmp, _pt1, _pt2)   _dmp->dm_drawLine3D(_dmp, _pt1, _pt2)
 
#define DM_DRAW_LINES_3D(_dmp, _npoints, _points, _sflag)   _dmp->dm_drawLines3D(_dmp, _npoints, _points, _sflag)
 
#define DM_DRAW_POINT_2D(_dmp, _x, _y)   _dmp->dm_drawPoint2D(_dmp, _x, _y)
 
#define DM_DRAW_POINT_3D(_dmp, _pt)   _dmp->dm_drawPoint3D(_dmp, _pt)
 
#define DM_DRAW_POINTS_3D(_dmp, _npoints, _points)   _dmp->dm_drawPoints3D(_dmp, _npoints, _points)
 
#define DM_DRAW_VLIST(_dmp, _vlist)   _dmp->dm_drawVList(_dmp, _vlist)
 
#define DM_DRAW_VLIST_HIDDEN_LINE(_dmp, _vlist)   _dmp->dm_drawVListHiddenLine(_dmp, _vlist)
 
#define DM_DRAW(_dmp, _callback, _data)   _dmp->dm_draw(_dmp, _callback, _data)
 
#define DM_SET_FGCOLOR(_dmp, _r, _g, _b, _strict, _transparency)   _dmp->dm_setFGColor(_dmp, _r, _g, _b, _strict, _transparency)
 
#define DM_SET_BGCOLOR(_dmp, _r, _g, _b)   _dmp->dm_setBGColor(_dmp, _r, _g, _b)
 
#define DM_SET_LINE_ATTR(_dmp, _width, _dashed)   _dmp->dm_setLineAttr(_dmp, _width, _dashed)
 
#define DM_CONFIGURE_WIN(_dmp, _force)   _dmp->dm_configureWin((_dmp), (_force))
 
#define DM_SET_WIN_BOUNDS(_dmp, _w)   _dmp->dm_setWinBounds(_dmp, _w)
 
#define DM_SET_LIGHT(_dmp, _on)   _dmp->dm_setLight(_dmp, _on)
 
#define DM_SET_TRANSPARENCY(_dmp, _on)   _dmp->dm_setTransparency(_dmp, _on)
 
#define DM_SET_DEPTH_MASK(_dmp, _on)   _dmp->dm_setDepthMask(_dmp, _on)
 
#define DM_SET_ZBUFFER(_dmp, _on)   _dmp->dm_setZBuffer(_dmp, _on)
 
#define DM_DEBUG(_dmp, _lvl)   _dmp->dm_debug(_dmp, _lvl)
 
#define DM_LOGFILE(_dmp, _lvl)   _dmp->dm_logfile(_dmp, _lvl)
 
#define DM_BEGINDLIST(_dmp, _list)   _dmp->dm_beginDList(_dmp, _list)
 
#define DM_ENDDLIST(_dmp)   _dmp->dm_endDList(_dmp)
 
#define DM_DRAWDLIST(_dmp, _list)   _dmp->dm_drawDList(_list)
 
#define DM_FREEDLISTS(_dmp, _list, _range)   _dmp->dm_freeDLists(_dmp, _list, _range)
 
#define DM_GEN_DLISTS(_dmp, _range)   _dmp->dm_genDLists(_dmp, _range)
 
#define DM_GET_DISPLAY_IMAGE(_dmp, _image)   _dmp->dm_getDisplayImage(_dmp, _image)
 
#define DM_MAKE_CURRENT(_dmp)   _dmp->dm_makeCurrent(_dmp)
 

Typedefs

typedef struct dm_internal dm
 

Functions

int Dm_Init (void *interp)
 
dmdm_open (Tcl_Interp *interp, int type, int argc, const char *argv[])
 
void * dm_interp (dm *dmp)
 
int dm_share_dlist (dm *dmp1, dm *dmp2)
 
fastf_t dm_Xx2Normal (dm *dmp, int x)
 
int dm_Normal2Xx (dm *dmp, fastf_t f)
 
fastf_t dm_Xy2Normal (dm *dmp, int y, int use_aspect)
 
int dm_Normal2Xy (dm *dmp, fastf_t f, int use_aspect)
 
void dm_fogHint (dm *dmp, int fastfog)
 
int dm_processOptions (dm *dmp, struct bu_vls *init_proc_vls, int argc, char **argv)
 
int dm_limit (int i)
 
int dm_unlimit (int i)
 
fastf_t dm_wrap (fastf_t f)
 
void dm_draw_adc (dm *dmp, struct bview_adc_state *adcp, mat_t view2model, mat_t model2view)
 
void dm_draw_data_axes (dm *dmp, fastf_t viewSize, struct bview_data_axes_state *bndasp)
 
void dm_draw_axes (dm *dmp, fastf_t viewSize, const mat_t rmat, struct bview_axes_state *bnasp)
 
int clip (fastf_t *, fastf_t *, fastf_t *, fastf_t *)
 
int vclip (fastf_t *, fastf_t *, fastf_t *, fastf_t *)
 
void dm_draw_grid (dm *dmp, struct bview_grid_state *ggsp, fastf_t scale, mat_t model2view, fastf_t base2local)
 
int dm_draw_labels (dm *dmp, struct rt_wdb *wdbp, const char *name, mat_t viewmat, int *labelsColor, int(*labelsHook)(dm *dmp_arg, struct rt_wdb *wdbp_arg, const char *name_arg, mat_t viewmat_arg, int *labelsColor_arg, ClientData labelsHookClientdata_arg), ClientData labelsHookClientdata)
 
void dm_draw_rect (dm *dmp, struct bview_interactive_rect_state *grsp)
 
void dm_draw_scale (dm *dmp, fastf_t viewSize, int *lineColor, int *textColor)
 
const char * dm_version (void)
 
dmdm_get ()
 
void dm_put (dm *dmp)
 
void dm_set_null (dm *dmp)
 
const char * dm_get_dm_name (dm *dmp)
 
const char * dm_get_dm_lname (dm *dmp)
 
int dm_get_width (dm *dmp)
 
int dm_get_height (dm *dmp)
 
void dm_set_width (dm *dmp, int width)
 
void dm_set_height (dm *dmp, int height)
 
fastf_t dm_get_aspect (dm *dmp)
 
int dm_get_type (dm *dmp)
 
void * dm_get_xvars (dm *dmp)
 
struct bu_vlsdm_list_types (const char separator)
 
unsigned long dm_get_id (dm *dmp)
 
void dm_set_id (dm *dmp, unsigned long new_id)
 
int dm_get_displaylist (dm *dmp)
 
int dm_close (dm *dmp)
 
unsigned char * dm_get_bg (dm *dmp)
 
int dm_set_bg (dm *dmp, unsigned char r, unsigned char g, unsigned char b)
 
unsigned char * dm_get_fg (dm *dmp)
 
int dm_set_fg (dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
 
int dm_make_current (dm *dmp)
 
vect_t * dm_get_clipmin (dm *dmp)
 
vect_t * dm_get_clipmax (dm *dmp)
 
int dm_get_bound_flag (dm *dmp)
 
void dm_set_bound (dm *dmp, fastf_t val)
 
int dm_get_stereo (dm *dmp)
 
int dm_set_win_bounds (dm *dmp, fastf_t *w)
 
int dm_configure_win (dm *dmp, int force)
 
struct bu_vlsdm_get_pathname (dm *dmp)
 
struct bu_vlsdm_get_dname (dm *dmp)
 
struct bu_vlsdm_get_tkname (dm *dmp)
 
int dm_get_fontsize (dm *dmp)
 
void dm_set_fontsize (dm *dmp, int size)
 
int dm_get_light_flag (dm *dmp)
 
void dm_set_light_flag (dm *dmp, int size)
 
int dm_set_light (dm *dmp, int light)
 
void * dm_get_public_vars (dm *dmp)
 
void * dm_get_private_vars (dm *dmp)
 
int dm_get_transparency (dm *dmp)
 
int dm_set_transparency (dm *dmp, int transparency)
 
int dm_get_zbuffer (dm *dmp)
 
int dm_set_zbuffer (dm *dmp, int zbuffer)
 
int dm_get_linewidth (dm *dmp)
 
void dm_set_linewidth (dm *dmp, int linewidth)
 
int dm_get_linestyle (dm *dmp)
 
void dm_set_linestyle (dm *dmp, int linestyle)
 
int dm_get_zclip (dm *dmp)
 
void dm_set_zclip (dm *dmp, int zclip)
 
int dm_get_perspective (dm *dmp)
 
void dm_set_perspective (dm *dmp, fastf_t perspective)
 
int dm_get_display_image (dm *dmp, unsigned char **image)
 
int dm_gen_dlists (dm *dmp, size_t range)
 
int dm_begin_dlist (dm *dmp, unsigned int list)
 
void dm_draw_dlist (dm *dmp, unsigned int list)
 
int dm_end_dlist (dm *dmp)
 
int dm_free_dlists (dm *dmp, unsigned int list, int range)
 
int dm_draw_vlist (dm *dmp, struct bn_vlist *vp)
 
int dm_draw_vlist_hidden_line (dm *dmp, struct bn_vlist *vp)
 
int dm_set_line_attr (dm *dmp, int width, int style)
 
int dm_draw_begin (dm *dmp)
 
int dm_draw_end (dm *dmp)
 
int dm_normal (dm *dmp)
 
int dm_loadmatrix (dm *dmp, fastf_t *mat, int eye)
 
int dm_loadpmatrix (dm *dmp, fastf_t *mat)
 
int dm_draw_string_2d (dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
 
int dm_draw_line_2d (dm *dmp, fastf_t x1, fastf_t y1_2d, fastf_t x2, fastf_t y2)
 
int dm_draw_line_3d (dm *dmp, point_t pt1, point_t pt2)
 
int dm_draw_lines_3d (dm *dmp, int npoints, point_t *points, int sflag)
 
int dm_draw_point_2d (dm *dmp, fastf_t x, fastf_t y)
 
int dm_draw_point_3d (dm *dmp, point_t pt)
 
int dm_draw_points_3d (dm *dmp, int npoints, point_t *points)
 
int dm_draw (dm *dmp, struct bn_vlist *(*callback)(void *), void **data)
 
int dm_draw_obj (dm *dmp, struct display_list *obj)
 
int dm_set_depth_mask (dm *dmp, int d_on)
 
int dm_debug (dm *dmp, int lvl)
 
int dm_logfile (dm *dmp, const char *filename)
 
fbdm_get_fb (dm *dmp)
 
int dm_get_fb_visible (dm *dmp)
 
int dm_set_fb_visible (dm *dmp, int is_fb_visible)
 
fastf_tdm_get_vp (dm *dmp)
 
void dm_set_vp (dm *dmp, fastf_t *vp)
 
int dm_set_hook (const struct bu_structparse_map *map, const char *key, void *data, struct dm_hook_data *hook)
 
struct bu_structparsedm_get_vparse (dm *dmp)
 
void * dm_get_mvars (dm *dmp)
 
int dm_draw_display_list (dm *dmp, struct bu_list *dl, fastf_t transparency_threshold, fastf_t inv_viewsize, short r, short g, short b, int line_width, int draw_style, int draw_edit, unsigned char *gdc, int solids_down, int mv_dlist)
 

Variables

dm dm_ogl
 
dm dm_plot
 
dm dm_ps
 
dm dm_rtgl
 
dm dm_tk
 
dm dm_wgl
 
dm dm_X
 
dm dm_txt
 
dm dm_qt
 
dm dm_osgl