1
#ifndef __SP_BOX3D_CONTEXT_H__
2
#define __SP_BOX3D_CONTEXT_H__
5
* 3D box drawing context
8
* Lauris Kaplinski <lauris@kaplinski.com>
10
* Copyright (C) 2000 Lauris Kaplinski
11
* Copyright (C) 2000-2001 Ximian, Inc.
12
* Copyright (C) 2002 Lauris Kaplinski
13
* Copyright (C) 2007 Maximilian Albert <Anhalter42@gmx.de>
15
* Released under GNU GPL
18
#include <sigc++/sigc++.h>
19
#include "event-context.h"
21
#include "vanishing-point.h"
23
#define SP_TYPE_BOX3D_CONTEXT (sp_box3d_context_get_type ())
24
#define SP_BOX3D_CONTEXT(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_BOX3D_CONTEXT, Box3DContext))
25
#define SP_BOX3D_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_BOX3D_CONTEXT, Box3DContextClass))
26
#define SP_IS_BOX3D_CONTEXT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_BOX3D_CONTEXT))
27
#define SP_IS_BOX3D_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_BOX3D_CONTEXT))
30
class Box3DContextClass;
32
struct Box3DContext : public SPEventContext {
37
* save three corners while dragging:
38
* 1) the starting point (already done by the event_context)
39
* 2) drag_ptB --> the opposite corner of the front face (before pressing shift)
40
* 3) drag_ptC --> the "extruded corner" (which coincides with the mouse pointer location
41
* if we are ctrl-dragging but is constrained to the perspective line from drag_ptC
42
* to the vanishing point Y otherwise)
44
Geom::Point drag_origin;
48
Proj::Pt3 drag_origin_proj;
49
Proj::Pt3 drag_ptB_proj;
50
Proj::Pt3 drag_ptC_proj;
52
bool ctrl_dragged; /* whether we are ctrl-dragging */
53
bool extruded; /* whether shift-dragging already occured (i.e. the box is already extruded) */
55
Box3D::VPDrag * _vpdrag;
57
sigc::connection sel_changed_connection;
59
Inkscape::MessageContext *_message_context;
62
struct Box3DContextClass {
63
SPEventContextClass parent_class;
66
/* Standard Gtk function */
68
GtkType sp_box3d_context_get_type (void);
70
void sp_box3d_context_update_lines(SPEventContext *ec);
72
#endif /* __SP_BOX3D_CONTEXT_H__ */
77
c-file-style:"stroustrup"
78
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
83
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :