X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fselection.h;h=9ac49ae12c698ec51c9427b00cd57734038c597e;hb=a2000ef431355d36b8d856b79add9c2fa7550e02;hp=bae368e8149461633866d43967deec77247e35a6;hpb=5e8a08857af3a55929109a0e6eaf5a149b4b6e1c;p=inkscape.git diff --git a/src/selection.h b/src/selection.h index bae368e81..9ac49ae12 100644 --- a/src/selection.h +++ b/src/selection.h @@ -18,9 +18,10 @@ #include #include +#include #include -#include "libnr/nr-rect.h" +//#include "libnr/nr-rect.h" #include "libnr/nr-convex-hull.h" #include "forward.h" #include "gc-managed.h" @@ -28,8 +29,12 @@ #include "gc-anchored.h" #include "gc-soft-ptr.h" #include "util/list.h" +#include "sp-item.h" +#include "snapped-point.h" class SPItem; +class SPBox3D; +class Persp3D; namespace Inkscape { namespace XML { @@ -53,7 +58,7 @@ namespace Inkscape { * at the given desktop. Both SPItem and SPRepr lists can be retrieved * from the selection. Many actions operate on the selection, so it is * widely used throughout the code. - * It also implements its own asynchronous notification signals that + * It also implements its own asynchronous notification signals that * UI elements can listen to. */ class Selection : public Inkscape::GC::Managed<>, @@ -71,7 +76,7 @@ public: ~Selection(); /** - * @brief Returns the desktop the seoection is bound to + * @brief Returns the desktop the selection is bound to * * @return the desktop the selection is bound to */ @@ -224,6 +229,15 @@ public: /// method for that GSList const *reprList(); + /** @brief Returns a list of all perspectives which have a 3D box in the current selection + (these may also be nested in groups) */ + std::list const perspList(); + + /** @brief Returns a list of all 3D boxes in the current selection which are associated to @c + persp. If @c pers is @c NULL, return all selected boxes. + */ + std::list const box3DList(Persp3D *persp = NULL); + /** @brief Returns the number of layers in which there are selected objects */ guint numberOfLayers(); @@ -231,52 +245,42 @@ public: guint numberOfParents(); /** @brief Returns the bounding rectangle of the selection */ - NRRect *bounds(NRRect *dest) const; + NRRect *bounds(NRRect *dest, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const; /** @brief Returns the bounding rectangle of the selection */ - ::NR::Rect bounds() const; + Geom::OptRect bounds(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const; /** * @brief Returns the bounding rectangle of the selection * - * \todo how is this different from bounds()? - */ - NRRect *boundsInDocument(NRRect *dest) const; + * Gives the coordinates in internal format, does not match onscreen guides. + * (0,0 is the upper left corner, not the lower left corner) + */ + NRRect *boundsInDocument(NRRect *dest, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const; /** * @brief Returns the bounding rectangle of the selection * - * \todo how is this different from bounds()? + * Gives the coordinates in internal format, does not match onscreen guides. + * (0,0 is the upper left corner, not the lower left corner) */ - ::NR::Rect boundsInDocument() const; + Geom::OptRect boundsInDocument(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const; /** * @brief Returns the rotation/skew center of the selection */ - ::NR::Point center() const; + boost::optional center() const; /** * @brief Gets the selection's snap points. * @return Selection's snap points */ - std::vector getSnapPoints() const; + std::vector getSnapPoints(SnapPreferences const *snapprefs) const; /** * @brief Gets the snap points of a selection that form a convex hull. * @return Selection's convex hull points */ - std::vector getSnapPointsConvexHull() const; - - /** - * @return A vector containing the top-left and bottom-right - * corners of each selected object's bounding box. - */ - std::vector getBBoxPoints() const; - - /** - * @return A vector containing the 2 (bottom-left and upper-right) - * corners of the selection bounding box. - */ - std::vector getBBoxPointsOuter() const; + std::vector getSnapPointsConvexHull(SnapPreferences const *snapprefs) const; /** * @brief Connects a slot to be notified of selection changes @@ -293,8 +297,8 @@ public: } /** - * @brief Connects a slot to be notified of selected - * object modifications + * @brief Connects a slot to be notified of selected + * object modifications * * This method connects the given slot such that it will * receive notifications whenever any selected item is @@ -347,6 +351,13 @@ private: mutable GSList *_reprs; mutable GSList *_items; + void add_box_perspective(SPBox3D *box); + void add_3D_boxes_recursively(SPObject *obj); + void remove_box_perspective(SPBox3D *box); + void remove_3D_boxes_recursively(SPObject *obj); + + std::list _3dboxes; + GC::soft_ptr _desktop; SPObject* _selection_context; guint _flags; @@ -372,4 +383,4 @@ private: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :