Ejemplo n.º 1
0
        public void TestTestOrientation()
        {
            IList <Point2d> points1 = AsList(new Point2d(0, 0), new Point2d(10, 0), new Point2d(10, 10), new Point2d(0, 10));
            IList <Point2d> points2 = AsList(new Point2d(0, 0), new Point2d(0, 10), new Point2d(10, 10), new Point2d(10, 0));

            Assert.AreEqual(Orientation.CCW, PolygonUtils.TestOrientation(points1, false));
            Assert.AreEqual(Orientation.CW, PolygonUtils.TestOrientation(points2, false));
        }
Ejemplo n.º 2
0
        public void TestOrientation_Robust()
        {
            IList <Point2d> points1 = AsList(new Point2d(0, 0), new Point2d(10, 0), new Point2d(10, 10), new Point2d(0, 10));
            IList <Point2d> points2 = AsList(new Point2d(0, 0), new Point2d(0, 10), new Point2d(10, 10), new Point2d(10, 0));

            Assert.AreEqual(Orientation.CCW, PolygonUtils.TestOrientation(points1, true));
            Assert.AreEqual(Orientation.CW, PolygonUtils.TestOrientation(points2, true));

            IList <Point2d> points3 = DuplicatePoints(points1);
            IList <Point2d> points4 = DuplicatePoints(points2);

            Assert.AreEqual(Orientation.CCW, PolygonUtils.TestOrientation(points3, true));
            Assert.AreEqual(Orientation.CW, PolygonUtils.TestOrientation(points4, true));
        }
Ejemplo n.º 3
0
 /**
  * This method evaluates the orientation of this polygon.
  * <p>
  * {@link http://www.easywms.com/easywms/?q=en/node/3602}
  * {@link http://paulbourke.net/geometry/clockwise/}
  * {@link http://paulbourke.net/geometry/polygonmesh/}
  */
 public Orientation TestOrientation()
 {
     return(PolygonUtils.TestOrientation(this.vertices, this.robust));
 }