1 #ifndef SP_CANVAS_AXONOMGRID_H
2 #define SP_CANVAS_AXONOMGRID_H
4 /*
5 * SPCAxonomGrid
6 *
7 * Generic (and quite unintelligent) modified copy of the grid item for gnome canvas
8 *
9 * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
10 * Copyright (C) 2000 Lauris Kaplinski 2000
11 *
12 */
14 #include <display/sp-canvas.h>
15 #include <libnr/nr-coord.h>
18 #define SP_TYPE_CAXONOMGRID (sp_caxonomgrid_get_type ())
19 #define SP_CAXONOMGRID(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CAXONOMGRID, SPCAxonomGrid))
20 #define SP_CAXONOMGRID_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_CAXONOMGRID, SPCAxonomGridClass))
21 #define SP_IS_CAXONOMGRID(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CAXONOMGRID))
22 #define SP_IS_CAXONOMGRID_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CAXONOMGRID))
25 /** \brief All the variables that are tracked for a axonometric grid specific
26 canvas item. */
27 struct SPCAxonomGrid : public SPCanvasItem{
28 NR::Point origin; /**< Origin of the grid */
29 double lengthy; /**< The lengths of the primary y-axis */
30 double angle_deg[3]; /**< Angle of each axis (note that angle[2] == 0) */
31 double angle_rad[3]; /**< Angle of each axis (note that angle[2] == 0) */
32 double tan_angle[3]; /**< tan(angle[.]) */
33 guint32 color; /**< Color for normal lines */
34 guint32 empcolor; /**< Color for emphasis lines */
35 gint empspacing; /**< Spacing between emphasis lines */
36 bool scaled; /**< Whether the grid is in scaled mode */
38 NR::Point ow; /**< Transformed origin by the affine for the zoom */
39 double lyw; /**< Transformed length y by the affine for the zoom */
40 double lxw_x;
41 double lxw_z;
42 double spacing_ylines;
44 NR::Point sw; /**< the scaling factors of the affine transform */
45 };
47 struct SPCAxonomGridClass {
48 SPCanvasItemClass parent_class;
49 };
52 /* Standard Gtk function */
53 GtkType sp_caxonomgrid_get_type (void);
57 #endif