Example #1
0
 public static double Length(DPoint point)
 {
     using (var native = point.ToNative())
     {
         NativeMethods.matrix_length_dpoint(native.NativePtr, out var length);
         return(length);
     }
 }
Example #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));
     }
 }
Example #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));
     }
 }
Example #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);
        }
Example #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;
         }
 }
Example #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;
             }
 }
        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);
        }