Class GeometryExtensions
Methods related to planar geometry.
Inheritance
Namespace: Telerik.Windows.Controls.Diagrams
Assembly: Telerik.Windows.Controls.Diagrams.dll
Syntax
public static class GeometryExtensions : Object
Methods
Add(PathFigure, PathSegment)
Adds the given System.
Declaration
public static PathFigure Add(this PathFigure pathFigure, PathSegment segment)
Parameters
System. The path figure. |
System. The segment. |
Returns
System. The augmented path figure. |
Add(PathFigure, PathSegment, Point)
Adds the given System.
Declaration
public static PathFigure Add(this PathFigure pathFigure, PathSegment segment, Point startPoint)
Parameters
System. The path figure. |
System. The segment. |
System. The start point. |
Returns
System. The augmented path figure. |
Add(PathGeometry, PathFigure)
Adds the given figure to the geometry.
Declaration
public static PathGeometry Add(this PathGeometry pathGeometry, PathFigure pathFigure)
Parameters
System. The path geometry. |
System. The path figure. |
Returns
System. The resulting path geometry. |
AddArc(PathFigure, Double, Double, Double, Double, Double, Double, Boolean)
Adds an arc to the path figure.
Declaration
public static void AddArc(this PathFigure pathFigure, double x, double y, double width, double height, double startAngle, double sweep, bool startPoint)
Parameters
System. The figure. |
System. The x-coordinate of the bounding rectangle. |
System. The y-coordinate of the bounding rectangle. |
System. The width of the bounding rectangle. |
System. The height of the bounding rectangle. |
System. The start angle. |
System. The sweeping angle of the arc. |
System. If set to |
AddArc(PathFigure, Rect, Double, Double, Boolean)
Adds the arc.
Declaration
public static PathFigure AddArc(this PathFigure pathFigure, Rect rectangle, double startAngle, double sweep, bool setStartingPoint)
Parameters
System. The path figure. |
System. The bounding rectangle. |
System. The start angle. |
System. The sweeping angle of the arc. |
System. If set to |
Returns
System.
|
AddBezier(PathFigure, Double[])
Adds a bezier segment to the path.
Declaration
public static void AddBezier(this PathFigure pathFigure, double[] points)
Parameters
System. The path. |
System. The eight values specifying the eight coordinates of the four Bezier points. |
AddBeziers(PathFigure, Point[])
Adds a bezier segment to the path.
Declaration
public static void AddBeziers(this PathFigure pathFigure, Point[] points)
Parameters
System. The figure. |
System. The points defining the Bezier segment. |
AddLine(PathFigure, Double, Double, Double, Double)
Adds a line to the path.
Declaration
public static PathFigure AddLine(this PathFigure pathFigure, double x1, double y1, double x2, double y2)
Parameters
System. The path figure. |
System. The x-coordinate of the start point. |
System. The y-coordinate of the start point. |
System. The x-coordinate of the end point. |
System. The y-coordinate of the end point. |
Returns
System.
|
AddLine(PathFigure, Point, Point)
Adds a line to the path.
Declaration
public static PathFigure AddLine(this PathFigure pathFigure, Point point1, Point point2)
Parameters
System. The path figure. |
System. The start point of the line. |
System. The end point of the line. |
Returns
System. The augmented path figure. |
AddPolyLine(PathFigure, IEnumerable<Point>)
Adds a polyline to the figure.
Declaration
public static void AddPolyLine(this PathFigure pathFigure, IEnumerable<Point> points)
Parameters
System. The figure. |
System. The points defining the polyline. |
AddPolyLine(PathFigure, PointCollection)
Adds a polyline to the figure.
Declaration
public static void AddPolyLine(this PathFigure pathFigure, PointCollection collection)
Parameters
System. The figure. |
System. The points defining the polyline. |
AddRoundRect(PathFigure, Double, Double, Double, Double, Double, Boolean)
Adds a rounded rectangle to the path figure.
Declaration
public static PathFigure AddRoundRect(this PathFigure pathFigure, double x, double y, double width, double height, double radius, bool setStartPoint)
Parameters
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
AddRoundRect(PathFigure, Rect, Double, Boolean)
Adds a rounded rectangle to the path figure.
Declaration
public static PathFigure AddRoundRect(this PathFigure pathFigure, Rect rectangle, double radius, bool setStartPoint)
Parameters
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
AsPathGeometry(Geometry)
Returns the original geometry as path geometry.
Declaration
public static PathGeometry AsPathGeometry(this Geometry original)
Parameters
System. The original. |
Returns
System.
|
Clone(Geometry)
Clones the specified geometry.
Declaration
public static Geometry Clone(this Geometry geometry)
Parameters
System. The geometry. |
Returns
System.
|
CreateBaseLineGeometry(LineSpecification)
Creates a line geometry based on the given specifications.
Declaration
public static PathGeometry CreateBaseLineGeometry(LineSpecification specs)
Parameters
Line The specs. |
Returns
System.
|
Remarks
CreateBezier(Point, Point, Point, Point, Double)
Creates a bezier geometry.
Declaration
public static Geometry CreateBezier(Point startPoint, Point endPoint, Point startBezierPoint, Point endBezierPoint, double tension = 1)
Parameters
System. The start point. |
System. The end point. |
System. The start bezier point. |
System. The end bezier point. |
System. The tension of the Bezier curve. |
Returns
System.
|
CreateConnectionGeometry(IConnection, BridgeType, Boolean)
This method is called by the connection update process to create a geometry which is then plugged into the Path in the XAML template of the connection.
Declaration
public static Geometry CreateConnectionGeometry(IConnection connection, BridgeType connectionBridge, bool connectionRoundedCorners)
Parameters
IConnection
connection
The connection for which to create a geometry. |
Bridge What type of bridging should be applied to the line. |
System. Whether the corners of the line should be rounded. |
Returns
System. The geometry of the connection path. |
Remarks
See Also
CreateEllipse(Point, Double, Double)
Creates an ellipse.
Declaration
public static Geometry CreateEllipse(Point center, double radiusX, double radiusY)
Parameters
System. The center. |
System. The x radius. |
System. The y radius. |
Returns
System.
|
CreateLineGeometry(Point, Point, Boolean, Point[])
Creates the polyline.
Declaration
public static Geometry CreateLineGeometry(Point startPoint, Point endPoint, bool roundedCorners = false, params Point[] points)
Parameters
System. The start point. |
System. The end point. |
System. If set to |
System. The points. |
Returns
System.
|
CreateLineGeometry(PolylineSpecification)
Creates a line geometry based on the given specifications.
Declaration
public static Geometry CreateLineGeometry(PolylineSpecification specs)
Parameters
Polyline
|
Returns
System. A System. |
Remarks
See Also
CreatePathGeometry(Point, IList<PathSegment>)
Creates a geometry.
Declaration
public static Geometry CreatePathGeometry(Point startPoint, IList<PathSegment> pathSegments)
Parameters
System. The start point. |
System. The path segments. |
Returns
System.
|
CreatePolylineLineFigure(PolylineSpecification)
Gets the polyline figure.
Declaration
public static PathGeometry CreatePolylineLineFigure(PolylineSpecification specs)
Parameters
Polyline The polyline specifications. |
Returns
System.
|
CreateRoundedPolyline(PathFigure, IList<Point>, Boolean)
Adds rounded corners to the existing polyline figure.
Declaration
public static void CreateRoundedPolyline(PathFigure figure, IList<Point> points, bool addLastLine)
Parameters
System. The figure which will be incremented with corner arcs. |
System. The points of the polyline. |
System. If set to |
Remarks
The corner radius is set in the Connection5.0
pixels.
CreateSplineFigures(IList<Point>, Double, Boolean, Boolean)
Creates a canonical spline figure.
Declaration
public static IList<PathFigure> CreateSplineFigures(IList<Point> points, double tension = 0.5, bool isClosed = false, bool isFilled = false)
Parameters
System. The points defining the spline. These should be in local coordinates and include the endpoints. |
System. The tension of the spline. A tension or zero will result in a polyline, a tension between 0.5 and 0.8 is pleasing, other values lead to wild curves. |
System. If set to |
System. If set to |
Returns
System.
|
Remarks
Based on the code in http://www.charlespetzold.com/blog/2009/01/canonical-splines-in-wpf-and-silverlight.html
.
FindIntersection(Point, Point, Geometry, Double, Boolean)
Finds the intersection.
Declaration
public static Point FindIntersection(Point sourcePoint, Point targetPoint, Geometry geometry, double edgeThick, bool isArrow)
Parameters
System. The source point. |
System. The target point. |
System. The geometry. |
System. The edge thick. |
System. If set to |
Returns
System.
|
GetPathGeometry(String)
Gets the path geometry.
Declaration
public static PathGeometry GetPathGeometry(string abbreviatedGeometry)
Parameters
System. The abbreviated geometry. |
Returns
System.
|
GetSplineFigureTangents(IList<Point>, out Point, out Point, Double, Boolean)
Gets the tangents of the spline figure.
Declaration
public static void GetSplineFigureTangents(IList<Point> points, out Point startTangentPoint, out Point endTangentPoint, double tension = 0.5, bool isClosed = false)
Parameters
System. The points of the connection. |
System. The start tangent point. |
System. The end tangent point. |
System. The tension. |
System. If set to |
GetString(Geometry)
Converts the geometry object to its string equivalent.
Declaration
public static string GetString(this Geometry geometry)
Parameters
System. The geometry. |
Returns
System.
|