Code

Pot and Dutch translation update
[inkscape.git] / src / box3d.h
1 #ifndef __SP_BOX3D_H__
2 #define __SP_BOX3D_H__
4 /*
5  * SVG <box3d> implementation
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *   Maximilian Albert <Anhalter42@gmx.de>
10  *
11  * Copyright (C) 2007      Authors
12  * Copyright (C) 1999-2002 Lauris Kaplinski
13  * Copyright (C) 2000-2001 Ximian, Inc.
14  *
15  * Released under GNU GPL, read the file 'COPYING' for more information
16  */
18 #include "sp-item-group.h"
19 #include "proj_pt.h"
20 #include "axis-manip.h"
22 #define SP_TYPE_BOX3D            (box3d_get_type ())
23 #define SP_BOX3D(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_BOX3D, SPBox3D))
24 #define SP_BOX3D_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_BOX3D, Box3DClass))
25 #define SP_IS_BOX3D(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_BOX3D))
26 #define SP_IS_BOX3D_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_BOX3D))
28 class Box3DSide;
29 class Persp3D;
30 class Persp3DReference;
32 struct SPBox3D : public SPGroup {
33     gint z_orders[6]; // z_orders[i] holds the ID of the face at position #i in the group (from top to bottom)
35     gchar *persp_href;
36     Persp3DReference *persp_ref;
38     Proj::Pt3 orig_corner0;
39     Proj::Pt3 orig_corner7;
41     Proj::Pt3 save_corner0;
42     Proj::Pt3 save_corner7;
44     Box3D::Axis swapped; // to indicate which coordinates are swapped during dragging
46     gint my_counter; // for debugging only
47 };
49 struct SPBox3DClass {
50     SPGroupClass parent_class;
51 };
53 GType box3d_get_type (void);
55 void box3d_position_set (SPBox3D *box);
56 Proj::Pt3 box3d_get_proj_corner (SPBox3D const *box, guint id);
57 Geom::Point box3d_get_corner_screen (SPBox3D const *box, guint id, bool item_coords = true);
58 Proj::Pt3 box3d_get_proj_center (SPBox3D *box);
59 Geom::Point box3d_get_center_screen (SPBox3D *box);
61 void box3d_set_corner (SPBox3D *box, guint id, Geom::Point const &new_pos, Box3D::Axis movement, bool constrained);
62 void box3d_set_center (SPBox3D *box, Geom::Point const &new_pos, Geom::Point const &old_pos, Box3D::Axis movement, bool constrained);
63 void box3d_corners_for_PLs (const SPBox3D * box, Proj::Axis axis, Geom::Point &corner1, Geom::Point &corner2, Geom::Point &corner3, Geom::Point &corner4);
64 bool box3d_recompute_z_orders (SPBox3D *box);
65 void box3d_set_z_orders (SPBox3D *box);
67 int box3d_pt_lies_in_PL_sector (SPBox3D const *box, Geom::Point const &pt, int id1, int id2, Box3D::Axis axis);
68 int box3d_VP_lies_in_PL_sector (SPBox3D const *box, Proj::Axis vpdir, int id1, int id2, Box3D::Axis axis);
70 void box3d_relabel_corners(SPBox3D *box);
71 void box3d_check_for_swapped_coords(SPBox3D *box);
73 std::list<SPBox3D *> box3d_extract_boxes(SPObject *obj);
75 Persp3D *box3d_get_perspective(SPBox3D const *box);
76 void box3d_switch_perspectives(SPBox3D *box, Persp3D *old_persp, Persp3D *new_persp, bool recompute_corners = false);
78 SPGroup *box3d_convert_to_group(SPBox3D *box);
81 #endif /* __SP_BOX3D_H__ */
83 /*
84   Local Variables:
85   mode:c++
86   c-file-style:"stroustrup"
87   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
88   indent-tabs-mode:nil
89   fill-column:99
90   End:
91 */
92 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :