ConnectionUtilities
Utilities and extension methods related to connections.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public static class ConnectionUtilities
Inheritance: objectConnectionUtilities
Methods
AllPoints(IConnection)
IList<Point>
Returns all the points of this connection, i.e. the start and end points together with the intermediate connection points.
public static IList<Point> AllPoints(this IConnection connection)
The connection.
Returns:IList<Point>
Calculates the middle point of line.
Gets the bezier default handle point.
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter, double bezierTension)
The entry point.
endPointPointThe end point.
connectorCenterPointThe connector center.
bezierTensiondoubleThe bezier tension.
Returns:Point
Gets the bezier default handle point.
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)
The entry point.
endPointPointThe end point (opposite of the entryPoint ).
The center of the connectors.
Returns:Point
GetConnectionEndPoints(IConnection, bool)
Tuple<Point, Point>
Gets the connection end points.
public static Tuple<Point, Point> GetConnectionEndPoints(this IConnection connection, bool useConnectionCoordinates = false)
The connection.
useConnectionCoordinatesboolIf set to true the points will be in global coordinates. If set to false, then the coordinates will be relative to the connection.
Tuple<Point, Point>
Gets the default handle bezier points.
public static Tuple<Point, Point> GetDefaultHandleBezierPoints(this IConnection connection, Point startPoint, Point endPoint, Point? sourceConnectorCenter = null, Point? targetConnectorCenter = null)
The connection.
startPointPointThe cached start point.
endPointPointThe cached end point.
sourceConnectorCenterPoint?The source connector center.
targetConnectorCenterPoint?The target connector center.
Returns:Tuple<Point, Point>
Returns the number of segments defined by the intermediate points.
public static int SegmentCount(this IConnection conn)
The connection.
Returns:Sets the connection points.
public static void SetConnectionPoints(this IConnection connection, IEnumerable<Point> connectionPoints)
The connection.
connectionPointsIEnumerable<Point>The connection points.
Shifts the ConnectionPoints by adding or substracting the Position vector.
public static IEnumerable<Point> TranslateConnectionPoints(this IConnection connection, bool globalCoordinates = true)
The connection. to shift.
globalCoordinatesboolIf set to true points will be transformed to global coordinates. If set to false, then the coordinates will be relative to the connection.
IEnumerable<Point>
The start/end points are not taken into account here.