BRL-CAD
plot3.c
Go to the documentation of this file.
1 /* P L O T 3 . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-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 plot */
21 /** @{ */
22 /** @file libbn/plot3.c
23  *
24  * @brief A public-domain UNIX plot library, for 2-D and 3-D plotting
25  * in 16-bit VAX signed integer spaces, or 64-bit IEEE floating point.
26  *
27  * These routines generate "UNIX plot" output (with the addition of
28  * 3-D commands). They behave almost exactly like the regular libplot
29  * routines, except:
30  *
31  * -# These all take a stdio file pointer, and can thus be used to
32  * create multiple plot files simultaneously.
33  * -# There are 3-D versions of most commands.
34  * -# There are IEEE floating point versions of the commands.
35  * -# The names have been changed.
36  *
37  * The 3-D extensions are those of Doug Gwyn, from his System V
38  * extensions.
39  *
40  * These are the ascii command letters allocated to various actions.
41  * Care has been taken to consistently match lowercase and uppercase
42  * letters.
43  *
44  * @code
45  2d 3d 2df 3df
46 space s S w W
47 move m M o O
48 cont n N q Q
49 point p P x X
50 line l L v V
51 circle c i
52 arc a r
53 linmod f
54 label t
55 erase e
56 color C
57 flush F
58 
59  bd gh jk uyz
60 ABDEGHIJKRTUYZ
61 
62 @endcode
63  *
64  */
65 
66 #include "common.h"
67 
68 #include <stdio.h>
69 
70 #include "bu/cv.h"
71 #include "vmath.h"
72 #include "plot3.h"
73 
74 
75 static int pl_outputMode = PL_OUTPUT_MODE_BINARY;
76 
77 /* For the sake of efficiency, we trust putc() to write only one byte */
78 /*#define putsi(a) putc(a&0377, plotfp); putc((a>>8)&0377, plotfp)*/
79 #define putsi(a) putc(a, plotfp); putc((a>>8), plotfp)
80 
81 /* Making a common pd_3 to be used in pd_3cont and pd_3move */
82 void
83 pd_3(register FILE *plotfp, double x, double y, double z, char c)
84 {
85  size_t ret;
86  double in[3];
87  unsigned char out[3*8+1];
88 
89  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
90  in[0] = x;
91  in[1] = y;
92  in[2] = z;
93  bu_cv_htond(&out[1], (unsigned char *)in, 3);
94 
95  out[0] = c;
96  ret = fwrite(out, 1, 3*8+1, plotfp);
97  if (ret != 3*8+1) {
98  perror("fwrite");
99  }
100  } else {
101  fprintf(plotfp, "%c %g %g %g\n", c, x, y, z);
102  }
103 }
104 
105 /* Making a common pdv_3 to be used in pdv_3cont and pdv_3move */
106 void
107 pdv_3(register FILE *plotfp, const fastf_t *pt, char c)
108 {
109  size_t ret;
110  unsigned char out[3*8+1];
111 
112  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
113  bu_cv_htond(&out[1], (unsigned char *)pt, 3);
114 
115  out[0] = c;
116  ret = fwrite(out, 1, 3*8+1, plotfp);
117  if (ret != 3*8+1) {
118  perror("fwrite");
119  }
120  } else {
121  fprintf(plotfp, "%c %g %g %g\n", c, V3ARGS(pt));
122  }
123 }
124 
125 /* Making a common pd to be used in pd_cont and pd_move */
126 void
127 pd(register FILE *plotfp, double x, double y, char c)
128 {
129  size_t ret;
130  double in[2];
131  unsigned char out[2*8+1];
132 
133  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
134  in[0] = x;
135  in[1] = y;
136  bu_cv_htond(&out[1], (unsigned char *)in, 2);
137 
138  out[0] = c;
139  ret = fwrite(out, 1, 2*8+1, plotfp);
140  if (ret != 2*8+1) {
141  perror("fwrite");
142  }
143  } else {
144  fprintf(plotfp, "%c %g %g\n", c, x, y);
145  }
146 }
147 
148 /* Making a common pl_3 to be used in pl_3cont and pl_3move */
149 void
150 pl_3(register FILE *plotfp, int x, int y, int z, char c)
151 {
152  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
153  putc( c, plotfp);
154  putsi(x);
155  putsi(y);
156  putsi(z);
157  } else {
158  fprintf(plotfp, "%c %d %d %d\n", c, x, y, z);
159  }
160 }
161 
162 /*
163  * These interfaces provide the standard UNIX-Plot functionality
164  */
165 
166 int
168  return pl_outputMode;
169 }
170 
171 void
172 pl_setOutputMode(int mode) {
173  pl_outputMode = mode;
174 }
175 
176 /**
177  * @brief
178  * plot a point
179  */
180 void
181 pl_point(register FILE *plotfp, int x, int y)
182 {
183  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
184  putc('p', plotfp);
185  putsi(x);
186  putsi(y);
187  } else {
188  fprintf(plotfp, "p %d %d\n", x, y);
189  }
190 }
191 
192 void
193 pl_line(register FILE *plotfp, int px1, int py1, int px2, int py2)
194 {
195  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
196  putc('l', plotfp);
197  putsi(px1);
198  putsi(py1);
199  putsi(px2);
200  putsi(py2);
201  } else {
202  fprintf(plotfp, "l %d %d %d %d\n", px1, py1, px2, py2);
203  }
204 }
205 
206 void
207 pl_linmod(register FILE *plotfp, const char *s)
208 {
209  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
210  putc('f', plotfp);
211  while (*s)
212  putc(*s++, plotfp);
213  putc('\n', plotfp);
214  } else {
215  fprintf(plotfp, "f %s\n", s);
216  }
217 }
218 
219 void
220 pl_move(register FILE *plotfp, int x, int y)
221 {
222  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
223  putc('m', plotfp);
224  putsi(x);
225  putsi(y);
226  } else {
227  fprintf(plotfp, "m %d %d\n", x, y);
228  }
229 }
230 
231 void
232 pl_cont(register FILE *plotfp, int x, int y)
233 {
234  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
235  putc('n', plotfp);
236  putsi(x);
237  putsi(y);
238  } else {
239  fprintf(plotfp, "n %d %d\n", x, y);
240  }
241 }
242 
243 void
244 pl_label(register FILE *plotfp, const char *s)
245 {
246  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
247  putc('t', plotfp);
248  while (*s)
249  putc(*s++, plotfp);
250  putc('\n', plotfp);
251  } else {
252  fprintf(plotfp, "t %s\n", s);
253  }
254 }
255 
256 void
257 pl_space(register FILE *plotfp, int px1, int py1, int px2, int py2)
258 {
259  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
260  putc('s', plotfp);
261  putsi(px1);
262  putsi(py1);
263  putsi(px2);
264  putsi(py2);
265  } else {
266  fprintf(plotfp, "s %d %d %d %d\n", px1, py1, px2, py2);
267  }
268 }
269 
270 void
271 pl_erase(register FILE *plotfp)
272 {
273  if (pl_outputMode == PL_OUTPUT_MODE_BINARY)
274  putc('e', plotfp);
275  else
276  fprintf(plotfp, "e\n");
277 }
278 
279 void
280 pl_circle(register FILE *plotfp, int x, int y, int r)
281 {
282  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
283  putc('c', plotfp);
284  putsi(x);
285  putsi(y);
286  putsi(r);
287  } else {
288  fprintf(plotfp, "c %d %d %d\n", x, y, r);
289  }
290 }
291 
292 void
293 pl_arc(register FILE *plotfp, int xc, int yc, int px1, int py1, int px2, int py2)
294 {
295  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
296  putc('a', plotfp);
297  putsi(xc);
298  putsi(yc);
299  putsi(px1);
300  putsi(py1);
301  putsi(px2);
302  putsi(py2);
303  } else {
304  fprintf(plotfp, "a %d %d %d %d %d %d\n", xc, yc, px1, py1, px2, py2);
305  }
306 }
307 
308 void
309 pl_box(register FILE *plotfp, int px1, int py1, int px2, int py2)
310 {
311  pl_move(plotfp, px1, py1);
312  pl_cont(plotfp, px1, py2);
313  pl_cont(plotfp, px2, py2);
314  pl_cont(plotfp, px2, py1);
315  pl_cont(plotfp, px1, py1);
316  pl_move(plotfp, px2, py2);
317 }
318 
319 /*
320  * Here lie the BRL 3-D extensions.
321  */
322 
323 /* Warning: r, g, b are ints. The output is chars. */
324 void
325 pl_color(register FILE *plotfp, int r, int g, int b)
326 {
327  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
328  putc('C', plotfp);
329  putc(r, plotfp);
330  putc(g, plotfp);
331  putc(b, plotfp);
332  } else {
333  fprintf(plotfp, "C %d %d %d\n", r, g, b);
334  }
335 }
336 
337 void
338 pl_flush(register FILE *plotfp)
339 {
340  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
341  putc('F', plotfp);
342  } else {
343  fprintf(plotfp, "F\n");
344  }
345 
346  fflush(plotfp);
347 }
348 
349 void
350 pl_3space(register FILE *plotfp, int px1, int py1, int pz1, int px2, int py2, int pz2)
351 {
352  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
353  putc('S', plotfp);
354  putsi(px1);
355  putsi(py1);
356  putsi(pz1);
357  putsi(px2);
358  putsi(py2);
359  putsi(pz2);
360  } else {
361  fprintf(plotfp, "S %d %d %d %d %d %d\n", px1, py1, pz1, px2, py2, pz2);
362  }
363 }
364 
365 void
366 pl_3point(register FILE *plotfp, int x, int y, int z)
367 {
368  pl_3(plotfp, x, y, z, 'P'); /* calling common function pl_3 */
369 }
370 
371 void
372 pl_3move(register FILE *plotfp, int x, int y, int z)
373 {
374  pl_3(plotfp, x, y, z, 'M'); /* calling common function pl_3 */
375 }
376 
377 void
378 pl_3cont(register FILE *plotfp, int x, int y, int z)
379 {
380  pl_3(plotfp, x, y, z, 'N'); /* calling common function pl_3 */
381 }
382 
383 void
384 pl_3line(register FILE *plotfp, int px1, int py1, int pz1, int px2, int py2, int pz2)
385 {
386  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
387  putc('L', plotfp);
388  putsi(px1);
389  putsi(py1);
390  putsi(pz1);
391  putsi(px2);
392  putsi(py2);
393  putsi(pz2);
394  } else {
395  fprintf(plotfp, "L %d %d %d %d %d %d\n", px1, py1, pz1, px2, py2, pz2);
396  }
397 }
398 
399 void
400 pl_3box(register FILE *plotfp, int px1, int py1, int pz1, int px2, int py2, int pz2)
401 {
402  pl_3move(plotfp, px1, py1, pz1);
403  /* first side */
404  pl_3cont(plotfp, px1, py2, pz1);
405  pl_3cont(plotfp, px1, py2, pz2);
406  pl_3cont(plotfp, px1, py1, pz2);
407  pl_3cont(plotfp, px1, py1, pz1);
408  /* across */
409  pl_3cont(plotfp, px2, py1, pz1);
410  /* second side */
411  pl_3cont(plotfp, px2, py2, pz1);
412  pl_3cont(plotfp, px2, py2, pz2);
413  pl_3cont(plotfp, px2, py1, pz2);
414  pl_3cont(plotfp, px2, py1, pz1);
415  /* front edge */
416  pl_3move(plotfp, px1, py2, pz1);
417  pl_3cont(plotfp, px2, py2, pz1);
418  /* bottom back */
419  pl_3move(plotfp, px1, py1, pz2);
420  pl_3cont(plotfp, px2, py1, pz2);
421  /* top back */
422  pl_3move(plotfp, px1, py2, pz2);
423  pl_3cont(plotfp, px2, py2, pz2);
424 }
425 
426 /*
427  * Double floating point versions
428  */
429 
430 void
431 pd_point(register FILE *plotfp, double x, double y)
432 {
433  pd( plotfp, x, y, 'x'); /* calling common function pd */
434 }
435 
436 void
437 pd_line(register FILE *plotfp, double px1, double py1, double px2, double py2)
438 {
439  size_t ret;
440  double in[4];
441  unsigned char out[4*8+1];
442 
443  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
444  in[0] = px1;
445  in[1] = py1;
446  in[2] = px2;
447  in[3] = py2;
448  bu_cv_htond(&out[1], (unsigned char *)in, 4);
449 
450  out[0] = 'v';
451  ret = fwrite(out, 1, 4*8+1, plotfp);
452  if (ret != 4*8+1) {
453  perror("fwrite");
454  }
455  } else {
456  fprintf(plotfp, "v %g %g %g %g\n", px1, py1, px2, py2);
457  }
458 }
459 
460 /* Note: no pd_linmod(), just use pl_linmod() */
461 
462 void
463 pd_move(register FILE *plotfp, double x, double y)
464 {
465  pd( plotfp, x, y, 'o'); /* calling common function pd */
466 }
467 
468 void
469 pd_cont(register FILE *plotfp, double x, double y)
470 {
471  pd( plotfp, x, y, 'q'); /* calling common function pd */
472 }
473 
474 void
475 pd_space(register FILE *plotfp, double px1, double py1, double px2, double py2)
476 {
477  size_t ret;
478  double in[4];
479  unsigned char out[4*8+1];
480 
481  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
482  in[0] = px1;
483  in[1] = py1;
484  in[2] = px2;
485  in[3] = py2;
486  bu_cv_htond(&out[1], (unsigned char *)in, 4);
487 
488  out[0] = 'w';
489  ret = fwrite(out, 1, 4*8+1, plotfp);
490  if (ret != 4*8+1) {
491  perror("fwrite");
492  }
493  } else {
494  fprintf(plotfp, "w %g %g %g %g\n", px1, py1, px2, py2);
495  }
496 }
497 
498 void
499 pd_circle(register FILE *plotfp, double x, double y, double r)
500 {
501  size_t ret;
502  double in[3];
503  unsigned char out[3*8+1];
504 
505  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
506  in[0] = x;
507  in[1] = y;
508  in[2] = r;
509  bu_cv_htond(&out[1], (unsigned char *)in, 3);
510 
511  out[0] = 'i';
512  ret = fwrite(out, 1, 3*8+1, plotfp);
513  if (ret != 3*8+1) {
514  perror("fwrite");
515  }
516  } else {
517  fprintf(plotfp, "i %g %g %g\n", x, y, r);
518  }
519 }
520 
521 void
522 pd_arc(register FILE *plotfp, double xc, double yc, double px1, double py1, double px2, double py2)
523 {
524  size_t ret;
525  double in[6];
526  unsigned char out[6*8+1];
527 
528  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
529  in[0] = xc;
530  in[1] = yc;
531  in[2] = px1;
532  in[3] = py1;
533  in[4] = px2;
534  in[5] = py2;
535  bu_cv_htond(&out[1], (unsigned char *)in, 6);
536 
537  out[0] = 'r';
538  ret = fwrite(out, 1, 6*8+1, plotfp);
539  if (ret != 6*8+1) {
540  perror("fwrite");
541  }
542  } else {
543  fprintf(plotfp, "r %g %g %g %g %g %g\n", xc, yc, px1, py1, px2, py2);
544  }
545 }
546 
547 void
548 pd_box(register FILE *plotfp, double px1, double py1, double px2, double py2)
549 {
550  pd_move(plotfp, px1, py1);
551  pd_cont(plotfp, px1, py2);
552  pd_cont(plotfp, px2, py2);
553  pd_cont(plotfp, px2, py1);
554  pd_cont(plotfp, px1, py1);
555  pd_move(plotfp, px2, py2);
556 }
557 
558 /* Double 3-D, both in vector and enumerated versions */
559 void
560 pdv_3space(register FILE *plotfp, const fastf_t *min, const fastf_t *max)
561 {
562  size_t ret;
563  unsigned char out[6*8+1];
564 
565  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
566  bu_cv_htond(&out[1], (unsigned char *)min, 3);
567  bu_cv_htond(&out[3*8+1], (unsigned char *)max, 3);
568 
569  out[0] = 'W';
570  ret = fwrite(out, 1, 6*8+1, plotfp);
571  if (ret != 6*8+1) {
572  perror("fwrite");
573  }
574  } else {
575  fprintf(plotfp, "W %g %g %g %g %g %g\n", V3ARGS(min), V3ARGS(max));
576  }
577 }
578 
579 void
580 pd_3space(register FILE *plotfp, double px1, double py1, double pz1, double px2, double py2, double pz2)
581 {
582  size_t ret;
583  double in[6];
584  unsigned char out[6*8+1];
585 
586  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
587  in[0] = px1;
588  in[1] = py1;
589  in[2] = pz1;
590  in[3] = px2;
591  in[4] = py2;
592  in[5] = pz2;
593  bu_cv_htond(&out[1], (unsigned char *)in, 6);
594 
595  out[0] = 'W';
596  ret = fwrite(out, 1, 6*8+1, plotfp);
597  if (ret != 6*8+1) {
598  perror("fwrite");
599  }
600  } else {
601  fprintf(plotfp, "W %g %g %g %g %g %g\n", px1, py1, pz1, px2, py2, pz2);
602  }
603 }
604 
605 void
606 pdv_3point(register FILE *plotfp, const fastf_t *pt)
607 {
608  pdv_3(plotfp, pt, 'X'); /* calling common function pdv_3 */
609 }
610 
611 void
612 pd_3point(register FILE *plotfp, double x, double y, double z)
613 {
614  pd_3(plotfp, x, y, z, 'X'); /* calling common function pd_3 */
615 }
616 
617 void
618 pdv_3move(register FILE *plotfp, const fastf_t *pt)
619 {
620  pdv_3(plotfp, pt, 'O'); /* calling common function pdv_3 */
621 }
622 
623 void
624 pd_3move(register FILE *plotfp, double x, double y, double z)
625 {
626  pd_3(plotfp, x, y, z, 'O'); /* calling common function pd_3 */
627 }
628 
629 void
630 pdv_3cont(register FILE *plotfp, const fastf_t *pt)
631 {
632  pdv_3(plotfp, pt, 'Q'); /* calling common function pdv_3 */
633 }
634 
635 void
636 pd_3cont(register FILE *plotfp, double x, double y, double z)
637 {
638  pd_3(plotfp, x, y, z, 'Q'); /* calling common function pd_3 */
639 }
640 
641 void
642 pdv_3line(register FILE *plotfp, const fastf_t *a, const fastf_t *b)
643 {
644  size_t ret;
645  unsigned char out[6*8+1];
646 
647  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
648  bu_cv_htond(&out[1], (unsigned char *)a, 3);
649  bu_cv_htond(&out[3*8+1], (unsigned char *)b, 3);
650 
651  out[0] = 'V';
652  ret = fwrite(out, 1, 6*8+1, plotfp);
653  if (ret != 6*8+1) {
654  perror("fwrite");
655  }
656  } else {
657  fprintf(plotfp, "V %g %g %g %g %g %g\n", V3ARGS(a), V3ARGS(b));
658  }
659 }
660 
661 void
662 pd_3line(register FILE *plotfp, double px1, double py1, double pz1, double px2, double py2, double pz2)
663 {
664  size_t ret;
665  double in[6];
666  unsigned char out[6*8+1];
667 
668  if (pl_outputMode == PL_OUTPUT_MODE_BINARY) {
669  in[0] = px1;
670  in[1] = py1;
671  in[2] = pz1;
672  in[3] = px2;
673  in[4] = py2;
674  in[5] = pz2;
675  bu_cv_htond(&out[1], (unsigned char *)in, 6);
676 
677  out[0] = 'V';
678  ret = fwrite(out, 1, 6*8+1, plotfp);
679  if (ret != 6*8+1) {
680  perror("fwrite");
681  }
682  } else {
683  fprintf(plotfp, "V %g %g %g %g %g %g\n", px1, py1, pz1, px2, py2, pz2);
684  }
685 }
686 
687 void
688 pdv_3box(register FILE *plotfp, const fastf_t *a, const fastf_t *b)
689 {
690  pd_3move(plotfp, a[X], a[Y], a[Z]);
691  /* first side */
692  pd_3cont(plotfp, a[X], b[Y], a[Z]);
693  pd_3cont(plotfp, a[X], b[Y], b[Z]);
694  pd_3cont(plotfp, a[X], a[Y], b[Z]);
695  pd_3cont(plotfp, a[X], a[Y], a[Z]);
696  /* across */
697  pd_3cont(plotfp, b[X], a[Y], a[Z]);
698  /* second side */
699  pd_3cont(plotfp, b[X], b[Y], a[Z]);
700  pd_3cont(plotfp, b[X], b[Y], b[Z]);
701  pd_3cont(plotfp, b[X], a[Y], b[Z]);
702  pd_3cont(plotfp, b[X], a[Y], a[Z]);
703  /* front edge */
704  pd_3move(plotfp, a[X], b[Y], a[Z]);
705  pd_3cont(plotfp, b[X], b[Y], a[Z]);
706  /* bottom back */
707  pd_3move(plotfp, a[X], a[Y], b[Z]);
708  pd_3cont(plotfp, b[X], a[Y], b[Z]);
709  /* top back */
710  pd_3move(plotfp, a[X], b[Y], b[Z]);
711  pd_3cont(plotfp, b[X], b[Y], b[Z]);
712 }
713 
714 void
715 pd_3box(register FILE *plotfp, double px1, double py1, double pz1, double px2, double py2, double pz2)
716 {
717  pd_3move(plotfp, px1, py1, pz1);
718  /* first side */
719  pd_3cont(plotfp, px1, py2, pz1);
720  pd_3cont(plotfp, px1, py2, pz2);
721  pd_3cont(plotfp, px1, py1, pz2);
722  pd_3cont(plotfp, px1, py1, pz1);
723  /* across */
724  pd_3cont(plotfp, px2, py1, pz1);
725  /* second side */
726  pd_3cont(plotfp, px2, py2, pz1);
727  pd_3cont(plotfp, px2, py2, pz2);
728  pd_3cont(plotfp, px2, py1, pz2);
729  pd_3cont(plotfp, px2, py1, pz1);
730  /* front edge */
731  pd_3move(plotfp, px1, py2, pz1);
732  pd_3cont(plotfp, px2, py2, pz1);
733  /* bottom back */
734  pd_3move(plotfp, px1, py1, pz2);
735  pd_3cont(plotfp, px2, py1, pz2);
736  /* top back */
737  pd_3move(plotfp, px1, py2, pz2);
738  pd_3cont(plotfp, px2, py2, pz2);
739 }
740 
741 /**
742  * Draw a ray
743  */
744 void
745 pdv_3ray(FILE *fp, const fastf_t *pt, const fastf_t *dir, double t)
746 {
747  point_t tip;
748 
749  VJOIN1(tip, pt, t, dir);
750  pdv_3move(fp, pt);
751  pdv_3cont(fp, tip);
752 }
753 
754 /** @} */
755 /*
756  * Local Variables:
757  * mode: C
758  * tab-width: 8
759  * indent-tabs-mode: t
760  * c-file-style: "stroustrup"
761  * End:
762  * ex: shiftwidth=4 tabstop=8
763  */
void pd_circle(register FILE *plotfp, double x, double y, double r)
Definition: plot3.c:499
void pl_cont(register FILE *plotfp, int x, int y)
Definition: plot3.c:232
void pdv_3move(register FILE *plotfp, const fastf_t *pt)
Definition: plot3.c:618
if lu s
Definition: nmg_mod.c:3860
void pl_arc(register FILE *plotfp, int xc, int yc, int px1, int py1, int px2, int py2)
Definition: plot3.c:293
void pl_line(register FILE *plotfp, int px1, int py1, int px2, int py2)
Definition: plot3.c:193
Header file for the BRL-CAD common definitions.
void pdv_3ray(FILE *fp, const fastf_t *pt, const fastf_t *dir, double t)
Definition: plot3.c:745
void pd_line(register FILE *plotfp, double px1, double py1, double px2, double py2)
Definition: plot3.c:437
void bu_cv_htond(unsigned char *out, const unsigned char *in, size_t count)
void pl_erase(register FILE *plotfp)
Definition: plot3.c:271
void pd_3move(register FILE *plotfp, double x, double y, double z)
Definition: plot3.c:624
void pl_space(register FILE *plotfp, int px1, int py1, int px2, int py2)
Definition: plot3.c:257
void pd_move(register FILE *plotfp, double x, double y)
Definition: plot3.c:463
#define putsi(a)
Definition: plot3.c:79
Definition: color.c:49
void pd_3point(register FILE *plotfp, double x, double y, double z)
Definition: plot3.c:612
void pl_point(register FILE *plotfp, int x, int y)
plot a point
Definition: plot3.c:181
void pd_3space(register FILE *plotfp, double px1, double py1, double pz1, double px2, double py2, double pz2)
Definition: plot3.c:580
void pl_3(register FILE *plotfp, int x, int y, int z, char c)
Definition: plot3.c:150
void pd_3cont(register FILE *plotfp, double x, double y, double z)
Definition: plot3.c:636
void pl_3point(register FILE *plotfp, int x, int y, int z)
Definition: plot3.c:366
void pdv_3space(register FILE *plotfp, const fastf_t *min, const fastf_t *max)
Definition: plot3.c:560
#define V3ARGS(a)
Definition: color.c:56
void pdv_3(register FILE *plotfp, const fastf_t *pt, char c)
Definition: plot3.c:107
void pl_3box(register FILE *plotfp, int px1, int py1, int pz1, int px2, int py2, int pz2)
Definition: plot3.c:400
void pd_space(register FILE *plotfp, double px1, double py1, double px2, double py2)
Definition: plot3.c:475
void pdv_3cont(register FILE *plotfp, const fastf_t *pt)
Definition: plot3.c:630
void pl_label(register FILE *plotfp, const char *s)
Definition: plot3.c:244
void pl_setOutputMode(int mode)
Definition: plot3.c:172
goto out
Definition: nmg_mod.c:3846
void pl_box(register FILE *plotfp, int px1, int py1, int px2, int py2)
Definition: plot3.c:309
void pl_linmod(register FILE *plotfp, const char *s)
Definition: plot3.c:207
void pl_color(register FILE *plotfp, int r, int g, int b)
Definition: plot3.c:325
void pdv_3line(register FILE *plotfp, const fastf_t *a, const fastf_t *b)
Definition: plot3.c:642
void pl_3space(register FILE *plotfp, int px1, int py1, int pz1, int px2, int py2, int pz2)
Definition: plot3.c:350
void pl_3move(register FILE *plotfp, int x, int y, int z)
Definition: plot3.c:372
void pl_3line(register FILE *plotfp, int px1, int py1, int pz1, int px2, int py2, int pz2)
Definition: plot3.c:384
void pl_3cont(register FILE *plotfp, int x, int y, int z)
Definition: plot3.c:378
void pd(register FILE *plotfp, double x, double y, char c)
Definition: plot3.c:127
void pd_cont(register FILE *plotfp, double x, double y)
Definition: plot3.c:469
void pl_flush(register FILE *plotfp)
Definition: plot3.c:338
void pdv_3point(register FILE *plotfp, const fastf_t *pt)
Definition: plot3.c:606
Definition: color.c:51
void pl_move(register FILE *plotfp, int x, int y)
Definition: plot3.c:220
void pl_circle(register FILE *plotfp, int x, int y, int r)
Definition: plot3.c:280
void pd_3box(register FILE *plotfp, double px1, double py1, double pz1, double px2, double py2, double pz2)
Definition: plot3.c:715
void pdv_3box(register FILE *plotfp, const fastf_t *a, const fastf_t *b)
Definition: plot3.c:688
void pd_point(register FILE *plotfp, double x, double y)
Definition: plot3.c:431
int pl_getOutputMode(void)
Definition: plot3.c:167
double fastf_t
Definition: defines.h:300
void pd_arc(register FILE *plotfp, double xc, double yc, double px1, double py1, double px2, double py2)
Definition: plot3.c:522
void pd_3line(register FILE *plotfp, double px1, double py1, double pz1, double px2, double py2, double pz2)
Definition: plot3.c:662
Definition: color.c:50
void pd_box(register FILE *plotfp, double px1, double py1, double px2, double py2)
Definition: plot3.c:548
void pd_3(register FILE *plotfp, double x, double y, double z, char c)
Definition: plot3.c:83