Exemple #1
0
        // Add or change the final unfixed point.
        private void AddUnfixedPoint(PointF newPoint)
        {
            if (numberFixedPoints > points.Count - 1)
            {
                points.Add(newPoint);
            }
            else
            {
                points[numberFixedPoints] = newPoint;
            }

            if (points.Count >= 2)
            {
                highlight = new BoundaryCourseObj(Id <Special> .None, courseObjRatio, appearance, new SymPath(points.ToArray()));
            }
        }
 public void BoundarySpecial()
 {
     CourseObj courseobj = new BoundaryCourseObj(SpecialId(0), 1.0F, specialAppearance, new SymPath(new PointF[4] { new PointF(-3.0F, -2.0F), new PointF(-1.0F, 1.5F), new PointF(2.5F, 1.0F), new PointF(3.0F, -2.0F) }));
     SingleObject(courseobj, "boundary_special");
 }
        public void GetLineHandles()
        {
            CourseObj courseobj = new BoundaryCourseObj(SpecialId(0), 1.0F, defaultCourseAppearance, new SymPath(new PointF[4] { new PointF(-3.0F, -2.0F), new PointF(-1.0F, 1.5F), new PointF(2.5F, 1.0F), new PointF(3.0F, -2.0F) }));
            PointF[] handles = courseobj.GetHandles();
            PointF[] expected = {new PointF(-3.0F, -2.0F), new PointF(-1.0F, 1.5F), new PointF(2.5F, 1.0F), new PointF(3.0F, -2.0F) };

            Assert.AreEqual(expected.Length, handles.Length);
            for (int i = 0; i < handles.Length; ++i)
                Assert.AreEqual(expected[i], handles[i]);
        }
 public void BoundaryOffset()
 {
     CourseObj courseobj = new BoundaryCourseObj(SpecialId(0), 1.0F, defaultCourseAppearance, new SymPath(new PointF[4] { new PointF(-3.0F, -2.0F), new PointF(-1.0F, 1.5F), new PointF(2.5F, 1.0F), new PointF(3.0F, -2.0F) }));
     SingleObjectOffset(courseobj, "boundary_offset");
 }