BRL-CAD
Plot3

A public-domain UNIX plot library, for 2-D and 3-D plotting in 16-bit VAX signed integer spaces, or 64-bit IEEE floating point. More...

Files

file  plot3.h
 

Macros

#define pl_getOutputMode   PL_ADD_PREFIX(pl_getOutputMode)
 
#define PLOT3_EXPORT
 
#define PL_OUTPUT_MODE_BINARY   0
 
#define PL_OUTPUT_MODE_TEXT   1
 
#define PLOT_PREFIX_STR   plot3_
 
#define PL_CONCAT2(a, b)   a ## b
 
#define PL_CONCAT(a, b)   PL_CONCAT2(a,b)
 
#define PL_ADD_PREFIX(b)   PL_CONCAT(PLOT_PREFIX_STR,b)
 
#define pd_3box   PL_ADD_PREFIX(pd_3box)
 
#define pd_3cont   PL_ADD_PREFIX(pd_3cont)
 
#define pd_3line   PL_ADD_PREFIX(pd_3line)
 
#define pd_3move   PL_ADD_PREFIX(pd_3move)
 
#define pd_3point   PL_ADD_PREFIX(pd_3point)
 
#define pd_3space   PL_ADD_PREFIX(pd_3space)
 
#define pd_arc   PL_ADD_PREFIX(pd_arc)
 
#define pd_box   PL_ADD_PREFIX(pd_box)
 
#define pd_circle   PL_ADD_PREFIX(pd_circle)
 
#define pd_cont   PL_ADD_PREFIX(pd_cont)
 
#define pd_line   PL_ADD_PREFIX(pd_line)
 
#define pd_move   PL_ADD_PREFIX(pd_move)
 
#define pd_point   PL_ADD_PREFIX(pd_point)
 
#define pd_space   PL_ADD_PREFIX(pd_space)
 
#define pdv_3box   PL_ADD_PREFIX(pdv_3box)
 
#define pdv_3cont   PL_ADD_PREFIX(pdv_3cont)
 
#define pdv_3line   PL_ADD_PREFIX(pdv_3line)
 
#define pdv_3move   PL_ADD_PREFIX(pdv_3move)
 
#define pdv_3point   PL_ADD_PREFIX(pdv_3point)
 
#define pdv_3ray   PL_ADD_PREFIX(pdv_3ray)
 
#define pdv_3space   PL_ADD_PREFIX(pdv_3space)
 
#define pl_3box   PL_ADD_PREFIX(pl_3box)
 
#define pl_3cont   PL_ADD_PREFIX(pl_3cont)
 
#define pl_3line   PL_ADD_PREFIX(pl_3line)
 
#define pl_3move   PL_ADD_PREFIX(pl_3move)
 
#define pl_3point   PL_ADD_PREFIX(pl_3point)
 
#define pl_3space   PL_ADD_PREFIX(pl_3space)
 
#define pl_arc   PL_ADD_PREFIX(pl_arc)
 
#define pl_box   PL_ADD_PREFIX(pl_box)
 
#define pl_circle   PL_ADD_PREFIX(pl_circle)
 
#define pl_color   PL_ADD_PREFIX(pl_color)
 
#define pl_color_buc   PL_ADD_PREFIX(pl_color_buc)
 
#define pl_cont   PL_ADD_PREFIX(pl_cont)
 
#define pl_erase   PL_ADD_PREFIX(pl_erase)
 
#define pl_flush   PL_ADD_PREFIX(pl_flush)
 
#define pl_label   PL_ADD_PREFIX(pl_label)
 
#define pl_line   PL_ADD_PREFIX(pl_line)
 
#define pl_linmod   PL_ADD_PREFIX(pl_linmod)
 
#define pl_move   PL_ADD_PREFIX(pl_move)
 
#define pl_point   PL_ADD_PREFIX(pl_point)
 
#define pl_setOutputMode   PL_ADD_PREFIX(pl_setOutputMode)
 
#define pl_space   PL_ADD_PREFIX(pl_space)
 
#define plot3_invalid   PL_ADD_PREFIX(plot3_invalid)
 

Functions

PLOT3_EXPORT void pl_setOutputMode (int mode)
 
PLOT3_EXPORT void pl_point (FILE *plotfp, int x, int y)
 
PLOT3_EXPORT void pl_line (FILE *plotfp, int fx, int fy, int tx, int ty)
 
PLOT3_EXPORT void pl_linmod (FILE *plotfp, const char *s)
 
PLOT3_EXPORT void pl_move (FILE *plotfp, int x, int y)
 
PLOT3_EXPORT void pl_cont (FILE *plotfp, int x, int y)
 
PLOT3_EXPORT void pl_label (FILE *plotfp, const char *s)
 
PLOT3_EXPORT void pl_space (FILE *plotfp, int x_1, int y_1, int x_2, int y_2)
 
PLOT3_EXPORT void pl_erase (FILE *plotfp)
 
PLOT3_EXPORT void pl_circle (FILE *plotfp, int x, int y, int r)
 
PLOT3_EXPORT void pl_arc (FILE *plotfp, int xc, int yc, int x_1, int y_1, int x_2, int y_2)
 
PLOT3_EXPORT void pl_box (FILE *plotfp, int x_1, int y_1, int x_2, int y_2)
 
PLOT3_EXPORT void pl_color (FILE *plotfp, int r, int g, int b)
 
PLOT3_EXPORT void pl_color_buc (FILE *plotfp, struct bu_color *c)
 
PLOT3_EXPORT void pl_flush (FILE *plotfp)
 
PLOT3_EXPORT void pl_3space (FILE *plotfp, int x_1, int y_1, int z_1, int x_2, int y_2, int z_2)
 
PLOT3_EXPORT void pl_3point (FILE *plotfp, int x, int y, int z)
 
PLOT3_EXPORT void pl_3move (FILE *plotfp, int x, int y, int z)
 
PLOT3_EXPORT void pl_3cont (FILE *plotfp, int x, int y, int z)
 
PLOT3_EXPORT void pl_3line (FILE *plotfp, int x_1, int y_1, int z_1, int x_2, int y_2, int z_2)
 
PLOT3_EXPORT void pl_3box (FILE *plotfp, int x_1, int y_1, int z_1, int x_2, int y_2, int z_2)
 
PLOT3_EXPORT void pd_point (FILE *plotfp, double x, double y)
 
PLOT3_EXPORT void pd_line (FILE *plotfp, double fx, double fy, double tx, double ty)
 
PLOT3_EXPORT void pd_move (FILE *plotfp, double x, double y)
 
PLOT3_EXPORT void pd_cont (FILE *plotfp, double x, double y)
 
PLOT3_EXPORT void pd_space (FILE *plotfp, double x_1, double y_1, double x_2, double y_2)
 
PLOT3_EXPORT void pd_circle (FILE *plotfp, double x, double y, double r)
 
PLOT3_EXPORT void pd_arc (FILE *plotfp, double xc, double yc, double x_1, double y_1, double x_2, double y_2)
 
PLOT3_EXPORT void pd_box (FILE *plotfp, double x_1, double y_1, double x_2, double y_2)
 
PLOT3_EXPORT void pd_3space (FILE *plotfp, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2)
 
PLOT3_EXPORT void pd_3point (FILE *plotfp, double x, double y, double z)
 
PLOT3_EXPORT void pd_3move (FILE *plotfp, double x, double y, double z)
 
PLOT3_EXPORT void pd_3cont (FILE *plotfp, double x, double y, double z)
 
PLOT3_EXPORT void pd_3line (FILE *plotfp, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2)
 
PLOT3_EXPORT void pd_3box (FILE *plotfp, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2)
 
PLOT3_EXPORT void pdv_3ray (FILE *fp, const point_t pt, const vect_t dir, double t)
 
PLOT3_EXPORT int plot3_invalid (FILE *fp, int mode)
 

Detailed Description

A public-domain UNIX plot library, for 2-D and 3-D plotting in 16-bit VAX signed integer spaces, or 64-bit IEEE floating point.

These routines generate "UNIX plot" output (with the addition of 3-D commands). They behave almost exactly like the regular libplot routines, except:

  1. These all take a stdio file pointer, and can thus be used to create multiple plot files simultaneously.
  2. There are 3-D versions of most commands.
  3. There are IEEE floating point versions of the commands.
  4. The names have been changed.

The 3-D extensions are those of Doug Gwyn, from his System V extensions.

These are the ascii command letters allocated to various actions. Care has been taken to consistently match lowercase and uppercase letters.

2d 3d 2df 3df
space s S w W
move m M o O
cont n N q Q
point p P x X
line l L v V
circle c i
arc a r
linmod f
label t
erase e
color C
flush F
bd gh jk uyz
ABDEGHIJKRTUYZ
void move(pt2d_t a, const double *b)
Definition: dvec.h:809
void float float int * n
Definition: tig.h:74
void int * c
Definition: tig.h:139
void float * x
Definition: tig.h:72
@ X
Definition: vmath.h:401
@ W
Definition: vmath.h:404

