box3d-context.h revision f8307d2d97a6e202153ae676f974f79e1b0ec5cd
2N/A#ifndef __SP_BOX3D_CONTEXT_H__
2N/A#define __SP_BOX3D_CONTEXT_H__
2N/A
2N/A/*
2N/A * 3D box drawing context
2N/A *
2N/A * Author:
2N/A * Lauris Kaplinski <lauris@kaplinski.com>
2N/A *
2N/A * Copyright (C) 2000 Lauris Kaplinski
2N/A * Copyright (C) 2000-2001 Ximian, Inc.
2N/A * Copyright (C) 2002 Lauris Kaplinski
2N/A * Copyright (C) 2007 Maximilian Albert <Anhalter42@gmx.de>
2N/A *
2N/A * Released under GNU GPL
2N/A */
2N/A
2N/A#include <stddef.h>
2N/A#include <sigc++/sigc++.h>
2N/A#include "event-context.h"
2N/A#include "proj_pt.h"
2N/A#include "vanishing-point.h"
2N/A
2N/A#define SP_TYPE_BOX3D_CONTEXT (sp_box3d_context_get_type ())
2N/A#define SP_BOX3D_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_BOX3D_CONTEXT, Box3DContext))
2N/A#define SP_BOX3D_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_BOX3D_CONTEXT, Box3DContextClass))
2N/A#define SP_IS_BOX3D_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_BOX3D_CONTEXT))
2N/A#define SP_IS_BOX3D_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_BOX3D_CONTEXT))
2N/A
2N/Aclass Box3DContext;
2N/Aclass Box3DContextClass;
2N/A
2N/Astruct Box3DContext : public SPEventContext {
2N/A SPItem *item;
2N/A Geom::Point center;
2N/A
2N/A /**
2N/A * save three corners while dragging:
2N/A * 1) the starting point (already done by the event_context)
2N/A * 2) drag_ptB --> the opposite corner of the front face (before pressing shift)
2N/A * 3) drag_ptC --> the "extruded corner" (which coincides with the mouse pointer location
2N/A * if we are ctrl-dragging but is constrained to the perspective line from drag_ptC
2N/A * to the vanishing point Y otherwise)
2N/A */
2N/A Geom::Point drag_origin;
2N/A Geom::Point drag_ptB;
2N/A Geom::Point drag_ptC;
2N/A
2N/A Proj::Pt3 drag_origin_proj;
2N/A Proj::Pt3 drag_ptB_proj;
2N/A Proj::Pt3 drag_ptC_proj;
2N/A
2N/A bool ctrl_dragged; /* whether we are ctrl-dragging */
2N/A bool extruded; /* whether shift-dragging already occured (i.e. the box is already extruded) */
2N/A
2N/A Box3D::VPDrag * _vpdrag;
2N/A
2N/A sigc::connection sel_changed_connection;
2N/A
2N/A Inkscape::MessageContext *_message_context;
2N/A};
2N/A
2N/Astruct Box3DContextClass {
2N/A SPEventContextClass parent_class;
2N/A};
2N/A
2N/A/* Standard Gtk function */
2N/A
2N/AGType sp_box3d_context_get_type (void);
2N/A
2N/Avoid sp_box3d_context_update_lines(SPEventContext *ec);
2N/A
2N/A#endif /* __SP_BOX3D_CONTEXT_H__ */
2N/A
2N/A/*
2N/A Local Variables:
2N/A mode:c++
2N/A c-file-style:"stroustrup"
2N/A c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
2N/A indent-tabs-mode:nil
2N/A fill-column:99
2N/A End:
2N/A*/
2N/A// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
2N/A