Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/LineHelper.cs
===================================================================
diff -u -r4184 -r4185
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/LineHelper.cs (.../LineHelper.cs) (revision 4184)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/LineHelper.cs (.../LineHelper.cs) (revision 4185)
@@ -28,27 +28,24 @@
///
/// Helper class for Line objects
///
-public class LineHelper
+public static class LineHelper
{
-
- private readonly Routines2D routines2D = new Routines2D();
-
///
/// Calculate intersection between two lines (strict interpolation)
///
///
///
///
///
- public bool GetStrictIntersectionPoint(Line line1, Line line2, ref GeometryPoint intersectPoint)
+ public static bool GetStrictIntersectionPoint(Line line1, Line line2, ref GeometryPoint intersectPoint)
{
var point1 = new Point2D(line1.BeginPoint.X, line1.BeginPoint.Z);
var point2 = new Point2D(line1.EndPoint.X, line1.EndPoint.Z);
var point3 = new Point2D(line2.BeginPoint.X, line2.BeginPoint.Z);
var point4 = new Point2D(line2.EndPoint.X, line2.EndPoint.Z);
Point2D ip;
- LineIntersection res = routines2D.DetermineIf2DLinesIntersectStrickly(point1, point2, point3,
+ LineIntersection res = Routines2D.DetermineIf2DLinesIntersectStrickly(point1, point2, point3,
point4, out ip);
if (ip != null)
{
@@ -69,7 +66,7 @@
/// Circle's radius
/// Point collection which defines a line. Extrapolation is performed at the start and end points.
/// Intersections of this line extrapolated to the negative and positive X with the circle.
- public List ExtendedSurfaceIntersectionPointsWithCircle(double xMid, double zMid, double radius, IList pointss)
+ public static List ExtendedSurfaceIntersectionPointsWithCircle(double xMid, double zMid, double radius, IList pointss)
{
List points = pointss.Where(p => !double.IsNaN(p.X)).ToList();
if (points.Count >= 2)
@@ -106,7 +103,7 @@
/// The radius.
/// The points.
///
- public List IntersectionPointsWithCircle(double xMid, double zMid, double radius, IList points)
+ public static List IntersectionPointsWithCircle(double xMid, double zMid, double radius, IList points)
{
var result = new List();
if (points.Count >= 2)
@@ -134,7 +131,7 @@
return result;
}
- public GeometryPoint GetIntersectionPointWithExtrapolation(GeometryPoint p1, GeometryPoint p2, GeometryPoint p3, GeometryPoint p4)
+ public static GeometryPoint GetIntersectionPointWithExtrapolation(GeometryPoint p1, GeometryPoint p2, GeometryPoint p3, GeometryPoint p4)
{
return IntersectionPointWithExtrapolation(p1, p2, p3, p4);
}
@@ -147,9 +144,9 @@
/// The r.
/// The line.
///
- private List Intersect_Circle_line(double xm, double ym, double r, Line line)
+ private static List Intersect_Circle_line(double xm, double ym, double r, Line line)
{
- return routines2D.IntersectCircleline(xm, ym, r, line.BeginPoint.X, line.EndPoint.X, line.BeginPoint.Z, line.EndPoint.Z);
+ return Routines2D.IntersectCircleline(xm, ym, r, line.BeginPoint.X, line.EndPoint.X, line.BeginPoint.Z, line.EndPoint.Z);
}
///
@@ -160,7 +157,7 @@
///
///
/// Intersection point or null (parallel lines)
- private GeometryPoint IntersectionPointWithExtrapolation(GeometryPoint p1, GeometryPoint p2, GeometryPoint p3, GeometryPoint p4)
+ private static GeometryPoint IntersectionPointWithExtrapolation(GeometryPoint p1, GeometryPoint p2, GeometryPoint p3, GeometryPoint p4)
{
GeometryPoint intersectPoint = null;
@@ -169,7 +166,7 @@
var point3 = new Point2D(p3.X, p3.Z);
var point4 = new Point2D(p4.X, p4.Z);
- routines2D.DetermineIf2DLinesIntersectWithExtrapolation(point1, point2, point3, point4, out Point2D ip);
+ Routines2D.DetermineIf2DLinesIntersectWithExtrapolation(point1, point2, point3, point4, out Point2D ip);
if (ip != null)
{
intersectPoint = new GeometryPoint(ip.X, ip.Z);