106# if defined(PLOT3_DLL_EXPORTS) && defined(PLOT3_DLL_IMPORTS)
107# error "Only PLOT3_DLL_EXPORTS or PLOT3_DLL_IMPORTS can be defined, not both."
108# elif defined(PLOT3_DLL_EXPORTS)
109# define PLOT3_EXPORT COMPILER_DLLEXPORT
110# elif defined(PLOT3_DLL_IMPORTS)
111# define PLOT3_EXPORT COMPILER_DLLIMPORT
118#define PL_OUTPUT_MODE_BINARY 0
119#define PL_OUTPUT_MODE_TEXT 1
121#if !defined(PLOT_PREFIX_STR)
122# define PLOT_PREFIX_STR plot3_
124#define PL_CONCAT2(a, b) a ## b
125#define PL_CONCAT(a, b) PL_CONCAT2(a,b)
126#define PL_ADD_PREFIX(b) PL_CONCAT(PLOT_PREFIX_STR,b)
129#define pd_3box PL_ADD_PREFIX(pd_3box)
130#define pd_3cont PL_ADD_PREFIX(pd_3cont)
131#define pd_3line PL_ADD_PREFIX(pd_3line)
132#define pd_3move PL_ADD_PREFIX(pd_3move)
133#define pd_3point PL_ADD_PREFIX(pd_3point)
134#define pd_3space PL_ADD_PREFIX(pd_3space)
135#define pd_arc PL_ADD_PREFIX(pd_arc)
136#define pd_box PL_ADD_PREFIX(pd_box)
137#define pd_circle PL_ADD_PREFIX(pd_circle)
138#define pd_cont PL_ADD_PREFIX(pd_cont)
139#define pd_line PL_ADD_PREFIX(pd_line)
140#define pd_move PL_ADD_PREFIX(pd_move)
141#define pd_point PL_ADD_PREFIX(pd_point)
142#define pd_space PL_ADD_PREFIX(pd_space)
143#define pdv_3box PL_ADD_PREFIX(pdv_3box)
144#define pdv_3cont PL_ADD_PREFIX(pdv_3cont)
145#define pdv_3line PL_ADD_PREFIX(pdv_3line)
146#define pdv_3move PL_ADD_PREFIX(pdv_3move)
147#define pdv_3point PL_ADD_PREFIX(pdv_3point)
148#define pdv_3ray PL_ADD_PREFIX(pdv_3ray)
149#define pdv_3space PL_ADD_PREFIX(pdv_3space)
150#define pl_3box PL_ADD_PREFIX(pl_3box)
151#define pl_3cont PL_ADD_PREFIX(pl_3cont)
152#define pl_3line PL_ADD_PREFIX(pl_3line)
153#define pl_3move PL_ADD_PREFIX(pl_3move)
154#define pl_3point PL_ADD_PREFIX(pl_3point)
155#define pl_3space PL_ADD_PREFIX(pl_3space)
156#define pl_arc PL_ADD_PREFIX(pl_arc)
157#define pl_box PL_ADD_PREFIX(pl_box)
158#define pl_circle PL_ADD_PREFIX(pl_circle)
159#define pl_color PL_ADD_PREFIX(pl_color)
160#define pl_color_buc PL_ADD_PREFIX(pl_color_buc)
161#define pl_cont PL_ADD_PREFIX(pl_cont)
162#define pl_erase PL_ADD_PREFIX(pl_erase)
163#define pl_flush PL_ADD_PREFIX(pl_flush)
164#define pl_getOutputMode PL_ADD_PREFIX(pl_getOutputMode)
165#define pl_label PL_ADD_PREFIX(pl_label)
166#define pl_line PL_ADD_PREFIX(pl_line)
167#define pl_linmod PL_ADD_PREFIX(pl_linmod)
168#define pl_move PL_ADD_PREFIX(pl_move)
169#define pl_point PL_ADD_PREFIX(pl_point)
170#define pl_setOutputMode PL_ADD_PREFIX(pl_setOutputMode)
171#define pl_space PL_ADD_PREFIX(pl_space)
172#define pl_list PL_ADD_PREFIX(pl_list)
173#define plot3_invalid PL_ADD_PREFIX(plot3_invalid)
174#define plot3_data_scale PL_ADD_PREFIX(plot3_data_scale)
175#define plot3_float_split PL_ADD_PREFIX(plot3_float_split)
176#define plot3_float_to_ascii PL_ADD_PREFIX(plot3_float_to_ascii)
177#define plot3_font_getchar PL_ADD_PREFIX(plot3_font_getchar)
178#define plot3_ipow PL_ADD_PREFIX(plot3_ipow)
179#define plot3_scale_fit PL_ADD_PREFIX(plot3_scale_fit)
180#define plot3_xy_plot PL_ADD_PREFIX(plot3_xy_plot)
181#define pd_3list PL_ADD_PREFIX(pd_3list)
182#define pd_3marker PL_ADD_PREFIX(pd_3marker)
183#define pd_list PL_ADD_PREFIX(pd_list)
184#define pd_marked_list PL_ADD_PREFIX(pd_marked_list)
185#define pd_marker PL_ADD_PREFIX(pd_marker)
186#define pd_symbol PL_ADD_PREFIX(pd_symbol)
187#define pdv_3axis PL_ADD_PREFIX(pdv_3axis)
188#define pdv_3symbol PL_ADD_PREFIX(pdv_3symbol)
189#define pdv_3vector PL_ADD_PREFIX(pdv_3vector)
191#define PLOT3_FONT_LAST -128
192#define PLOT3_FONT_NEGY -127
470#if defined(PLOT3_IMPLEMENTATION)
479#define putsi(a) putc(a, plotfp); putc((a>>8), plotfp)
483pd_3(FILE *
plotfp,
double x,
double y,
double z,
char c)
487 unsigned char out[3*8+1];
510 unsigned char out[3*8+1];
531 unsigned char out[2*8+1];
851 unsigned char out[4*8+1];
889 unsigned char out[4*8+1];
913 unsigned char out[3*8+1];
936 unsigned char out[6*8+1];
973 unsigned char out[6*8+1];
994 unsigned char out[6*8+1];
1055 unsigned char out[6*8+1];
1076 unsigned char out[6*8+1];
1173 for (
int i = 0; i <
cnt * 2; i++) {
1182 for (
int i = 0; i <
cnt; i++) {
1198 for (
int i = 0; i <
cnt; i++) {
1208 for (
int i = 0; i <
cnt; i++) {
1233 char carg[256] = {0};
1244#define PLOT3_NUM_SYMBOLS 8
1245#define PLOT3_BRT(_x, _y) (11*(_x)+(_y))
1246#define PLOT3_DRK(_x, _y) -(11*(_x)+(_y))
1247#define PLOT3_BNEG(_x, _y) PLOT3_FONT_NEGY, PLOT3_BRT((_x), (_y))
1248#define PLOT3_DNEG(_x, _y) PLOT3_FONT_NEGY, PLOT3_DRK((_x), (_y))
1249#define PLOT3_TICK_YLEN (char_width)
1250#define PLOT3_NUM_YOFF (3*char_width)
1251#define PLOT3_TITLE_YOFF (5*char_width)
1252#define PLOT3_TIC 100
1253#define PLOT3_REF_WIDTH 0.857143
1254#define PLOT3_NUM_DISTANCE 250
1255#define PLOT3_LAB_LNGTH 860
2287 + a[
row*4 + 1] * b[
col + 4]
2288 + a[
row*4 + 2] * b[
col + 8]
2289 + a[
row*4 + 3] * b[
col + 12];
2401 for (i = 1; i <
npoints; i++) {
2414pd_marker(FILE *fp,
int c,
double x,
double y,
double scale)
2424pd_3marker(FILE *fp,
int c,
double x,
double y,
double z,
double scale)
2433 VSET(p, x - scale*0.5, y - scale*0.5,
z);
2448 if (
string ==
NULL || *
string ==
'\0')
2456 for (
cp = (
unsigned char *)
string; *
cp;
cp++, offset += scale) {
2493pd_symbol(FILE *fp,
char *
string,
double x,
double y,
double scale,
double theta)
2554pdv_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)
2604 for (i = 0; i <=
nticks; i++) {
2658 for (i = 1; i < 39; ++i) {
2671 for (i = 1; i < 39; ++i) {
2706 else if (
coef < 4.0f)
2737plot3_xy_plot(FILE *fp,
int xp,
int yp,
int xl,
int yl,
char *
xtitle,
char *
ytitle,
float *x,
float *y,
int n,
double cscale)
2743 int ix[101] = {0},
iy[101] = {0},
isave = 0;
2775 if ((i%
xtics) == 0) {
2798 if ((i%
ytics) == 0) {
2828 while (i <=
isave) {
2883 for (i = 1; i <= 3; ++i) {
2967 else if (mode ==
'd')
2994 unsigned int tchar = 0;
2997 if (c <
'A' || c >
'z') {
3004 for (i = 0; i < 3; i++) {
Header file for the BRL-CAD common definitions.
int bu_color_to_rgb_ints(const struct bu_color *cp, int *r, int *g, int *b)
#define SIZEOF_NETWORK_DOUBLE
void bu_cv_htond(unsigned char *out, const unsigned char *in, size_t count)
#define PL_OUTPUT_MODE_BINARY
#define plot3_float_to_ascii
#define plot3_font_getchar
#define plot3_float_split
#define PL_OUTPUT_MODE_TEXT
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
#define VUNITIZE(v)
Normalize vector ‘v’ to be a unit vector.
double fastf_t
fastest 64-bit (or larger) floating point type
#define VADD2(o, a, b)
Add 3D vectors at ‘a’ and ‘b’, store result at ‘o’.
#define VCROSS(o, a, b)
Store cross product of 3D vectors at ‘a’ and ‘b’ in vector at ‘o’.
#define MAT_IDN(m)
Set matrix to identity.
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
#define VMOVE(o, v)
Transfer 3D vector at ‘v’ to vector at ‘o’.
#define VSCALE(o, v, s)
Scale 3D vector at ‘v’ by scalar ‘s’, store result at ‘o’.
#define VSUB2(o, a, b)
Subtract 3D vector at ‘b’ from vector at ‘a’, store result at ‘o’.
#define VADD3(o, a, b, c)
Add 3 3D vectors at ‘a’, ‘b’, and ‘c’, store result at ‘o’.
#define MAT_COPY(c, m)
Copy a matrix ‘m’ into ‘c’.
#define VJOIN1(o, a, sb, b)
#define VDOT(a, b)
Compute dot product of vectors at ‘a’ and ‘b’.
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
#define VSET(o, a, b, c)
Set 3D vector at ‘o’ to have coordinates ‘a’, ‘b’, and ‘c’.
#define V_MIN(r, s)
Included below are macros to update min and max X, Y, Z values to contain a point.
#define MAT4X3PNT(o, m, i)
Apply a 4x4 matrix to a 3-tuple which is an absolute Point in space. Output and input points should b...
#define MAGNITUDE(v)
Return scalar magnitude of the 3D vector ‘a’. This is otherwise known as the Euclidean norm of the pr...
#define MAT_DELTAS_VEC(_m, _v)
set translation values of 4x4 matrix from a vector.
#define MAT4X3VEC(o, m, i)
Apply a 4x4 matrix to a 3-tuple which is a relative Vector in space. This macro can scale the length ...
fundamental vector, matrix, quaternion math macros