26 #ifndef AVOID_VERTICES_H 27 #define AVOID_VERTICES_H 44 typedef std::list<EdgeInf *> EdgeInfList;
45 typedef std::pair<VertInf *, VertInf *> VertexPair;
48 typedef unsigned short VertIDProps;
59 static const unsigned short src;
60 static const unsigned short tar;
62 static const VertIDProps PROP_ConnPoint;
63 static const VertIDProps PROP_OrthShapeEdge;
64 static const VertIDProps PROP_ConnectionPin;
65 static const VertIDProps PROP_ConnCheckpoint;
66 static const VertIDProps PROP_DummyPinHelper;
69 VertID(
unsigned int id,
unsigned short n, VertIDProps p = 0);
70 VertID(
const VertID& other);
71 VertID& operator= (
const VertID& rhs);
72 bool operator==(
const VertID& rhs)
const;
73 bool operator!=(
const VertID& rhs)
const;
74 bool operator<(
const VertID& rhs)
const;
75 VertID operator+(
const int& rhs)
const;
76 VertID operator-(
const int& rhs)
const;
77 VertID& operator++(
int);
78 void print(FILE *file = stdout)
const;
79 void db_print(
void)
const;
80 friend std::ostream& operator<<(std::ostream& os,
const VertID& vID);
83 inline bool isOrthShapeEdge(
void)
const 85 return (props & PROP_OrthShapeEdge) ? true :
false;
87 inline bool isConnPt(
void)
const 89 return (props & PROP_ConnPoint) ? true :
false;
91 inline bool isConnectionPin(
void)
const 93 return (props & PROP_ConnectionPin) ? true :
false;
95 inline bool isConnCheckpoint(
void)
const 97 return (props & PROP_ConnCheckpoint) ? true :
false;
99 inline bool isDummyPinHelper(
void)
const 101 return (props & PROP_DummyPinHelper) ? true :
false;
110 static const VertID dummyOrthogID(0, 0);
111 static const VertID dummyOrthogShapeID(0, 0, VertID::PROP_OrthShapeEdge);
118 VertInf(Router *router,
const VertID& vid,
const Point& vpoint,
119 const bool addToRouter =
true);
121 void Reset(
const VertID& vid,
const Point& vpoint);
122 void Reset(
const Point& vpoint);
123 void removeFromGraph(
const bool isConnVert =
true);
126 unsigned int pathLeadsBackTo(
const VertInf *start)
const;
127 void setVisibleDirections(
const ConnDirFlags directions);
130 EdgeInf *hasNeighbour(VertInf *target,
bool orthogonal)
const;
133 VertInf **makeTreeRootPointer(VertInf *root);
134 VertInf *treeRoot(
void)
const;
135 VertInf **treeRootPointer(
void)
const;
136 void setTreeRootPointer(VertInf **pointer);
137 void clearTreeRootPointer(
void);
139 void setSPTFRoot(VertInf *root);
140 VertInf *sptfRoot(
void)
const;
150 unsigned int visListSize;
151 EdgeInfList orthogVisList;
152 unsigned int orthogVisListSize;
153 EdgeInfList invisList;
154 unsigned int invisListSize;
162 VertInf *m_orthogonalPartner;
163 VertInf **m_treeRoot;
167 std::list<ANode *> aStarDoneNodes;
168 std::list<ANode *> aStarPendingNodes;
171 unsigned int orthogVisPropFlags;
176 static const unsigned int XL_EDGE = 1;
177 static const unsigned int XL_CONN = 2;
178 static const unsigned int XH_EDGE = 4;
179 static const unsigned int XH_CONN = 8;
180 static const unsigned int YL_EDGE = 16;
181 static const unsigned int YL_CONN = 32;
182 static const unsigned int YH_EDGE = 64;
183 static const unsigned int YH_CONN = 128;
186 bool directVis(VertInf *src, VertInf *dst);
198 void addVertex(VertInf *vert);
199 VertInf *removeVertex(VertInf *vert);
200 VertInf *getVertexByID(
const VertID&
id);
201 VertInf *getVertexByPos(
const Point& p);
202 VertInf *shapesBegin(
void);
203 VertInf *connsBegin(
void);
205 unsigned int connsSize(
void)
const;
206 unsigned int shapesSize(
void)
const;
208 VertInf *_firstShapeVert;
209 VertInf *_firstConnVert;
210 VertInf *_lastShapeVert;
211 VertInf *_lastConnVert;
212 unsigned int _shapeVertices;
213 unsigned int _connVertices;
217 typedef std::set<unsigned int> ShapeSet;
218 typedef std::map<VertID, ShapeSet> ContainsMap;
unsigned int ConnDirFlags
One or more Avoid::ConnDirFlag options.
Definition: connend.h:83
Contains the interface for various geometry types and classes.
libavoid: Object-avoiding orthogonal and polyline connector routing library.
Definition: actioninfo.cpp:33