Adaptagrams
|
libavoid: Object-avoiding orthogonal and polyline connector routing library. More...
Classes | |
class | Box |
A bounding box, represented by the top-left and bottom-right corners. More... | |
class | Checkpoint |
A checkpoint is a point that the route for a particular connector must visit. They may optionally be given an arrival/departure direction. More... | |
class | ClusterRef |
The ClusterRef class represents a cluster object. More... | |
class | ConnEnd |
The ConnEnd class represents different possible endpoints for connectors. More... | |
class | ConnRef |
The ConnRef class represents a connector object. More... | |
class | Edge |
A line between two points. More... | |
struct | HyperedgeNewAndDeletedObjectLists |
The HyperedgeNewAndDeletedObjectLists class stores lists of objects created and deleted during hyperedge improvement. More... | |
class | HyperedgeRerouter |
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... | |
class | JunctionRef |
The JunctionRef class represents a fixed or free-floating point that connectors can be attached to. More... | |
class | Point |
The Point class defines a point in the plane. More... | |
class | Polygon |
A dynamic Polygon, to which points can be easily added and removed. More... | |
class | PolygonInterface |
A common interface used by the Polygon classes. More... | |
class | Rectangle |
A Rectangle, a simpler way to define the polygon for square or rectangular shapes. More... | |
class | ReferencingPolygon |
A Polygon which just references its points from other Polygons. More... | |
class | Router |
The Router class represents a libavoid router instance. More... | |
class | ShapeConnectionPin |
The ShapeConnectionPin class represents a fixed point or "pin" on a shape that can be connected to. More... | |
class | ShapeRef |
The ShapeRef class represents a shape object. More... | |
Typedefs | |
typedef std::list< ConnRef * > | ConnRefList |
A list of ConnRef objects. | |
typedef unsigned int | ConnDirFlags |
One or more Avoid::ConnDirFlag options. | |
typedef Point | Vector |
A vector, represented by the Point class. | |
typedef Polygon | PolyLine |
A multi-segment line, represented with the Polygon class. | |
typedef std::list< ConnEnd > | ConnEndList |
A list of ConnEnd objects. | |
typedef std::list< JunctionRef * > | JunctionRefList |
A list of JunctionRef objects. | |
libavoid: Object-avoiding orthogonal and polyline connector routing library.
You should use libavoid via an instance of the Router class.
enum Avoid::ConnDirFlag |
Flags that can be passed to the ConnEnd constructor to specify which sides of a shape this point should have visibility to if it is located within the shape's area.
Like SVG, libavoid considers the Y-axis to point downwards, that is, like screen coordinates the coordinates increase from left-to-right and also from top-to-bottom.
enum Avoid::ConnEndType |
Types that describe the kind a connection that a ConnEnd represents.
Enumerator | |
---|---|
ConnEndPoint | The ConnEnd represents a free-floating point that may or may not have visibility in specific directions. |
ConnEndShapePin | The ConnEnd attaches to a specific ShapeConnectionPin on a shape. |
ConnEndJunction | The ConnEnd attaches to a junction. |
ConnEndEmpty | The ConnEnd is empty and doesn't have any information set. |
enum Avoid::ConnType |
Describes the type of routing that is performed for each connector.
enum Avoid::RouterFlag |
Flags that can be passed to the router during initialisation to specify options.
enum Avoid::RoutingOption |
Types of routing options that can be enabled.
Enumerator | |
---|---|
nudgeOrthogonalSegmentsConnectedToShapes | This option causes the final segments of connectors, which are attached to shapes, to be nudged apart. Usually these segments are fixed, since they are considered to be attached to ports. Defaults to false. This option also causes routes running through the same checkpoint to be nudged apart. This option has no effect if nudgeSharedPathsWithCommonEndPoint is set to false,
|
improveHyperedgeRoutesMovingJunctions | This option causes hyperedge routes to be locally improved fixing obviously bad paths. As part of this process libavoid will effectively move junctions, setting new ideal positions which can be accessed via JunctionRef::recommendedPosition() for each junction. Defaults to true. This will not add or remove junctions, so will keep the hyperedge topology the same. Better routes can be achieved by enabling the improveHyperedgeRoutesMovingAddingAndDeletingJunctions option. If initial sensible positions for junctions in hyperedges are not known you can register those hyperedges with the HyperedgeRerouter class for complete rerouting. |
penaliseOrthogonalSharedPathsAtConnEnds | This option penalises and attempts to reroute orthogonal shared connector paths terminating at a common junction or shape connection pin. When multiple connector paths enter or leave the same side of a junction (or shape pin), the router will attempt to reroute these to different sides of the junction or different shape pins. Defaults to false. This option depends on the fixedSharedPathPenalty penalty having been set.
|
nudgeOrthogonalTouchingColinearSegments | This option can be used to control whether collinear line segments that touch just at their ends will be nudged apart. The overlap will usually be resolved in the other dimension, so this is not usually required. Defaults to false. |
performUnifyingNudgingPreprocessingStep | This option can be used to control whether the router performs a preprocessing step before orthogonal nudging where is tries to unify segments and centre them in free space. This generally results in better quality ordering and nudging. Defaults to true. You may wish to turn this off for large examples where it can be very slow and will make little difference. |
improveHyperedgeRoutesMovingAddingAndDeletingJunctions | This option causes hyperedge routes to be locally improved fixing obviously bad paths. It can cause junctions and connectors to be added or removed from hyperedges. To get details of these changes for each connector you can call Router::newAndDeletedObjectListsFromHyperedgeImprovement(). As part of this process libavoid will effectively move junctions by setting new ideal positions for each remaining or added junction, which can be read from JunctionRef::recommendedPosition() for each junction. Defaults to false. If set, this option overrides the improveHyperedgeRoutesMovingJunctions option. If initial sensible positions for junctions in hyperedges are not known you can register those hyperedges with the HyperedgeRerouter class for complete rerouting. |
nudgeSharedPathsWithCommonEndPoint | This option determines whether intermediate segments of connectors that are attached to common endpoints will be nudged apart. Usually these segments get nudged apart, but you may want to turn this off if you would prefer that entire shared paths terminating at a common end point should overlap. Defaults to true. |
Types of routing parameters and penalties that can be used to tailor the style and improve the quality of the connector routes produced.
Enumerator | |
---|---|
segmentPenalty | This penalty is applied for each segment in the connector path beyond the first. This should always normally be set when doing orthogonal routing to prevent step-like connector paths.
|
anglePenalty | This penalty is applied in its full amount to tight acute bends in the connector path. A smaller portion of the penalty is applied for slight bends, i.e., where the bend is close to 180 degrees. This is useful for polyline routing where there is some evidence that tighter corners are worse for readability, but that slight bends might not be so bad, especially when smoothed by curves. |
crossingPenalty | This penalty is applied whenever a connector path crosses another connector path. It takes shared paths into consideration and the penalty is only applied if there is an actual crossing.
|
clusterCrossingPenalty | This penalty is applied whenever a connector path crosses a cluster boundary.
|
fixedSharedPathPenalty | This penalty is applied whenever a connector path shares some segments with an immovable portion of an existing connector route (such as the first or last segment of a connector).
|
portDirectionPenalty | This penalty is applied to port selection choice when the other end of the connector being routed does not appear in any of the 90 degree visibility cones centered on the visibility directions for the port.
|
shapeBufferDistance | This parameter defines the spacing distance that will be added to the sides of each shape when determining obstacle sizes for routing. This controls how closely connectors pass shapes, and can be used to prevent connectors overlapping with shape boundaries. By default, this distance is set to a value of 0. |
idealNudgingDistance | This parameter defines the spacing distance that will be used for nudging apart overlapping corners and line segments of connectors. By default, this distance is set to a value of 4. |
reverseDirectionPenalty | This penalty is applied whenever a connector path travels in the direction opposite of the destination from the source endpoint. By default this penalty is set to zero. This shouldn't be needed in most cases but can be useful if you use penalties such as crossingPenalty which cause connectors to loop around obstacles. |
Describes the type of transformation that has been applied to a shape having its transformConnectionPinPositions() method called.
Types of routing phases reported by Router::shouldContinueTransactionWithProgress().
This phases will occur in the order given here, but each phase may take varying amounts of time.