BRL-CAD
dm.h
Go to the documentation of this file.
1 /* D M . H
2  * BRL-CAD
3  *
4  * Copyright (c) 1993-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @addtogroup libdm */
21 /** @{ */
22 /** @file dm.h
23  *
24  */
25 
26 #ifndef DM_H
27 #define DM_H
28 
29 #include "common.h"
30 
31 #include "vmath.h"
32 #include "bn.h"
33 #include "raytrace.h"
34 
35 #define USE_FBSERV 1
36 
37 #ifdef USE_FBSERV
38 # include "fbserv_obj.h"
39 #endif
40 
41 #include "./dm/defines.h"
42 
43 #define DM_NULL (dm *)NULL
44 #define DM_MIN (-2048)
45 #define DM_MAX (2047)
46 
47 #define DM_O(_m) offsetof(dm, _m)
48 
49 #define GED_MAX 2047.0
50 #define GED_MIN -2048.0
51 #define GED_RANGE 4095.0
52 #define INV_GED 0.00048828125
53 #define INV_4096 0.000244140625
54 
55 /*
56  * Display coordinate conversion:
57  * GED is using -2048..+2048,
58  * X is 0..width, 0..height
59  */
60 #define DIVBY4096(x) (((double)(x))*INV_4096)
61 #define GED_TO_Xx(_dmp, x) ((int)((DIVBY4096(x)+0.5)*_dmp->dm_width))
62 #define GED_TO_Xy(_dmp, x) ((int)((0.5-DIVBY4096(x))*_dmp->dm_height))
63 #define Xx_TO_GED(_dmp, x) ((int)(((x)/(double)_dmp->dm_width - 0.5) * GED_RANGE))
64 #define Xy_TO_GED(_dmp, x) ((int)((0.5 - (x)/(double)_dmp->dm_height) * GED_RANGE))
65 
66 /* +-2048 to +-1 */
67 #define GED_TO_PM1(x) (((fastf_t)(x))*INV_GED)
68 
69 #ifdef IR_KNOBS
70 # define NOISE 16 /* Size of dead spot on knob */
71 #endif
72 
73 /* the font used depends on the size of the window opened */
74 #define FONTBACK "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1"
75 #define FONT5 "5x7"
76 #define FONT6 "6x10"
77 #define FONT7 "7x13"
78 #define FONT8 "8x13"
79 #define FONT9 "9x15"
80 #define FONT10 "10x20"
81 #define FONT12 "12x24"
82 
83 #if defined(_WIN32) && !defined(__CYGWIN__)
84 # define DM_VALID_FONT_SIZE(_size) (14 <= (_size) && (_size) <= 29)
85 #else
86 # define DM_VALID_FONT_SIZE(_size) (5 <= (_size) && (_size) <= 12 && (_size) != 11)
87 # 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))))))
88 #endif
89 
90 /* Display Manager Types */
91 #define DM_TYPE_BAD -1
92 #define DM_TYPE_NULL 0
93 #define DM_TYPE_PLOT 1
94 #define DM_TYPE_PS 2
95 #define DM_TYPE_X 3
96 #define DM_TYPE_OGL 4
97 #define DM_TYPE_GLX 5
98 #define DM_TYPE_PEX 6
99 #define DM_TYPE_WGL 7
100 #define DM_TYPE_TK 8
101 #define DM_TYPE_RTGL 9
102 #define DM_TYPE_TXT 10
103 #define DM_TYPE_QT 11
104 #define DM_TYPE_OSG 12
105 #define DM_TYPE_OSGL 13
106 
107 /* Line Styles */
108 #define DM_SOLID_LINE 0
109 #define DM_DASHED_LINE 1
110 
111 #define IS_DM_TYPE_NULL(_t) ((_t) == DM_TYPE_NULL)
112 #define IS_DM_TYPE_PLOT(_t) ((_t) == DM_TYPE_PLOT)
113 #define IS_DM_TYPE_PS(_t) ((_t) == DM_TYPE_PS)
114 #define IS_DM_TYPE_X(_t) ((_t) == DM_TYPE_X)
115 #define IS_DM_TYPE_TK(_t) ((_t) == DM_TYPE_TK)
116 #define IS_DM_TYPE_OGL(_t) ((_t) == DM_TYPE_OGL)
117 #define IS_DM_TYPE_GLX(_t) ((_t) == DM_TYPE_GLX)
118 #define IS_DM_TYPE_PEX(_t) ((_t) == DM_TYPE_PEX)
119 #define IS_DM_TYPE_WGL(_t) ((_t) == DM_TYPE_WGL)
120 #define IS_DM_TYPE_RTGL(_t) ((_t) == DM_TYPE_RTGL)
121 #define IS_DM_TYPE_TXT(_t) ((_t) == DM_TYPE_TXT)
122 #define IS_DM_TYPE_QT(_t) ((_t) == DM_TYPE_QT)
123 #define IS_DM_TYPE_OSG(_t) ((_t) == DM_TYPE_OSG)
124 #define IS_DM_TYPE_OSGL(_t) ((_t) == DM_TYPE_OSGL)
125 
126 #define GET_DM(p, structure, w, hp) { \
127  register struct structure *tp; \
128  for (BU_LIST_FOR(tp, structure, hp)) { \
129  if (w == tp->win) { \
130  (p) = tp; \
131  break; \
132  } \
133  } \
134  \
135  if (BU_LIST_IS_HEAD(tp, hp)) \
136  p = (struct structure *)NULL; \
137  }
138 
139 
140 /* Colors */
141 #define DM_COLOR_HI ((short)230)
142 #define DM_COLOR_LOW ((short)0)
143 #define DM_BLACK_R DM_COLOR_LOW
144 #define DM_BLACK_G DM_COLOR_LOW
145 #define DM_BLACK_B DM_COLOR_LOW
146 #define DM_RED_R DM_COLOR_HI
147 #define DM_RED_G DM_COLOR_LOW
148 #define DM_RED_B DM_COLOR_LOW
149 #define DM_BLUE_R DM_COLOR_LOW
150 #define DM_BLUE_G DM_COLOR_LOW
151 #define DM_BLUE_B DM_COLOR_HI
152 #define DM_YELLOW_R DM_COLOR_HI
153 #define DM_YELLOW_G DM_COLOR_HI
154 #define DM_YELLOW_B DM_COLOR_LOW
155 #define DM_WHITE_R DM_COLOR_HI
156 #define DM_WHITE_G DM_COLOR_HI
157 #define DM_WHITE_B DM_COLOR_HI
158 #define DM_BLACK DM_BLACK_R, DM_BLACK_G, DM_BLACK_B
159 #define DM_RED DM_RED_R, DM_RED_G, DM_RED_B
160 #define DM_BLUE DM_BLUE_R, DM_BLUE_G, DM_BLUE_B
161 #define DM_YELLOW DM_YELLOW_R, DM_YELLOW_G, DM_YELLOW_B
162 #define DM_WHITE DM_WHITE_R, DM_WHITE_G, DM_WHITE_B
163 #define DM_COPY_COLOR(_dr, _dg, _db, _sr, _sg, _sb) {\
164  (_dr) = (_sr);\
165  (_dg) = (_sg);\
166  (_db) = (_sb); }
167 #define DM_SAME_COLOR(_dr, _dg, _db, _sr, _sg, _sb)(\
168  (_dr) == (_sr) &&\
169  (_dg) == (_sg) &&\
170  (_db) == (_sb))
171 #if defined(DM_X) || defined(DM_OGL)
172 #define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask) { \
173  _shift = 24 - _shift; \
174  switch (_shift) { \
175  case 0: \
176  _mask >>= 24; \
177  break; \
178  case 8: \
179  _mask >>= 8; \
180  break; \
181  case 16: \
182  _mask <<= 8; \
183  break; \
184  case 24: \
185  _mask <<= 24; \
186  break; \
187  } \
188  }
189 #else
190 /* Do nothing */
191 #define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask)
192 #endif
193 
194 /* Command parameter to dmr_viewchange() */
195 #define DM_CHGV_REDO 0 /* Display has changed substantially */
196 #define DM_CHGV_ADD 1 /* Add an object to the display */
197 #define DM_CHGV_DEL 2 /* Delete an object from the display */
198 #define DM_CHGV_REPL 3 /* Replace an object */
199 #define DM_CHGV_ILLUM 4 /* Make new object the illuminated object */
200 
201 /*
202  * Definitions for dealing with the buttons and lights.
203  * BV are for viewing, and BE are for editing functions.
204  */
205 #define LIGHT_OFF 0
206 #define LIGHT_ON 1
207 #define LIGHT_RESET 2 /* all lights out */
208 
209 /* This is how a parent application can pass a generic
210  * hook function in when setting dm variables. The dm_hook_data
211  * container holds the bu_structparse hook function and data
212  * needed by it in the dm_hook and dm_hook_data slots. When
213  * bu_struct_parse or one of the other libbu structure parsing
214  * functions is called, the dm_hook_data container is passed
215  * in as the data slot in that call.
216  *
217  * TODO - need example
218  *
219  */
220 struct dm_hook_data {
221  void(*dm_hook)(const struct bu_structparse *, const char *, void *, const char *, void *);
222  void *dmh_data;
223 };
224 
225 /* Hide the dm structure behind a typedef */
226 typedef struct dm_internal dm;
227 
228 #define DM_OPEN(_interp, _type, _argc, _argv) dm_open(_interp, _type, _argc, _argv)
229 
231 
232 DM_EXPORT extern dm dm_ogl;
233 DM_EXPORT extern dm dm_plot;
234 DM_EXPORT extern dm dm_ps;
235 DM_EXPORT extern dm dm_rtgl;
236 DM_EXPORT extern dm dm_tk;
237 DM_EXPORT extern dm dm_wgl;
238 DM_EXPORT extern dm dm_X;
239 DM_EXPORT extern dm dm_txt;
240 DM_EXPORT extern dm dm_qt;
241 DM_EXPORT extern dm dm_osgl;
242 
243 DM_EXPORT extern int Dm_Init(void *interp);
244 DM_EXPORT extern dm *dm_open(Tcl_Interp *interp,
245  int type,
246  int argc,
247  const char *argv[]);
248 DM_EXPORT extern void *dm_interp(dm *dmp);
249 DM_EXPORT extern int dm_share_dlist(dm *dmp1,
250  dm *dmp2);
251 DM_EXPORT extern fastf_t dm_Xx2Normal(dm *dmp,
252  int x);
253 DM_EXPORT extern int dm_Normal2Xx(dm *dmp,
254  fastf_t f);
255 DM_EXPORT extern fastf_t dm_Xy2Normal(dm *dmp,
256  int y,
257  int use_aspect);
258 DM_EXPORT extern int dm_Normal2Xy(dm *dmp,
259  fastf_t f,
260  int use_aspect);
261 DM_EXPORT extern void dm_fogHint(dm *dmp,
262  int fastfog);
263 DM_EXPORT extern int dm_processOptions(dm *dmp, struct bu_vls *init_proc_vls, int argc, char **argv);
264 DM_EXPORT extern int dm_limit(int i);
265 DM_EXPORT extern int dm_unlimit(int i);
266 DM_EXPORT extern fastf_t dm_wrap(fastf_t f);
267 
268 /* adc.c */
269 DM_EXPORT extern void dm_draw_adc(dm *dmp,
270  struct bview_adc_state *adcp, mat_t view2model, mat_t model2view);
271 
272 /* axes.c */
273 DM_EXPORT extern void dm_draw_data_axes(dm *dmp,
274  fastf_t viewSize,
275  struct bview_data_axes_state *bndasp);
276 
277 DM_EXPORT extern void dm_draw_axes(dm *dmp,
278  fastf_t viewSize,
279  const mat_t rmat,
280  struct bview_axes_state *bnasp);
281 
282 /* clip.c */
283 DM_EXPORT extern int clip(fastf_t *,
284  fastf_t *,
285  fastf_t *,
286  fastf_t *);
287 DM_EXPORT extern int vclip(fastf_t *,
288  fastf_t *,
289  fastf_t *,
290  fastf_t *);
291 
292 /* grid.c */
293 DM_EXPORT extern void dm_draw_grid(dm *dmp,
294  struct bview_grid_state *ggsp,
295  fastf_t scale,
296  mat_t model2view,
297  fastf_t base2local);
298 
299 /* labels.c */
300 DM_EXPORT extern int dm_draw_labels(dm *dmp,
301  struct rt_wdb *wdbp,
302  const char *name,
303  mat_t viewmat,
304  int *labelsColor,
305  int (*labelsHook)(dm *dmp_arg, struct rt_wdb *wdbp_arg,
306  const char *name_arg, mat_t viewmat_arg,
307  int *labelsColor_arg, ClientData labelsHookClientdata_arg),
308  ClientData labelsHookClientdata);
309 
310 /* rect.c */
311 DM_EXPORT extern void dm_draw_rect(dm *dmp,
312  struct bview_interactive_rect_state *grsp);
313 
314 /* scale.c */
315 DM_EXPORT extern void dm_draw_scale(dm *dmp,
316  fastf_t viewSize,
317  int *lineColor,
318  int *textColor);
319 
320 /* vers.c */
321 DM_EXPORT extern const char *dm_version(void);
322 
323 
324 
325 /* functions to make a dm struct hideable - will need to
326  * sort these out later */
327 
328 DM_EXPORT extern dm *dm_get();
329 DM_EXPORT extern void dm_put(dm *dmp);
330 DM_EXPORT extern void dm_set_null(dm *dmp); /* TODO - HACK, need general set mechanism */
331 DM_EXPORT extern const char *dm_get_dm_name(dm *dmp);
332 DM_EXPORT extern const char *dm_get_dm_lname(dm *dmp);
333 DM_EXPORT extern int dm_get_width(dm *dmp);
334 DM_EXPORT extern int dm_get_height(dm *dmp);
335 DM_EXPORT extern void dm_set_width(dm *dmp, int width);
336 DM_EXPORT extern void dm_set_height(dm *dmp, int height);
337 DM_EXPORT extern fastf_t dm_get_aspect(dm *dmp);
338 DM_EXPORT extern int dm_get_type(dm *dmp);
339 DM_EXPORT void *dm_get_xvars(dm *dmp);
340 DM_EXPORT extern struct bu_vls *dm_list_types(const char separator); /* free return list with bu_vls_free(list); BU_PUT(list, struct bu_vls); */
341 DM_EXPORT extern unsigned long dm_get_id(dm *dmp);
342 DM_EXPORT extern void dm_set_id(dm *dmp, unsigned long new_id);
343 DM_EXPORT extern int dm_get_displaylist(dm *dmp);
344 DM_EXPORT extern int dm_close(dm *dmp);
345 DM_EXPORT extern unsigned char *dm_get_bg(dm *dmp);
346 DM_EXPORT extern int dm_set_bg(dm *dmp, unsigned char r, unsigned char g, unsigned char b);
347 DM_EXPORT extern unsigned char *dm_get_fg(dm *dmp);
348 DM_EXPORT extern int dm_set_fg(dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency);
349 DM_EXPORT extern int dm_make_current(dm *dmp);
350 DM_EXPORT extern vect_t *dm_get_clipmin(dm *dmp);
351 DM_EXPORT extern vect_t *dm_get_clipmax(dm *dmp);
352 DM_EXPORT extern int dm_get_bound_flag(dm *dmp);
353 DM_EXPORT extern void dm_set_bound(dm *dmp, fastf_t val);
354 DM_EXPORT extern int dm_get_stereo(dm *dmp);
355 DM_EXPORT extern int dm_set_win_bounds(dm *dmp, fastf_t *w);
356 DM_EXPORT extern int dm_configure_win(dm *dmp, int force);
357 DM_EXPORT extern struct bu_vls *dm_get_pathname(dm *dmp);
358 DM_EXPORT extern struct bu_vls *dm_get_dname(dm *dmp);
359 DM_EXPORT extern struct bu_vls *dm_get_tkname(dm *dmp);
360 DM_EXPORT extern int dm_get_fontsize(dm *dmp);
361 DM_EXPORT extern void dm_set_fontsize(dm *dmp, int size);
362 DM_EXPORT extern int dm_get_light_flag(dm *dmp);
363 DM_EXPORT extern void dm_set_light_flag(dm *dmp, int size);
364 DM_EXPORT extern int dm_set_light(dm *dmp, int light);
365 DM_EXPORT extern void *dm_get_public_vars(dm *dmp);
366 DM_EXPORT extern void *dm_get_private_vars(dm *dmp);
367 DM_EXPORT extern int dm_get_transparency(dm *dmp);
368 DM_EXPORT extern int dm_set_transparency(dm *dmp, int transparency);
369 DM_EXPORT extern int dm_get_zbuffer(dm *dmp);
370 DM_EXPORT extern int dm_set_zbuffer(dm *dmp, int zbuffer);
371 DM_EXPORT extern int dm_get_linewidth(dm *dmp);
372 DM_EXPORT extern void dm_set_linewidth(dm *dmp, int linewidth);
373 DM_EXPORT extern int dm_get_linestyle(dm *dmp);
374 DM_EXPORT extern void dm_set_linestyle(dm *dmp, int linestyle);
375 DM_EXPORT extern int dm_get_zclip(dm *dmp);
376 DM_EXPORT extern void dm_set_zclip(dm *dmp, int zclip);
377 DM_EXPORT extern int dm_get_perspective(dm *dmp);
378 DM_EXPORT extern void dm_set_perspective(dm *dmp, fastf_t perspective);
379 DM_EXPORT extern int dm_get_display_image(dm *dmp, unsigned char **image);
380 DM_EXPORT extern int dm_gen_dlists(dm *dmp, size_t range);
381 DM_EXPORT extern int dm_begin_dlist(dm *dmp, unsigned int list);
382 DM_EXPORT extern void dm_draw_dlist(dm *dmp, unsigned int list);
383 DM_EXPORT extern int dm_end_dlist(dm *dmp);
384 DM_EXPORT extern int dm_free_dlists(dm *dmp, unsigned int list, int range);
385 DM_EXPORT extern int dm_draw_vlist(dm *dmp, struct bn_vlist *vp);
386 DM_EXPORT extern int dm_draw_vlist_hidden_line(dm *dmp, struct bn_vlist *vp);
387 DM_EXPORT extern int dm_set_line_attr(dm *dmp, int width, int style);
388 DM_EXPORT extern int dm_draw_begin(dm *dmp);
389 DM_EXPORT extern int dm_draw_end(dm *dmp);
390 DM_EXPORT extern int dm_normal(dm *dmp);
391 DM_EXPORT extern int dm_loadmatrix(dm *dmp, fastf_t *mat, int eye);
392 DM_EXPORT extern int dm_loadpmatrix(dm *dmp, fastf_t *mat);
393 DM_EXPORT extern int dm_draw_string_2d(dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect);
394 DM_EXPORT extern int dm_draw_line_2d(dm *dmp, fastf_t x1, fastf_t y1_2d, fastf_t x2, fastf_t y2);
395 DM_EXPORT extern int dm_draw_line_3d(dm *dmp, point_t pt1, point_t pt2);
396 DM_EXPORT extern int dm_draw_lines_3d(dm *dmp, int npoints, point_t *points, int sflag);
397 DM_EXPORT extern int dm_draw_point_2d(dm *dmp, fastf_t x, fastf_t y);
398 DM_EXPORT extern int dm_draw_point_3d(dm *dmp, point_t pt);
399 DM_EXPORT extern int dm_draw_points_3d(dm *dmp, int npoints, point_t *points);
400 DM_EXPORT extern int dm_draw(dm *dmp, struct bn_vlist *(*callback)(void *), void **data);
401 DM_EXPORT extern int dm_draw_obj(dm *dmp, struct display_list *obj);
402 DM_EXPORT extern int dm_set_depth_mask(dm *dmp, int d_on);
403 DM_EXPORT extern int dm_debug(dm *dmp, int lvl);
404 DM_EXPORT extern int dm_logfile(dm *dmp, const char *filename);
405 DM_EXPORT extern fb *dm_get_fb(dm *dmp);
406 DM_EXPORT extern int dm_get_fb_visible(dm *dmp);
407 DM_EXPORT extern int dm_set_fb_visible(dm *dmp, int is_fb_visible);
408 
409 /* TODO - dm_vp is supposed to go away, but until we figure it out
410  * expose it here to allow dm hiding */
411 DM_EXPORT extern fastf_t *dm_get_vp(dm *dmp);
412 DM_EXPORT extern void dm_set_vp(dm *dmp, fastf_t *vp);
413 
414 DM_EXPORT extern int dm_set_hook(const struct bu_structparse_map *map,
415  const char *key, void *data, struct dm_hook_data *hook);
416 
417 DM_EXPORT extern struct bu_structparse *dm_get_vparse(dm *dmp);
418 DM_EXPORT extern void *dm_get_mvars(dm *dmp);
419 
420 DM_EXPORT extern int dm_draw_display_list(dm *dmp,
421  struct bu_list *dl,
422  fastf_t transparency_threshold,
423  fastf_t inv_viewsize,
424  short r, short g, short b,
425  int line_width,
426  int draw_style,
427  int draw_edit,
428  unsigned char *gdc,
429  int solids_down,
430  int mv_dlist
431  );
432 
433 
434 /* For backwards compatibility, define macros and expose struct dm */
435 #ifdef EXPOSE_DM_HEADER
436 # include "../src/libdm/dm_private.h"
437 #endif
438 
439 #define DM_OPEN(_interp, _type, _argc, _argv) dm_open(_interp, _type, _argc, _argv)
440 #define DM_CLOSE(_dmp) _dmp->dm_close(_dmp)
441 #define DM_DRAW_BEGIN(_dmp) _dmp->dm_drawBegin(_dmp)
442 #define DM_DRAW_END(_dmp) _dmp->dm_drawEnd(_dmp)
443 #define DM_NORMAL(_dmp) _dmp->dm_normal(_dmp)
444 #define DM_LOADMATRIX(_dmp, _mat, _eye) _dmp->dm_loadMatrix(_dmp, _mat, _eye)
445 #define DM_LOADPMATRIX(_dmp, _mat) _dmp->dm_loadPMatrix(_dmp, _mat)
446 #define DM_DRAW_STRING_2D(_dmp, _str, _x, _y, _size, _use_aspect) _dmp->dm_drawString2D(_dmp, _str, _x, _y, _size, _use_aspect)
447 #define DM_DRAW_LINE_2D(_dmp, _x1, _y1, _x2, _y2) _dmp->dm_drawLine2D(_dmp, _x1, _y1, _x2, _y2)
448 #define DM_DRAW_LINE_3D(_dmp, _pt1, _pt2) _dmp->dm_drawLine3D(_dmp, _pt1, _pt2)
449 #define DM_DRAW_LINES_3D(_dmp, _npoints, _points, _sflag) _dmp->dm_drawLines3D(_dmp, _npoints, _points, _sflag)
450 #define DM_DRAW_POINT_2D(_dmp, _x, _y) _dmp->dm_drawPoint2D(_dmp, _x, _y)
451 #define DM_DRAW_POINT_3D(_dmp, _pt) _dmp->dm_drawPoint3D(_dmp, _pt)
452 #define DM_DRAW_POINTS_3D(_dmp, _npoints, _points) _dmp->dm_drawPoints3D(_dmp, _npoints, _points)
453 #define DM_DRAW_VLIST(_dmp, _vlist) _dmp->dm_drawVList(_dmp, _vlist)
454 #define DM_DRAW_VLIST_HIDDEN_LINE(_dmp, _vlist) _dmp->dm_drawVListHiddenLine(_dmp, _vlist)
455 #define DM_DRAW(_dmp, _callback, _data) _dmp->dm_draw(_dmp, _callback, _data)
456 #define DM_SET_FGCOLOR(_dmp, _r, _g, _b, _strict, _transparency) _dmp->dm_setFGColor(_dmp, _r, _g, _b, _strict, _transparency)
457 #define DM_SET_BGCOLOR(_dmp, _r, _g, _b) _dmp->dm_setBGColor(_dmp, _r, _g, _b)
458 #define DM_SET_LINE_ATTR(_dmp, _width, _dashed) _dmp->dm_setLineAttr(_dmp, _width, _dashed)
459 #define DM_CONFIGURE_WIN(_dmp, _force) _dmp->dm_configureWin((_dmp), (_force))
460 #define DM_SET_WIN_BOUNDS(_dmp, _w) _dmp->dm_setWinBounds(_dmp, _w)
461 #define DM_SET_LIGHT(_dmp, _on) _dmp->dm_setLight(_dmp, _on)
462 #define DM_SET_TRANSPARENCY(_dmp, _on) _dmp->dm_setTransparency(_dmp, _on)
463 #define DM_SET_DEPTH_MASK(_dmp, _on) _dmp->dm_setDepthMask(_dmp, _on)
464 #define DM_SET_ZBUFFER(_dmp, _on) _dmp->dm_setZBuffer(_dmp, _on)
465 #define DM_DEBUG(_dmp, _lvl) _dmp->dm_debug(_dmp, _lvl)
466 #define DM_LOGFILE(_dmp, _lvl) _dmp->dm_logfile(_dmp, _lvl)
467 #define DM_BEGINDLIST(_dmp, _list) _dmp->dm_beginDList(_dmp, _list)
468 #define DM_ENDDLIST(_dmp) _dmp->dm_endDList(_dmp)
469 #define DM_DRAWDLIST(_dmp, _list) _dmp->dm_drawDList(_list)
470 #define DM_FREEDLISTS(_dmp, _list, _range) _dmp->dm_freeDLists(_dmp, _list, _range)
471 #define DM_GEN_DLISTS(_dmp, _range) _dmp->dm_genDLists(_dmp, _range)
472 #define DM_GET_DISPLAY_IMAGE(_dmp, _image) _dmp->dm_getDisplayImage(_dmp, _image)
473 #define DM_MAKE_CURRENT(_dmp) _dmp->dm_makeCurrent(_dmp)
474 
476 
477 #endif /* DM_H */
478 
479 /** @} */
480 /*
481  * Local Variables:
482  * mode: C
483  * tab-width: 8
484  * indent-tabs-mode: t
485  * c-file-style: "stroustrup"
486  * End:
487  * ex: shiftwidth=4 tabstop=8
488  */
dm dm_plot
Definition: dm-plot.c:496
Definition: db_flip.c:35
int dm_get_displaylist(dm *dmp)
Definition: dm-generic.c:371
int dm_loadmatrix(dm *dmp, fastf_t *mat, int eye)
Definition: dm-generic.c:723
char filename[MAXLENGTH]
Definition: human.c:105
dm dm_txt
Definition: dm-txt.c:341
void dm_set_height(dm *dmp, int height)
Definition: dm-generic.c:356
void dm_set_fontsize(dm *dmp, int size)
Definition: dm-generic.c:392
int dm_draw(dm *dmp, struct bn_vlist *(*callback)(void *), void **data)
Definition: dm-generic.c:778
int dm_set_fb_visible(dm *dmp, int is_fb_visible)
int dm_set_light(dm *dmp, int light)
Definition: dm-generic.c:540
int dm_draw_obj(dm *dmp, struct display_list *obj)
Definition: dm-generic.c:784
void * dm_get_mvars(dm *dmp)
Definition: dm-generic.c:870
Definition: list.h:118
ustring interp
int dm_get_width(dm *dmp)
Definition: dm-generic.c:335
int dm_draw_line_3d(dm *dmp, point_t pt1, point_t pt2)
Definition: dm-generic.c:747
int dm_normal(dm *dmp)
Definition: dm-generic.c:717
void dm_set_bound(dm *dmp, fastf_t val)
Definition: dm-generic.c:477
void * dm_get_xvars(dm *dmp)
Definition: dm-generic.c:314
int dm_draw_lines_3d(dm *dmp, int npoints, point_t *points, int sflag)
Definition: dm-generic.c:754
int dm_gen_dlists(dm *dmp, size_t range)
Definition: dm-generic.c:660
Definition: clone.c:90
int dm_Normal2Xx(dm *dmp, fastf_t f)
Definition: dm-generic.c:216
dm dm_rtgl
fastf_t dm_Xx2Normal(dm *dmp, int x)
Definition: dm-generic.c:209
int dm_processOptions(dm *dmp, struct bu_vls *init_proc_vls, int argc, char **argv)
Definition: options.c:38
int dm_end_dlist(dm *dmp)
Definition: dm-generic.c:679
int dm_get_zbuffer(dm *dmp)
Definition: dm-generic.c:575
unsigned char * dm_get_bg(dm *dmp)
Definition: dm-generic.c:420
dm dm_qt
int dm_draw_string_2d(dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
Definition: dm-generic.c:735
void dm_set_vp(dm *dmp, fastf_t *vp)
Definition: dm-generic.c:816
int dm_limit(int i)
int dm_free_dlists(dm *dmp, unsigned int list, int range)
Definition: dm-generic.c:685
int dm_get_bound_flag(dm *dmp)
Definition: dm-generic.c:470
void dm_set_id(dm *dmp, unsigned long new_id)
Definition: dm-generic.c:533
int dm_logfile(dm *dmp, const char *filename)
Definition: dm-generic.c:802
Header file for the BRL-CAD common definitions.
struct bu_vls * dm_list_types(const char separator)
Definition: dm-generic.c:992
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)
ustring width
void dm_draw_axes(dm *dmp, fastf_t viewSize, const mat_t rmat, struct bview_axes_state *bnasp)
Definition: axes.c:121
int dm_configure_win(dm *dmp, int force)
Definition: dm-generic.c:497
int dm_get_transparency(dm *dmp)
Definition: dm-generic.c:561
int dm_get_stereo(dm *dmp)
Definition: dm-generic.c:491
void dm_set_width(dm *dmp, int width)
Definition: dm-generic.c:349
unsigned long dm_get_id(dm *dmp)
Definition: dm-generic.c:526
int dm_begin_dlist(dm *dmp, unsigned int list)
Definition: dm-generic.c:667
const char * dm_version(void)
Definition: vers.c:32
int dm_draw_points_3d(dm *dmp, int npoints, point_t *points)
Definition: dm-generic.c:772
COMPLEX data[64]
Definition: fftest.c:34
dm dm_X
struct bu_vls * dm_get_dname(dm *dmp)
Definition: dm-generic.c:512
void(* dm_hook)(const struct bu_structparse *, const char *, void *, const char *, void *)
Definition: dm.h:221
const char * dm_get_dm_lname(dm *dmp)
Definition: dm-generic.c:328
fastf_t dm_Xy2Normal(dm *dmp, int y, int use_aspect)
Definition: dm-generic.c:223
fastf_t * dm_get_vp(dm *dmp)
Definition: dm-generic.c:809
void dm_put(dm *dmp)
Definition: dm-generic.c:285
#define __BEGIN_DECLS
Definition: common.h:73
int dm_draw_end(dm *dmp)
Definition: dm-generic.c:711
void dm_set_light_flag(dm *dmp, int size)
Definition: dm-generic.c:406
int dm_draw_begin(dm *dmp)
Definition: dm-generic.c:705
int dm_set_fg(dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
Definition: dm-generic.c:441
int dm_draw_point_2d(dm *dmp, fastf_t x, fastf_t y)
Definition: dm-generic.c:760
int vclip(fastf_t *, fastf_t *, fastf_t *, fastf_t *)
int dm_get_perspective(dm *dmp)
Definition: dm-generic.c:639
void dm_draw_adc(dm *dmp, struct bview_adc_state *adcp, mat_t view2model, mat_t model2view)
Definition: adc.c:107
void * dm_get_public_vars(dm *dmp)
Definition: dm-generic.c:547
int dm_draw_vlist_hidden_line(dm *dmp, struct bn_vlist *vp)
Definition: dm-generic.c:699
void dm_set_linewidth(dm *dmp, int linewidth)
Definition: dm-generic.c:596
int dm_share_dlist(dm *dmp1, dm *dmp2)
Definition: dm-generic.c:173
int dm_get_fb_visible(dm *dmp)
fb * dm_get_fb(dm *dmp)
Definition: dm-generic.c:305
int dm_set_depth_mask(dm *dmp, int d_on)
Definition: dm-generic.c:790
struct bu_vls * dm_get_pathname(dm *dmp)
Definition: dm-generic.c:504
int dm_get_type(dm *dmp)
Definition: dm-generic.c:364
int dm_get_height(dm *dmp)
Definition: dm-generic.c:342
struct bu_structparse * dm_get_vparse(dm *dmp)
Definition: dm-generic.c:863
int dm_loadpmatrix(dm *dmp, fastf_t *mat)
Definition: dm-generic.c:729
void dm_set_linestyle(dm *dmp, int linestyle)
Definition: dm-generic.c:610
int dm_make_current(dm *dmp)
Definition: dm-generic.c:448
int dm_debug(dm *dmp, int lvl)
Definition: dm-generic.c:796
void dm_set_zclip(dm *dmp, int zclip)
Definition: dm-generic.c:632
dm dm_wgl
int dm_get_zclip(dm *dmp)
Definition: dm-generic.c:625
void * dm_get_private_vars(dm *dmp)
Definition: dm-generic.c:554
int dm_set_hook(const struct bu_structparse_map *map, const char *key, void *data, struct dm_hook_data *hook)
Definition: dm-generic.c:845
const char * dm_get_dm_name(dm *dmp)
Definition: dm-generic.c:321
int dm_get_fontsize(dm *dmp)
Definition: dm-generic.c:385
int dm_get_display_image(dm *dmp, unsigned char **image)
Definition: dm-generic.c:653
int dm_get_light_flag(dm *dmp)
Definition: dm-generic.c:399
fastf_t dm_get_aspect(dm *dmp)
Definition: dm-generic.c:378
void dm_draw_scale(dm *dmp, fastf_t viewSize, int *lineColor, int *textColor)
Definition: scale.c:39
dm * dm_open(Tcl_Interp *interp, int type, int argc, const char *argv[])
Definition: dm-generic.c:107
fastf_t dm_wrap(fastf_t f)
void dm_fogHint(dm *dmp, int fastfog)
Definition: dm-generic.c:243
Definition: vlist.h:71
int dm_set_win_bounds(dm *dmp, fastf_t *w)
Definition: dm-generic.c:484
int dm_set_bg(dm *dmp, unsigned char r, unsigned char g, unsigned char b)
Definition: dm-generic.c:427
int clip(fastf_t *, fastf_t *, fastf_t *, fastf_t *)
Definition: clip.c:66
unsigned char * dm_get_fg(dm *dmp)
Definition: dm-generic.c:434
void dm_set_null(dm *dmp)
Definition: dm-generic.c:298
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)
Definition: dm-generic.c:922
int dm_Normal2Xy(dm *dmp, fastf_t f, int use_aspect)
Definition: dm-generic.c:233
dm dm_osgl
vect_t * dm_get_clipmin(dm *dmp)
Definition: dm-generic.c:455
void dm_draw_rect(dm *dmp, struct bview_interactive_rect_state *grsp)
Definition: rect.c:35
int dm_set_line_attr(dm *dmp, int width, int style)
Definition: dm-generic.c:617
#define __END_DECLS
Definition: common.h:74
int dm_unlimit(int i)
A frame-buffer IO structure.
Definition: fb_private.h:80
int dm_get_linestyle(dm *dmp)
Definition: dm-generic.c:603
int Dm_Init(void *interp)
Definition: tcl.c:127
int dm_draw_line_2d(dm *dmp, fastf_t x1, fastf_t y1_2d, fastf_t x2, fastf_t y2)
Definition: dm-generic.c:741
Definition: vls.h:56
void * dmh_data
Definition: dm.h:222
struct bu_vls * dm_get_tkname(dm *dmp)
Definition: dm-generic.c:519
int dm_get_linewidth(dm *dmp)
Definition: dm-generic.c:589
dm dm_tk
int dm_draw_point_3d(dm *dmp, point_t pt)
Definition: dm-generic.c:766
double fastf_t
Definition: defines.h:300
int dm_draw_vlist(dm *dmp, struct bn_vlist *vp)
Definition: dm-generic.c:692
dm * dm_get()
Definition: dm-generic.c:274
void dm_draw_data_axes(dm *dmp, fastf_t viewSize, struct bview_data_axes_state *bndasp)
Definition: axes.c:46
void dm_set_perspective(dm *dmp, fastf_t perspective)
Definition: dm-generic.c:646
void dm_draw_grid(dm *dmp, struct bview_grid_state *ggsp, fastf_t scale, mat_t model2view, fastf_t base2local)
Definition: grid.c:35
int dm_close(dm *dmp)
Definition: dm-generic.c:413
int dm_set_zbuffer(dm *dmp, int zbuffer)
Definition: dm-generic.c:582
vect_t * dm_get_clipmax(dm *dmp)
Definition: dm-generic.c:463
void dm_draw_dlist(dm *dmp, unsigned int list)
Definition: dm-generic.c:673
void * dm_interp(dm *dmp)
Definition: dm-generic.c:162
dm dm_ps
Definition: dm-ps.c:488
int dm_set_transparency(dm *dmp, int transparency)
Definition: dm-generic.c:568
dm dm_ogl