Пример #1
0
        public static DummyLine ByStartPointEndPoint(DummyPoint a, DummyPoint b)
        {
            DummyLine ln = new DummyLine();

            ln.Start = a;
            ln.End   = b;

            return(ln);
        }
Пример #2
0
        // Another deprecated function for testing default argument
        //public static DummyLine ByPoint(DummyPoint p)
        //{
        //    DummyLine ln = new DummyLine();
        //    ln.Start = DummyPoint.ByCoordinates(0, 0, 0);
        //    ln.End = p;
        //    return ln;
        //}

        public static DummyLine ByPoint(DummyPoint p,
                                        [DefaultArgumentAttribute("DummyVector.ByCoordinates(1,2,3)")] DummyVector v)
        {
            DummyLine ln = new DummyLine();

            ln.Start = p;
            ln.End   = DummyPoint.ByCoordinates(p.X + v.X, p.Y + v.Y, p.Z + v.Z);
            return(ln);
        }
Пример #3
0
        // Deprecated function for testing
        // This function is replaced with a function with one additional parameter which has
        // default argument. During load time, any saved node created with this function
        // will be replaced by the other function but will UsingDefaultArgument enabled
        //public static DummyLine ByVector(
        //    [DefaultArgumentAttribute("DummyVector.ByCoordinates(0,0,1)")] DummyVector v)
        //{
        //    DummyLine ln = new DummyLine();
        //    ln.Start = DummyPoint.ByCoordinates(0, 0, 0);
        //    ln.End = DummyPoint.ByCoordinates(v.X, v.Y, v.Z);
        //    return ln;
        //}

        public static DummyLine ByVector(
            [DefaultArgumentAttribute("DummyVector.ByCoordinates(0,0,1)")] DummyVector v,
            double length = 10)
        {
            DummyLine ln = new DummyLine();

            ln.Start = DummyPoint.ByCoordinates(0, 0, 0);
            ln.End   = DummyPoint.ByCoordinates(v.X * length, v.Y * length, v.Z * length);
            return(ln);
        }
Пример #4
0
        // Another deprecated function for testing default argument
        //public static DummyLine ByPoint(DummyPoint p)
        //{
        //    DummyLine ln = new DummyLine();
        //    ln.Start = DummyPoint.ByCoordinates(0, 0, 0);
        //    ln.End = p;
        //    return ln;
        //}

        public static DummyLine ByPoint(DummyPoint p,
            [DefaultArgumentAttribute("DummyVector.ByCoordinates(1,2,3)")] DummyVector v)
        {
            DummyLine ln = new DummyLine();
            ln.Start = p;
            ln.End = DummyPoint.ByCoordinates(p.X + v.X, p.Y + v.Y, p.Z + v.Z);
            return ln;
        }
Пример #5
0
        // Deprecated function for testing
        // This function is replaced with a function with one additional parameter which has 
        // default argument. During load time, any saved node created with this function
        // will be replaced by the other function but will UsingDefaultArgument enabled
        //public static DummyLine ByVector(
        //    [DefaultArgumentAttribute("DummyVector.ByCoordinates(0,0,1)")] DummyVector v)
        //{
        //    DummyLine ln = new DummyLine();
        //    ln.Start = DummyPoint.ByCoordinates(0, 0, 0);
        //    ln.End = DummyPoint.ByCoordinates(v.X, v.Y, v.Z);
        //    return ln;
        //}

        public static DummyLine ByVector(
            [DefaultArgumentAttribute("DummyVector.ByCoordinates(0,0,1)")] DummyVector v,
            double length = 10)
        {
            DummyLine ln = new DummyLine();
            ln.Start = DummyPoint.ByCoordinates(0, 0, 0);
            ln.End = DummyPoint.ByCoordinates(v.X*length, v.Y*length, v.Z*length);
            return ln;
        }
Пример #6
0
        public static DummyLine ByStartPointEndPoint(DummyPoint a, DummyPoint b)
        {
            DummyLine ln = new DummyLine();
            ln.Start = a;
            ln.End = b;

            return ln;
        }