summaryrefslogtreecommitdiffstats
path: root/src/box3d-face.h
blob: d3d83e7026034f3de138f32010298afdafec6b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef __SP_3DBOX_FACE_H__
#define __SP_3DBOX_FACE_H__

/*
 * Face of a 3D box ('perspectivic rectangle')
 *
 * Authors:
 *   Maximilian Albert <Anhalter42@gmx.de>
 *
 * Copyright (C) 2007      Authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#include "perspective-line.h"
#include "display/curve.h"
#include "sp-path.h"
#include "sp-object.h"
#include "inkscape.h"
#include "desktop-style.h"
#include "desktop.h"
#include "xml/document.h"

class SP3DBox;

class Box3DFace {
public:
    Box3DFace(SP3DBox *box, NR::Point &A, NR::Point &B, NR::Point &C, NR::Point &D,
	                    Box3D::Axis plane, Box3D::FrontOrRear rel_pos);
    Box3DFace(Box3DFace const &box3dface);
    ~Box3DFace();

    NR::Point operator[](unsigned int i);
    void draw(SP3DBox *box3d, SPCurve *c);

    /***
    void set_shape(NR::Point const ul, NR::Point const lr,
                   Box3D::Axis const dir1, Box3D::Axis const dir2,
                   unsigned int shift_count = 0, NR::Maybe<NR::Point> pt_align = NR::Nothing(),
                   bool align_along_PL = false);
    ***/
    void set_corners (NR::Point &A, NR::Point &B, NR::Point &C, NR::Point &D);
    //void set_face (NR::Point const A, NR::Point const C, Box3D::Axis const dir1, Box3D::Axis const dir2);
    
    void hook_path_to_3dbox(SPPath * existing_path = NULL);
    void set_path_repr();
    void set_curve();
    inline void lower_to_bottom() { SP_ITEM (path)->lowerToBottom(); }
    inline void raise_to_top() { SP_ITEM (path)->raiseToTop(); }
    gchar * axes_string();
    gchar * svg_repr_string();
    static gint descr_to_id (gchar const *descr);

private:
    NR::Point *corners[4];

    Box3D::Axis dir1;
    Box3D::Axis dir2;

    Box3D::FrontOrRear front_or_rear;
    
    SPPath *path;
    SP3DBox *parent_box3d;
};

#endif