97 fprintf(fp,
" HyperedgeRerouter *hyperedgeRerouter = router->hyperedgeRerouter();\n");
98 const size_t num_hyperedges =
count();
99 for (
size_t i = 0; i < num_hyperedges; ++i)
103 fprintf(fp,
" hyperedgeRerouter->registerHyperedgeForRerouting(junctionRef%u);\n",
108 fprintf(fp,
" ConnEndList heConnList%u;\n", (
unsigned int) i);
112 (*it).outputCode(fp,
"heEnd");
113 fprintf(fp,
" heConnList%u.push_back(heEndPt);\n",
116 fprintf(fp,
" hyperedgeRerouter->registerHyperedgeForRerouting(heConnList%u);\n",
131 bool validHyperedge =
false;
136 hyperedgeConns.insert(connector);
138 std::pair<Obstacle *, Obstacle *> anchors = connector->
endpointAnchors();
145 if (jFirst != ignore)
160 if (jSecond != ignore)
171 return validHyperedge;
181 bool validHyperedge =
false;
187 if (connectors.size() > 2)
191 validHyperedge |=
true;
194 for (ConnRefList::iterator curr = connectors.begin();
195 curr != connectors.end(); ++curr)
202 COLA_ASSERT(*curr !=
nullptr);
205 return validHyperedge;
229 const size_t num_hyperedges =
count();
230 for (
size_t i = 0; i < num_hyperedges; ++i)
236 allRegisteredHyperedgeConns);
239 err_printf(
"Warning: Hyperedge %d registered with "
240 "HyperedgeRerouter is invalid and will be "
241 "ignored.\n", (
int) i);
255 std::pair<bool, VertInf *> maybeNewVertex;
259 maybeNewVertex = it->getHyperedgeVertex(
m_router);
260 COLA_ASSERT(maybeNewVertex.second !=
nullptr);
263 if (maybeNewVertex.first)
273 return allRegisteredHyperedgeConns;
289 std::vector<Box> obstacleBoxes;
302 obstacleBoxes.push_back(bbox);
310 const size_t num_hyperedges =
count();
311 for (
size_t i = 0; i < num_hyperedges; ++i)
333 COLA_ASSERT(treeRoot);
346 for (
size_t pass = 0; pass < 2; ++pass)
353 for (ConnRefList::iterator curr =
358 (*curr)->assignConnectionPinVisibility(
false);
362 for (JunctionRefList::iterator curr =
379 (*curr)->removeFromGraph();
A bounding box, represented by the top-left and bottom-right corners.
The ConnRef class represents a connector object.
std::pair< Obstacle *, Obstacle * > endpointAnchors(void) const
std::pair< bool, bool > assignConnectionPinVisibility(const bool connect)
virtual void updateObstacleBoxes(std::vector< Avoid::Box > obstacles)
JunctionRefVector m_root_junction_vector
ConnEndListVector m_terminals_vector
ConnRefSet calcHyperedgeConnectors(void)
JunctionRefListVector m_new_junctions_vector
VertexSetVector m_terminal_vertices_vector
VertexList m_added_vertices
HyperedgeNewAndDeletedObjectLists newAndDeletedObjectLists(size_t index) const
Returns a HyperedgeNewAndDeletedObjectLists detailing the lists of junctions and connectors created a...
ConnRefListVector m_new_connectors_vector
bool findAttachedObjects(size_t index, ConnRef *connector, JunctionRef *ignore, ConnRefSet &hyperedgeConns)
ConnRefListVector m_deleted_connectors_vector
HyperedgeRerouter()
Constructor for hyperedge rerouter object.
void setRouter(Router *router)
void performRerouting(void)
void outputInstanceToSVG(FILE *fp)
JunctionRefListVector m_deleted_junctions_vector
size_t registerHyperedgeForRerouting(ConnEndList terminals)
Registers a hyperedge to be fully rerouted the next time the router processes a transaction.
The JunctionRef class represents a fixed or free-floating point that connectors can be attached to.
bool positionFixed(void) const
Returns whether this junction has a fixed position (that can't be moved by the Router during routing)...
HyperedgeTreeNode * rootJunction(void) const
void constructInterleaved(void)
Box routingBox(void) const
ConnRefList attachedConnectors(void) const
The Router class represents a libavoid router instance.
void deleteConnector(ConnRef *connector)
Remove a connector from the router scene.
DebugHandler * debugHandler(void) const
void deleteJunction(JunctionRef *junction)
Remove a junction from the router scene.
VertInf * removeVertex(VertInf *vert)
Contains the interface for the ConnRef class.
Contains the interface for the ConnEnd class.
Contains the interface for the HyperedgeRerouter class.
Contains the interface for the JunctionRef class.
libavoid: Object-avoiding orthogonal and polyline connector routing library.
std::list< ConnEnd > ConnEndList
A list of ConnEnd objects.
std::set< ConnRef * > ConnRefSet
std::list< ConnRef * > ConnRefList
A list of ConnRef objects.
void err_printf(const char *fmt,...)
std::map< JunctionRef *, HyperedgeTreeNode * > JunctionHyperedgeTreeNodeMap
Contains the interface for the Router class.
Contains the interface for the ShapeRef class.
The HyperedgeNewAndDeletedObjectLists class stores lists of objects created and deleted during hypere...
JunctionRefList newJunctionList
A list of newly created junctions.
void writeEdgesToConns(HyperedgeTreeEdge *ignored, size_t pass)
void listJunctionsAndConnectors(HyperedgeTreeEdge *ignored, JunctionRefList &junctions, ConnRefList &connectors)
void addConns(HyperedgeTreeEdge *ignored, Router *router, ConnRefList &oldConns, ConnRef *conn)