Code

* src/libavoid/connector.cpp, src/libavoid/connector.h,
authormjwybrow <mjwybrow@users.sourceforge.net>
Tue, 24 Jan 2006 05:54:19 +0000 (05:54 +0000)
committermjwybrow <mjwybrow@users.sourceforge.net>
Tue, 24 Jan 2006 05:54:19 +0000 (05:54 +0000)
      src/libavoid/shape.cpp, src/libavoid/graph.cpp,
      src/libavoid/incremental.cpp, src/libavoid/incremental.h,
      src/libavoid/static.cpp, src/libavoid/visibility.cpp,
      src/libavoid/makepath.cpp:

    Some minor upstream libavoid fixes.

ChangeLog
src/libavoid/connector.cpp
src/libavoid/connector.h
src/libavoid/graph.cpp
src/libavoid/incremental.cpp
src/libavoid/incremental.h
src/libavoid/makepath.cpp
src/libavoid/shape.cpp
src/libavoid/static.cpp
src/libavoid/visibility.cpp

index 18df22f3fd8673595a2979cf31b446dd3da65a84..438f94fde54e7559401d6c24f49111c7c83d522b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-01-24  Michael Wybrow  <mjwybrow@users.sourceforge.net>
+
+       * src/libavoid/connector.cpp, src/libavoid/connector.h, 
+         src/libavoid/shape.cpp, src/libavoid/graph.cpp,
+         src/libavoid/incremental.cpp, src/libavoid/incremental.h,
+         src/libavoid/static.cpp, src/libavoid/visibility.cpp, 
+         src/libavoid/makepath.cpp:
+
+       Some minor upstream libavoid fixes.  
+
 2006-01-23  Carl Hetherington  <inkscape@carlh.net>
 
        * src/selection.cpp: fix a typo in one of my previous commits.
@@ -13,9 +23,9 @@
          src/sp-namedview.h, src/attributes.cpp, src/attributes.h,
          src/attributes-test.cpp:
 
-         Added a "Spacing" control to the connector toolbar which allows
-         the user to adjust the amount of space left around avoided shapes
-         for the purpose of determining auto-routing connector paths.
+       Added a "Spacing" control to the connector toolbar which allows
+       the user to adjust the amount of space left around avoided shapes
+       for the purpose of determining auto-routing connector paths.
 
 2006-01-17  Marco Scholten  <mscholtn@xs4all.nl>
 
index cde387c5b5be6443193aa6c2516b8acc8461df13..87009541593c4b8a65be7071e0fd8ad84d05d027 100644 (file)
@@ -32,7 +32,7 @@ namespace Avoid {
 ConnRefList connRefs;
 
 
-ConnRef::ConnRef(const uint id)
+ConnRef::ConnRef(const unsigned int id)
     : _id(id)
     , _needs_reroute_flag(true)
     , _false_path(false)
@@ -50,7 +50,7 @@ ConnRef::ConnRef(const uint id)
 }
 
 
-ConnRef::ConnRef(const uint id, const Point& src, const Point& dst)
+ConnRef::ConnRef(const unsigned int id, const Point& src, const Point& dst)
     : _id(id)
     , _needs_reroute_flag(true)
     , _false_path(false)
@@ -102,16 +102,23 @@ ConnRef::~ConnRef()
     }
 }
 
