BRL-CAD
dm-generic.c
Go to the documentation of this file.
1 /* D M - G E N E R I C . C
2  * BRL-CAD
3  *
4  * Copyright (c) 1999-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 /** @file libdm/dm-generic.c
21  *
22  * Generic display manager routines.
23  *
24  */
25 
26 #include "common.h"
27 
28 #include <string.h>
29 
30 #include "tcl.h"
31 
32 #include "vmath.h"
33 #include "dm.h"
34 #include "dm_private.h"
35 
36 #include "dm-Null.h"
37 #include "solid.h"
38 
39 extern dm *plot_open(Tcl_Interp *interp, int argc, const char *argv[]);
40 extern dm *ps_open(Tcl_Interp *interp, int argc, const char *argv[]);
41 extern dm *txt_open(Tcl_Interp *interp, int argc, const char **argv);
42 
43 #ifdef DM_X
44 # if defined(HAVE_TK)
45 extern dm *X_open_dm();
46 # endif
47 #endif /* DM_X */
48 
49 #ifdef DM_TK
50 extern dm *tk_open_dm();
51 #endif /* DM_TK */
52 
53 #ifdef DM_OGL
54 # if defined(HAVE_TK)
55 extern dm *ogl_open();
56 extern void ogl_fogHint();
57 extern int ogl_share_dlist();
58 # endif
59 #endif /* DM_OGL */
60 
61 #ifdef DM_OSG
62 extern dm *osg_open();
63 extern void osg_fogHint();
64 extern int osg_share_dlist();
65 #endif /* DM_OSG*/
66 
67 #ifdef DM_OSGL
68 extern dm *osgl_open();
69 extern void osgl_fogHint();
70 extern int osgl_share_dlist();
71 #endif /* DM_OSGL*/
72 
73 #ifdef DM_RTGL
74 extern dm *rtgl_open();
75 extern void rtgl_fogHint();
76 extern int rtgl_share_dlist();
77 #endif /* DM_RTGL */
78 
79 #ifdef DM_WGL
80 extern dm *wgl_open();
81 extern void wgl_fogHint();
82 extern int wgl_share_dlist();
83 #endif /* DM_WGL */
84 
85 #ifdef DM_QT
86 extern dm *qt_open();
87 #endif /* DM_QT */
88 
89 HIDDEN dm *
90 null_open(Tcl_Interp *interp, int argc, const char *argv[])
91 {
92  dm *dmp = DM_NULL;
93 
94  if (argc < 0 || !argv)
95  return DM_NULL;
96 
97  BU_ALLOC(dmp, struct dm_internal);
98 
99  *dmp = dm_null;
100  dmp->dm_interp = interp;
101 
102  return dmp;
103 }
104 
105 
106 dm *
107 dm_open(Tcl_Interp *interp, int type, int argc, const char *argv[])
108 {
109  switch (type) {
110  case DM_TYPE_NULL:
111  return null_open(interp, argc, argv);
112  case DM_TYPE_TXT:
113  return txt_open(interp, argc, argv);
114  case DM_TYPE_PLOT:
115  return plot_open(interp, argc, argv);
116  case DM_TYPE_PS:
117  return ps_open(interp, argc, argv);
118 #ifdef DM_X
119 # if defined(HAVE_TK)
120  case DM_TYPE_X:
121  return X_open_dm(interp, argc, argv);
122 # endif
123 #endif
124 #ifdef DM_TK
125  case DM_TYPE_TK:
126  return tk_open_dm(interp, argc, argv);
127 #endif
128 #ifdef DM_OGL
129 # if defined(HAVE_TK)
130  case DM_TYPE_OGL:
131  return ogl_open(interp, argc, argv);
132 # endif
133 #endif
134 #ifdef DM_OSG
135  case DM_TYPE_OSG:
136  return osg_open(interp, argc, argv);
137 #endif
138 #ifdef DM_OSGL
139  case DM_TYPE_OSGL:
140  return osgl_open(interp, argc, argv);
141 #endif
142 #ifdef DM_RTGL
143  case DM_TYPE_RTGL:
144  return rtgl_open(interp, argc, argv);
145 #endif
146 #ifdef DM_WGL
147  case DM_TYPE_WGL:
148  return wgl_open(interp, argc, argv);
149 #endif
150 #ifdef DM_QT
151  case DM_TYPE_QT:
152  return qt_open(interp, argc, argv);
153 #endif
154  default:
155  break;
156  }
157 
158  return DM_NULL;
159 }
160 
161 void *
163 {
164  if (UNLIKELY(!dmp)) return NULL;
165  return (void *)dmp->dm_interp;
166 }
167 
168 /*
169  * Provides a way to (un)share display lists. If dmp2 is
170  * NULL, then dmp1 will no longer share its display lists.
171  */
172 int
173 dm_share_dlist(dm *dmp1, dm *dmp2)
174 {
175  if (UNLIKELY(!dmp1) || UNLIKELY(!dmp2)) return TCL_ERROR;
176 
177  /*
178  * Only display managers of the same type and using the
179  * same OGL server are allowed to share display lists.
180  *
181  * XXX - need a better way to check if using the same OGL server.
182  */
183  if (dmp2 != DM_NULL)
184  if (dmp1->dm_type != dmp2->dm_type ||
185  bu_vls_strcmp(&dmp1->dm_dName, &dmp2->dm_dName))
186  return TCL_ERROR;
187 
188  switch (dmp1->dm_type) {
189 #ifdef DM_OGL
190 # if defined(HAVE_TK)
191  case DM_TYPE_OGL:
192  return ogl_share_dlist(dmp1, dmp2);
193 # endif
194 #endif
195 #ifdef DM_RTGL
196  case DM_TYPE_RTGL:
197  return rtgl_share_dlist(dmp1, dmp2);
198 #endif
199 #ifdef DM_WGL
200  case DM_TYPE_WGL:
201  return wgl_share_dlist(dmp1, dmp2);
202 #endif
203  default:
204  return TCL_ERROR;
205  }
206 }
207 
208 fastf_t
209 dm_Xx2Normal(dm *dmp, int x)
210 {
211  if (UNLIKELY(!dmp)) return 0.0;
212  return ((x / (fastf_t)dmp->dm_width - 0.5) * 2.0);
213 }
214 
215 int
217 {
218  if (UNLIKELY(!dmp)) return 0.0;
219  return (f * 0.5 + 0.5) * dmp->dm_width;
220 }
221 
222 fastf_t
223 dm_Xy2Normal(dm *dmp, int y, int use_aspect)
224 {
225  if (UNLIKELY(!dmp)) return 0.0;
226  if (use_aspect)
227  return ((0.5 - y / (fastf_t)dmp->dm_height) / dmp->dm_aspect * 2.0);
228  else
229  return ((0.5 - y / (fastf_t)dmp->dm_height) * 2.0);
230 }
231 
232 int
233 dm_Normal2Xy(dm *dmp, fastf_t f, int use_aspect)
234 {
235  if (UNLIKELY(!dmp)) return 0.0;
236  if (use_aspect)
237  return (0.5 - f * 0.5 * dmp->dm_aspect) * dmp->dm_height;
238  else
239  return (0.5 - f * 0.5) * dmp->dm_height;
240 }
241 
242 void
243 dm_fogHint(dm *dmp, int fastfog)
244 {
245  if (UNLIKELY(!dmp)) {
246  bu_log("WARNING: NULL display (fastfog => %d)\n", fastfog);
247  return;
248  }
249 
250  switch (dmp->dm_type) {
251 #ifdef DM_OGL
252 # if defined(HAVE_TK)
253  case DM_TYPE_OGL:
254  ogl_fogHint(dmp, fastfog);
255  return;
256 # endif
257 #endif
258 #ifdef DM_RTGL
259  case DM_TYPE_RTGL:
260  rtgl_fogHint(dmp, fastfog);
261  return;
262 #endif
263 #ifdef DM_WGL
264  case DM_TYPE_WGL:
265  wgl_fogHint(dmp, fastfog);
266  return;
267 #endif
268  default:
269  return;
270  }
271 }
272 
273 dm *
275 {
276  struct dm_internal *new_dm = DM_NULL;
277  BU_GET(new_dm, struct dm_internal);
278  bu_vls_init(&new_dm->dm_pathName);
279  bu_vls_init(&new_dm->dm_dName);
280 
281  return new_dm;
282 }
283 
284 void
285 dm_put(dm *dmp)
286 {
287  if (dmp && dmp != DM_NULL) {
288  bu_vls_free(&dmp->dm_pathName);
289  bu_vls_free(&dmp->dm_dName);
290  if (dmp->fbp) fb_put(dmp->fbp);
291  if (dmp->dm_put_internal)
292  dmp->dm_put_internal(dmp);
293  BU_PUT(dmp, struct dm_internal);
294  }
295 }
296 
297 void
299 {
300  if (UNLIKELY(!dmp)) return;
301  *dmp = dm_null;
302 }
303 
304 fb *
306 {
307  if (UNLIKELY(!dmp)) return NULL;
308  if (dmp->fbp == FB_NULL)
309  dmp->dm_openFb(dmp);
310  return dmp->fbp;
311 }
312 
313 void *
315 {
316  if (UNLIKELY(!dmp)) return NULL;
317  return (void *)(dmp->dm_vars.pub_vars);
318 }
319 
320 const char *
322 {
323  if (UNLIKELY(!dmp)) return NULL;
324  return dmp->dm_name;
325 }
326 
327 const char *
329 {
330  if (UNLIKELY(!dmp)) return NULL;
331  return dmp->dm_lname;
332 }
333 
334 int
336 {
337  if (UNLIKELY(!dmp)) return 0;
338  return dmp->dm_width;
339 }
340 
341 int
343 {
344  if (UNLIKELY(!dmp)) return 0;
345  return dmp->dm_height;
346 }
347 
348 void
350 {
351  if (UNLIKELY(!dmp)) return;
352  dmp->dm_width = width;
353 }
354 
355 void
356 dm_set_height(dm *dmp, int height)
357 {
358  if (UNLIKELY(!dmp)) return;
359  dmp->dm_height = height;
360 }
361 
362 
363 int
365 {
366  if (UNLIKELY(!dmp)) return 0;
367  return dmp->dm_type;
368 }
369 
370 int
372 {
373  if (UNLIKELY(!dmp)) return 0;
374  return dmp->dm_displaylist;
375 }
376 
377 fastf_t
379 {
380  if (UNLIKELY(!dmp)) return 0;
381  return dmp->dm_aspect;
382 }
383 
384 int
386 {
387  if (UNLIKELY(!dmp)) return 0;
388  return dmp->dm_fontsize;
389 }
390 
391 void
392 dm_set_fontsize(dm *dmp, int size)
393 {
394  if (UNLIKELY(!dmp)) return;
395  dmp->dm_fontsize = size;
396 }
397 
398 int
400 {
401  if (UNLIKELY(!dmp)) return 0;
402  return dmp->dm_light;
403 }
404 
405 void
407 {
408  if (UNLIKELY(!dmp)) return;
409  dmp->dm_light = val;
410 }
411 
412 int
414 {
415  if (UNLIKELY(!dmp)) return 0;
416  return dmp->dm_close(dmp);
417 }
418 
419 unsigned char *
421 {
422  if (UNLIKELY(!dmp)) return NULL;
423  return dmp->dm_bg;
424 }
425 
426 int
427 dm_set_bg(dm *dmp, unsigned char r, unsigned char g, unsigned char b)
428 {
429  if (UNLIKELY(!dmp)) return 0;
430  return dmp->dm_setBGColor(dmp, r, g, b);
431 }
432 
433 unsigned char *
435 {
436  if (UNLIKELY(!dmp)) return NULL;
437  return dmp->dm_fg;
438 }
439 
440 int
441 dm_set_fg(dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
442 {
443  if (UNLIKELY(!dmp)) return 0;
444  return dmp->dm_setFGColor(dmp, r, g, b, strict, transparency);
445 }
446 
447 int
449 {
450  if (UNLIKELY(!dmp)) return 0;
451  return dmp->dm_makeCurrent(dmp);
452 }
453 
454 vect_t *
456 {
457  if (UNLIKELY(!dmp)) return 0;
458  return &(dmp->dm_clipmin);
459 }
460 
461 
462 vect_t *
464 {
465  if (UNLIKELY(!dmp)) return 0;
466  return &(dmp->dm_clipmax);
467 }
468 
469 int
471 {
472  if (UNLIKELY(!dmp)) return 0;
473  return dmp->dm_boundFlag;
474 }
475 
476 void
478 {
479  if (UNLIKELY(!dmp)) return;
480  dmp->dm_bound = val;
481 }
482 
483 int
485 {
486  if (UNLIKELY(!dmp)) return 0;
487  return dmp->dm_setWinBounds(dmp, w);
488 }
489 
490 int
492 {
493  if (UNLIKELY(!dmp)) return 0;
494  return dmp->dm_stereo;
495 }
496 int
497 dm_configure_win(dm *dmp, int force)
498 {
499  if (UNLIKELY(!dmp)) return 0;
500  return dmp->dm_configureWin(dmp, force);
501 }
502 
503 struct bu_vls *
505 {
506  if (UNLIKELY(!dmp)) return NULL;
507  return &(dmp->dm_pathName);
508 }
509 
510 
511 struct bu_vls *
513 {
514  if (UNLIKELY(!dmp)) return NULL;
515  return &(dmp->dm_dName);
516 }
517 
518 struct bu_vls *
520 {
521  if (UNLIKELY(!dmp)) return NULL;
522  return &(dmp->dm_tkName);
523 }
524 
525 unsigned long
527 {
528  if (UNLIKELY(!dmp)) return 0;
529  return dmp->dm_id;
530 }
531 
532 void
533 dm_set_id(dm *dmp, unsigned long new_id)
534 {
535  if (UNLIKELY(!dmp)) return;
536  dmp->dm_id = new_id;
537 }
538 
539 int
540 dm_set_light(dm *dmp, int light)
541 {
542  if (UNLIKELY(!dmp)) return 0;
543  return dmp->dm_setLight(dmp, light);
544 }
545 
546 void *
548 {
549  if (UNLIKELY(!dmp)) return NULL;
550  return dmp->dm_vars.pub_vars;
551 }
552 
553 void *
555 {
556  if (UNLIKELY(!dmp)) return NULL;
557  return dmp->dm_vars.priv_vars;
558 }
559 
560 int
562 {
563  if (UNLIKELY(!dmp)) return 0;
564  return dmp->dm_transparency;
565 }
566 
567 int
568 dm_set_transparency(dm *dmp, int transparency)
569 {
570  if (UNLIKELY(!dmp)) return 0;
571  return dmp->dm_setTransparency(dmp, transparency);
572 }
573 
574 int
576 {
577  if (UNLIKELY(!dmp)) return 0;
578  return dmp->dm_zbuffer;
579 }
580 
581 int
582 dm_set_zbuffer(dm *dmp, int zbuffer)
583 {
584  if (UNLIKELY(!dmp)) return 0;
585  return dmp->dm_setZBuffer(dmp, zbuffer);
586 }
587 
588 int
590 {
591  if (UNLIKELY(!dmp)) return 0;
592  return dmp->dm_lineWidth;
593 }
594 
595 void
596 dm_set_linewidth(dm *dmp, int linewidth)
597 {
598  if (UNLIKELY(!dmp)) return;
599  dmp->dm_lineWidth = linewidth;
600 }
601 
602 int
604 {
605  if (UNLIKELY(!dmp)) return 0;
606  return dmp->dm_lineStyle;
607 }
608 
609 void
610 dm_set_linestyle(dm *dmp, int linestyle)
611 {
612  if (UNLIKELY(!dmp)) return;
613  dmp->dm_lineStyle = linestyle;
614 }
615 
616 int
617 dm_set_line_attr(dm *dmp, int width, int style)
618 {
619  if (UNLIKELY(!dmp)) return 0;
620  return dmp->dm_setLineAttr(dmp, width, style);
621 }
622 
623 
624 int
626 {
627  if (UNLIKELY(!dmp)) return 0;
628  return dmp->dm_zclip;
629 }
630 
631 void
632 dm_set_zclip(dm *dmp, int zclip)
633 {
634  if (UNLIKELY(!dmp)) return;
635  dmp->dm_zclip = zclip;
636 }
637 
638 int
640 {
641  if (UNLIKELY(!dmp)) return 0;
642  return dmp->dm_perspective;
643 }
644 
645 void
646 dm_set_perspective(dm *dmp, fastf_t perspective)
647 {
648  if (UNLIKELY(!dmp)) return;
649  dmp->dm_perspective = perspective;
650 }
651 
652 int
653 dm_get_display_image(struct dm_internal *dmp, unsigned char **image)
654 {
655  if (!dmp || !image) return 0;
656  return dmp->dm_getDisplayImage(dmp, image);
657 }
658 
659 int
660 dm_gen_dlists(struct dm_internal *dmp, size_t range)
661 {
662  if (UNLIKELY(!dmp)) return 0;
663  return dmp->dm_genDLists(dmp, range);
664 }
665 
666 int
667 dm_begin_dlist(struct dm_internal *dmp, unsigned int list)
668 {
669  if (UNLIKELY(!dmp)) return 0;
670  return dmp->dm_beginDList(dmp, list);
671 }
672 void
673 dm_draw_dlist(struct dm_internal *dmp, unsigned int list)
674 {
675  if (UNLIKELY(!dmp)) return;
676  dmp->dm_drawDList(list);
677 }
678 int
680 {
681  if (UNLIKELY(!dmp)) return 0;
682  return dmp->dm_endDList(dmp);
683 }
684 int
685 dm_free_dlists(struct dm_internal *dmp, unsigned int list, int range)
686 {
687  if (UNLIKELY(!dmp)) return 0;
688  return dmp->dm_freeDLists(dmp, list, range);
689 }
690 
691 int
692 dm_draw_vlist(struct dm_internal *dmp, struct bn_vlist *vp)
693 {
694  if (UNLIKELY(!dmp)) return 0;
695  return dmp->dm_drawVList(dmp, vp);
696 }
697 
698 int
700 {
701  if (UNLIKELY(!dmp)) return 0;
702  return dmp->dm_drawVListHiddenLine(dmp, vp);
703 }
704 int
706 {
707  if (UNLIKELY(!dmp)) return 0;
708  return dmp->dm_drawBegin(dmp);
709 }
710 int
712 {
713  if (UNLIKELY(!dmp)) return 0;
714  return dmp->dm_drawEnd(dmp);
715 }
716 int
718 {
719  if (UNLIKELY(!dmp)) return 0;
720  return dmp->dm_normal(dmp);
721 }
722 int
723 dm_loadmatrix(dm *dmp, fastf_t *mat, int eye)
724 {
725  if (!dmp || !mat) return 0;
726  return dmp->dm_loadMatrix(dmp, mat, eye);
727 }
728 int
730 {
731  if (!dmp || !mat) return 0;
732  return dmp->dm_loadPMatrix(dmp, mat);
733 }
734 int
735 dm_draw_string_2d(dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
736 {
737  if (!dmp || !str) return 0;
738  return dmp->dm_drawString2D(dmp, str, x, y, size, use_aspect);
739 }
740 int
742 {
743  if (UNLIKELY(!dmp)) return 0;
744  return dmp->dm_drawLine2D(dmp, x1, y1_2d, x2, y2);
745 }
746 int
747 dm_draw_line_3d(dm *dmp, point_t pt1, point_t pt2)
748 {
749  if (UNLIKELY(!dmp)) return 0;
750  if (!!pt1 || !pt2) return 0;
751  return dmp->dm_drawLine3D(dmp, pt1, pt2);
752 }
753 int
754 dm_draw_lines_3d(dm *dmp, int npoints, point_t *points, int sflag)
755 {
756  if (UNLIKELY(!dmp)) return 0;
757  return dmp->dm_drawLines3D(dmp, npoints, points, sflag);
758 }
759 int
761 {
762  if (UNLIKELY(!dmp)) return 0;
763  return dmp->dm_drawPoint2D(dmp, x, y);
764 }
765 int
766 dm_draw_point_3d(dm *dmp, point_t pt)
767 {
768  if (UNLIKELY(!dmp)) return 0;
769  return dmp->dm_drawPoint3D(dmp, pt);
770 }
771 int
772 dm_draw_points_3d(dm *dmp, int npoints, point_t *points)
773 {
774  if (UNLIKELY(!dmp)) return 0;
775  return dmp->dm_drawPoints3D(dmp, npoints, points);
776 }
777 int
778 dm_draw(dm *dmp, struct bn_vlist *(*callback)(void *), void **data)
779 {
780  if (UNLIKELY(!dmp)) return 0;
781  return dmp->dm_draw(dmp, callback, data);
782 }
783 int
784 dm_draw_obj(dm *dmp, struct display_list *obj)
785 {
786  if (!dmp || !obj) return 0;
787  return dmp->dm_draw_obj(dmp, obj);
788 }
789 int
790 dm_set_depth_mask(dm *dmp, int d_on)
791 {
792  if (UNLIKELY(!dmp)) return 0;
793  return dmp->dm_setDepthMask(dmp, d_on);
794 }
795 int
796 dm_debug(dm *dmp, int lvl)
797 {
798  if (UNLIKELY(!dmp)) return 0;
799  return dmp->dm_debug(dmp, lvl);
800 }
801 int
802 dm_logfile(dm *dmp, const char *filename)
803 {
804  if (!dmp || !filename) return 0;
805  return dmp->dm_logfile(dmp, filename);
806 }
807 
808 fastf_t *
810 {
811  if (UNLIKELY(!dmp)) return NULL;
812  return dmp->dm_vp;
813 }
814 
815 void
816 dm_set_vp(dm *dmp, fastf_t *vp)
817 {
818  if (UNLIKELY(!dmp)) return;
819  dmp->dm_vp = vp;
820 }
821 
822 /* This is the generic "catch-all" hook that is used
823  * to run any user supplied callbacks. If more side
824  * effects are needed at the libdm level, a task-specific
825  * hook should be defined using this function as a
826  * starting point and adding in whatever additional
827  * logic is needed. The full dm structure should always
828  * be accessible as a slot in the modifiable variables
829  * structure passed in here as "base" */
830 void
831 dm_generic_hook(const struct bu_structparse *sdp,
832  const char *name, void *base, const char *value, void *data)
833 {
834  if (data) {
835  struct dm_hook_data *hook= (struct dm_hook_data *)data;
836 
837  /* Call hook function(if it exists) to carry out the
838  * application requested logic */
839  if (hook && hook->dm_hook)
840  hook->dm_hook(sdp, name, base, value, hook->dmh_data);
841  }
842 }
843 
844 int
845 dm_set_hook(const struct bu_structparse_map *map,
846  const char *key, void *data, struct dm_hook_data *hook)
847 {
848  if (UNLIKELY(!map || !key || !hook)) return -1;
850  hook->dmh_data = NULL;
851  for (; map->sp_name != (char *)0; map++) {
852  if (BU_STR_EQUAL(map->sp_name, key)) {
853  hook->dm_hook = map->sp_hook;
854  if (data)
855  hook->dmh_data = data;
856  return 0;
857  }
858  }
859  return 1;
860 }
861 
862 struct bu_structparse *
864 {
865  if (UNLIKELY(!dmp)) return NULL;
866  return dmp->vparse;
867 }
868 
869 void *
871 {
872  if (UNLIKELY(!dmp)) return NULL;
873  if (!dmp->m_vars) return (void *)dmp;
874  return dmp->m_vars;
875 }
876 
877 
878 /* Routines for drawing based on a list of display_list
879  * structures. This will probably need to be a struct dm
880  * entry to allow it to be customized for various dm
881  * backends, but as a first step get it out of MGED
882  * and into libdm. */
883 static int
884 dm_drawSolid(dm *dmp,
885  struct solid *sp,
886  short r,
887  short g,
888  short b,
889  int draw_style,
890  unsigned char *gdc)
891 {
892  int ndrawn = 0;
893 
894  if (sp->s_cflag) {
895  if (!DM_SAME_COLOR(r, g, b, (short)gdc[0], (short)gdc[1], (short)gdc[2])) {
896  dm_set_fg(dmp, (short)gdc[0], (short)gdc[1], (short)gdc[2], 0, sp->s_transparency);
897  DM_COPY_COLOR(r, g, b, (short)gdc[0], (short)gdc[1], (short)gdc[2]);
898  }
899  } else {
900  if (!DM_SAME_COLOR(r, g, b, (short)sp->s_color[0], (short)sp->s_color[1], (short)sp->s_color[2])) {
901  dm_set_fg(dmp, (short)sp->s_color[0], (short)sp->s_color[1], (short)sp->s_color[2], 0, sp->s_transparency);
902  DM_COPY_COLOR(r, g, b, (short)sp->s_color[0], (short)sp->s_color[1], (short)sp->s_color[2]);
903  }
904  }
905 
906  if (dm_get_displaylist(dmp) && draw_style) {
907  dm_draw_dlist(dmp, sp->s_dlist);
908  sp->s_flag = UP;
909  ndrawn++;
910  } else {
911  if (dm_draw_vlist(dmp, (struct bn_vlist *)&sp->s_vlist) == TCL_OK) {
912  sp->s_flag = UP;
913  ndrawn++;
914  }
915  }
916 
917  return ndrawn;
918 }
919 
920 
921 int
923  struct bu_list *dl,
924  fastf_t transparency_threshold,
925  fastf_t inv_viewsize,
926  short r, short g, short b,
927  int line_width,
928  int draw_style,
929  int draw_edit,
930  unsigned char *gdc,
931  int solids_down,
932  int mv_dlist
933  )
934 {
935  struct display_list *gdlp;
936  struct display_list *next_gdlp;
937  struct solid *sp;
938  fastf_t ratio;
939  int ndrawn = 0;
940 
941  gdlp = BU_LIST_NEXT(display_list, dl);
942  while (BU_LIST_NOT_HEAD(gdlp, dl)) {
943  next_gdlp = BU_LIST_PNEXT(display_list, gdlp);
944 
945  FOR_ALL_SOLIDS(sp, &gdlp->dl_headSolid) {
946  if (solids_down) sp->s_flag = DOWN; /* Not drawn yet */
947 
948  /* If part of object edit, will be drawn below */
949  if ((sp->s_iflag == UP && !draw_edit) || (sp->s_iflag != UP && draw_edit))
950  continue;
951 
952  if (!((sp->s_transparency > transparency_threshold) || (EQUAL(sp->s_transparency, transparency_threshold))))
953  continue;
954 
955  if (dm_get_bound_flag(dmp)) {
956  ratio = sp->s_size * inv_viewsize;
957 
958  /*
959  * Check for this object being bigger than
960  * dmp->dm_bound * the window size, or smaller than a speck.
961  */
962  if (ratio < 0.001)
963  continue;
964  }
965 
966  dm_set_line_attr(dmp, line_width, sp->s_soldash);
967 
968  if (!draw_edit) {
969  ndrawn += dm_drawSolid(dmp, sp, r, g, b, draw_style, gdc);
970  } else {
971  if (dm_get_displaylist(dmp) && mv_dlist) {
972  dm_draw_dlist(dmp, sp->s_dlist);
973  sp->s_flag = UP;
974  ndrawn++;
975  } else {
976  /* draw in immediate mode */
977  if (dm_draw_vlist(dmp, (struct bn_vlist *)&sp->s_vlist) == TCL_OK) {
978  sp->s_flag = UP;
979  ndrawn++;
980  }
981  }
982  }
983  }
984 
985  gdlp = next_gdlp;
986  }
987 
988  return ndrawn;
989 }
990 
991 struct bu_vls *
992 dm_list_types(const char separator)
993 {
994  struct bu_vls *list;
995  char sep = ' ';
996  if (separator) sep = separator;
997  BU_GET(list, struct bu_vls);
998  bu_vls_init(list);
999 
1000  bu_vls_trunc(list, 0);
1001 
1002 #ifdef DM_OSGL
1003  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1004  bu_vls_printf(list, "osgl");
1005 #endif /* DM_OSGL*/
1006 
1007 #ifdef DM_WGL
1008  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1009  bu_vls_printf(list, "wgl");
1010 #endif /* DM_WGL */
1011 
1012 #ifdef DM_OGL
1013  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1014  bu_vls_printf(list, "ogl");
1015 #endif /* DM_OGL */
1016 
1017 #ifdef DM_QT
1018  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1019  bu_vls_printf(list, "Qt");
1020 #endif /* DM_QT */
1021 
1022 #ifdef DM_X
1023  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1024  bu_vls_printf(list, "X");
1025 #endif /* DM_X */
1026 
1027 #ifdef DM_X
1028  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1029  bu_vls_printf(list, "tk");
1030 #endif /* DM_X */
1031 
1032  if (strlen(bu_vls_addr(list)) > 0) bu_vls_printf(list, "%c", sep);
1033  bu_vls_printf(list, "txt");
1034  bu_vls_printf(list, "%c", sep);
1035  bu_vls_printf(list, "plot");
1036  bu_vls_printf(list, "%c", sep);
1037  bu_vls_printf(list, "ps");
1038  bu_vls_printf(list, "%c", sep);
1039  bu_vls_printf(list, "null");
1040  return list;
1041 }
1042 
1043 /*
1044  * Local Variables:
1045  * mode: C
1046  * tab-width: 8
1047  * indent-tabs-mode: t
1048  * c-file-style: "stroustrup"
1049  * End:
1050  * ex: shiftwidth=4 tabstop=8
1051  */
Definition: db_flip.c:35
int(* dm_close)(struct dm_internal *dmp)
Definition: dm_private.h:43
int(* dm_beginDList)(struct dm_internal *dmp, unsigned int list)
Definition: dm_private.h:70
int dm_get_displaylist(dm *dmp)
Definition: dm-generic.c:371
void bu_vls_init(struct bu_vls *vp)
Definition: vls.c:56
int dm_loadmatrix(dm *dmp, fastf_t *mat, int eye)
Definition: dm-generic.c:723
#define DM_COPY_COLOR(_dr, _dg, _db, _sr, _sg, _sb)
Definition: dm.h:163
char filename[MAXLENGTH]
Definition: human.c:105
void dm_set_height(dm *dmp, int height)
Definition: dm-generic.c:356
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
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
struct bu_list dl_headSolid
head of solid list for this object
Definition: bview.h:49
char * UP
int dm_set_light(dm *dmp, int light)
Definition: dm-generic.c:540
int dm_width
Definition: dm_private.h:91
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
void * pub_vars
Definition: dm_private.h:35
ustring interp
int dm_zclip
!0 means zclipping
Definition: dm_private.h:116
fb * fbp
Framebuffer associated with this display instance.
Definition: dm_private.h:120
int dm_displaylist
!0 means device has displaylist
Definition: dm_private.h:83
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
int(* dm_getDisplayImage)(struct dm_internal *dmp, unsigned char **image)
Definition: dm_private.h:76
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(struct dm_internal *dmp, size_t range)
Definition: dm-generic.c:660
Definition: clone.c:90
int(* dm_setLineAttr)(struct dm_internal *dmp, int width, int style)
currently - linewidth, (not-)dashed
Definition: dm_private.h:61
int dm_Normal2Xx(dm *dmp, fastf_t f)
Definition: dm-generic.c:216
int(* dm_drawVList)(struct dm_internal *dmp, struct bn_vlist *vp)
Definition: dm_private.h:56
#define DM_TYPE_OSGL
Definition: dm.h:105
#define DM_SAME_COLOR(_dr, _dg, _db, _sr, _sg, _sb)
Definition: dm.h:167
#define DM_TYPE_WGL
Definition: dm.h:99
void bu_vls_trunc(struct bu_vls *vp, int len)
Definition: vls.c:198
vect_t dm_clipmax
maximum clipping vector
Definition: dm_private.h:108
Tcl_Interp * dm_interp
Tcl interpreter.
Definition: dm_private.h:121
fastf_t dm_Xx2Normal(dm *dmp, int x)
Definition: dm-generic.c:209
int(* dm_makeCurrent)(struct dm_internal *dmp)
Definition: dm_private.h:78
unsigned char dm_fg[3]
foreground color
Definition: dm_private.h:106
int dm_end_dlist(struct dm_internal *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
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_drawPoint3D)(struct dm_internal *dmp, point_t point)
Definition: dm_private.h:54
int dm_free_dlists(struct dm_internal *dmp, unsigned int list, int range)
Definition: dm-generic.c:685
void ogl_fogHint()
int dm_get_bound_flag(dm *dmp)
Definition: dm-generic.c:470
int(* dm_genDLists)(struct dm_internal *dmp, size_t range)
Definition: dm_private.h:74
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.
HIDDEN dm * null_open(Tcl_Interp *interp, int argc, const char *argv[])
Definition: dm-generic.c:90
struct bu_vls * dm_list_types(const char separator)
Definition: dm-generic.c:992
void fb_put(fb *ifp)
Definition: fb_generic.c:91
int dm_light
!0 means lighting on
Definition: dm_private.h:112
int(* dm_setDepthMask)(struct dm_internal *dmp, int depthMask_on)
Definition: dm_private.h:66
ustring width
fastf_t dm_aspect
Definition: dm_private.h:97
int(* dm_setZBuffer)(struct dm_internal *dmp, int zbuffer_on)
Definition: dm_private.h:67
#define HIDDEN
Definition: common.h:86
int dm_configure_win(dm *dmp, int force)
Definition: dm-generic.c:497
int(* dm_normal)(struct dm_internal *dmp)
Definition: dm_private.h:46
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
struct bu_vls dm_tkName
short Tcl/Tk name of drawing window
Definition: dm_private.h:103
#define DM_TYPE_TXT
Definition: dm.h:102
unsigned long dm_get_id(dm *dmp)
Definition: dm-generic.c:526
#define DM_TYPE_RTGL
Definition: dm.h:101
int dm_begin_dlist(struct dm_internal *dmp, unsigned int list)
Definition: dm-generic.c:667
fastf_t * dm_vp
(FIXME: ogl still depends on this) Viewscale pointer
Definition: dm_private.h:98
void bu_vls_free(struct bu_vls *vp)
Definition: vls.c:248
#define DM_TYPE_TK
Definition: dm.h:100
int dm_draw_points_3d(dm *dmp, int npoints, point_t *points)
Definition: dm-generic.c:772
COMPLEX data[64]
Definition: fftest.c:34
#define DM_NULL
Definition: dm.h:43
struct bu_vls * dm_get_dname(dm *dmp)
Definition: dm-generic.c:512
void(* dm_put_internal)(struct dm_internal *dmp)
Definition: dm_private.h:81
void(* dm_hook)(const struct bu_structparse *, const char *, void *, const char *, void *)
Definition: dm.h:221
const char * dm_name
short name of device
Definition: dm_private.h:87
int(* dm_debug)(struct dm_internal *dmp, int lvl)
Set DM debug level.
Definition: dm_private.h:68
const char * dm_get_dm_lname(dm *dmp)
Definition: dm-generic.c:328
#define FB_NULL
Definition: fb.h:95
fastf_t dm_Xy2Normal(dm *dmp, int y, int use_aspect)
Definition: dm-generic.c:223
const char * dm_lname
long name of device
Definition: dm_private.h:88
#define BU_ALLOC(_ptr, _type)
Definition: malloc.h:223
int dm_perspective
!0 means perspective on
Definition: dm_private.h:111
unsigned long dm_id
window id
Definition: dm_private.h:82
HIDDEN int qt_open(fb *ifp, const char *file, int width, int height)
Definition: if_qt.cpp:720
fastf_t * dm_get_vp(dm *dmp)
Definition: dm-generic.c:809
void dm_put(dm *dmp)
Definition: dm-generic.c:285
#define DM_TYPE_X
Definition: dm.h:95
int(* dm_drawVListHiddenLine)(struct dm_internal *dmp, register struct bn_vlist *vp)
Definition: dm_private.h:57
int(* dm_draw)(struct dm_internal *dmp, struct bn_vlist *(*callback_function)(void *), void **data)
formerly dmr_object
Definition: dm_private.h:58
int(* dm_setFGColor)(struct dm_internal *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
Definition: dm_private.h:59
int dm_draw_end(dm *dmp)
Definition: dm-generic.c:711
int(* dm_loadPMatrix)(struct dm_internal *dmp, fastf_t *mat)
Definition: dm_private.h:48
void dm_set_light_flag(dm *dmp, int val)
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
struct bu_vls dm_dName
Display name.
Definition: dm_private.h:104
#define BU_GET(_ptr, _type)
Definition: malloc.h:201
int dm_draw_point_2d(dm *dmp, fastf_t x, fastf_t y)
Definition: dm-generic.c:760
const char * sp_name
Definition: parse.h:160
int dm_get_perspective(dm *dmp)
Definition: dm-generic.c:639
void * dm_get_public_vars(dm *dmp)
Definition: dm-generic.c:547
int dm_draw_vlist_hidden_line(struct dm_internal *dmp, struct bn_vlist *vp)
Definition: dm-generic.c:699
void dm_set_linewidth(dm *dmp, int linewidth)
Definition: dm-generic.c:596
#define BU_LIST_PNEXT(structure, p)
Definition: list.h:422
int(* dm_draw_obj)(struct dm_internal *dmp, struct display_list *obj)
Definition: dm_private.h:75
int dm_share_dlist(dm *dmp1, dm *dmp2)
Definition: dm-generic.c:173
struct bu_structparse * vparse
Table listing settable variables.
Definition: dm_private.h:119
int(* dm_setWinBounds)(struct dm_internal *dmp, fastf_t *w)
Definition: dm_private.h:63
int(* dm_drawEnd)(struct dm_internal *dmp)
formerly dmr_epilog
Definition: dm_private.h:45
#define BU_PUT(_ptr, _type)
Definition: malloc.h:215
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_drawLines3D)(struct dm_internal *dmp, int npoints, point_t *points, int sflag)
Definition: dm_private.h:52
int dm_get_type(dm *dmp)
Definition: dm-generic.c:364
#define DM_TYPE_PLOT
Definition: dm.h:93
int(* dm_drawPoints3D)(struct dm_internal *dmp, int npoints, point_t *points)
Definition: dm_private.h:55
int dm_get_height(dm *dmp)
Definition: dm-generic.c:342
char * bu_vls_addr(const struct bu_vls *vp)
Definition: vls.c:111
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_stereo
stereo flag
Definition: dm_private.h:84
dm * ps_open(Tcl_Interp *interp, int argc, const char *argv[])
Definition: dm-ps.c:576
int dm_lineWidth
Definition: dm_private.h:95
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
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
int dm_get_zclip(dm *dmp)
Definition: dm-generic.c:625
void * dm_get_private_vars(dm *dmp)
Definition: dm-generic.c:554
void(* sp_hook)(const struct bu_structparse *, const char *, void *, const char *, void *)
Definition: parse.h:161
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_openFb)(struct dm_internal *dmp)
Definition: dm_private.h:79
int dm_get_fontsize(dm *dmp)
Definition: dm-generic.c:385
int dm_get_display_image(struct dm_internal *dmp, unsigned char **image)
Definition: dm-generic.c:653
int(* dm_drawLine2D)(struct dm_internal *dmp, fastf_t x_1, fastf_t y_1, fastf_t x_2, fastf_t y_2)
formerly dmr_2d_line
Definition: dm_private.h:50
int dm_fontsize
!0 override's the auto font size
Definition: dm_private.h:118
#define DM_TYPE_PS
Definition: dm.h:94
int dm_get_light_flag(dm *dmp)
Definition: dm-generic.c:399
fastf_t dm_get_aspect(dm *dmp)
Definition: dm-generic.c:378
dm * dm_open(Tcl_Interp *interp, int type, int argc, const char *argv[])
Definition: dm-generic.c:107
void * priv_vars
Definition: dm_private.h:36
vect_t dm_clipmin
minimum clipping vector
Definition: dm_private.h:107
void dm_fogHint(dm *dmp, int fastfog)
Definition: dm-generic.c:243
int(* dm_configureWin)(struct dm_internal *dmp, int force)
Definition: dm_private.h:62
Definition: vlist.h:71
dm * txt_open(Tcl_Interp *interp, int argc, const char **argv)
Definition: dm-txt.c:37
int(* dm_logfile)(struct dm_internal *dmp, const char *filename)
Set DM log file.
Definition: dm_private.h:69
void rtgl_fogHint()
int(* dm_drawLine3D)(struct dm_internal *dmp, point_t pt1, point_t pt2)
Definition: dm_private.h:51
struct dm_vars dm_vars
display manager dependent variables
Definition: dm_private.h:99
int(* dm_loadMatrix)(struct dm_internal *dmp, fastf_t *mat, int which_eye)
Definition: dm_private.h:47
int dm_height
Definition: dm_private.h:92
int dm_zbuffer
!0 means zbuffer on
Definition: dm_private.h:115
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(* dm_endDList)(struct dm_internal *dmp)
Definition: dm_private.h:71
unsigned char * dm_get_fg(dm *dmp)
Definition: dm-generic.c:434
void bu_vls_printf(struct bu_vls *vls, const char *fmt,...) _BU_ATTR_PRINTF23
Definition: vls.c:694
struct bu_vls dm_pathName
full Tcl/Tk name of drawing window
Definition: dm_private.h:102
int(* dm_drawPoint2D)(struct dm_internal *dmp, fastf_t x, fastf_t y)
Definition: dm_private.h:53
void wgl_fogHint()
int(* dm_setLight)(struct dm_internal *dmp, int light_on)
Definition: dm_private.h:64
void dm_set_null(dm *dmp)
Definition: dm-generic.c:298
int bu_vls_strcmp(struct bu_vls *s1, struct bu_vls *s2)
Definition: vls.c:482
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
double dm_bound
zoom-in limit
Definition: dm_private.h:85
int dm_Normal2Xy(dm *dmp, fastf_t f, int use_aspect)
Definition: dm-generic.c:233
vect_t * dm_get_clipmin(dm *dmp)
Definition: dm-generic.c:455
unsigned char dm_bg[3]
background color
Definition: dm_private.h:105
#define DM_TYPE_OSG
Definition: dm.h:104
int dm_set_line_attr(dm *dmp, int width, int style)
Definition: dm-generic.c:617
void dm_generic_hook(const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
Definition: dm-generic.c:831
int dm_transparency
!0 means transparency on
Definition: dm_private.h:113
void * m_vars
Definition: dm_private.h:100
A frame-buffer IO structure.
Definition: fb_private.h:80
struct dm_internal dm_null
Definition: dm-Null.c:285
int(* dm_drawBegin)(struct dm_internal *dmp)
formerly dmr_prolog
Definition: dm_private.h:44
int(* dm_freeDLists)(struct dm_internal *dmp, unsigned int list, int range)
Definition: dm_private.h:73
#define DOWN
Definition: bview.h:42
int dm_get_linestyle(dm *dmp)
Definition: dm-generic.c:603
dm * plot_open(Tcl_Interp *interp, int argc, const char *argv[])
Definition: dm-plot.c:584
#define DM_TYPE_NULL
Definition: dm.h:92
int dm_boundFlag
Definition: dm_private.h:86
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
int dm_type
display manager type
Definition: dm_private.h:89
Definition: vls.h:56
int(* dm_setBGColor)(struct dm_internal *, unsigned char, unsigned char, unsigned char)
Definition: dm_private.h:60
void * dmh_data
Definition: dm.h:222
struct bu_vls * dm_get_tkname(dm *dmp)
Definition: dm-generic.c:519
int(* dm_drawString2D)(struct dm_internal *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
formerly dmr_puts
Definition: dm_private.h:49
int dm_get_linewidth(dm *dmp)
Definition: dm-generic.c:589
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(struct dm_internal *dmp, struct bn_vlist *vp)
Definition: dm-generic.c:692
dm * dm_get()
Definition: dm-generic.c:274
void dm_set_perspective(dm *dmp, fastf_t perspective)
Definition: dm-generic.c:646
void(* dm_drawDList)(unsigned int list)
Definition: dm_private.h:72
#define BU_LIST_NEXT(structure, hp)
Definition: list.h:316
#define DM_TYPE_QT
Definition: dm.h:103
#define BU_LIST_NOT_HEAD(p, hp)
Definition: list.h:324
int dm_lineStyle
Definition: dm_private.h:96
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
int(* dm_setTransparency)(struct dm_internal *dmp, int transparency_on)
Definition: dm_private.h:65
void dm_draw_dlist(struct dm_internal *dmp, unsigned int list)
Definition: dm-generic.c:673
void * dm_interp(dm *dmp)
Definition: dm-generic.c:162
int dm_set_transparency(dm *dmp, int transparency)
Definition: dm-generic.c:568
#define DM_TYPE_OGL
Definition: dm.h:96
#define UNLIKELY(expression)
Definition: common.h:282
#define BU_STR_EQUAL(s1, s2)
Definition: str.h:126