Example #1
0
        Stroke AddStroke(Vectors vectors)
        {
            var controlpoints = new CoordinateList <double> {
                new Coordinate <double>(10, 10),
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100)
            };

            return(vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints,
                                         true));
        }
Example #2
0
        public void NewFromPoints()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };

            vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false);
            Assert.AreEqual(1, vectors.Strokes.Count);
        }
Example #3
0
 // [Test]
 public void Close()
 {
     var vectors = new Vectors(_image, "firstVector");
       var controlpoints = new CoordinateList<double>() {
     new Coordinate<double>(50, 50),
     new Coordinate<double>(100, 100),
     new Coordinate<double>(150, 150)
       };
       var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
              controlpoints, false);
       stroke.Close();
       bool closed;
       stroke.GetPoints(out closed);
       Assert.IsTrue(closed);
 }
Example #4
0
        // [Test]
        public void Close()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };
            var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                                               controlpoints, false);

            stroke.Close();
            bool closed;

            stroke.GetPoints(out closed);
            Assert.IsTrue(closed);
        }
Example #5
0
        public void GetPoints()
        {
            var vectors = new Vectors(_image, "firstVector");
              var controlpoints = new CoordinateList<double>() {
            new Coordinate<double>(50, 50),
            new Coordinate<double>(100, 100),
            new Coordinate<double>(150, 150)
              };
              var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                     controlpoints, false);
              bool closed;

              // Fix me: this one segfaults
              // var points = stroke.GetPoints(out closed);
              // Assert.AreEqual(controlpoints.Count, points.Count);
              // Assert.AreEqual(controlpoints, points);
              // Assert.IsFalse(closed);
        }
Example #6
0
        public void GetPoints()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };
            var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                                               controlpoints, false);
            bool closed;

            // Fix me: this one segfaults
            // var points = stroke.GetPoints(out closed);
            // Assert.AreEqual(controlpoints.Count, points.Count);
            // Assert.AreEqual(controlpoints, points);
            // Assert.IsFalse(closed);
        }
Example #7
0
        public void Scale()
        {
            var vectors       = new Vectors(_image, "firstVector");
            var controlpoints = new CoordinateList <double>()
            {
                new Coordinate <double>(50, 50),
                new Coordinate <double>(100, 100),
                new Coordinate <double>(150, 150)
            };
            var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
                                               controlpoints, false);
            double precision = 0.001;

            stroke.Close();
            double oldLength = stroke.GetLength(precision);

            stroke.Scale(2, 2);
            double newLength = stroke.GetLength(precision);

            Assert.IsTrue(Math.Abs(2 * oldLength - newLength) < precision);
        }
Example #8
0
 Stroke AddStroke(Vectors vectors)
 {
     var controlpoints = new CoordinateList<double> {
     new Coordinate<double>(10, 10),
     new Coordinate<double>(50, 50),
     new Coordinate<double>(100, 100)
       };
       return vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints,
            true);
 }
Example #9
0
 public void NewFromPoints()
 {
     var vectors = new Vectors(_image, "firstVector");
       var controlpoints = new CoordinateList<double>() {
     new Coordinate<double>(50, 50),
     new Coordinate<double>(100, 100),
     new Coordinate<double>(150, 150)
       };
       vectors.NewFromPoints(VectorsStrokeType.Bezier, controlpoints, false);
       Assert.AreEqual(1, vectors.Strokes.Count);
 }
Example #10
0
 public void Scale()
 {
     var vectors = new Vectors(_image, "firstVector");
       var controlpoints = new CoordinateList<double>() {
     new Coordinate<double>(50, 50),
     new Coordinate<double>(100, 100),
     new Coordinate<double>(150, 150)
       };
       var stroke = vectors.NewFromPoints(VectorsStrokeType.Bezier,
              controlpoints, false);
       double precision = 0.001;
       stroke.Close();
       double oldLength = stroke.GetLength(precision);
       stroke.Scale(2, 2);
       double newLength = stroke.GetLength(precision);
       Assert.IsTrue(Math.Abs(2 * oldLength - newLength) < precision);
 }