Adaptagrams
Public Member Functions | Public Attributes | List of all members
dialect::RoutingAdapter Struct Reference

Adapter to easily apply libavoid::Routers to libdialect::Graphs. More...

#include <routing.h>

Collaboration diagram for dialect::RoutingAdapter:
Collaboration graph

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.
 

Detailed Description

Adapter to easily apply libavoid::Routers to libdialect::Graphs.

Constructor & Destructor Documentation

◆ RoutingAdapter()

dialect::RoutingAdapter::RoutingAdapter ( Avoid::RouterFlag  flag)
inline

Standard Constructor.

Parameters
[in]flagA RouterFlag to say what kind of routing is desired (polyline or orthogonal).

Member Function Documentation

◆ addEdges()

void RoutingAdapter::addEdges ( const EdgesById &  edges,
const EdgeConnDirsById *  connDirs = nullptr 
)

Add edges.

Parameters
[in]edgesThe Edges to be added, given by an EdgesById mapping.
[in]connDirsOptional 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addNodes()

void RoutingAdapter::addNodes ( const NodesById &  nodes)

Add nodes.

Parameters
[in]nodesThe 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().

Here is the caller graph for this function:

◆ recordRoutes()

void RoutingAdapter::recordRoutes ( bool  refine = false)

Record the routes in the Edges.

Parameters
[in]refineSay 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().

Here is the caller graph for this function:

◆ route()

void RoutingAdapter::route ( RouteProcessing  processing = RouteProcessing::RECORD)

Do the routing.

Parameters
[in]processingSet to the desired level of route processing. Default: routes are recorded in Edges, without any post-processing.
See also
RouteProcessing enum.

References Avoid::Router::processTransaction(), dialect::RECORD, recordRoutes(), dialect::REFINE_AND_RECORD, and router.

Referenced by dialect::doHOLA(), and dialect::Graph::route().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this struct was generated from the following files: