Adaptagrams
|
Adapter to easily apply libavoid::Routers to libdialect::Graphs. More...
#include <routing.h>
Public Member Functions | |
RoutingAdapter (Avoid::RouterFlag flag) | |
Standard Constructor. More... | |
void | addNodes (const NodesById &nodes) |
Add nodes. More... | |
void | addEdges (const EdgesById &edges, const EdgeConnDirsById *connDirs=nullptr) |
Add edges. More... | |
void | route (RouteProcessing processing=RouteProcessing::RECORD) |
Do the routing. More... | |
void | recordRoutes (bool refine=false) |
Record the routes in the Edges. More... | |
Public Attributes | |
Avoid::Router | router |
The Router. | |
EdgesById | edges |
Lookup for Edges. | |
std::map< id_type, Avoid::ConnRef * > | edgeIdToConnRef |
Lookup an Edge's associated ConnRef* by the Edge's ID. | |
std::map< id_type, Avoid::ShapeRef * > | nodeIdToShapeRef |
Lookup a Node's associated ShapeRef* by the Node's ID. | |
Adapter to easily apply libavoid::Routers to libdialect::Graphs.
|
inline |
Standard Constructor.
[in] | flag | A RouterFlag to say what kind of routing is desired (polyline or orthogonal). |
void RoutingAdapter::addEdges | ( | const EdgesById & | edges, |
const EdgeConnDirsById * | connDirs = nullptr |
||
) |
Add edges.
[in] | edges | The Edges to be added, given by an EdgesById mapping. |
[in] | connDirs | Optional specification of the allowed connection directions at the source and target ends of the Edges. Specifically, an Edge's ID should map to a pair (srcConnDirs, tgtConnDirs) giving the allowed directions for source and target respectively. For any Edge whose ID is not present in the mapping, all connection directions are allowed at both ends. |
References edgeIdToConnRef, edges, router, and Avoid::ConnRef::setEndpoints().
Referenced by dialect::Graph::addBendlessSubnetworkToRoutingAdapter(), dialect::LeaflessOrthoRouter::LeaflessOrthoRouter(), and dialect::Graph::route().
void RoutingAdapter::addNodes | ( | const NodesById & | nodes | ) |
Add nodes.
[in] | nodes | The Nodes to be added, given by a NodesById mapping. |
References nodeIdToShapeRef, and router.
Referenced by dialect::Graph::addBendlessSubnetworkToRoutingAdapter(), dialect::LeaflessOrthoRouter::LeaflessOrthoRouter(), and dialect::Graph::route().
void RoutingAdapter::recordRoutes | ( | bool | refine = false | ) |
Record the routes in the Edges.
[in] | refine | Say whether the routes should be refined before recording. |
References edgeIdToConnRef, edges, Avoid::Polygon::ps, Avoid::Point::x, and Avoid::Point::y.
Referenced by route(), and dialect::LeaflessOrthoRouter::route().
void RoutingAdapter::route | ( | RouteProcessing | processing = RouteProcessing::RECORD | ) |
Do the routing.
[in] | processing | Set to the desired level of route processing. Default: routes are recorded in Edges, without any post-processing. |
References Avoid::Router::processTransaction(), dialect::RECORD, recordRoutes(), dialect::REFINE_AND_RECORD, and router.
Referenced by dialect::doHOLA(), and dialect::Graph::route().