summaryrefslogtreecommitdiffstats
path: root/src/box3d-side.h
blob: 49273305b7d7888e026e4edee009e11cb27501b1 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef SEEN_BOX3D_SIDE_H
#define SEEN_BOX3D_SIDE_H

/*
 * 3D box face implementation
 *
 * Authors:
 *   Maximilian Albert <Anhalter42@gmx.de>
 *   Abhishek Sharma
 *
 * Copyright (C) 2007  Authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#include "sp-polygon.h"
#include "axis-manip.h"

#define SP_TYPE_BOX3D_SIDE            (box3d_side_get_type ())
#define SP_BOX3D_SIDE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_BOX3D_SIDE, Box3DSide))
#define SP_BOX3D_SIDE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_BOX3D_SIDE, Box3DSideClass))
#define SP_IS_BOX3D_SIDE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_BOX3D_SIDE))
#define SP_IS_BOX3D_SIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_BOX3D_SIDE))

class SPBox3D;
class Box3DSide;
class Box3DSideClass;
class CBox3DSide;
class Persp3D;

// FIXME: Would it be better to inherit from SPPath instead?
class Box3DSide : public SPPolygon {
public:
	CBox3DSide* cbox3dside;

    Box3D::Axis dir1;
    Box3D::Axis dir2;
    Box3D::FrontOrRear front_or_rear;
    int getFaceId();
    static Box3DSide * createBox3DSide(SPBox3D *box);
};

struct Box3DSideClass {
    SPPolygonClass parent_class;
};


class CBox3DSide : public CPolygon {
public:
	CBox3DSide(Box3DSide* box3dside);
	virtual ~CBox3DSide();

	virtual void onBuild(SPDocument* doc, Inkscape::XML::Node* repr);
	virtual void onSet(unsigned int key, gchar const* value);
	virtual Inkscape::XML::Node* onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
	virtual void onUpdate(SPCtx *ctx, guint flags);

	virtual void onSetShape();

protected:
	Box3DSide* spbox3dside;
};


GType box3d_side_get_type (void);

void box3d_side_position_set (Box3DSide *side); // FIXME: Replace this by box3d_side_set_shape??

gchar *box3d_side_axes_string(Box3DSide *side);

Persp3D *box3d_side_perspective(Box3DSide *side);


Inkscape::XML::Node *box3d_side_convert_to_path(Box3DSide *side);

#endif // SEEN_BOX3D_SIDE_H

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :