Code

1fb8280eed9ae4acfbc94974cb0ccfb833137897
[inkscape.git] / src / box3d.h
1 #ifndef __SP_3DBOX_H__
2 #define __SP_3DBOX_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 "inkscape.h"
19 #include "perspective-line.h"
21 #include "sp-item-group.h"
22 #include "sp-path.h"
23 #include "xml/document.h"
24 #include "xml/repr.h"
25 #include "line-geometry.h"
26 #include "box3d-face.h"
29 #define SP_TYPE_3DBOX            (sp_3dbox_get_type ())
30 #define SP_3DBOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_3DBOX, SP3DBox))
31 #define SP_3DBOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_3DBOX, SP3DBoxClass))
32 #define SP_IS_3DBOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_3DBOX))
33 #define SP_IS_3DBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_3DBOX))
36 struct SP3DBox : public SPGroup {
37     NR::Point corners[8];
38     Box3DFace *faces[6];
39 };
41 struct SP3DBoxClass {
42         SPGroupClass parent_class;
43 };
45 GType sp_3dbox_get_type (void);
47 void sp_3dbox_position_set (SP3DBoxContext &bc);
48 void sp_3dbox_recompute_corners (SP3DBox *box, NR::Point const pt1, NR::Point const pt2, NR::Point const pt3);
49 void sp_3dbox_update_curves (SP3DBox *box);
50 void sp_3dbox_move_corner_in_XY_plane (SP3DBox *box, guint id, NR::Point pt);
51 void sp_3dbox_move_corner_in_constrained_Z_direction (SP3DBox *box, guint id, NR::Point pt);
53 inline NR::Point sp_3dbox_get_corner (SP3DBox *box, guint id) { return box->corners[id]; }
55 #endif