Browse Source

removed old Line constructor

Alexander Hendrich 10 years ago
parent
commit
c1be5e8596
1 changed files with 0 additions and 41 deletions
  1. 0 41
      bbiwarg/Utility/Line2D.cs

+ 0 - 41
bbiwarg/Utility/Line2D.cs

@@ -30,47 +30,6 @@ namespace bbiwarg.Utility
             NumCombinedLines = 1;
         }
 
-        public Line2D(List<Line2D> lines) {
-            //list all points
-            List<Vector2D> points = new List<Vector2D>();
-            List<Vector2D> directions = new List<Vector2D>();
-            NumCombinedLines = 0;
-            foreach (Line2D line in lines) {
-                points.Add(line.P1);
-                points.Add(line.P2);
-                directions.Add(line.Direction);
-                NumCombinedLines += line.NumCombinedLines;
-            }
-
-            //find two points with max-distance
-            Vector2D a = points[0];
-            Vector2D b = points[0];
-            float length = 0;
-            foreach (Vector2D p in points) {
-                float distanceToA = p.getDistanceTo(a);
-                float distanceToB = p.getDistanceTo(b);
-
-                if (distanceToA > length && distanceToA >= distanceToB) {
-                    b = p;
-                    length = distanceToA;
-                }
-                else if (distanceToB > length && distanceToB > distanceToA) {
-                    a = p;
-                    length = distanceToA;
-                }
-            }
-
-            //project a and b on mean-line
-            Vector2D meanPoint = Vector2D.mean(points);
-            Vector2D meanDirection = Vector2D.mean(directions);
-
-            Line2D meanLine = new Line2D(meanPoint, meanPoint + meanDirection);
-            Vector2D meanA = meanLine.projectToLine(a);
-            Vector2D meanB = meanLine.projectToLine(b);
-
-            setPoints(meanA, meanB);
-        }
-
         private void setPoints(Vector2D p1, Vector2D p2) {
             //endpoints
             P1 = p1;