Exemplo n.º 1
0
 public static double Length(DPoint point)
 {
     using (var native = point.ToNative())
     {
         NativeMethods.matrix_length_dpoint(native.NativePtr, out var length);
         return(length);
     }
 }
Exemplo n.º 2
0
 public override DPoint Operator(DPoint point)
 {
     using (var native = point.ToNative())
     {
         var ptr = Native.point_rotator_operator(this.NativePtr, native.NativePtr);
         return(new DPoint(ptr));
     }
 }
Exemplo n.º 3
0
 public override DPoint Operator(DPoint point)
 {
     using (var native = point.ToNative())
     {
         var ptr = NativeMethods.point_transform_operator(this.NativePtr, native.NativePtr);
         return(new DPoint(ptr));
     }
 }
Exemplo n.º 4
0
        public PointTransform(double angle, DPoint vector)
        {
            if (vector == null)
            {
                throw new ArgumentNullException(nameof(vector));
            }

            using (var native = vector.ToNative())
                this.NativePtr = Native.point_transform_new1(angle, native.NativePtr);
        }
Exemplo n.º 5
0
 public DRectangle(DPoint point)
 {
     using (var np = point.ToNative())
         using (var native = new NativeDRectangle(np))
         {
             this._Left   = native.Left;
             this._Top    = native.Top;
             this._Right  = native.Right;
             this._Bottom = native.Bottom;
         }
 }
Exemplo n.º 6
0
 public DRectangle(DPoint p1, DPoint p2)
 {
     using (var np1 = p1.ToNative())
         using (var np2 = p2.ToNative())
             using (var native = new NativeDRectangle(np1, np2))
             {
                 this._Left   = native.Left;
                 this._Top    = native.Top;
                 this._Right  = native.Right;
                 this._Bottom = native.Bottom;
             }
 }
Exemplo n.º 7
0
        public PointTransformAffine(Matrix <double> matrix, DPoint vector)
        {
            if (matrix == null)
            {
                throw new ArgumentNullException(nameof(matrix));
            }
            if (vector == null)
            {
                throw new ArgumentNullException(nameof(vector));
            }

            matrix.ThrowIfDisposed();

            if (matrix.Columns != 2 || matrix.Rows != 2)
            {
                throw new ArgumentException($"{nameof(matrix)} should be 2x2 matrix");
            }

            using (var native = vector.ToNative())
                this.NativePtr = Native.point_transform_affine_new1(matrix.NativePtr, native.NativePtr);
        }