1 /*
2  * gog-xyz.h
3  *
4  * Copyright (C) 2004-2007 Jean Brefort (jean.brefort@normalesup.org)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) version 3.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
19  * USA
20  */
21 
22 #ifndef GOG_XYZ_H
23 #define GOG_XYZ_H
24 
25 #include <goffice/graph/gog-plot-impl.h>
26 
27 G_BEGIN_DECLS
28 
29 /*-----------------------------------------------------------------------------
30  *
31  * GogContourPlot
32  *
33  *-----------------------------------------------------------------------------
34  */
35 
36 typedef struct {
37 	GogPlot	base;
38 
39 	unsigned rows, columns;
40 	gboolean transposed;
41 	gboolean data_xyz;
42 	gboolean auto_x, auto_y; /* automatic limits for xyz plots */
43 	struct {
44 		double minima, maxima;
45 		GOFormat const *fmt;
46 		GODateConventions const *date_conv;
47 	} x, y, z;
48 	double *plotted_data;
49 	GOData *x_vals, *y_vals;
50 } GogXYZPlot;
51 
52 #define GOG_TYPE_XYZ_PLOT	(gog_xyz_plot_get_type ())
53 #define GOG_XYZ_PLOT(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_TYPE_XYZ_PLOT, GogXYZPlot))
54 #define GOG_IS_PLOT_XYZ(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_TYPE_XYZ_PLOT))
55 
56 GType gog_xyz_plot_get_type (void);
57 
58 typedef struct {
59 	GogPlotClass	base;
60 
61 	GogAxisType third_axis;
62 
63 	double * (*build_matrix) (GogXYZPlot *plot, gboolean *cardinality_changed);
64 	GOData * (*get_x_vals) (GogXYZPlot *plot);
65 	GOData * (*get_y_vals) (GogXYZPlot *plot);
66 } GogXYZPlotClass;
67 
68 #define GOG_XYZ_PLOT_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GOG_TYPE_XYZ_PLOT, GogXYZPlotClass))
69 
70 double *gog_xyz_plot_build_matrix (GogXYZPlot *plot, gboolean *cardinality_changed);
71 GOData *gog_xyz_plot_get_x_vals (GogXYZPlot *plot);
72 GOData *gog_xyz_plot_get_y_vals (GogXYZPlot *plot);
73 
74 typedef struct {
75 	GogSeries base;
76 
77 	unsigned rows, columns;
78 } GogXYZSeries;
79 typedef GogSeriesClass GogXYZSeriesClass;
80 
81 #define GOG_TYPE_XYZ_SERIES	(gog_xyz_series_get_type ())
82 #define GOG_XYZ_SERIES(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_TYPE_XYZ_SERIES, GogXYZSeries))
83 #define GOG_IS_XYZ_SERIES(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_TYPE_XYZ_SERIES))
84 
85 GType gog_xyz_series_get_type (void);
86 
87 G_END_DECLS
88 
89 #endif /* GOG_XYZ_H */
90