2 * $Id: graph3d.h,v 1.24.2.2 2008/12/15 03:44:22 sfeam Exp $
5 /* GNUPLOT - graph3d.h */
8 * Copyright 1999, 2004 Thomas Williams, Colin Kelley
10 * Permission to use, copy, and distribute this software and its
11 * documentation for any purpose with or without fee is hereby granted,
12 * provided that the above copyright notice appear in all copies and
13 * that both that copyright notice and this permission notice appear
14 * in supporting documentation.
16 * Permission to modify the software is granted, but not the right to
17 * distribute the complete modified source code. Modifications are to
18 * be distributed as patches to the released version. Permission to
19 * distribute binaries produced by compiling modified sources is granted,
21 * 1. distribute the corresponding source modifications from the
22 * released version in the form of a patch file along with the binaries,
23 * 2. add special version identification to distinguish your version
24 * in addition to the base release version number,
25 * 3. provide your name and address as the primary contact for the
26 * support of your modified version, and
27 * 4. retain our contact information in regard to use of the base
29 * Permission to distribute the released version of the source code along
30 * with corresponding source modifications in the form of a patch file is
31 * granted with same provisions 2 through 4 for binary distributions.
33 * This software is provided "as is" without express or implied warranty
34 * to the extent permitted by applicable law.
37 #ifndef GNUPLOT_GRAPH3D_H
38 # define GNUPLOT_GRAPH3D_H
40 /* #if... / #include / #define collection: */
48 /* Function macros to map from user 3D space into normalized -1..1 */
49 #define map_x3d(x) ((x-X_AXIS.min)*xscale3d + xcenter3d -1.0)
50 #define map_y3d(y) ((y-Y_AXIS.min)*yscale3d + ycenter3d -1.0)
51 #define map_z3d(z) ((z-floor_z)*zscale3d + zcenter3d -1.0)
53 /* Type definitions */
55 typedef enum en_contour_placement {
56 /* Where to place contour maps if at all. */
61 } t_contour_placement;
63 typedef double transform_matrix[4][4]; /* HBB 990826: added */
65 typedef struct gnuplot_contours {
66 struct gnuplot_contours *next;
67 struct coordinate GPHUGE *coords;
74 typedef struct iso_curve {
75 struct iso_curve *next;
76 int p_max; /* how many points are allocated */
77 int p_count; /* count of points in points */
78 struct coordinate GPHUGE *points;
81 typedef struct surface_points {
82 struct surface_points *next_sp; /* linked list */
83 int token; /* last token nr, for second pass */
84 enum PLOT_TYPE plot_type;
85 enum PLOT_STYLE plot_style;
87 TBOOLEAN title_no_enhanced; /* don't typeset title in enhanced mode */
88 TBOOLEAN opt_out_of_hidden3d; /* set by "with nohidden" opeion */
89 struct lp_style_type lp_properties;
90 struct arrow_style_type arrow_properties;
91 int has_grid_topology;
93 /* Data files only - num of isolines read from file. For
94 * functions, num_iso_read is the number of 'primary' isolines (in
97 struct gnuplot_contours *contours; /* NULL if not doing contours. */
98 struct iso_curve *iso_crvs; /* the actual data */
99 #ifdef EAM_DATASTRINGS
100 struct text_label *labels; /* Only used if plot_style == LABELPOINTS */
102 TBOOLEAN opt_out_of_contours; /* set by "nocontours" option to splot command */
103 TBOOLEAN pm3d_color_from_column;
104 char pm3d_where[7]; /* explicitly given base, top, surface */
108 /* Variables of graph3d.c needed by other modules: */
110 extern int xmiddle, ymiddle, xscaler, yscaler;
111 extern double floor_z;
112 extern double ceiling_z, base_z; /* made exportable for PM3D */
113 extern transform_matrix trans_mat;
114 extern double xscale3d, yscale3d, zscale3d;
115 extern double xcenter3d, ycenter3d, zcenter3d;
117 extern t_contour_placement draw_contour;
118 extern TBOOLEAN label_contours;
120 extern TBOOLEAN draw_surface;
122 /* is hidden3d display wanted? */
123 extern TBOOLEAN hidden3d;
125 extern float surface_rot_z;
126 extern float surface_rot_x;
127 extern float surface_scale;
128 extern float surface_zscale;
129 extern int splot_map;
137 extern t_xyplane xyplane;
139 #define ISO_SAMPLES 10 /* default number of isolines per splot */
140 extern int iso_samples_1;
141 extern int iso_samples_2;
144 extern int axis3d_o_x, axis3d_o_y, axis3d_x_dx, axis3d_x_dy, axis3d_y_dx, axis3d_y_dy;
147 /* Prototypes from file "graph3d.c" */
149 void do_3dplot __PROTO((struct surface_points *plots, int pcount, int quick));
150 void map3d_position __PROTO((struct position *pos, int *x, int *y, const char *what));
151 void map3d_position_double __PROTO((struct position *pos, double *x, double *y, const char *what));
152 void map3d_position_r __PROTO((struct position *pos, int *x, int *y, const char *what));
155 #endif /* GNUPLOT_GRAPH3D_H */