예제 #1
0
        internal RectFileReader(string fileName, int fileRoundingDigits)
        {
            comparer = new TestPointComparer(fileRoundingDigits);

            UnpaddedObstacles          = new List <Shape>();
            PaddedObstacles            = new List <Polyline>();
            RoutingSpecs               = new List <EdgeGeometry>();
            HorizontalScanLineSegments = new List <LineSegment>();
            VerticalScanLineSegments   = new List <LineSegment>();
            VisibilityGraph            = new VisibilityGraph();

            this.FreeRelativePortToShapeMap = new Dictionary <Port, Shape>();

            this.inputFileReader = new StreamReader(fileName);

            this.RandomObstacleArg     = RectFileStrings.NullStr;
            this.RandomObstacleDensity = RectFileStrings.NullStr;

            // Input parameters
            ReadHeader();

            // Input detail
            ReadInputObstacles();
            ReadPorts();
            ReadRoutingSpecs();

            // Output detail.
            ReadPaddedObstacles();
            ReadConvexHulls();
            ReadScanSegments();
            ReadVisibilityGraph();
            ReadPaths();

            this.inputFileReader.Close();
            if (0 == this.UnpaddedObstacles.Count)
            {
                Validate.Fail("No obstacles found in file");
            }
        }
 internal SegmentOrderer(TestPointComparer comp)
 {
     this.comparer = comp;
 }