Code

0e911cccfdbe84a1d18878ac63586d47767441e7
[inkscape.git] / src / box3d-face.h
1 #ifndef __SP_3DBOX_FACE_H__
2 #define __SP_3DBOX_FACE_H__
4 /*
5  * Face of a 3D box ('perspectivic rectangle')
6  *
7  * Authors:
8  *   Maximilian Albert <Anhalter42@gmx.de>
9  *
10  * Copyright (C) 2007      Authors
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #include "perspective-line.h"
16 #include "display/curve.h"
17 #include "sp-path.h"
18 #include "sp-object.h"
19 #include "inkscape.h"
20 #include "desktop-style.h"
21 #include "desktop.h"
22 #include "xml/document.h"
24 class SP3DBox;
26 class Box3DFace {
27 public:
28     Box3DFace(SP3DBox *box, NR::Point &A, NR::Point &B, NR::Point &C, NR::Point &D,
29                             Box3D::Axis plane, Box3D::FrontOrRear rel_pos);
30     Box3DFace(Box3DFace const &box3dface);
31     ~Box3DFace();
33     NR::Point operator[](unsigned int i);
34     void draw(SP3DBox *box3d, SPCurve *c);
36     /***
37     void set_shape(NR::Point const ul, NR::Point const lr,
38                    Box3D::Axis const dir1, Box3D::Axis const dir2,
39                    unsigned int shift_count = 0, NR::Maybe<NR::Point> pt_align = NR::Nothing(),
40                    bool align_along_PL = false);
41     ***/
42     void set_corners (NR::Point &A, NR::Point &B, NR::Point &C, NR::Point &D);
43     void set_face (NR::Point const A, NR::Point const C, Box3D::Axis const dir1, Box3D::Axis const dir2);
44     
45     void hook_path_to_3dbox(SPPath * existing_path = NULL);
46     void set_path_repr();
47     void set_curve();
48     inline void lower_to_bottom() { SP_ITEM (path)->lowerToBottom(); }
49     inline void raise_to_top() { SP_ITEM (path)->raiseToTop(); }
50     gchar * axes_string();
51     gchar * svg_repr_string();
53 private:
54     NR::Point *corners[4];
56     Box3D::Axis dir1;
57     Box3D::Axis dir2;
59     Box3D::FrontOrRear front_or_rear;
60     
61     SPPath *path;
62     SP3DBox *parent_box3d;
63 };
65 #endif