コード例 #1
0
        public static DummyLine ByStartPointEndPoint(DummyPoint a, DummyPoint b)
        {
            DummyLine ln = new DummyLine();

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

            return(ln);
        }
コード例 #2
0
ファイル: DummyGeometry.cs プロジェクト: zjloscar/Dynamo
        // 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
ファイル: DummyGeometry.cs プロジェクト: zjloscar/Dynamo
        // 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
ファイル: DummyGeometry.cs プロジェクト: rafatahmed/Dynamo
        public static DummyPoint ByCoordinates(double x, double y, double z)
        {
            DummyPoint ret = new DummyPoint()
                {
                    X = x,
                    Y = y,
                    Z = z
                };

            return ret;
        }
コード例 #5
0
        public override bool Equals(object obj)
        {
            DummyPoint other = obj as DummyPoint;

            if (null == other)
            {
                return(false);
            }

            return(this.DirectionTo(other).GetLengthSquare() < 0.00001);
        }
コード例 #6
0
        public static DummyPoint ByCoordinates(double x, double y, double z)
        {
            DummyPoint ret = new DummyPoint()
            {
                X = x,
                Y = y,
                Z = z
            };

            return(ret);
        }
コード例 #7
0
ファイル: DummyGeometry.cs プロジェクト: rafatahmed/Dynamo
 public DummyVector DirectionTo(DummyPoint p1)
 {
     return DummyVector.ByCoordinates(
         p1.X - X, p1.Y - Y, p1.Z - Z);
 }
コード例 #8
0
ファイル: DummyGeometry.cs プロジェクト: rafatahmed/Dynamo
        // 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;
        }
コード例 #9
0
ファイル: DummyGeometry.cs プロジェクト: rafatahmed/Dynamo
        public static DummyLine ByStartPointEndPoint(DummyPoint a, DummyPoint b)
        {
            DummyLine ln = new DummyLine();
            ln.Start = a;
            ln.End = b;

            return ln;
        }
コード例 #10
0
 public DummyPoint Translate(double dx, double dy, double dz)
 {
     return(DummyPoint.ByCoordinates(X + dx, Y + dy, Z + dz));
 }
コード例 #11
0
 public DummyPoint Translate(DummyVector direction)
 {
     return(DummyPoint.ByCoordinates(X + direction.X, Y + direction.Y, Z + direction.Z));
 }
コード例 #12
0
 public DummyVector DirectionTo(DummyPoint p1)
 {
     return(DummyVector.ByCoordinates(
                p1.X - X, p1.Y - Y, p1.Z - Z));
 }
コード例 #13
0
ファイル: DummyGeometry.cs プロジェクト: zjloscar/Dynamo
 public static DummyLine ByStartPointEndPointWithDefault(
     [DefaultArgumentAttribute("DummyPoint.ByCoordinates(0,0,0)")] DummyPoint p1,
     [DefaultArgumentAttribute("DummyPoint.ByCoordinates(5,5,5)")] DummyPoint p2)
 {
     return(ByStartPointEndPoint(p1, p2));
 }
コード例 #14
0
ファイル: OverloadTarget.cs プロジェクト: RobertiF/Dynamo
 public static int StaticOverload(DummyPoint a)
 {
     return 2;
 }
コード例 #15
0
ファイル: OverloadTarget.cs プロジェクト: algobasket/Dynamo
 public static int StaticOverload(DummyPoint a)
 {
     return(2);
 }