Code

Various snapping cleanups and bug fixes.
[inkscape.git] / src / libavoid / graph.h
index d30f394cfe8ad748b0abea56c18a1ae346640d82..92451f2054d2916ef1f8bf6c3bfeedcd7595e38f 100644 (file)
@@ -2,7 +2,7 @@
  * vim: ts=4 sw=4 et tw=0 wm=0
  *
  * libavoid - Fast, Incremental, Object-avoiding Line Router
- * Copyright (C) 2004-2005  Michael Wybrow <mjwybrow@users.sourceforge.net>
+ * Copyright (C) 2004-2006  Michael Wybrow <mjwybrow@users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 #include <list>
 #include <utility>
 using std::pair;
-
 #include "libavoid/vertices.h"
 
-
 namespace Avoid {
 
-
-extern bool UseAStarSearch;
-extern bool IgnoreRegions;
-extern bool SelectiveReroute;
-extern bool IncludeEndpoints;
-extern bool UseLeesAlgorithm;
-extern bool InvisibilityGrph;
-extern bool PartialFeedback;
+class ConnRef;
+class Router;
 
 
 typedef std::list<int> ShapeList;
@@ -53,13 +45,16 @@ class EdgeInf
     public:
         EdgeInf(VertInf *v1, VertInf *v2);
         ~EdgeInf();
-        double getDist(void);
+        inline double getDist(void)
+        {
+            return _dist;
+        }
         void setDist(double dist);
         void alertConns(void);
         void addConn(bool *flag);
         void addCycleBlocker(void);
         void addBlocker(int b);
-        bool hasBlocker(int b);
+
         pair<VertID, VertID> ids(void);
         pair<Point, Point> points(void);
         void db_print(void);
@@ -71,14 +66,15 @@ class EdgeInf
 
         EdgeInf *lstPrev;
         EdgeInf *lstNext;
+        int _blocker;
     private:
+        Router *_router;
         bool _added;
         bool _visible;
         VertInf *_v1;
         VertInf *_v2;
         EdgeInfList::iterator _pos1;
         EdgeInfList::iterator _pos2;
-        ShapeList _blockers;
         FlagList  _conns;
         double  _dist;
 
@@ -104,21 +100,6 @@ class EdgeList
 };
 
 
-extern EdgeList visGraph;
-extern EdgeList invisGraph;
-
-class ShapeRef;
-
-extern void newBlockingShape(Polygn *poly, int pid);
-extern void checkAllBlockedEdges(int pid);
-extern void checkAllMissingEdges(void);
-extern void generateContains(VertInf *pt);
-extern void adjustContainsWithAdd(const Polygn& poly, const int p_shape);
-extern void adjustContainsWithDel(const int p_shape);
-extern void markConnectors(ShapeRef *shape);
-extern void printInfo(void);
-
-
 }