BRL-CAD
dm-txt.c
Go to the documentation of this file.
1 /* D M - T X T . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2013-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-txt.c
21  *
22  */
23 
24 #include "common.h"
25 
26 #ifdef HAVE_SYS_TIME_H
27 # include <sys/time.h>
28 #endif
29 
30 #include "tcl.h"
31 #include "vmath.h"
32 #include "dm.h"
33 #include "dm_private.h"
34 
35 
36 dm *
37 txt_open(Tcl_Interp *interp, int argc, const char **argv)
38 {
39  dm *dmp;
40 
41  if (argc < 0 || !argv)
42  return DM_NULL;
43 
44  BU_ALLOC(dmp, struct dm_internal);
45 
46  *dmp = dm_txt;
47  dmp->dm_interp = interp;
48 
49  bu_log("open called\n");
50 
51  return dmp;
52 }
53 
54 
55 HIDDEN int
57 {
58  bu_log("close called\n");
59  return 0;
60 }
61 
62 
63 HIDDEN int
65 {
66  bu_log("drawBegin called\n");
67  return 0;
68 }
69 
70 
71 HIDDEN int
73 {
74  bu_log("drawEnd called\n");
75  return 0;
76 }
77 
78 
79 HIDDEN int
81 {
82  bu_log("normal called\n");
83  return 0;
84 }
85 
86 
87 HIDDEN int
88 txt_loadMatrix(dm *UNUSED(dmp), fastf_t *UNUSED(mat), int UNUSED(which_eye))
89 {
90  bu_log("loadMatrix called\n");
91  return 0;
92 }
93 
94 
95 HIDDEN int
97 {
98  bu_log("loadPMatrix called\n");
99  return 0;
100 }
101 
102 
103 HIDDEN int
104 txt_drawString2D(dm *UNUSED(dmp), const char *UNUSED(str), fastf_t UNUSED(x), fastf_t UNUSED(y), int UNUSED(size), int UNUSED(use_aspect))
105 {
106  bu_log("drawString2D called\n");
107  return 0;
108 }
109 
110 
111 HIDDEN int
113 {
114  bu_log("drawLine2D called\n");
115  return 0;
116 }
117 
118 
119 HIDDEN int
120 txt_drawLine3D(dm *UNUSED(dmp), point_t UNUSED(pt1), point_t UNUSED(pt2))
121 {
122  bu_log("drawLine3D called\n");
123  return 0;
124 }
125 
126 
127 HIDDEN int
128 txt_drawLines3D(dm *UNUSED(dmp), int UNUSED(npoints), point_t *UNUSED(points), int UNUSED(sflag))
129 {
130  bu_log("drawLines3D called\n");
131  return 0;
132 }
133 
134 
135 HIDDEN int
137 {
138  bu_log("drawPoint2D called\n");
139  return 0;
140 }
141 
142 
143 HIDDEN int
145 {
146  bu_log("drawPoint3D called\n");
147  return 0;
148 }
149 
150 
151 HIDDEN int
152 txt_drawPoints3D(dm *UNUSED(dmp), int UNUSED(npoints), point_t *UNUSED(points))
153 {
154  bu_log("drawPoints3D called\n");
155  return 0;
156 }
157 
158 
159 HIDDEN int
160 txt_drawVList(dm *UNUSED(dmp), struct bn_vlist *UNUSED(vp))
161 {
162  bu_log("drawVList called\n");
163  return 0;
164 }
165 
166 
167 HIDDEN int
169 {
170  bu_log("drawVListHiddenLine called\n");
171  return 0;
172 }
173 
174 
175 HIDDEN int
176 txt_draw(dm *dmp, struct bn_vlist *(*callback_function)(void *), void **data)
177 {
178  bu_log("draw called\n");
179  return dmp == NULL && callback_function == NULL && data == NULL;
180 }
181 
182 
183 HIDDEN int
184 txt_setFGColor(dm *UNUSED(dmp), unsigned char UNUSED(r), unsigned char UNUSED(g), unsigned char UNUSED(b), int UNUSED(strict), fastf_t UNUSED(transparency))
185 {
186  bu_log("setFGColor called\n");
187  return 0;
188 }
189 
190 
191 HIDDEN int
192 txt_setBGColor(dm *UNUSED(dmp), unsigned char UNUSED(r), unsigned char UNUSED(g), unsigned char UNUSED(b))
193 {
194  bu_log("setBGColor called\n");
195  return 0;
196 }
197 
198 
199 HIDDEN int
200 txt_setLineAttr(dm *UNUSED(dmp), int UNUSED(width), int UNUSED(style))
201 {
202  bu_log("setLineAttr called\n");
203  return 0;
204 }
205 
206 
207 HIDDEN int
208 txt_configureWin(dm *UNUSED(dmp), int UNUSED(force))
209 {
210  bu_log("configureWin called\n");
211  return 0;
212 }
213 
214 
215 HIDDEN int
217 {
218  bu_log("setWinBounds called\n");
219  return 0;
220 }
221 
222 
223 HIDDEN int
224 txt_setLight(dm *UNUSED(dmp), int UNUSED(light_on))
225 {
226  bu_log("setLight called\n");
227  return 0;
228 }
229 
230 
231 HIDDEN int
232 txt_setTransparency(dm *UNUSED(dmp), int UNUSED(transparency))
233 {
234  bu_log("setTransparency called\n");
235  return 0;
236 }
237 
238 
239 HIDDEN int
240 txt_setDepthMask(dm *UNUSED(dmp), int UNUSED(mask))
241 {
242  bu_log("setDepthMask called\n");
243  return 0;
244 }
245 
246 
247 HIDDEN int
248 txt_setZBuffer(dm *UNUSED(dmp), int UNUSED(zbuffer_on))
249 {
250  bu_log("setZBuffer called\n");
251  return 0;
252 }
253 
254 
255 HIDDEN int
256 txt_debug(dm *UNUSED(dmp), int UNUSED(lvl))
257 {
258  bu_log("debug called\n");
259  return 0;
260 }
261 
262 
263 HIDDEN int
264 txt_logfile(dm *UNUSED(dmp), const char *UNUSED(filename))
265 {
266  bu_log("logfile called\n");
267  return 0;
268 }
269 
270 
271 HIDDEN int
272 txt_beginDList(dm *UNUSED(dmp), unsigned int UNUSED(list))
273 {
274  bu_log("beginDList called\n");
275  return 0;
276 }
277 
278 
279 HIDDEN int
281 {
282  bu_log("endDList called\n");
283  return 0;
284 }
285 
286 
287 HIDDEN void
288 txt_drawDList(unsigned int UNUSED(list))
289 {
290  bu_log("drawDList called\n");
291 }
292 
293 
294 HIDDEN int
295 txt_freeDLists(dm *UNUSED(dmp), unsigned int UNUSED(list), int UNUSED(range))
296 {
297  bu_log("freeDList called\n");
298  return 0;
299 }
300 
301 
302 HIDDEN int
303 txt_genDLists(dm *UNUSED(dmp), size_t UNUSED(range))
304 {
305  bu_log("genDLists called\n");
306  return 0;
307 }
308 
309 
310 HIDDEN int
311 txt_getDisplayImage(dm *UNUSED(dmp), unsigned char **UNUSED(image))
312 {
313  bu_log("getDisplayImage called\n");
314  return 0;
315 }
316 
317 
318 HIDDEN void
319 txt_reshape(dm *UNUSED(dmp), int UNUSED(width), int UNUSED(height))
320 {
321  bu_log("reshape called\n");
322 }
323 
324 
325 HIDDEN int
327 {
328  bu_log("makeCurrent called\n");
329  return 0;
330 }
331 
332 
333 HIDDEN int
335 {
336  bu_log("openFb called\n");
337  return 0;
338 }
339 
340 
342  txt_close,
344  txt_drawEnd,
345  txt_normal,
357  txt_draw,
363  txt_setLight,
367  txt_debug,
368  txt_logfile,
370  txt_endDList,
374  NULL,
376  txt_reshape,
378  txt_openFb,
379  NULL,
380  NULL,
381  0,
382  0, /* no displaylist */
383  0, /* no stereo */
384  0.0, /* zoom-in limit */
385  1, /* bound flag */
386  "txt",
387  "Text Display",
388  DM_TYPE_TXT,
389  0,/* top */
390  0,/* width */
391  0,/* height */
392  0,/* bytes per pixel */
393  0,/* bits per channel */
394  0,
395  0,
396  0,
397  0,
398  {0, 0},
399  NULL,
400  NULL,
401  BU_VLS_INIT_ZERO, /* bu_vls path name*/
402  BU_VLS_INIT_ZERO, /* bu_vls full name drawing window */
403  BU_VLS_INIT_ZERO, /* bu_vls short name drawing window */
404  {0, 0, 0}, /* bg color */
405  {0, 0, 0}, /* fg color */
406  {0.0, 0.0, 0.0}, /* clipmin */
407  {0.0, 0.0, 0.0}, /* clipmax */
408  0, /* no debugging */
409  BU_VLS_INIT_ZERO, /* bu_vls logfile */
410  0, /* no perspective */
411  0, /* no lighting */
412  0, /* no transparency */
413  0, /* depth buffer is not writable */
414  0, /* no zbuffer */
415  0, /* no zclipping */
416  1, /* clear back buffer after drawing and swap */
417  0, /* not overriding the auto font size */
419  FB_NULL,
420  0 /* Tcl interpreter */
421 };
422 
423 
424 /*
425  * Local Variables:
426  * mode: C
427  * tab-width: 8
428  * indent-tabs-mode: t
429  * c-file-style: "stroustrup"
430  * End:
431  * ex: shiftwidth=4 tabstop=8
432  */
char filename[MAXLENGTH]
Definition: human.c:105
dm dm_txt
Definition: dm-txt.c:341
HIDDEN int txt_normal(dm *dmp)
Definition: dm-txt.c:80
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
HIDDEN int txt_drawLines3D(dm *dmp, int npoints, point_t *points, int sflag)
Definition: dm-txt.c:128
HIDDEN int txt_setLight(dm *dmp, int light_on)
Definition: dm-txt.c:224
HIDDEN int txt_drawPoints3D(dm *dmp, int npoints, point_t *points)
Definition: dm-txt.c:152
HIDDEN int txt_freeDLists(dm *dmp, unsigned int list, int range)
Definition: dm-txt.c:295
ustring interp
HIDDEN int txt_drawBegin(dm *dmp)
Definition: dm-txt.c:64
HIDDEN int txt_configureWin(dm *dmp, int force)
Definition: dm-txt.c:208
HIDDEN int txt_beginDList(dm *dmp, unsigned int list)
Definition: dm-txt.c:272
HIDDEN int txt_logfile(dm *dmp, const char *filename)
Definition: dm-txt.c:264
HIDDEN int txt_debug(dm *dmp, int lvl)
Definition: dm-txt.c:256
HIDDEN int txt_setLineAttr(dm *dmp, int width, int style)
Definition: dm-txt.c:200
HIDDEN int txt_drawVList(dm *dmp, struct bn_vlist *vp)
Definition: dm-txt.c:160
Tcl_Interp * dm_interp
Tcl interpreter.
Definition: dm_private.h:121
HIDDEN int txt_drawLine3D(dm *dmp, point_t pt1, point_t pt2)
Definition: dm-txt.c:120
HIDDEN int txt_setZBuffer(dm *dmp, int zbuffer_on)
Definition: dm-txt.c:248
HIDDEN int txt_getDisplayImage(dm *dmp, unsigned char **image)
Definition: dm-txt.c:311
HIDDEN int txt_setDepthMask(dm *dmp, int mask)
Definition: dm-txt.c:240
HIDDEN int txt_drawString2D(dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
Definition: dm-txt.c:104
HIDDEN int txt_drawLine2D(dm *dmp, fastf_t x_1, fastf_t y_1, fastf_t x_2, fastf_t y_2)
Definition: dm-txt.c:112
HIDDEN int txt_drawPoint3D(dm *dmp, point_t point)
Definition: dm-txt.c:144
Header file for the BRL-CAD common definitions.
HIDDEN int txt_endDList(dm *dmp)
Definition: dm-txt.c:280
HIDDEN int txt_setTransparency(dm *dmp, int transparency)
Definition: dm-txt.c:232
HIDDEN int txt_makeCurrent(dm *dmp)
Definition: dm-txt.c:326
ustring width
#define HIDDEN
Definition: common.h:86
HIDDEN int txt_openFb(dm *dmp)
Definition: dm-txt.c:334
#define DM_TYPE_TXT
Definition: dm.h:102
HIDDEN int txt_drawPoint2D(dm *dmp, fastf_t x, fastf_t y)
Definition: dm-txt.c:136
COMPLEX data[64]
Definition: fftest.c:34
#define DM_NULL
Definition: dm.h:43
#define FB_NULL
Definition: fb.h:95
#define BU_ALLOC(_ptr, _type)
Definition: malloc.h:223
HIDDEN int txt_setFGColor(dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
Definition: dm-txt.c:184
HIDDEN int txt_genDLists(dm *dmp, size_t range)
Definition: dm-txt.c:303
Coord * point
Definition: chull3d.cpp:52
#define UNUSED(parameter)
Definition: common.h:239
HIDDEN int txt_drawEnd(dm *dmp)
Definition: dm-txt.c:72
HIDDEN void txt_drawDList(unsigned int list)
Definition: dm-txt.c:288
#define BU_STRUCTPARSE_NULL
Definition: parse.h:151
HIDDEN int txt_loadMatrix(dm *dmp, fastf_t *mat, int which_eye)
Definition: dm-txt.c:88
Definition: vlist.h:71
dm * txt_open(Tcl_Interp *interp, int argc, const char **argv)
Definition: dm-txt.c:37
HIDDEN int txt_setBGColor(dm *dmp, unsigned char r, unsigned char g, unsigned char b)
Definition: dm-txt.c:192
HIDDEN int txt_drawVListHiddenLine(dm *dmp, struct bn_vlist *vp)
Definition: dm-txt.c:168
#define BU_VLS_INIT_ZERO
Definition: vls.h:84
HIDDEN int txt_setWinBounds(dm *dmp, fastf_t *w)
Definition: dm-txt.c:216
double fastf_t
Definition: defines.h:300
HIDDEN int txt_close(dm *dmp)
Definition: dm-txt.c:56
HIDDEN void txt_reshape(dm *dmp, int width, int height)
Definition: dm-txt.c:319
HIDDEN int txt_loadPMatrix(dm *dmp, fastf_t *mat)
Definition: dm-txt.c:96
HIDDEN int txt_draw(dm *dmp, struct bn_vlist *(*callback_function)(void *), void **data)
Definition: dm-txt.c:176