BRL-CAD
dm-rtgl.h
Go to the documentation of this file.
1 /* D M - R T G L . 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-rtgl.h
23  *
24  */
25 
26 #ifndef DM_RTGL_H
27 #define DM_RTGL_H
28 
29 #include "common.h"
30 #include "vmath.h"
31 
32 #ifdef HAVE_GL_GLX_H
33 # include <GL/glx.h>
34 #endif
35 #ifdef HAVE_GL_GL_H
36 # include <GL/gl.h>
37 #endif
38 #define CMAP_BASE 40
39 
40 /* Map +/-2048 GED space into -1.0..+1.0 :: x/2048*/
41 #define GED2IRIS(x) (((float)(x))*0.00048828125)
42 
43 #define Rtgl_MV_O(_m) offsetof(struct modifiable_rtgl_vars, _m)
44 
45 #define RTGL_MVARS (((struct rtgl_vars *)dmp->dm_vars.priv_vars)->mvars)
46 #define RTGL_GEDP RTGL_MVARS.gedp
47 #define RTGL_DIRTY RTGL_MVARS.needRefresh
48 
50  struct ged *gedp; /* used to set up ray tracing */
52  int cueing_on;
57  int fastfog;
58  double fogdensity;
59  int zbuf;
60  int rgb;
62  int depth;
63  int debug;
64  double bound;
65  int boundFlag;
66 };
67 
68 struct rtgl_vars {
69  GLXContext glxc;
70  GLdouble faceplate_mat[16];
71  int face_flag;
74  int ovec; /* Old color map entry number */
75  char is_direct;
76  GLclampf r, g, b;
78 };
79 
80 extern void rtgl_fogHint();
81 
82 #define JOB_ARRAY_SIZE 1000
83 
84 struct job {
85  point_t pt;
86  vect_t dir;
87 };
88 
89 struct jobList {
90  struct bu_list l;
91  int used;
93 };
94 
95 #define COPY_JOB(a, b) \
96  VMOVE((a).pt, (b).pt); \
97  VMOVE((a).dir, (b).dir);
98 
99 #define START_TABLE_SIZE 64
100 #define KEY_LENGTH 3
101 #define PT_ARRAY_SIZE 999
102 
103 struct ptInfoList {
104  struct bu_list l;
105  int used;
108 };
109 
110 struct colorBin {
111  float color[3];
112  struct ptInfoList *list;
113 };
114 
115 struct objTree {
116  char *name;
118  struct objTree *children;
119  struct objTree *parent;
121 };
122 
123 #define INIT_OBJTREE(p) { \
124  ((struct objTree *)(p))->name = NULL; \
125  ((struct objTree *)(p))->numChildren = 0; \
126  ((struct objTree *)(p))->children = NULL; \
127  ((struct objTree *)(p))->parent = NULL; \
128  ((struct objTree *)(p))->ptInfo = NULL; \
129 }
130 
131 /**
132  * Structure to hold information specific to running the incremental
133  * ray firings and drawing events needed for rtgl
134  */
135 struct rtglJobs {
137  int calls;
138  int jobsDone;
139  char **oldTrees;
140  size_t numTrees;
141  size_t treeCapacity;
144  struct jobList *currJob;
145  size_t numJobs;
147 };
148 
149 
150 #endif /* DM_RTGL_H */
151 
152 /** @} */
153 /*
154  * Local Variables:
155  * mode: C
156  * tab-width: 8
157  * indent-tabs-mode: t
158  * c-file-style: "stroustrup"
159  * End:
160  * ex: shiftwidth=4 tabstop=8
161  */
struct bu_list l
Definition: dm-rtgl.h:104
struct jobList * currJob
Definition: dm-rtgl.h:144
float norms[PT_ARRAY_SIZE]
Definition: dm-rtgl.h:107
struct ptInfoList * currItem
Definition: dm-rtgl.h:143
Definition: list.h:118
GLclampf g
Definition: dm-rtgl.h:76
Definition: dm-rtgl.h:84
int face_flag
Definition: dm-rtgl.h:71
Definition: ged.h:338
GLclampf r
Definition: dm-rtgl.h:76
int numChildren
Definition: dm-rtgl.h:117
size_t numTrees
Definition: dm-rtgl.h:140
Header file for the BRL-CAD common definitions.
struct bu_hash_tbl * colorTable
Definition: dm-rtgl.h:142
int calls
Definition: dm-rtgl.h:137
GLXContext glxc
Definition: dm-rtgl.h:69
int fontOffset
Definition: dm-rtgl.h:73
struct ptInfoList * ptInfo
Definition: dm-rtgl.h:120
size_t numJobs
Definition: dm-rtgl.h:145
int * perspective_mode
Definition: dm-rtgl.h:72
int rtglWasClosed
Definition: dm-rtgl.h:146
int used
Definition: dm-rtgl.h:91
struct ptInfoList * list
Definition: dm-rtgl.h:112
GLdouble faceplate_mat[16]
Definition: dm-rtgl.h:70
int ovec
Definition: dm-rtgl.h:74
char is_direct
Definition: dm-rtgl.h:75
struct ged * gedp
Definition: dm-rtgl.h:50
vect_t dir
Definition: dm-rtgl.h:86
int used
Definition: dm-rtgl.h:105
char ** oldTrees
Definition: dm-rtgl.h:139
size_t treeCapacity
Definition: dm-rtgl.h:141
point_t pt
Definition: dm-rtgl.h:85
void rtgl_fogHint()
int controlClip
Definition: dm-rtgl.h:136
struct objTree * children
Definition: dm-rtgl.h:118
int jobsDone
Definition: dm-rtgl.h:138
struct objTree * parent
Definition: dm-rtgl.h:119
struct modifiable_rtgl_vars mvars
Definition: dm-rtgl.h:77
float color[3]
Definition: dm-rtgl.h:111
char * name
Definition: dm-rtgl.h:116
#define PT_ARRAY_SIZE
Definition: dm-rtgl.h:101
GLclampf b
Definition: dm-rtgl.h:76
struct job jobs[JOB_ARRAY_SIZE]
Definition: dm-rtgl.h:92
#define JOB_ARRAY_SIZE
Definition: dm-rtgl.h:82
struct bu_list l
Definition: dm-rtgl.h:90