Adaptagrams
|
The HyperedgeRerouter class is a convenience object that can be used to register hyperedges to be rerouted, improving the placement of their junctions and connector paths. More...
#include <hyperedge.h>
Public Member Functions | |
HyperedgeRerouter () | |
Constructor for hyperedge rerouter object. More... | |
size_t | registerHyperedgeForRerouting (ConnEndList terminals) |
Registers a hyperedge to be fully rerouted the next time the router processes a transaction. More... | |
size_t | registerHyperedgeForRerouting (JunctionRef *junction) |
Registers a hyperedge to be fully rerouted the next time the router processes a transaction. More... | |
HyperedgeNewAndDeletedObjectLists | newAndDeletedObjectLists (size_t index) const |
Returns a HyperedgeNewAndDeletedObjectLists detailing the lists of junctions and connectors created and deleted during hyperedge improvement. More... | |
The HyperedgeRerouter class is a convenience object that can be used to register hyperedges to be rerouted, improving the placement of their junctions and connector paths.
To work with this class, you should get a copy from the router instance via a call to Router::hyperedgeRerouter().
If you would like a particular hyperedge to be completely rerouted with new junction positions then you should register it with this class via a call to registerHyperedgeForRerouting. A hyperedge can either be specified as a set of terminal vertices, or as a single JunctionRef. Passing a JunctionRef will cause HyperedgeRerouter to follow the attached connectors and junctions to determine the hyperedge. When you register a hyperedge you get an index number that can be used to later find information about it.
The rerouting will actually occur the next time the Router processes a transaction, see Router::processTransaction(). The rerouting will effectively create new junctions (JunctionRefs) and connectors (ConnRefs) for the hyperedge.
Since hyperedges are composed of multiple connections and junction objects, rerouting a hyperedge can cause creation of new or deletion of existing connectors and/or junctions. Thus once the transaction has been completed you should call the newAndDeletedObjectLists() to get an object containing the lists of created and deleted junctions and connectors. After the transaction You should not use references to these deleted objects any more from your own code (since the router will free their memory at its convenience) and you should refer only to the unaffected objects and the new connectors and junctions.
Avoid::HyperedgeRerouter::HyperedgeRerouter | ( | ) |
Constructor for hyperedge rerouter object.
HyperedgeNewAndDeletedObjectLists Avoid::HyperedgeRerouter::newAndDeletedObjectLists | ( | size_t | index | ) | const |
Returns a HyperedgeNewAndDeletedObjectLists detailing the lists of junctions and connectors created and deleted during hyperedge improvement.
This method will only return information once the router has processed the transaction. You should read this information before processTransaction() is called again.
After calling this you should no longer refer to any of the objects in the "deleted" lists — the router will delete these and free their memory at its convenience.
index | The index of the hyperedge to return junctions for. |
References Avoid::HyperedgeNewAndDeletedObjectLists::deletedConnectorList, Avoid::HyperedgeNewAndDeletedObjectLists::deletedJunctionList, Avoid::HyperedgeNewAndDeletedObjectLists::newConnectorList, and Avoid::HyperedgeNewAndDeletedObjectLists::newJunctionList.
size_t Avoid::HyperedgeRerouter::registerHyperedgeForRerouting | ( | ConnEndList | terminals | ) |
Registers a hyperedge to be fully rerouted the next time the router processes a transaction.
[in] | terminals | The ConnEnds that form the endpoints of the hyperedge. |
size_t Avoid::HyperedgeRerouter::registerHyperedgeForRerouting | ( | JunctionRef * | junction | ) |
Registers a hyperedge to be fully rerouted the next time the router processes a transaction.
In this case the connectors and junctions attached to the given junction will be traversed to determine the endpoints of the hyperedge. These endpoints will then be used for the rerouting. The junctions and connectors forming the old route will be deleted.
[in] | junction | One of the junctions that forms the hyperedge. |