2 * $Id: pm3d.h,v 1.26 2006/06/15 15:42:33 sfeam Exp $
9 * Petr Mikulik, since December 1998
10 * Copyright: open source as much as possible
13 * What is here: #defines, global variables and declaration of routines for
14 * the pm3d plotting mode
19 /* avoid multiple includes */
29 #include "graph3d.h" /* struct surface_points */
34 Global options for pm3d algorithm (to be accessed by set / show)
37 /* HBB NEW 20040311: setting this to 0 removes the pm3d option
38 * {transparent|solid} --- it's a duplicate of 'set grid front' */
39 #ifndef PM3D_HAVE_SOLID
40 # define PM3D_HAVE_SOLID 0
44 where to plot pm3d: base or top (color map) or surface (color surface)
45 The string pm3d.where can be any combination of the #defines below.
46 For instance, "b" plot at botton only, "st" plots firstly surface, then top, etc.
48 #define PM3D_AT_BASE 'b'
49 #define PM3D_AT_TOP 't'
50 #define PM3D_AT_SURFACE 's'
53 options for flushing scans (for pm3d.flush)
54 Note: new terminology compared to my pm3d program; in gnuplot it became
55 begin and right instead of left and right
57 #define PM3D_FLUSH_BEGIN 'b'
58 #define PM3D_FLUSH_END 'r'
59 #define PM3D_FLUSH_CENTER 'c'
62 direction of taking the scans: forward = as the scans are stored in the
63 file; backward = opposite direction, i.e. like from the end of the file
65 #define PM3D_SCANS_AUTOMATIC 'a'
66 #define PM3D_SCANS_FORWARD 'f'
67 #define PM3D_SCANS_BACKWARD 'b'
68 #define PM3D_DEPTH 'd'
72 PM3D_CLIP_1IN: all 4 points of the quadrangle must be defined and at least
73 1 point of the quadrangle must be in the x and y ranges
74 PM3D_CLIP_4IN: all 4 points of the quadrangle must be in the x and y ranges
76 #define PM3D_CLIP_1IN '1'
77 #define PM3D_CLIP_4IN '4'
80 is pm3d plotting style implicit or explicit?
88 from which corner take the color?
91 /* keep the following order of PM3D_WHICHCORNER_C1 .. _C4 */
92 PM3D_WHICHCORNER_C1 = 0, /* corner 1: first scan, first point */
93 PM3D_WHICHCORNER_C2 = 1, /* corner 2: first scan, second point */
94 PM3D_WHICHCORNER_C3 = 2, /* corner 3: second scan, first point */
95 PM3D_WHICHCORNER_C4 = 3, /* corner 4: second scan, second point */
96 /* now in any order */
97 PM3D_WHICHCORNER_MEAN = 4, /* average z-value from all 4 corners */
98 PM3D_WHICHCORNER_GEOMEAN = 5, /* geometrical mean of 4 corners */
99 PM3D_WHICHCORNER_MEDIAN = 6, /* median of 4 corners */
100 PM3D_WHICHCORNER_MIN = 7, /* minimum of 4 corners */
101 PM3D_WHICHCORNER_MAX = 8 /* maximum of 4 corners */
102 } PM3D_WHICH_CORNERS2COLOR;
105 structure defining all properties of pm3d plotting mode
106 (except for the properties of the smooth color box, see color_box instead)
109 char where[7]; /* base, top, surface */
110 char flush; /* left, right, center */
111 char ftriangles; /* 0/1 (don't) draw flushing triangles */
112 char direction; /* forward, backward */
113 char clip; /* 1in, 4in */
114 int hidden3d_tag; /* if this is > 0, pm3d hidden lines are drawn with
115 this linestyle (which must naturally present). */
117 int solid; /* if this is != 0, border tics and labels might be
118 hidden by the surface */
120 PM3D_IMPL_MODE implicit;
121 /* 1: [default] draw ALL surfaces with pm3d
122 0: only surfaces specified with 'with pm3d' */
123 PM3D_WHICH_CORNERS2COLOR which_corner_color;
124 /* default: average color from all 4 points */
125 int interp_i; /* # of interpolation steps along scanline */
126 int interp_j; /* # of interpolation steps between scanlines */
130 extern pm3d_struct pm3d;
134 Declaration of routines
137 int get_pm3d_at_option __PROTO((char *pm3d_where));
138 void pm3d_depth_queue_clear __PROTO((void));
139 void pm3d_depth_queue_flush __PROTO((void));
140 void pm3d_reset __PROTO((void));
141 void pm3d_draw_one __PROTO((struct surface_points* plots));
142 double z2cb __PROTO((double z));
143 double cb2gray __PROTO((double cb));
145 pm3d_rearrange_scan_array __PROTO((struct surface_points* this_plot,
146 struct iso_curve*** first_ptr, int* first_n, int* first_invert,
147 struct iso_curve*** second_ptr, int* second_n, int* second_invert));
149 void set_plot_with_palette __PROTO((int plot_num, int plot_mode));
151 TBOOLEAN is_plot_with_palette __PROTO((void));
152 TBOOLEAN is_plot_with_colorbox __PROTO((void));
156 #endif /* TERM_HELP */