Code

Connector tool: make connectors avoid the convex hull of shapes.
[inkscape.git] / src / selection.h
index f02aeb456725e951382625b077d9e6d8b14b8f42..ecb1ef45e5399780cbe4812bf52a1bb18b6517ce 100644 (file)
@@ -21,7 +21,7 @@
 #include <list>
 #include <sigc++/sigc++.h>
 
-#include "libnr/nr-rect.h"
+//#include "libnr/nr-rect.h"
 #include "libnr/nr-convex-hull.h"
 #include "forward.h"
 #include "gc-managed.h"
@@ -30,6 +30,7 @@
 #include "gc-soft-ptr.h"
 #include "util/list.h"
 #include "sp-item.h"
+#include "snapped-point.h"
 
 class SPItem;
 class SPBox3D;
@@ -57,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<>,
@@ -243,13 +244,13 @@ public:
     /** @brief Returns the bounding rectangle of the selection */
     NRRect *bounds(NRRect *dest, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
     /** @brief Returns the bounding rectangle of the selection */
-    boost::optional<NR::Rect> bounds(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) 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, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
 
     /**
@@ -257,24 +258,24 @@ public:
      *
      * \todo how is this different from bounds()?
      */
-    boost::optional<NR::Rect> boundsInDocument(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
+    Geom::OptRect boundsInDocument(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
 
     /**
      * @brief Returns the rotation/skew center of the selection
      */
-    boost::optional<NR::Point> center() const;
+    boost::optional<Geom::Point> center() const;
 
     /**
      * @brief Gets the selection's snap points.
      * @return Selection's snap points
      */
-    std::vector<NR::Point> getSnapPoints(bool includeItemCenter) const;
+    std::vector<std::pair<Geom::Point, int> > 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<NR::Point> getSnapPointsConvexHull() const;
+    std::vector<std::pair<Geom::Point, int> > getSnapPointsConvexHull(SnapPreferences const *snapprefs) const;
 
     /**
      * @brief Connects a slot to be notified of selection changes
@@ -291,8 +292,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