BRL-CAD
|
The basic UNIX-plot routines. More...
Files | |
file | plot3.h |
file | tig.h |
Macros | |
#define | pl_mat_idn(_mat) MAT_IDN( _mat ) |
#define | pl_mat_zero(_mat) MAT_ZERO( _mat ) |
#define | pl_mat_copy(_mat1, _mat2) MAT_COPY( _mat1, _mat2 ) |
#define | PL_OUTPUT_MODE_BINARY 0 |
#define | PL_OUTPUT_MODE_TEXT 1 |
#define | PL_FORTRAN(lc, uc) BU_FORTRAN(lc, uc) |
Functions | |
int | pl_getOutputMode (void) |
void | pl_setOutputMode (int mode) |
void | pl_point (FILE *plotfp, int x, int y) |
void | pl_line (FILE *plotfp, int fx, int fy, int tx, int ty) |
void | pl_linmod (FILE *plotfp, const char *s) |
void | pl_move (FILE *plotfp, int x, int y) |
void | pl_cont (FILE *plotfp, int x, int y) |
void | pl_label (FILE *plotfp, const char *s) |
void | pl_space (FILE *plotfp, int x_1, int y_1, int x_2, int y_2) |
void | pl_erase (FILE *plotfp) |
void | pl_circle (FILE *plotfp, int x, int y, int r) |
void | pl_arc (FILE *plotfp, int xc, int yc, int x_1, int y_1, int x_2, int y_2) |
void | pl_box (FILE *plotfp, int x_1, int y_1, int x_2, int y_2) |
void | pl_color (FILE *plotfp, int r, int g, int b) |
void | pl_color_buc (FILE *plotfp, struct bu_color *c) |
void | pl_flush (FILE *plotfp) |
void | pl_3space (FILE *plotfp, int x_1, int y_1, int z_1, int x_2, int y_2, int z_2) |
void | pl_3point (FILE *plotfp, int x, int y, int z) |
void | pl_3move (FILE *plotfp, int x, int y, int z) |
void | pl_3cont (FILE *plotfp, int x, int y, int z) |
void | pl_3line (FILE *plotfp, int x_1, int y_1, int z_1, int x_2, int y_2, int z_2) |
void | pl_3box (FILE *plotfp, int x_1, int y_1, int z_1, int x_2, int y_2, int z_2) |
void | pd_point (FILE *plotfp, double x, double y) |
void | pd_line (FILE *plotfp, double fx, double fy, double tx, double ty) |
void | pd_move (FILE *plotfp, double x, double y) |
void | pd_cont (FILE *plotfp, double x, double y) |
void | pd_space (FILE *plotfp, double x_1, double y_1, double x_2, double y_2) |
void | pd_circle (FILE *plotfp, double x, double y, double r) |
void | pd_arc (FILE *plotfp, double xc, double yc, double x_1, double y_1, double x_2, double y_2) |
void | pd_box (FILE *plotfp, double x_1, double y_1, double x_2, double y_2) |
void | pd_3space (FILE *plotfp, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2) |
void | pd_3point (FILE *plotfp, double x, double y, double z) |
void | pd_3move (FILE *plotfp, double x, double y, double z) |
void | pd_3cont (FILE *plotfp, double x, double y, double z) |
void | pd_3line (FILE *plotfp, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2) |
void | pd_3box (FILE *plotfp, double x_1, double y_1, double z_1, double x_2, double y_2, double z_2) |
void | pdv_3ray (FILE *fp, const point_t pt, const vect_t dir, double t) |
int | plot3_invalid (FILE *fp, int mode) |
void | tp_i2list (FILE *fp, int *x, int *y, int npoints) |
void | tp_2list (FILE *fp, double *x, double *y, int npoints) |
void | BU_FORTRAN (f2list, F2LIST)(FILE **fpp |
void | tp_3list (FILE *fp, double *x, double *y, double *z, int npoints) |
void | BU_FORTRAN (f3list, F3LIST)(FILE **fpp |
void | tp_2mlist (FILE *fp, double *x, double *y, int npoints, int flag, int mark, int interval, double size) |
void | BU_FORTRAN (f2mlst, F2MLST)(FILE **fp |
void | tp_2marker (FILE *fp, int c, double x, double y, double scale) |
void | BU_FORTRAN (f2mark, F2MARK)(FILE **fp |
void | tp_3marker (FILE *fp, int c, double x, double y, double z, double scale) |
void | BU_FORTRAN (f3mark, F3MARK)(FILE **fp |
void | tp_2number (FILE *fp, double input, int x, int y, int cscale, double theta, int digits) |
void | BU_FORTRAN (f2numb, F2NUMB)(FILE **fp |
void | tp_scale (int idata[], int elements, int mode, int length, int odata[], double *min, double *dx) |
void | BU_FORTRAN (fscale, FSCALE)(int idata[] |
void | tp_2symbol (FILE *fp, char *string, double x, double y, double scale, double theta) |
void | BU_FORTRAN (f2symb, F2SYMB)(FILE **fp |
void | tp_plot (FILE *fp, int xp, int yp, int xl, int yl, char xtitle[], char ytitle[], float x[], float y[], int n, double cscale) |
void | BU_FORTRAN (fplot, FPLOT)(FILE **fp |
void | tp_ftoa (float x, char *s) |
void | tp_fixsc (float *x, int npts, float size, float *xs, float *xmin, float *xmax, float *dx) |
void | tp_sep (float x, float *coef, int *ex) |
double | tp_ipow (double x, int n) |
void | tp_3axis (FILE *fp, char *string, point_t origin, mat_t rot, double length, int ccw, int ndigits, double label_start, double label_incr, double tick_separation, double char_width) |
void | BU_FORTRAN (f3axis, F3AXIS)(FILE **fp |
void | tp_3symbol (FILE *fp, char *string, point_t origin, mat_t rot, double scale) |
void | tp_3vector (FILE *plotfp, point_t from, point_t to, double fromheadfract, double toheadfract) |
void | BU_FORTRAN (f3vect, F3VECT)(FILE **fp |
Variables | |
void float * | x |
void float float * | y |
void float float int * | n |
void float float float * | z |
void float float int * | np |
void float float int int * | flag |
void float float int int int * | mark |
void float float int int int int * | interval |
void float float int int int int float * | size |
void int * | c |
void int float float float * | scale |
void float * | input |
void float int int float * | cscale |
void float int int float float * | theta |
void float int int float float int * | digits |
void int * | elements |
void int char * | mode |
void int char int * | length |
void int char int int | odata [] |
void int char int int double * | min |
void int char int int double double * | dx |
void char * | string |
void int * | xp |
void int int * | yp |
void int int int * | xl |
void int int int int * | yl |
void int int int int char * | xtitle |
void int int int int char char * | ytitle |
void char float float float float float int * | ccw |
void char float float float float float int int * | ndigits |
void char float float float float float int int float * | label_start |
void char float float float float float int int float float * | label_incr |
void char float float float float float int int float float float * | tick_separation |
void char float float float float float int int float float float float * | char_width |
void float * | fx |
void float float * | fy |
void float float float * | fz |
void float float float float * | tx |
void float float float float float * | ty |
void float float float float float float * | tz |
void float float float float float float float * | fl |
void float float float float float float float float * | tl |
The basic UNIX-plot routines.
The calling sequence is the same as the original Bell Labs routines, with the exception of the pl_ prefix on the name.
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...
The following routines are taken from the BRL TIG-PACK (Terminal Independent Plotting Package). These routines create plots by using the pl_() and pd_() routines declared in plot3.h.
#define pl_mat_copy | ( | _mat1, | |
_mat2 | |||
) | MAT_COPY( _mat1, _mat2 ) |
#define PL_FORTRAN | ( | lc, | |
uc | |||
) | BU_FORTRAN(lc, uc) |
int pl_getOutputMode | ( | void | ) |
void pl_setOutputMode | ( | int | mode | ) |
void pl_point | ( | FILE * | plotfp, |
int | x, | ||
int | y | ||
) |
void pl_line | ( | FILE * | plotfp, |
int | fx, | ||
int | fy, | ||
int | tx, | ||
int | ty | ||
) |
void pl_linmod | ( | FILE * | plotfp, |
const char * | s | ||
) |
void pl_move | ( | FILE * | plotfp, |
int | x, | ||
int | y | ||
) |
void pl_cont | ( | FILE * | plotfp, |
int | x, | ||
int | y | ||
) |
void pl_label | ( | FILE * | plotfp, |
const char * | s | ||
) |
void pl_space | ( | FILE * | plotfp, |
int | x_1, | ||
int | y_1, | ||
int | x_2, | ||
int | y_2 | ||
) |
void pl_erase | ( | FILE * | plotfp | ) |
void pl_circle | ( | FILE * | plotfp, |
int | x, | ||
int | y, | ||
int | r | ||
) |
void pl_arc | ( | FILE * | plotfp, |
int | xc, | ||
int | yc, | ||
int | x_1, | ||
int | y_1, | ||
int | x_2, | ||
int | y_2 | ||
) |
void pl_box | ( | FILE * | plotfp, |
int | x_1, | ||
int | y_1, | ||
int | x_2, | ||
int | y_2 | ||
) |
void pl_color | ( | FILE * | plotfp, |
int | r, | ||
int | g, | ||
int | b | ||
) |
void pl_color_buc | ( | FILE * | plotfp, |
struct bu_color * | c | ||
) |
void pl_flush | ( | FILE * | plotfp | ) |
void pl_3space | ( | FILE * | plotfp, |
int | x_1, | ||
int | y_1, | ||
int | z_1, | ||
int | x_2, | ||
int | y_2, | ||
int | z_2 | ||
) |
void pl_3point | ( | FILE * | plotfp, |
int | x, | ||
int | y, | ||
int | z | ||
) |
void pl_3move | ( | FILE * | plotfp, |
int | x, | ||
int | y, | ||
int | z | ||
) |
void pl_3cont | ( | FILE * | plotfp, |
int | x, | ||
int | y, | ||
int | z | ||
) |
void pl_3line | ( | FILE * | plotfp, |
int | x_1, | ||
int | y_1, | ||
int | z_1, | ||
int | x_2, | ||
int | y_2, | ||
int | z_2 | ||
) |
void pl_3box | ( | FILE * | plotfp, |
int | x_1, | ||
int | y_1, | ||
int | z_1, | ||
int | x_2, | ||
int | y_2, | ||
int | z_2 | ||
) |
void pd_point | ( | FILE * | plotfp, |
double | x, | ||
double | y | ||
) |
void pd_line | ( | FILE * | plotfp, |
double | fx, | ||
double | fy, | ||
double | tx, | ||
double | ty | ||
) |
void pd_move | ( | FILE * | plotfp, |
double | x, | ||
double | y | ||
) |
void pd_cont | ( | FILE * | plotfp, |
double | x, | ||
double | y | ||
) |
void pd_space | ( | FILE * | plotfp, |
double | x_1, | ||
double | y_1, | ||
double | x_2, | ||
double | y_2 | ||
) |
void pd_circle | ( | FILE * | plotfp, |
double | x, | ||
double | y, | ||
double | r | ||
) |
void pd_arc | ( | FILE * | plotfp, |
double | xc, | ||
double | yc, | ||
double | x_1, | ||
double | y_1, | ||
double | x_2, | ||
double | y_2 | ||
) |
void pd_box | ( | FILE * | plotfp, |
double | x_1, | ||
double | y_1, | ||
double | x_2, | ||
double | y_2 | ||
) |
void pd_3space | ( | FILE * | plotfp, |
double | x_1, | ||
double | y_1, | ||
double | z_1, | ||
double | x_2, | ||
double | y_2, | ||
double | z_2 | ||
) |
void pd_3point | ( | FILE * | plotfp, |
double | x, | ||
double | y, | ||
double | z | ||
) |
void pd_3move | ( | FILE * | plotfp, |
double | x, | ||
double | y, | ||
double | z | ||
) |
void pd_3cont | ( | FILE * | plotfp, |
double | x, | ||
double | y, | ||
double | z | ||
) |
void pd_3line | ( | FILE * | plotfp, |
double | x_1, | ||
double | y_1, | ||
double | z_1, | ||
double | x_2, | ||
double | y_2, | ||
double | z_2 | ||
) |
void pd_3box | ( | FILE * | plotfp, |
double | x_1, | ||
double | y_1, | ||
double | z_1, | ||
double | x_2, | ||
double | y_2, | ||
double | z_2 | ||
) |
int plot3_invalid | ( | FILE * | fp, |
int | mode | ||
) |
void tp_i2list | ( | FILE * | fp, |
int * | x, | ||
int * | y, | ||
int | npoints | ||
) |
Take a set of x, y coordinates, and plot them as a polyline, i.e., connect them with line segments. For markers, use tp_mlist(), below. This "C" interface expects arrays of INTs.
void tp_2list | ( | FILE * | fp, |
double * | x, | ||
double * | y, | ||
int | npoints | ||
) |
Take a set of x, y coordinates, and plot them as a polyline, i.e., connect them with line segments. For markers, use tp_mlist(), below. This "C" interface expects arrays of DOUBLES.
NOTE: tp_2list() and tp_3list() are good candidates to become intrinsic parts of plot3.c, for efficiency reasons.
Originally written in August 04, 1978
void BU_FORTRAN | ( | f2list | , |
F2LIST | |||
) |
void tp_3list | ( | FILE * | fp, |
double * | x, | ||
double * | y, | ||
double * | z, | ||
int | npoints | ||
) |
NOTE: tp_2list() and tp_3list() are good candidates to become intrinsic parts of plot3.c, for efficiency reasons.
Originally written in August 04, 1978
void BU_FORTRAN | ( | f3list | , |
F3LIST | |||
) |
void tp_2mlist | ( | FILE * | fp, |
double * | x, | ||
double * | y, | ||
int | npoints, | ||
int | flag, | ||
int | mark, | ||
int | interval, | ||
double | size | ||
) |
Take a set of x, y co-ordinates and plots them, with a combination of connecting lines and/or place markers. It is important to note that the arrays are arrays of doubles, and express UNIX-plot coordinates in the current pl_space().
tp_scale(TIG) may be called first to optionally re-scale the data.
The 'mark' character to be used for marking points off can be any printing ASCII character, or 001 to 005 for the special marker characters.
In addition, the value of the 'flag' variable determines the type of line to be drawn, as follows:
void BU_FORTRAN | ( | f2mlst | , |
F2MLST | |||
) |
This FORTRAN interface expects arrays of REALs (single precision).
void tp_2marker | ( | FILE * | fp, |
int | c, | ||
double | x, | ||
double | y, | ||
double | scale | ||
) |
void BU_FORTRAN | ( | f2mark | , |
F2MARK | |||
) |
void tp_3marker | ( | FILE * | fp, |
int | c, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | scale | ||
) |
void BU_FORTRAN | ( | f3mark | , |
F3MARK | |||
) |
void tp_2number | ( | FILE * | fp, |
double | input, | ||
int | x, | ||
int | y, | ||
int | cscale, | ||
double | theta, | ||
int | digits | ||
) |
void BU_FORTRAN | ( | f2numb | , |
F2NUMB | |||
) |
void tp_scale | ( | int | idata[], |
int | elements, | ||
int | mode, | ||
int | length, | ||
int | odata[], | ||
double * | min, | ||
double * | dx | ||
) |
void BU_FORTRAN | ( | fscale | , |
FSCALE | |||
) |
void tp_2symbol | ( | FILE * | fp, |
char * | string, | ||
double | x, | ||
double | y, | ||
double | scale, | ||
double | theta | ||
) |
void BU_FORTRAN | ( | f2symb | , |
F2SYMB | |||
) |
void tp_plot | ( | FILE * | fp, |
int | xp, | ||
int | yp, | ||
int | xl, | ||
int | yl, | ||
char | xtitle[], | ||
char | ytitle[], | ||
float | x[], | ||
float | y[], | ||
int | n, | ||
double | cscale | ||
) |
void BU_FORTRAN | ( | fplot | , |
FPLOT | |||
) |
void tp_ftoa | ( | float | x, |
char * | s | ||
) |
void tp_fixsc | ( | float * | x, |
int | npts, | ||
float | size, | ||
float * | xs, | ||
float * | xmin, | ||
float * | xmax, | ||
float * | dx | ||
) |
void tp_sep | ( | float | x, |
float * | coef, | ||
int * | ex | ||
) |
double tp_ipow | ( | double | x, |
int | n | ||
) |
void tp_3axis | ( | FILE * | fp, |
char * | string, | ||
point_t | origin, | ||
mat_t | rot, | ||
double | length, | ||
int | ccw, | ||
int | ndigits, | ||
double | label_start, | ||
double | label_incr, | ||
double | tick_separation, | ||
double | char_width | ||
) |
This routine is used to generate an axis for a graph. It draws an axis with a linear scale, places tic marks every inch, labels the tics, and uses the supplied title for the axis.
The strategy behind this routine is to split the axis into SEGMENTS, which run from one tick to the next. The origin of the first segment (x, y), the origin of the bottom of the first tick (xbott, ybott), and the origin of the first tick label (xnum, ynum) are computed along with the delta x and delta y (xincr, yincr) which describes the interval to the start of the next tick.
Originally written on August 01, 1978
void BU_FORTRAN | ( | f3axis | , |
F3AXIS | |||
) |
void tp_3vector | ( | FILE * | plotfp, |
point_t | from, | ||
point_t | to, | ||
double | fromheadfract, | ||
double | toheadfract | ||
) |
void BU_FORTRAN | ( | f3vect | , |
F3VECT | |||
) |
void char float * x |
Definition at line 72 of file tig.h.
Referenced by mat2d_pt2d_mul().
void char float float * y |
Definition at line 73 of file tig.h.
Referenced by mat2d_pt2d_mul().
void float float int int int int float* size |
Definition at line 132 of file tig.h.
Referenced by PooledObject< T >::operator new().
void int * c |
Definition at line 139 of file tig.h.
Referenced by mat2d_inverse(), and mat2d_pt2d_mul().
void char float float float * scale |
Definition at line 142 of file tig.h.
Referenced by mat2d_inverse().
void int char int int double* min |
Definition at line 182 of file tig.h.
Referenced by BRNode::GetBBox(), and BBNode::GetBBox().
void char float float float float float int int float* label_start |
void char float float float float float int int float float* label_incr |
void char float float float float float int int float float float* tick_separation |
void char float float float float float int int float float float float* char_width |