Icons are changed
[gnuplot] / src / graph3d.h
1 /*
2  * $Id: graph3d.h,v 1.24.2.2 2008/12/15 03:44:22 sfeam Exp $
3  */
4
5 /* GNUPLOT - graph3d.h */
6
7 /*[
8  * Copyright 1999, 2004   Thomas Williams, Colin Kelley
9  *
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.
15  *
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,
20  * provided you
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
28  *    software.
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.
32  *
33  * This software is provided "as is" without express or implied warranty
34  * to the extent permitted by applicable law.
35 ]*/
36
37 #ifndef GNUPLOT_GRAPH3D_H
38 # define GNUPLOT_GRAPH3D_H
39
40 /* #if... / #include / #define collection: */
41
42 #include "syscfg.h"
43 #include "gp_types.h"
44
45 #include "gadgets.h"
46 #include "term_api.h"
47
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)
52
53 /* Type definitions */
54
55 typedef enum en_contour_placement {
56     /* Where to place contour maps if at all. */
57     CONTOUR_NONE,
58     CONTOUR_BASE,
59     CONTOUR_SRF,
60     CONTOUR_BOTH
61 } t_contour_placement;
62
63 typedef double transform_matrix[4][4]; /* HBB 990826: added */
64
65 typedef struct gnuplot_contours {
66     struct gnuplot_contours *next;
67     struct coordinate GPHUGE *coords;
68     char isNewLevel;
69     char label[32];
70     int num_pts;
71     double z;
72 } gnuplot_contours;
73
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;
79 } iso_curve;
80
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;
86     char *title;
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;
92
93     /* Data files only - num of isolines read from file. For
94      * functions, num_iso_read is the number of 'primary' isolines (in
95      * x direction) */
96     int num_iso_read;
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 */
101 #endif
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 */
105
106 } surface_points;
107
108 /* Variables of graph3d.c needed by other modules: */
109
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;
116
117 extern t_contour_placement draw_contour;
118 extern TBOOLEAN label_contours;
119
120 extern TBOOLEAN draw_surface;
121
122 /* is hidden3d display wanted? */
123 extern TBOOLEAN hidden3d;
124
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;
130
131 typedef struct { 
132     double ticslevel; 
133     double xyplane_z; 
134     TBOOLEAN absolute;
135 } t_xyplane;
136
137 extern t_xyplane xyplane;
138
139 #define ISO_SAMPLES 10          /* default number of isolines per splot */
140 extern int iso_samples_1;
141 extern int iso_samples_2;
142
143 #ifdef USE_MOUSE
144 extern int axis3d_o_x, axis3d_o_y, axis3d_x_dx, axis3d_x_dy, axis3d_y_dx, axis3d_y_dy;
145 #endif
146
147 /* Prototypes from file "graph3d.c" */
148
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));
153
154
155 #endif /* GNUPLOT_GRAPH3D_H */