1 | /*
|
---|
2 | * $Id: graph3d.h,v 1.1.1.1 2001-12-19 18:01:18 perderos Exp $
|
---|
3 | */
|
---|
4 |
|
---|
5 | /* GNUPLOT - graph3d.h */
|
---|
6 |
|
---|
7 | /*[
|
---|
8 | * Copyright 1999 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 | /***
|
---|
43 | #include "syscfg.h"
|
---|
44 |
|
---|
45 | #include "gadgets.h"
|
---|
46 | #include "term_api.h"
|
---|
47 | ****/
|
---|
48 |
|
---|
49 | #include <stdio.h>
|
---|
50 | #include <stdlib.h>
|
---|
51 | #include "gp_types.h"
|
---|
52 | #include "mymisc.h"
|
---|
53 | /* Function macros to map from user 3D space into normalized -1..1 */
|
---|
54 | #define map_x3d(x) ((x-X_AXIS.min)*xscale3d-1.0)
|
---|
55 | #define map_y3d(y) ((y-Y_AXIS.min)*yscale3d-1.0)
|
---|
56 | #define map_z3d(z) ((z-floor_z)*zscale3d-1.0)
|
---|
57 |
|
---|
58 | /* Type definitions */
|
---|
59 |
|
---|
60 | typedef enum en_contour_placement {
|
---|
61 | /* Where to place contour maps if at all. */
|
---|
62 | CONTOUR_NONE,
|
---|
63 | CONTOUR_BASE,
|
---|
64 | CONTOUR_SRF,
|
---|
65 | CONTOUR_BOTH
|
---|
66 | } t_contour_placement;
|
---|
67 |
|
---|
68 | typedef double transform_matrix[4][4]; /* HBB 990826: added */
|
---|
69 |
|
---|
70 | typedef struct gnuplot_contours {
|
---|
71 | struct gnuplot_contours *next;
|
---|
72 | struct coordinate *coords;
|
---|
73 | char isNewLevel;
|
---|
74 | char label[32];
|
---|
75 | int num_pts;
|
---|
76 | #ifdef PM3D
|
---|
77 | double z;
|
---|
78 | #endif
|
---|
79 | } gnuplot_contours;
|
---|
80 |
|
---|
81 | typedef struct iso_curve {
|
---|
82 | struct iso_curve *next;
|
---|
83 | int p_max; /* how many points are allocated */
|
---|
84 | int p_count; /* count of points in points */
|
---|
85 | struct coordinate *points;
|
---|
86 | } iso_curve;
|
---|
87 |
|
---|
88 | typedef struct surface_points {
|
---|
89 | struct surface_points *next_sp; /* linked list */
|
---|
90 | int token; /* last token nr, for second pass */
|
---|
91 | enum PLOT_TYPE plot_type;
|
---|
92 | enum PLOT_STYLE plot_style;
|
---|
93 | char *title;
|
---|
94 | int title_no_enhanced; /* don't typeset title in enhanced mode */
|
---|
95 | /*struct lp_style_type lp_properties;*/
|
---|
96 | int has_grid_topology;
|
---|
97 |
|
---|
98 | /* Data files only - num of isolines read from file. For
|
---|
99 | * functions, num_iso_read is the number of 'primary' isolines (in
|
---|
100 | * x direction) */
|
---|
101 | int num_iso_read;
|
---|
102 | struct gnuplot_contours *contours; /* NULL if not doing contours. */
|
---|
103 | struct iso_curve *iso_crvs; /* the actual data */
|
---|
104 |
|
---|
105 | #ifdef PM3D_COLUMN
|
---|
106 | int pm3d_color_from_column;
|
---|
107 | coordval color_min;
|
---|
108 | coordval color_max;
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | } surface_points;
|
---|
112 |
|
---|
113 | /* Variables of graph3d.c needed by other modules: */
|
---|
114 |
|
---|
115 | extern int xmiddle, ymiddle, xscaler, yscaler;
|
---|
116 | extern double floor_z;
|
---|
117 | extern double ceiling_z, base_z; /* made exportable for PM3D */
|
---|
118 | extern transform_matrix trans_mat;
|
---|
119 | extern double xscale3d, yscale3d, zscale3d;
|
---|
120 |
|
---|
121 | extern t_contour_placement draw_contour;
|
---|
122 | extern TBOOLEAN label_contours;
|
---|
123 |
|
---|
124 | extern TBOOLEAN draw_surface;
|
---|
125 |
|
---|
126 | /* is hidden3d display wanted? */
|
---|
127 | extern TBOOLEAN hidden3d;
|
---|
128 |
|
---|
129 | extern float surface_rot_z;
|
---|
130 | extern float surface_rot_x;
|
---|
131 | extern float surface_scale;
|
---|
132 | extern float surface_zscale;
|
---|
133 |
|
---|
134 | extern float ticslevel;
|
---|
135 |
|
---|
136 | #define ISO_SAMPLES 10 /* default number of isolines per splot */
|
---|
137 | extern int iso_samples_1;
|
---|
138 | extern int iso_samples_2;
|
---|
139 |
|
---|
140 | #ifdef USE_MOUSE
|
---|
141 | extern int axis3d_o_x, axis3d_o_y, axis3d_x_dx, axis3d_x_dy, axis3d_y_dx, axis3d_y_dy;
|
---|
142 | #endif
|
---|
143 |
|
---|
144 | /* Prototypes from file "graph3d.c" */
|
---|
145 |
|
---|
146 | void do_3dplot (struct surface_points *plots, int pcount, int quick);
|
---|
147 | void map3d_position (struct position * pos, unsigned int *x,
|
---|
148 | unsigned int *y, const char *what);
|
---|
149 |
|
---|
150 |
|
---|
151 | #endif /* GNUPLOT_GRAPH3D_H */
|
---|