public void TestGrid()
        {
            // Use fixed PM to try and get at least some points hitting the boundary
            var geomFactory = GeometryFactory.Fixed;
            //		GeometryFactory geomFactory = new GeometryFactory();

            var gridBuilder = new PerturbedGridPolygonBuilder(geomFactory)
                                  {
                                      NumLines = 20,
                                      LineWidth = 10.0,
                                      Seed = 1185072199
                                      , Verbose =  false
                                  };
            //gridBuilder.SetSeed(1185072199562);
            var area = gridBuilder.Geometry;

            //    PointInAreaLocator pia = new IndexedPointInAreaLocator(area); 
            IPointOnGeometryLocator pia = new IndexedPointInAreaLocator(area);

            var gridTester = new PointInAreaStressTester(geomFactory, area)
                                 {
                                     NumPoints = 100000,
                                     TestPointInAreaLocator = pia
                                 };

            Boolean isCorrect = gridTester.Run();
            Assert.IsTrue(isCorrect);
        }
예제 #2
0
        public void TestGrid()
        {
            // Use fixed PM to try and get at least some points hitting the boundary
            var geomFactory = GeometryFactory.Fixed;
            //		GeometryFactory geomFactory = new GeometryFactory();

            var gridBuilder = new PerturbedGridPolygonBuilder(geomFactory)
            {
                NumLines  = 20,
                LineWidth = 10.0,
                Seed      = 1185072199
                , Verbose = false
            };
            //gridBuilder.SetSeed(1185072199562);
            var area = gridBuilder.Geometry;

            //    PointInAreaLocator pia = new IndexedPointInAreaLocator(area);
            IPointOnGeometryLocator pia = new IndexedPointInAreaLocator(area);

            var gridTester = new PointInAreaStressTester(geomFactory, area)
            {
                NumPoints = 100000,
                TestPointInAreaLocator = pia
            };

            Boolean isCorrect = gridTester.Run();

            Assert.IsTrue(isCorrect);
        }
        public void TestGrid()
        {
            // Use fixed PM to try and get at least some points hitting the boundary
            GeometryFactory geomFactory = new GeometryFactory(pmFixed_1);
            //		GeometryFactory geomFactory = new GeometryFactory();
		
            PerturbedGridPolygonBuilder gridBuilder = new PerturbedGridPolygonBuilder(geomFactory);
            gridBuilder.NumLines = 20;
            gridBuilder.LineWidth = 10.0;
            IGeometry area = gridBuilder.Geometry;
		
            SimpleRayCrossingPointInAreaLocator pia = new SimpleRayCrossingPointInAreaLocator(area); 

            PointInAreaStressTester gridTester = new PointInAreaStressTester(geomFactory, area);
            gridTester.NumPoints = 100000;
            gridTester.TestPointInAreaLocator = pia;
		
            bool isCorrect = gridTester.Run();
            Assert.IsTrue(isCorrect);
        }