Packages

 

com.aspose.cad

Class Point

  • java.lang.Object
    • com.aspose.ms.System.ValueType<T>
      • com.aspose.ms.lang.Struct<Point>
        • com.aspose.cad.Point


  • public class Point
    extends com.aspose.ms.lang.Struct<Point>

    Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Point() 
      Point(int dw)
      Initializes a new instance of the Aspose.CAD.Point structure using coordinates specified by an integer value.
      Point(int x, int y)
      Initializes a new instance of the Aspose.CAD.Point structure with the specified coordinates.
      Point(Size size)
      Initializes a new instance of the Aspose.CAD.Point structure from the Aspose.CAD.Size structure.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static Point add(Point point, Size size)
      Adds the specified Aspose.CAD.Size to the specified Aspose.CAD.Point.
      static Point ceiling(PointF point)
      Converts the specified Aspose.CAD.PointF to a Aspose.CAD.Point by rounding the values of the Aspose.CAD.PointF to the next higher integer values.
      Object clone() 
      Point Clone() 
      void CloneTo(Point that) 
      boolean equals(Object obj)
      Specifies whether this Aspose.CAD.Point contains the same coordinates as the specified System.Object.
      static Point getEmpty()
      Gets a new instance of the Aspose.CAD.Point structure that has Aspose.CAD.Point.X and Aspose.CAD.Point.Y values set to zero.
      int getX()
      Gets or sets the x-coordinate of this Aspose.CAD.Point.
      int getY()
      Gets or sets the y-coordinate of this Aspose.CAD.Point.
      int hashCode()
      Returns a hash code for this Aspose.CAD.Point.
      boolean isEmpty()
      Gets a value indicating whether this Aspose.CAD.Point is empty.
      void offset(int dx, int dy)
      Translates this Aspose.CAD.Point by the specified amount.
      void offset(Point point)
      Translates this Aspose.CAD.Point by the specified Aspose.CAD.Point.
      static Point op_Addition(Point point, Size size)
      Translates a Aspose.CAD.Point by a given Aspose.CAD.Size.
      static boolean op_Equality(Point point1, Point point2)
      Compares two Aspose.CAD.Point objects.
      static boolean op_Inequality(Point point1, Point point2)
      Compares two Aspose.CAD.Point objects.
      static Point op_Subtraction(Point point, Size size)
      Translates a Aspose.CAD.Point by the negative of a given Aspose.CAD.Size.
      static Point round(PointF point)
      Converts the specified Aspose.CAD.PointF to a Aspose.CAD.Point object by rounding the Aspose.CAD.Point values to the nearest integer.
      void setX(int value)
      Gets or sets the x-coordinate of this Aspose.CAD.Point.
      void setY(int value)
      Gets or sets the y-coordinate of this Aspose.CAD.Point.
      static Point subtract(Point point, Size size)
      Returns the result of subtracting specified Aspose.CAD.Size from the specified Aspose.CAD.Point.
      static PointF to_PointF(Point point)
      Converts the specified Point structure to the PointF structure.
      static Size to_Size(Point point)
      Converts the specified Aspose.CAD.Point structure to a Aspose.CAD.Size structure.
      String toString()
      Converts this Aspose.CAD.Point to a human-readable string.
      static Point truncate(PointF point)
      Converts the specified Aspose.CAD.PointF to a Aspose.CAD.Point by truncating the values of the Aspose.CAD.Point.
    • Constructor Detail

      • Point

        public Point()
      • Point

        public Point(int x,
             int y)

        Initializes a new instance of the Aspose.CAD.Point structure with the specified coordinates.

        Parameters:
        x - The horizontal position of the point.
        y - The vertical position of the point.
      • Point

        public Point(Size size)

        Initializes a new instance of the Aspose.CAD.Point structure from the Aspose.CAD.Size structure.

        Parameters:
        size - Contains the new point coordinates.
      • Point

        public Point(int dw)

        Initializes a new instance of the Aspose.CAD.Point structure using coordinates specified by an integer value.

        Parameters:
        dw - A 32-bit integer that specifies the coordinates for the new point.
    • Method Detail

      • getEmpty

        public static Point getEmpty()

        Gets a new instance of the Aspose.CAD.Point structure that has Aspose.CAD.Point.X and Aspose.CAD.Point.Y values set to zero.

      • isEmpty

        public boolean isEmpty()

        Gets a value indicating whether this Aspose.CAD.Point is empty.

        Returns:
        True if both Aspose.CAD.Point.X and Aspose.CAD.Point.Y are 0; otherwise, false.
      • getX

        public int getX()

        Gets or sets the x-coordinate of this Aspose.CAD.Point.

      • setX

        public void setX(int value)

        Gets or sets the x-coordinate of this Aspose.CAD.Point.

      • getY

        public int getY()

        Gets or sets the y-coordinate of this Aspose.CAD.Point.

      • setY

        public void setY(int value)

        Gets or sets the y-coordinate of this Aspose.CAD.Point.

      • add

        public static Point add(Point point,
                Size size)

        Adds the specified Aspose.CAD.Size to the specified Aspose.CAD.Point.

        Parameters:
        point - The Aspose.CAD.Point to add to.
        size - The Aspose.CAD.Size to add to the point.
        Returns:
        The Aspose.CAD.Point that is the result of the addition operation.
      • subtract

        public static Point subtract(Point point,
                     Size size)

        Returns the result of subtracting specified Aspose.CAD.Size from the specified Aspose.CAD.Point.

        Parameters:
        point - The Aspose.CAD.Point to be subtracted from.
        size - The Aspose.CAD.Size to subtract from the point.
        Returns:
        The Aspose.CAD.Point that is the result of the subtraction operation.
      • ceiling

        public static Point ceiling(PointF point)

        Converts the specified Aspose.CAD.PointF to a Aspose.CAD.Point by rounding the values of the Aspose.CAD.PointF to the next higher integer values.

        Parameters:
        point - The Aspose.CAD.PointF to convert.
        Returns:
        The Aspose.CAD.Point this method converts to.
      • round

        public static Point round(PointF point)

        Converts the specified Aspose.CAD.PointF to a Aspose.CAD.Point object by rounding the Aspose.CAD.Point values to the nearest integer.

        Parameters:
        point - The Aspose.CAD.PointF to convert.
        Returns:
        The Aspose.CAD.Point this method converts to.
      • truncate

        public static Point truncate(PointF point)

        Converts the specified Aspose.CAD.PointF to a Aspose.CAD.Point by truncating the values of the Aspose.CAD.Point.

        Parameters:
        point - The Aspose.CAD.PointF to convert.
        Returns:
        The Aspose.CAD.Point this method converts to.
      • op_Addition

        public static Point op_Addition(Point point,
                        Size size)

        Translates a Aspose.CAD.Point by a given Aspose.CAD.Size.

        Parameters:
        point - The Aspose.CAD.Point to translate.
        size - A Aspose.CAD.Size that specifies the pair of numbers to add to the coordinates of point.
        Returns:
        The translated Aspose.CAD.Point.
      • op_Subtraction

        public static Point op_Subtraction(Point point,
                           Size size)

        Translates a Aspose.CAD.Point by the negative of a given Aspose.CAD.Size.

        Parameters:
        point - The Aspose.CAD.Point to translate.
        size - A Aspose.CAD.Size that specifies the pair of numbers to subtract from the coordinates of point.
        Returns:
        A Aspose.CAD.Point structure that is translated by the negative of a given Aspose.CAD.Size structure.
      • op_Equality

        public static boolean op_Equality(Point point1,
                          Point point2)

        Compares two Aspose.CAD.Point objects. The result specifies whether the values of the Aspose.CAD.Point.X and Aspose.CAD.Point.Y properties of the two Aspose.CAD.Point objects are equal.

        Parameters:
        point1 - A first Aspose.CAD.Point to compare.
        point2 - A second Aspose.CAD.Point to compare.
        Returns:
        True if the Aspose.CAD.Point.X and Aspose.CAD.Point.Y values of point1 and point2 are equal; otherwise, false.
      • op_Inequality

        public static boolean op_Inequality(Point point1,
                            Point point2)

        Compares two Aspose.CAD.Point objects. The result specifies whether the values of the Aspose.CAD.Point.X or Aspose.CAD.Point.Y properties of the two Aspose.CAD.Point objects are unequal.

        Parameters:
        point1 - A first Aspose.CAD.Point to compare.
        point2 - A second Aspose.CAD.Point to compare.
        Returns:
        True if the values of either the Aspose.CAD.Point.X properties or the Aspose.CAD.Point.Y properties of point1 and point2 differ; otherwise, false.
      • to_Size

        public static Size to_Size(Point point)

        Converts the specified Aspose.CAD.Point structure to a Aspose.CAD.Size structure.

        Parameters:
        point - The Aspose.CAD.Point to be converted.
        Returns:
        The Aspose.CAD.Size that results from the conversion.
      • to_PointF

        public static PointF to_PointF(Point point)

        Converts the specified Point structure to the PointF structure.

        Parameters:
        point - The Point to be converted.
        Returns:
        The PointF that results from the conversion.
      • offset

        public void offset(Point point)

        Translates this Aspose.CAD.Point by the specified Aspose.CAD.Point.

        Parameters:
        point - The Aspose.CAD.Point used to offset this Aspose.CAD.Point.
      • offset

        public void offset(int dx,
                  int dy)

        Translates this Aspose.CAD.Point by the specified amount.

        Parameters:
        dx - The amount to offset the x-coordinate.
        dy - The amount to offset the y-coordinate.
      • equals

        public boolean equals(Object obj)

        Specifies whether this Aspose.CAD.Point contains the same coordinates as the specified System.Object.

        Overrides:
        equals in class Object
        Parameters:
        obj - The System.Object to test.
        Returns:
        True if obj is a Aspose.CAD.Point and has the same coordinates as this Aspose.CAD.Point.
      • hashCode

        public int hashCode()

        Returns a hash code for this Aspose.CAD.Point.

        Overrides:
        hashCode in class Object
        Returns:
        A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
      • toString

        public String toString()

        Converts this Aspose.CAD.Point to a human-readable string.

        Overrides:
        toString in class Object
        Returns:
        A System.String that represents this instance.
      • CloneTo

        public void CloneTo(Point that)
        Specified by:
        CloneTo in class com.aspose.ms.System.ValueType<Point>
      • Clone

        public Point Clone()
        Specified by:
        Clone in class com.aspose.ms.System.ValueType<Point>