Code

Node tool: fix handle retraction with non-cusp nodes
[inkscape.git] / src / conn-avoid-ref.h
index 29c7e69b3e6bc65ac9c83fc7e562f47a74e941fc..5dff8dd381dcde6fcff5db0f54a0f7491e35cf18 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef SEEN_CONN_AVOID_REF
 #define SEEN_CONN_AVOID_REF
 
-/*
+/** \file
  * A class for handling shape interaction with libavoid.
- *
+ */
+/*
  * Authors:
  *   Michael Wybrow <mjwybrow@users.sourceforge.net>
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
-
+#include <glib/gslist.h>
 #include <sigc++/connection.h>
 
+struct SPDesktop;
 struct SPItem;
-namespace Avoid {
-    class ShapeRef;
-}
+struct ConnectionPoint;
+typedef std::map<int, ConnectionPoint> IdConnectionPointMap;
+namespace Avoid { class ShapeRef; }
 
 class SPAvoidRef {
 public:
@@ -28,9 +30,16 @@ public:
     // libavoid's internal representation of the item.
     Avoid::ShapeRef *shapeRef;
 
+    // Used for holding connection points for item
+    IdConnectionPointMap connection_points;
+
     void setAvoid(char const *value);
+    void setConnectionPoints(gchar const *value);
+    void addConnectionPoint(ConnectionPoint &cp);
+    void updateConnectionPoint(ConnectionPoint &cp);
+    void deleteConnectionPoint(ConnectionPoint &cp);
     void handleSettingChange(void);
-    
+
     // Returns a list of SPItems of all connectors/shapes attached to
     // this object.  Pass one of the following for 'type':
     //     Avoid::runningTo
@@ -38,6 +47,9 @@ public:
     //     Avoid::runningToAndFrom
     GSList *getAttachedShapes(const unsigned int type);
     GSList *getAttachedConnectors(const unsigned int type);
+    Geom::Point getConnectionPointPos(const int type, const int id);
+
+    bool isValidConnPointId( const int type, const int id );
 
 private:
     SPItem *item;
@@ -48,14 +60,16 @@ private:
 
     // A sigc connection for transformed signal.
     sigc::connection _transformed_connection;
+    void setConnectionPointsAttrUndoable(const gchar* value, const gchar* action);
 };
 
 extern GSList *get_avoided_items(GSList *list, SPObject *from,
         SPDesktop *desktop, bool initialised = true);
-extern void avoid_item_move(NR::Matrix const *mp, SPItem *moved_item);
+extern void avoid_item_move(Geom::Matrix const *mp, SPItem *moved_item);
 extern void init_avoided_shape_geometry(SPDesktop *desktop);
 
 static const double defaultConnSpacing = 3.0;
+static const double defaultConnCurvature = 3.0;
 
 #endif /* !SEEN_CONN_AVOID_REF */