Route
A Route is an object associated with a Link that computes and remembers the set of points that the link should follow to connect two nodes.
Inherits: FrameworkElement
Constructors
Route()
Construct an empty Route.
Properties
Adjusting : LinkAdjusting
Gets or sets how ComputePoints behaves.
Corner : double
Gets or sets how rounded the corners are for adjacent line segments when the Curve is None, JumpOver, or JumpGap and the two line segments are orthogonal to each other.
Curviness : double
Gets or sets how far the control points are offset when the curve is Bezier or when there are multiple links between the same two ports.
DefiningGeometry : Geometry
Gets the Geometry for this Route.
FirstPickIndex : int
Return the index of the first stroke point to get a handle.
FromEndSegmentDirection : LinkEndSegmentDirection
Gets or sets how FrameworkElement) behaves.
FromEndSegmentLength : double
Gets or sets the length of the short segment that should start the route.
FromShortLength : double
Gets or sets the length of the segment between the far edge of the Arrowhead and the Node at the start of the route.
LastPickIndex : int
Return the index of the last stroke point to get a handle.
LinkReshapeHandleTemplate : DataTemplate
Gets or sets the DataTemplate used by LinkReshapingTool to create a handle for allowing the user to reshape the route of a Link.
Orthogonal : bool
Gets whether the segments of the link are always horizontal or vertical.
PointsCount : int
Gets the number of points in the route.
RelinkableFrom : bool
Gets or sets whether the user may reconnect the "from" end of this link.
RelinkableTo : bool
Gets or sets whether the user may reconnect the "to" end of this link.
RelinkFromAdornmentTemplate : DataTemplate
Gets or sets the DataTemplate used by RelinkingTool to create the Adornment for allowing the user to relink the "from" end of a Link.
RelinkToAdornmentTemplate : DataTemplate
Gets or sets the DataTemplate used by RelinkingTool to create the Adornment for allowing the user to relink the "to" end of a Link.
Routing : LinkRouting
Gets or sets whether the link's path tries to avoid other nodes.
Smoothness : double
Gets or sets how far control points are from the points of the Route when Routing is Orthogonal and Curve is Bezier.
ToEndSegmentDirection : LinkEndSegmentDirection
Gets or sets how FrameworkElement) behaves.
ToEndSegmentLength : double
Gets or sets the length of the short segment that should end the route.
ToShortLength : double
Gets or sets the length of the segment between the far edge of the Arrowhead and the Node at the end of the route.
Methods
AddOrthoPoints(Point, double, Point, double, Node, Node)
This method is called by ComputePoints when Orthogonal is true and at least one port has a link spot that is not IsNoSpot.
- startFrom
- this point will already have been added to the stroke by ComputePoints before calling this method
- fromDir
- normally 0, 90, 180, or 270 degrees
- endTo
- ComputePoints will add this point after calling this method
- toDir
- normally 0, 90, 180, or 270 degrees
- fromnode
- the Node that the link is coming from
- tonode
- the Node that the link is going to
AddPoint(Point)
Add a point at the end of the route.
- p
- the new point, which should not have infinite coordinate values
AdjustPoints(int, Point, int, Point) : bool
Adjust all of the existing points in this link's stroke in an inclusive range according to new first and last stroke points.
- startIndex
- the zero-based index of the first point to be changed, to be the value of
- newFromPoint
- endIndex
- the zero-based index of the last point to be changed, to be the value of
- newToPoint
CanRelinkFrom() : bool
This predicate is true if the user may reconnect the "from" end of this link.
Returns: Return true if this link is RelinkableFrom, if this link's layer's AllowRelink is true, and if this link's diagram's AllowRelink is true.
CanRelinkTo() : bool
This predicate is true if the user may reconnect the "to" end of this link.
Returns: Return true if this link is RelinkableTo, if this link's layer's AllowRelink is true, and if this link's diagram's AllowRelink is true.
ClearPoints()
Remove all of the points of the route.
ComputeCorner() : double
Returns the Corner, if it's a non-negative number, or else 10.
ComputeCurviness() : double
Returns the Curviness, if it's a number, or else a computed value based on how many links connect this pair of nodes/ports.
ComputeMidAngle() : double
Compute the angle of the route at the MidPoint.
ComputeMidPoint() : Point
Computes the point at the middle of the route.
ComputePoints() : bool
Compute all of the points of this route.
Returns: true if the points were calculated
FindClosestSegment(Point) : int
Find the index of the segment that is closest to a given point.
- q
- the Point, in model coordinates
Returns: The index of the segment, from zero to the number of points minus 2
GetEndSegmentLength(Node, FrameworkElement, Spot, bool) : double
Get the length of the end segment, typically a short distance.
- node
- port
- the FrameworkElement representing a port on the node
- spot
- a Spot value describing where the link should connect
- from
- true if the link is coming out of the port; false if going to the port
GetLinkDirection(Node, FrameworkElement, Point, Spot, bool, bool, Node, FrameworkElement) : double
Compute the direction in which a link should go from a given point.
- node
- port
- the FrameworkElement representing a port on the node
- linkpoint
- spot
- a Spot value describing where the link should connect
- from
- true if the link is coming out of the port; false if going to the port
- ortho
- whether the link should have orthogonal segments
- othernode
- the node at the other end of the link
- otherport
- the FrameworkElement port at the other end of the link
Returns: an angle in degrees
GetLinkPoint(Node, FrameworkElement, Spot, bool, bool, Node, FrameworkElement) : Point
Compute the point on a node/port at which the route of a link should end.
- node
- port
- the FrameworkElement representing a port on the node
- spot
- a Spot value describing where the link should connect
- from
- true if the link is coming out of the port; false if going to the port
- ortho
- whether the link should have orthogonal segments
- othernode
- the node at the other end of the link
- otherport
- the FrameworkElement port at the other end of the link
GetLinkPointFromPoint(Node, FrameworkElement, Point, Point, bool) : Point
Compute the intersection point for the edge of a particular port element, given a point, when no particular spot or side has been specified.
- node
- port
- the FrameworkElement representing a port on the node
- focus
- the point in model coordinates to/from which the link should point, normally the center of the port
- p
- often this point is far away from the node, to give a general direction, particularly an orthogonal one
- from
- true if the link is coming out of the port; false if going to the port
Returns: the point in model coordinates of the intersection point on the edge of the port
GetMidOrthoPosition(double, double, bool) : double
This method is called by Node) to determine the distance of the middle segment between the two ports.
- fromPosition
- The first point's X or Y coordinate, depending on the direction
- toPosition
- The last point's X or Y coordinate, depending on the direction
- vertical
- Whether the mid-position is along the vertical axis or horizontal
GetPoint(int) : Point
Gets a particular point of the route.
- i
- the zero-based index of the desired point
Returns: if the index is negative or beyond the list of Points, this method will return Point(Double.NaN, Double.NaN)
HasCurviness() : bool
Returns true if an extra or a different point is needed based on Curviness.
InsertPoint(int, Point)
Insert a point at a particular position in the route.
- i
- the zero-based index of the new point; if less than zero this does nothing; if greater than the number of points it adds the point at the end
- p
- the new point, which should not have infinite coordinate values
InvalidateRoute()
Declare that the points in this Route are invalid and request that it call RecomputePoints soon.
MakeGeometry() : Geometry
Produce a Geometry given the points of this Route, depending on the value of Curve.
ModifyEndPoints(int, Point, int, Point) : bool
Modify only the end points of this stroke to match any new or points; intermediate points are not changed.
- startIndex
- newFromPoint
- endIndex
- newToPoint
MovePoints(Point)
Modify all of the points by adding a constant offset to each one.
- offset
- the values must be a number other than infinity
RecomputePoints()
Call ComputePoints right now.
RemovePoint(int)
Remove a particular point from the route.
- i
- the zero-based index of the point to extract; if beyond range this does nothing
RescalePoints(int, Point, int, Point) : bool
Maintain the same shape for the stroke, but scale and rotate according to new points and .
- startIndex
- newFromPoint
- endIndex
- newToPoint
SetPoint(int, Point)
Modify a particular point of the route.
- i
- the zero-based index of the point; if beyond range this does nothing
- p
- the new point, which should not have infinite coordinate values
StretchPoints(int, Point, int, Point) : bool
Stretch the points of this stroke by interpolating the points from to between the new points and .
- startIndex
- newFromPoint
- endIndex
- newToPoint
UpdatePoints()
Recalculate route points by calling RecomputePoints only if needed.
Fields
AdjustingProperty : DependencyProperty
Identifies the Adjusting dependency property.
CornerProperty : DependencyProperty
Identifies the Corner dependency property.
CurveProperty : DependencyProperty
Identifies the Curve dependency property.
CurvinessProperty : DependencyProperty
Identifies the Curviness dependency property.
FromEndSegmentDirectionProperty : DependencyProperty
Identifies the FromEndSegmentDirection dependency property.
FromEndSegmentLengthProperty : DependencyProperty
Identifies the FromEndSegmentLength dependency property.
FromShortLengthProperty : DependencyProperty
Identifies the FromShortLength dependency property.
FromSpotProperty : DependencyProperty
Identifies the FromSpot dependency property.
LinkReshapeHandleTemplateProperty : DependencyProperty
Identifies the LinkReshapeHandleTemplate dependency property.
RelinkableFromProperty : DependencyProperty
Identifies the RelinkableFrom dependency property.
RelinkableToProperty : DependencyProperty
Identifies the RelinkableTo dependency property.
RelinkFromAdornmentTemplateProperty : DependencyProperty
Identifies the RelinkFromAdornmentTemplate dependency property.
RelinkToAdornmentTemplateProperty : DependencyProperty
Identifies the RelinkToAdornmentTemplate dependency property.
RoutingProperty : DependencyProperty
Identifies the Routing dependency property.
SmoothnessProperty : DependencyProperty
Identifies the Smoothness dependency property.
ToEndSegmentDirectionProperty : DependencyProperty
Identifies the ToEndSegmentDirection dependency property.
ToEndSegmentLengthProperty : DependencyProperty
Identifies the ToEndSegmentLength dependency property.
ToShortLengthProperty : DependencyProperty
Identifies the ToShortLength dependency property.
ToSpotProperty : DependencyProperty
Identifies the ToSpot dependency property.