The calling sequence is the same as the original Bell Labs routines, with the exception of the pl_ prefix on the name.

NOTE: from libbv's perspective, plot3.h is a stand-alone header that does not use any other library functionality. To use this header without libbv, define PLOT3_IMPLEMENTATION before including the plot3.h header.

Of interest: the Plan 9 sources (recently MIT licensed) appear to be related to the original code that would have formed the conceptual basis for these routines:

https://plan9.io/sources/plan9/sys/src/cmd/plot/libplot/

Don't know if there would be any improvements that could be retrofitted onto this version, but might be worth looking. In particular, curious if the spline routine might be useful...

Macro Definition Documentation

◆ pl_getOutputMode

PLOT3_EXPORT int pl_getOutputMode   PL_ADD_PREFIX(pl_getOutputMode)

Definition at line 150 of file plot3.h.

◆ PLOT3_EXPORT

#define PLOT3_EXPORT

Definition at line 99 of file plot3.h.

◆ PL_OUTPUT_MODE_BINARY

#define PL_OUTPUT_MODE_BINARY   0

Definition at line 104 of file plot3.h.

◆ PL_OUTPUT_MODE_TEXT

#define PL_OUTPUT_MODE_TEXT   1

Definition at line 105 of file plot3.h.

◆ PLOT_PREFIX_STR

#define PLOT_PREFIX_STR   plot3_

Definition at line 108 of file plot3.h.

◆ PL_CONCAT2

#define PL_CONCAT2 (   a,
 
)    a ## b

Definition at line 110 of file plot3.h.

◆ PL_CONCAT

#define PL_CONCAT (   a,
 
)    PL_CONCAT2(a,b)

Definition at line 111 of file plot3.h.

◆ PL_ADD_PREFIX

#define PL_ADD_PREFIX (   b)    PL_CONCAT(PLOT_PREFIX_STR,b)

Definition at line 112 of file plot3.h.

◆ pd_3box

#define pd_3box   PL_ADD_PREFIX(pd_3box)

Definition at line 115 of file plot3.h.

◆ pd_3cont

#define pd_3cont   PL_ADD_PREFIX(pd_3cont)

Definition at line 116 of file plot3.h.

◆ pd_3line

#define pd_3line   PL_ADD_PREFIX(pd_3line)

Definition at line 117 of file plot3.h.

◆ pd_3move

#define pd_3move   PL_ADD_PREFIX(pd_3move)

Definition at line 118 of file plot3.h.

◆ pd_3point

#define pd_3point   PL_ADD_PREFIX(pd_3point)

Definition at line 119 of file plot3.h.

◆ pd_3space

#define pd_3space   PL_ADD_PREFIX(pd_3space)

Definition at line 120 of file plot3.h.

◆ pd_arc

#define pd_arc   PL_ADD_PREFIX(pd_arc)

Definition at line 121 of file plot3.h.

◆ pd_box

#define pd_box   PL_ADD_PREFIX(pd_box)

Definition at line 122 of file plot3.h.

◆ pd_circle

#define pd_circle   PL_ADD_PREFIX(pd_circle)

Definition at line 123 of file plot3.h.

◆ pd_cont

#define pd_cont   PL_ADD_PREFIX(pd_cont)

Definition at line 124 of file plot3.h.

◆ pd_line

#define pd_line   PL_ADD_PREFIX(pd_line)

Definition at line 125 of file plot3.h.

◆ pd_move

#define pd_move   PL_ADD_PREFIX(pd_move)

Definition at line 126 of file plot3.h.

◆ pd_point

#define pd_point   PL_ADD_PREFIX(pd_point)

Definition at line 127 of file plot3.h.

◆ pd_space

#define pd_space   PL_ADD_PREFIX(pd_space)

Definition at line 128 of file plot3.h.

◆ pdv_3box

#define pdv_3box   PL_ADD_PREFIX(pdv_3box)

Definition at line 129 of file plot3.h.

◆ pdv_3cont

#define pdv_3cont   PL_ADD_PREFIX(pdv_3cont)

Definition at line 130 of file plot3.h.

◆ pdv_3line

#define pdv_3line   PL_ADD_PREFIX(pdv_3line)

Definition at line 131 of file plot3.h.

◆ pdv_3move

#define pdv_3move   PL_ADD_PREFIX(pdv_3move)

Definition at line 132 of file plot3.h.

◆ pdv_3point

#define pdv_3point   PL_ADD_PREFIX(pdv_3point)

Definition at line 133 of file plot3.h.

◆ pdv_3ray

#define pdv_3ray   PL_ADD_PREFIX(pdv_3ray)

Definition at line 134 of file plot3.h.

◆ pdv_3space

#define pdv_3space   PL_ADD_PREFIX(pdv_3space)

Definition at line 135 of file plot3.h.

◆ pl_3box

#define pl_3box   PL_ADD_PREFIX(pl_3box)

Definition at line 136 of file plot3.h.

◆ pl_3cont

#define pl_3cont   PL_ADD_PREFIX(pl_3cont)

Definition at line 137 of file plot3.h.

◆ pl_3line

#define pl_3line   PL_ADD_PREFIX(pl_3line)

Definition at line 138 of file plot3.h.

◆ pl_3move

#define pl_3move   PL_ADD_PREFIX(pl_3move)

Definition at line 139 of file plot3.h.

◆ pl_3point

#define pl_3point   PL_ADD_PREFIX(pl_3point)

Definition at line 140 of file plot3.h.

◆ pl_3space

#define pl_3space   PL_ADD_PREFIX(pl_3space)

Definition at line 141 of file plot3.h.

◆ pl_arc

#define pl_arc   PL_ADD_PREFIX(pl_arc)

Definition at line 142 of file plot3.h.

◆ pl_box

#define pl_box   PL_ADD_PREFIX(pl_box)

Definition at line 143 of file plot3.h.

◆ pl_circle

#define pl_circle   PL_ADD_PREFIX(pl_circle)

Definition at line 144 of file plot3.h.

◆ pl_color

#define pl_color   PL_ADD_PREFIX(pl_color)

Definition at line 145 of file plot3.h.

◆ pl_color_buc

#define pl_color_buc   PL_ADD_PREFIX(pl_color_buc)

Definition at line 146 of file plot3.h.

◆ pl_cont

#define pl_cont   PL_ADD_PREFIX(pl_cont)

Definition at line 147 of file plot3.h.

◆ pl_erase

#define pl_erase   PL_ADD_PREFIX(pl_erase)

Definition at line 148 of file plot3.h.

◆ pl_flush

#define pl_flush   PL_ADD_PREFIX(pl_flush)

Definition at line 149 of file plot3.h.

◆ pl_label

#define pl_label   PL_ADD_PREFIX(pl_label)

Definition at line 151 of file plot3.h.

◆ pl_line

#define pl_line   PL_ADD_PREFIX(pl_line)

Definition at line 152 of file plot3.h.

◆ pl_linmod

#define pl_linmod   PL_ADD_PREFIX(pl_linmod)

Definition at line 153 of file plot3.h.

◆ pl_move

#define pl_move   PL_ADD_PREFIX(pl_move)

Definition at line 154 of file plot3.h.

◆ pl_point

#define pl_point   PL_ADD_PREFIX(pl_point)

Definition at line 155 of file plot3.h.

◆ pl_setOutputMode

#define pl_setOutputMode   PL_ADD_PREFIX(pl_setOutputMode)

Definition at line 156 of file plot3.h.

◆ pl_space

#define pl_space   PL_ADD_PREFIX(pl_space)

Definition at line 157 of file plot3.h.

◆ plot3_invalid

#define plot3_invalid   PL_ADD_PREFIX(plot3_invalid)

Definition at line 158 of file plot3.h.

Function Documentation

◆ pl_setOutputMode()

PLOT3_EXPORT void pl_setOutputMode ( int  mode)

◆ pl_point()

PLOT3_EXPORT void pl_point ( FILE *  plotfp,
int  x,
int  y 
)

◆ pl_line()

PLOT3_EXPORT void pl_line ( FILE *  plotfp,
int  fx,
int  fy,
int  tx,
int  ty 
)

◆ pl_linmod()

PLOT3_EXPORT void pl_linmod ( FILE *  plotfp,
const char *  s 
)

◆ pl_move()

PLOT3_EXPORT void pl_move ( FILE *  plotfp,
int  x,
int  y 
)

◆ pl_cont()

PLOT3_EXPORT void pl_cont ( FILE *  plotfp,
int  x,
int  y 
)

◆ pl_label()

PLOT3_EXPORT void pl_label ( FILE *  plotfp,
const char *  s 
)

◆ pl_space()

PLOT3_EXPORT void pl_space ( FILE *  plotfp,
int  x_1,
int  y_1,
int  x_2,
int  y_2 
)

◆ pl_erase()

PLOT3_EXPORT void pl_erase ( FILE *  plotfp)

◆ pl_circle()

PLOT3_EXPORT void pl_circle ( FILE *  plotfp,
int  x,
int  y,
int  r 
)

◆ pl_arc()

PLOT3_EXPORT void pl_arc ( FILE *  plotfp,
int  xc,
int  yc,
int  x_1,
int  y_1,
int  x_2,
int  y_2 
)

◆ pl_box()

PLOT3_EXPORT void pl_box ( FILE *  plotfp,
int  x_1,
int  y_1,
int  x_2,
int  y_2 
)

◆ pl_color()

PLOT3_EXPORT void pl_color ( FILE *  plotfp,
int  r,
int  g,
int  b 
)

◆ pl_color_buc()

PLOT3_EXPORT void pl_color_buc ( FILE *  plotfp,
struct bu_color c 
)

◆ pl_flush()

PLOT3_EXPORT void pl_flush ( FILE *  plotfp)

◆ pl_3space()

PLOT3_EXPORT void pl_3space ( FILE *  plotfp,
int  x_1,
int  y_1,
int  z_1,
int  x_2,
int  y_2,
int  z_2 
)

◆ pl_3point()

PLOT3_EXPORT void pl_3point ( FILE *  plotfp,
int  x,
int  y,
int  z 
)

◆ pl_3move()

PLOT3_EXPORT void pl_3move ( FILE *  plotfp,
int  x,
int  y,
int  z 
)

◆ pl_3cont()

PLOT3_EXPORT void pl_3cont ( FILE *  plotfp,
int  x,
int  y,
int  z 
)

◆ pl_3line()

PLOT3_EXPORT void pl_3line ( FILE *  plotfp,
int  x_1,
int  y_1,
int  z_1,
int  x_2,
int  y_2,
int  z_2 
)

◆ pl_3box()

PLOT3_EXPORT void pl_3box ( FILE *  plotfp,
int  x_1,
int  y_1,
int  z_1,
int  x_2,
int  y_2,
int  z_2 
)

◆ pd_point()

PLOT3_EXPORT void pd_point ( FILE *  plotfp,
double  x,
double  y 
)

◆ pd_line()

PLOT3_EXPORT void pd_line ( FILE *  plotfp,
double  fx,
double  fy,
double  tx,
double  ty 
)

◆ pd_move()

PLOT3_EXPORT void pd_move ( FILE *  plotfp,
double  x,
double  y 
)

◆ pd_cont()

PLOT3_EXPORT void pd_cont ( FILE *  plotfp,
double  x,
double  y 
)

◆ pd_space()

PLOT3_EXPORT void pd_space ( FILE *  plotfp,
double  x_1,
double  y_1,
double  x_2,
double  y_2 
)

◆ pd_circle()

PLOT3_EXPORT void pd_circle ( FILE *  plotfp,
double  x,
double  y,
double  r 
)

◆ pd_arc()

PLOT3_EXPORT void pd_arc ( FILE *  plotfp,
double  xc,
double  yc,
double  x_1,
double  y_1,
double  x_2,
double  y_2 
)

◆ pd_box()

PLOT3_EXPORT void pd_box ( FILE *  plotfp,
double  x_1,
double  y_1,
double  x_2,
double  y_2 
)

◆ pd_3space()

PLOT3_EXPORT void pd_3space ( FILE *  plotfp,
double  x_1,
double  y_1,
double  z_1,
double  x_2,
double  y_2,
double  z_2 
)

◆ pd_3point()

PLOT3_EXPORT void pd_3point ( FILE *  plotfp,
double  x,
double  y,
double  z 
)

◆ pd_3move()

PLOT3_EXPORT void pd_3move ( FILE *  plotfp,
double  x,
double  y,
double  z 
)

◆ pd_3cont()

PLOT3_EXPORT void pd_3cont ( FILE *  plotfp,
double  x,
double  y,
double  z 
)

◆ pd_3line()

PLOT3_EXPORT void pd_3line ( FILE *  plotfp,
double  x_1,
double  y_1,
double  z_1,
double  x_2,
double  y_2,
double  z_2 
)

◆ pd_3box()

PLOT3_EXPORT void pd_3box ( FILE *  plotfp,
double  x_1,
double  y_1,
double  z_1,
double  x_2,
double  y_2,
double  z_2 
)

◆ pdv_3ray()

PLOT3_EXPORT void pdv_3ray ( FILE *  fp,
const point_t  pt,
const vect_t  dir,
double  t 
)

◆ plot3_invalid()

PLOT3_EXPORT int plot3_invalid ( FILE *  fp,
int  mode 
)