コード例 #1
0
ファイル: VectorizerTest.cs プロジェクト: ubhatwar/vectorizer
        public void ScoreMethodsAreEquivalentCase2()
        {
            var polygon = new Polygon(Color.White);

            polygon.AddPoint(5, 7);
            polygon.AddPoint(10, 5);
            polygon.AddPoint(7, 15);
            var picture = new VectorPicture();

            picture.Polygons.Add(polygon);
            var mutationPolygon = new Polygon(Color.White);

            mutationPolygon.AddPoint(6, 0);
            mutationPolygon.AddPoint(5, 0);
            mutationPolygon.AddPoint(19, 18);
            mutationPolygon.AddPoint(18, 1);
            var mutation = new PolygonChanged(mutationPolygon, 0);

            CompareScoreMethods(picture, mutation, Resources.Polygon);
        }
コード例 #2
0
ファイル: VectorizerTest.cs プロジェクト: ubhatwar/vectorizer
        public void ScoreMethodsAreEquivalentCase1()
        {
            var polygon = new Polygon(Color.White);

            polygon.AddPoint(8, 13);
            polygon.AddPoint(7, 1);
            polygon.AddPoint(11, 14);
            var picture = new VectorPicture();

            picture.Polygons.Add(polygon);
            var mutationPolygon = new Polygon(Color.White);

            mutationPolygon.AddPoint(1, 4);
            mutationPolygon.AddPoint(13, 0);
            mutationPolygon.AddPoint(17, 15);
            mutationPolygon.AddPoint(2, 10);
            var mutation = new PolygonChanged(mutationPolygon, 0);

            CompareScoreMethods(picture, mutation, Resources.Polygon);
        }
コード例 #3
0
ファイル: VectorizerTest.cs プロジェクト: ubhatwar/vectorizer
        public void FindIntersection1()
        {
            var polygon = new Polygon(Color.White);

            polygon.AddPoint(33, 18);
            polygon.AddPoint(25, 1);
            polygon.AddPoint(8, 13);
            polygon.AddPoint(13, 26);
            polygon.AddPoint(34, 36);
            polygon.AddPoint(28, 14);
            polygon.AddPoint(30, 19);
            polygon.AddPoint(30, 9);
            Assert.IsTrue(polygon.IsSelfIntersecting());
        }
コード例 #4
0
ファイル: VectorizerTest.cs プロジェクト: ubhatwar/vectorizer
        public void FindIntersection2()
        {
            var polygon = new Polygon(Color.White);

            polygon.AddPoint(23, 4);
            polygon.AddPoint(12, 36);
            polygon.AddPoint(36, 34); //edge1
            polygon.AddPoint(23, 13); //edge1
            polygon.AddPoint(28, 24); //edge2
            polygon.AddPoint(28, 18); //edge2
            Assert.IsTrue(polygon.IsSelfIntersecting());
        }
コード例 #5
0
 public void ScoreMethodsAreEquivalentCase2()
 {
     var polygon = new Polygon(Color.White);
     polygon.AddPoint(5, 7);
     polygon.AddPoint(10, 5);
     polygon.AddPoint(7, 15);
     var picture = new VectorPicture();
     picture.Polygons.Add(polygon);
     var mutationPolygon = new Polygon(Color.White);
     mutationPolygon.AddPoint(6, 0);
     mutationPolygon.AddPoint(5, 0);
     mutationPolygon.AddPoint(19, 18);
     mutationPolygon.AddPoint(18, 1);
     var mutation = new PolygonChanged(mutationPolygon, 0);
     CompareScoreMethods(picture, mutation, Resources.Polygon);
 }
コード例 #6
0
 public void ScoreMethodsAreEquivalentCase1()
 {
     var polygon = new Polygon(Color.White);
     polygon.AddPoint(8,13);
     polygon.AddPoint(7,1);
     polygon.AddPoint(11,14);
     var picture = new VectorPicture();
     picture.Polygons.Add(polygon);
     var mutationPolygon = new Polygon(Color.White);
     mutationPolygon.AddPoint(1, 4);
     mutationPolygon.AddPoint(13, 0);
     mutationPolygon.AddPoint(17, 15);
     mutationPolygon.AddPoint(2, 10);
     var mutation = new PolygonChanged(mutationPolygon, 0);
     CompareScoreMethods(picture,mutation,Resources.Polygon);
 }
コード例 #7
0
 public void FindIntersection2()
 {
     var polygon = new Polygon(Color.White);
     polygon.AddPoint(23, 4);
     polygon.AddPoint(12, 36);
     polygon.AddPoint(36, 34); //edge1
     polygon.AddPoint(23, 13); //edge1
     polygon.AddPoint(28,24); //edge2
     polygon.AddPoint(28,18); //edge2
     Assert.IsTrue(polygon.IsSelfIntersecting());
 }
コード例 #8
0
 public void FindIntersection1()
 {
     var polygon = new Polygon(Color.White);
     polygon.AddPoint(33,18);
     polygon.AddPoint(25, 1);
     polygon.AddPoint(8, 13);
     polygon.AddPoint(13, 26);
     polygon.AddPoint(34, 36);
     polygon.AddPoint(28, 14);
     polygon.AddPoint(30, 19);
     polygon.AddPoint(30, 9);
     Assert.IsTrue(polygon.IsSelfIntersecting());
 }