-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathgraph3d.h
More file actions
205 lines (168 loc) · 7.3 KB
/
graph3d.h
File metadata and controls
205 lines (168 loc) · 7.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/* GNUPLOT - graph3d.h */
/*[
* Copyright 1999, 2004 Thomas Williams, Colin Kelley
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
*
* Permission to modify the software is granted, but not the right to
* distribute the complete modified source code. Modifications are to
* be distributed as patches to the released version. Permission to
* distribute binaries produced by compiling modified sources is granted,
* provided you
* 1. distribute the corresponding source modifications from the
* released version in the form of a patch file along with the binaries,
* 2. add special version identification to distinguish your version
* in addition to the base release version number,
* 3. provide your name and address as the primary contact for the
* support of your modified version, and
* 4. retain our contact information in regard to use of the base
* software.
* Permission to distribute the released version of the source code along
* with corresponding source modifications in the form of a patch file is
* granted with same provisions 2 through 4 for binary distributions.
*
* This software is provided "as is" without express or implied warranty
* to the extent permitted by applicable law.
]*/
#ifndef GNUPLOT_GRAPH3D_H
# define GNUPLOT_GRAPH3D_H
/* #if... / #include / #define collection: */
#include "syscfg.h"
#include "gp_types.h"
#include "gadgets.h"
#include "term_api.h"
/* Type definitions */
typedef enum en_contour_placement {
/* Where to place contour maps if at all. */
CONTOUR_NONE,
CONTOUR_BASE,
CONTOUR_SRF,
CONTOUR_BOTH
} t_contour_placement;
typedef double transform_matrix[4][4]; /* HBB 990826: added */
typedef struct gnuplot_contours {
struct gnuplot_contours *next;
struct coordinate *coords;
char isNewLevel;
char label[32];
int num_pts;
double z;
} gnuplot_contours;
typedef enum cfill_mode {
CFILL_AUTO,
CFILL_ZTICS,
CFILL_CBTICS,
CFILL_LIST
} t_cfill_mode;
typedef struct contourfill {
t_cfill_mode mode;
int nslices;
int tic_level;
int firstlinetype;
} t_contourfill;
#define MAX_ZSLICES 100
typedef struct iso_curve {
struct iso_curve *next;
int p_max; /* how many points are allocated */
int p_count; /* count of points in points */
struct coordinate *points;
} iso_curve;
typedef struct surface_points {
struct surface_points *next_sp; /* pointer to next plot in linked list */
int token; /* last token used, for second parsing pass */
enum PLOT_TYPE plot_type; /* DATA2D? DATA3D? FUNC2D FUNC3D? NODATA? */
enum PLOT_STYLE plot_style; /* style set by "with" or by default */
char *title; /* plot title, a.k.a. key entry */
t_position *title_position; /* title at {beginning|end|<xpos>,<ypos>} */
TBOOLEAN title_no_enhanced; /* don't typeset title in enhanced mode */
TBOOLEAN title_is_automated;/* TRUE if title was auto-generated */
TBOOLEAN title_is_suppressed;/* TRUE if 'notitle' was specified */
TBOOLEAN noautoscale; /* ignore data from this plot during autoscaling */
struct lp_style_type lp_properties;
struct arrow_style_type arrow_properties;
struct fill_style_type fill_properties;
struct text_label *labels; /* Only used if plot_style == LABELPOINTS */
struct t_image image_properties; /* only used if plot_style is IMAGE, RGBIMAGE or RGBA_IMAGE */
struct udvt_entry *sample_var; /* used by '+' if plot has private sampling range */
struct udvt_entry *sample_var2; /* used by '++' if plot has private sampling range */
struct udft_entry plot_function; /* action table and dummy variables for function plot */
/* 2D and 3D plot structure fields overlay only to this point */
enum PLOT_FILTER plot_filter; /* currently only "mask" */
enum PLOT_SMOOTH plot_smooth; /* smooth lines in 3D */
TBOOLEAN opt_out_of_hidden3d; /* set by "nohidden" option to splot command */
TBOOLEAN opt_out_of_contours; /* set by "nocontours" option to splot command */
TBOOLEAN opt_out_of_surface; /* set by "nosurface" option to splot command */
TBOOLEAN opt_out_of_dgrid3d; /* set by "nogrid" option to splot command */
TBOOLEAN pm3d_color_from_column;
TBOOLEAN has_grid_topology;
int hidden3d_top_linetype; /* before any calls to load_linetype() */
void *iteration; /* needed for tracking iteration */
struct vgrid *vgrid; /* used only for voxel plots */
double iso_level; /* used only for voxel plots */
/* Data files only - num of isolines read from file. For functions, */
/* num_iso_read is the number of 'primary' isolines (in x direction) */
int num_iso_read;
struct gnuplot_contours *contours; /* NULL if not doing contours. */
struct iso_curve *iso_crvs; /* the actual data */
char pm3d_where[8]; /* explicitly given base, top, surface */
struct zslice *zclip; /* pm3d surface z-clipping array (contour fill) */
int zclip_index; /* index into zclip[] */
} surface_points;
/* Variables of graph3d.c needed by other modules: */
extern int xmiddle, ymiddle, xscaler, yscaler;
extern double floor_z, floor_z1;
extern double ceiling_z, base_z; /* made exportable for PM3D */
extern transform_matrix trans_mat;
extern double xscale3d, yscale3d, zscale3d;
extern double xcenter3d, ycenter3d, zcenter3d;
extern double radius_scaler;
/* "set cntrlabel" parameters */
extern t_contour_placement draw_contour;
extern TBOOLEAN clabel_onecolor;
extern int clabel_start;
extern int clabel_interval;
extern char *clabel_font;
/* "set contourfill" parameters */
extern t_contourfill contourfill;
extern TBOOLEAN draw_surface;
extern TBOOLEAN implicit_surface;
/* is hidden3d display wanted? */
extern TBOOLEAN hidden3d;
extern int hidden3d_layer; /* LAYER_FRONT or LAYER_BACK */
extern float surface_rot_z;
extern float surface_rot_x;
extern float surface_scale;
extern float surface_zscale;
extern float surface_lscale;
extern float mapview_scale;
extern float azimuth;
extern TBOOLEAN splot_map, xz_projection, yz_projection;
extern TBOOLEAN in_3d_polygon;
typedef struct {
double z;
TBOOLEAN absolute;
} t_xyplane;
extern t_xyplane xyplane;
#define ISO_SAMPLES 10 /* default number of isolines per splot */
extern int iso_samples_1;
extern int iso_samples_2;
#ifdef USE_MOUSE
extern int axis3d_o_x, axis3d_o_y, axis3d_x_dx, axis3d_x_dy, axis3d_y_dx, axis3d_y_dy;
#endif
typedef enum {
NORMAL_REPLOT = 0, /* e.g. "replot" command */
AXIS_ONLY_ROTATE, /* suppress replots during 3D rotation by ctrl-left-mouse */
NORMAL_REFRESH, /* e.g. "refresh" command */
QUICK_REFRESH /* auto-generated refresh during 3D rotation */
} REPLOT_TYPE;
/* Prototypes from file "graph3d.c" */
void do_3dplot(struct surface_points *plots, int pcount, REPLOT_TYPE quick);
void map3d_position(struct position *pos, int *x, int *y, const char *what);
void map3d_position_double(struct position *pos, double *x, double *y, const char *what);
void map3d_position_r(struct position *pos, int *x, int *y, const char *what);
void map3d_position_r_double(struct position *pos, double *x, double *y, const char *what);
#endif /* GNUPLOT_GRAPH3D_H */