-void ConnRef::updateEndPoint(const uint type, const Point& point)
+void ConnRef::updateEndPoint(const unsigned int type, const Point& point)
 {
-    assert((type == (uint) VertID::src) || (type == (uint) VertID::tar));
+    assert((type == (unsigned int) VertID::src) ||
+           (type == (unsigned int) VertID::tar));
     //assert(IncludeEndpoints);
 
+    if (!_initialised)
+    {
+        makeActive();
+        _initialised = true;
+    }
+    
     VertInf *altered = NULL;
     VertInf *partner = NULL;
     bool isShape = false;
 
-    if (type == (uint) VertID::src)
+    if (type == (unsigned int) VertID::src)
     {
         if (_srcVert)
         {
@@ -126,7 +133,7 @@ void ConnRef::updateEndPoint(const uint type, const Point& point)
         altered = _srcVert;
         partner = _dstVert;
     }
-    else // if (type == (uint) VertID::dst)
+    else // if (type == (unsigned int) VertID::dst)
     {
         if (_dstVert)
         {
@@ -311,10 +318,10 @@ int ConnRef::generatePath(Point p0, Point p1)
 
     _false_path = false;
     _needs_reroute_flag = false;
-    
+
     VertInf *src = _srcVert;
     VertInf *tar = _dstVert;
-   
+
     if (!IncludeEndpoints)
     {
         lateSetup(p0, p1);
index 6abb01d497e67fdd070b0753b2dd37a18a66cd2d..71713ae414ac61552d5d0b7012b2c1269160eaa5 100644 (file)
@@ -30,8 +30,6 @@
 
 namespace Avoid {
 
-typedef unsigned int uint;
-    
 class ConnRef;
 
 typedef std::list<ConnRef *> ConnRefList;
@@ -40,8 +38,8 @@ typedef std::list<ConnRef *> ConnRefList;
 class ConnRef
 {
     public:
-        ConnRef(const uint id);
-        ConnRef(const uint id, const Point& src, const Point& dst);
+        ConnRef(const unsigned int id);
+        ConnRef(const unsigned int id, const Point& src, const Point& dst);
         ~ConnRef();
         
         PolyLine& route(void);
@@ -49,7 +47,7 @@ class ConnRef
         void moveRoute(const int& diff_x, const int& diff_y);
         void freeRoute(void);
         void calcRouteDist(void);
-        void updateEndPoint(const uint type, const Point& point);
+        void updateEndPoint(const unsigned int type, const Point& point);
         void makeActive(void);
         void makeInactive(void);
         void lateSetup(const Point& src, const Point& dst);
@@ -66,7 +64,7 @@ class ConnRef
         friend void markConnectors(ShapeRef *shape);
 
     private:
-        uint _id;
+        unsigned int _id;
         bool _needs_reroute_flag;
         bool _false_path;
         bool _active;
index 9b1d602bea2cd4b875363289f265cec1c73c2bf4..05b59a79d71b0bc06f3e084fe167ea3f7c96ad5c 100644 (file)
@@ -340,7 +340,7 @@ int EdgeInf::firstBlocker(void)
         VertID kID = k->id;
         if ((ss.find(kID.objID) != ss.end()))
         {
-            uint shapeID = kID.objID;
+            unsigned int shapeID = kID.objID;
             db_printf("Endpoint is inside shape %u so ignore shape edges.\n",
                     kID.objID);
             // One of the endpoints is inside this shape so ignore it.
@@ -914,7 +914,7 @@ void printInfo(void)
     fprintf(fp, "\nVisibility Graph info:\n");
     fprintf(fp, "----------------------\n");
 
-    uint currshape = 0;
+    unsigned int currshape = 0;
     int st_shapes = 0;
     int st_vertices = 0;
     int st_endpoints = 0;
index 3830c70ee91fe2aeca2bb2c5c61adf75f8687aab..f7d48ac70a55efa4cc8fd502617625bbbdd2ff3e 100644 (file)
@@ -29,7 +29,7 @@ namespace Avoid {
 
 void addShape(ShapeRef *shape)
 {
-    uint pid = shape->id();
+    unsigned int pid = shape->id();
     Polygn poly = shape->poly();
     
     adjustContainsWithAdd(poly, pid);
@@ -53,7 +53,7 @@ void addShape(ShapeRef *shape)
 
 void delShape(ShapeRef *shape)
 {
-    uint pid = shape->id();
+    unsigned int pid = shape->id();
 
     // o  Remove entries related to this shape's vertices
     shape->removeFromGraph();
@@ -81,14 +81,14 @@ void delShape(ShapeRef *shape)
 }
 
 
-ShapeRef *moveShape(ShapeRef *oldShape, Polygn *newPoly)
+ShapeRef *moveShape(ShapeRef *oldShape, Polygn *newPoly, const bool first_move)
 {
-    uint pid = oldShape->id();
+    unsigned int pid = oldShape->id();
     
     // o  Remove entries related to this shape's vertices
     oldShape->removeFromGraph();
     
-    if (SelectiveReroute && !(PartialFeedback && PartialTime))
+    if (SelectiveReroute && (!(PartialFeedback && PartialTime) || first_move))
     {
         markConnectors(oldShape);
     }
index 50ef8f7dc374169740dc50e9142e6aa38c566e89..6bc69a6a79179954adf66f502a3d2bcc84c949d3 100644 (file)
@@ -31,7 +31,8 @@ namespace Avoid {
 
 extern void addShape(ShapeRef *shape);
 extern void delShape(ShapeRef *shape);
-extern ShapeRef *moveShape(ShapeRef *oldShape, Polygn *newPoly);
+extern ShapeRef *moveShape(ShapeRef *oldShape, Polygn *newPoly,
+        const bool first_move = false);
 
 }
 
index 776ffd307e681ec2c113121192a36dbdfa4914f6..37b4f18018f4bb3e55aaf6e3a468beb02cc77fb2 100644 (file)
@@ -429,6 +429,10 @@ void makePath(ConnRef *lineRef, bool *flag)
         // each other.  This is true if we are here.
         if (!IncludeEndpoints && InvisibilityGrph)
         {
+            if (!directEdge)
+            {
+                directEdge = new EdgeInf(src, tar);
+            }
             directEdge->addBlocker(0);
         }
 
index b08e75f3ea4b1b7832abdef31bf03c67257a70e8..43195080183e19c5a1365f9a51b7509e95ef5a1c 100644 (file)
@@ -31,7 +31,7 @@ namespace Avoid {
 ShapeRefList shapeRefs;
 
 
-ShapeRef::ShapeRef(uint id, Polygn& ply)
+ShapeRef::ShapeRef(unsigned int id, Polygn& ply)
     : _id(id)
     , _poly(copyPoly(ply))
     , _active(false)
@@ -130,7 +130,7 @@ VertInf *ShapeRef::lastVert(void)
 }
 
 
-uint ShapeRef::id(void)
+unsigned int ShapeRef::id(void)
 {
     return _id;
 }
index d424a2e7f5ac9d94b20a375f206c73fda8c80889..72d3e3b079097a73d328d682b1c4ca417ee9d87c 100644 (file)
@@ -36,7 +36,7 @@ void CreateVisGraph(Polygn **obs, int n_obs)
 {
     for (int poly_i = 0; poly_i < n_obs; poly_i++)
     {
-        uint id = obs[poly_i]->id;
+        unsigned int id = obs[poly_i]->id;
         
         new ShapeRef(id, *(obs[poly_i]));
     }
index e13656f5f8995b55bf0c66f8cbd1ffab6d25fc1b..84e38037d2531f8a8fa3b13931ac622d2b841e58 100644 (file)
@@ -448,7 +448,7 @@ void vertexSweep(VertInf *vert)
         VertID kID = k->id;
         if (!(centerID.isShape) && (ss.find(kID.objID) != ss.end()))
         {
-            uint shapeID = kID.objID;
+            unsigned int shapeID = kID.objID;
             db_printf("Center is inside shape %u so ignore shape edges.\n",
                     shapeID);
             // One of the endpoints is inside this shape so ignore it.