Example #1
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);
        }
Example #2
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);
        }
Example #3
0
        public static DummyVector ByCoordinates(double x, double y, double z)
        {
            DummyVector ret = new DummyVector()
            {
                X = x,
                Y = y,
                Z = z
            };

            return(ret);
        }
Example #4
0
        public static DummyVector ByVector(DummyVector rhs)
        {
            DummyVector ret = new DummyVector()
            {
                X = rhs.X,
                Y = rhs.Y,
                Z = rhs.Z
            };

            return(ret);
        }
Example #5
0
        public static DummyVector ByCoordinates(double x, double y, double z)
        {
            DummyVector ret = new DummyVector()
            {
                X = x,
                Y = y,
                Z = z
            };

            return ret;
        }
Example #6
0
 public DummyPoint Translate(DummyVector direction)
 {
     return DummyPoint.ByCoordinates(X + direction.X, Y + direction.Y, Z + direction.Z);
 }
Example #7
0
 public DummyPoint Translate(DummyVector direction)
 {
     return(DummyPoint.ByCoordinates(X + direction.X, Y + direction.Y, Z + direction.Z));
 }
Example #8
0
 public DummyVector DirectionTo(DummyPoint p1)
 {
     return(DummyVector.ByCoordinates(
                p1.X - X, p1.Y - Y, p1.Z - Z));
 }
Example #9
0
 public DummyVector Scale(double value)
 {
     return(DummyVector.ByCoordinates(X * value, Y * value, Z * value));
 }
Example #10
0
        public static DummyVector ByVector(DummyVector rhs)
        {
            DummyVector ret = new DummyVector()
            {
                X = rhs.X,
                Y = rhs.Y,
                Z = rhs.Z
            };

            return ret;
        }