box3d.h revision 6bbadb7dace9a9325f05c20ab8401ef71e857c10
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * SVG <box3d> implementation
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Lauris Kaplinski <lauris@kaplinski.com>
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Maximilian Albert <Anhalter42@gmx.de>
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Abhishek Sharma
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Copyright (C) 2007 Authors
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Copyright (C) 1999-2002 Lauris Kaplinski
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Copyright (C) 2000-2001 Ximian, Inc.
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Released under GNU GPL, read the file 'COPYING' for more information
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński#define SP_IS_BOX3D(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPBox3D)))
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński gint z_orders[6]; // z_orders[i] holds the ID of the face at position #i in the group (from top to bottom)
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński Box3D::Axis swapped; // to indicate which coordinates are swapped during dragging
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński * Create a SPBox3D and append it to the parent.
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński static SPBox3D * createBox3D(SPItem * parent);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński virtual void build(SPDocument *document, Inkscape::XML::Node *repr);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński virtual void set(unsigned int key, gchar const* value);
ef494f75ca77f36881ad59e94263a07c146c3649Krzysztof Kosiński virtual void update(SPCtx *ctx, guint flags);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosiński virtual Geom::Affine set_transform(Geom::Affine const &transform);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof KosińskiProj::Pt3 box3d_get_proj_corner (SPBox3D const *box, guint id);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof KosińskiGeom::Point box3d_get_corner_screen (SPBox3D const *box, guint id, bool item_coords = true);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof KosińskiProj::Pt3 box3d_get_proj_center (SPBox3D *box);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof KosińskiGeom::Point box3d_get_center_screen (SPBox3D *box);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskivoid box3d_set_corner (SPBox3D *box, guint id, Geom::Point const &new_pos, Box3D::Axis movement, bool constrained);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskivoid box3d_set_center (SPBox3D *box, Geom::Point const &new_pos, Geom::Point const &old_pos, Box3D::Axis movement, bool constrained);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskivoid box3d_corners_for_PLs (const SPBox3D * box, Proj::Axis axis, Geom::Point &corner1, Geom::Point &corner2, Geom::Point &corner3, Geom::Point &corner4);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskibool box3d_recompute_z_orders (SPBox3D *box);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskiint box3d_pt_lies_in_PL_sector (SPBox3D const *box, Geom::Point const &pt, int id1, int id2, Box3D::Axis axis);
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosińskiint box3d_VP_lies_in_PL_sector (SPBox3D const *box, Proj::Axis vpdir, int id1, int id2, Box3D::Axis axis);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskivoid box3d_check_for_swapped_coords(SPBox3D *box);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof Kosińskistd::list<SPBox3D *> box3d_extract_boxes(SPObject *obj);
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof KosińskiPersp3D *box3d_get_perspective(SPBox3D const *box);
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosińskivoid box3d_switch_perspectives(SPBox3D *box, Persp3D *old_persp, Persp3D *new_persp, bool recompute_corners = false);
40742313779ee5e43be93a9191f1c86412cf183bKrzysztof KosińskiSPGroup *box3d_convert_to_group(SPBox3D *box);
ef494f75ca77f36881ad59e94263a07c146c3649Krzysztof Kosiński#endif // SEEN_SP_BOX3D_H
ef494f75ca77f36881ad59e94263a07c146c3649Krzysztof Kosiński Local Variables:
ef494f75ca77f36881ad59e94263a07c146c3649Krzysztof Kosiński c-file-style:"stroustrup"
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosiński c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosiński indent-tabs-mode:nil
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosiński fill-column:99
d6519bf53baba32bd74436ad9c85f1fa2c6b6ae9Krzysztof Kosiński// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :