com.supermap.data

Class GeoRectangle



  • public class GeoRectangle
    extends Geometry
    The Rectangle2D object class.

    This class is mainly used in the CAD layer, it is the subobject of the Geometryobject.

    • Constructor Detail

      • GeoRectangle

        public GeoRectangle()
        Constructs a new GeoRectangle object.
      • GeoRectangle

        public GeoRectangle(GeoRectangle geoRectangle)
        Initializes a new instance identical to the given GeoRectangle object.
        Parameters:
        geoRectangle - The given GeoRectangle object.
      • GeoRectangle

        public GeoRectangle(Point2D center,
                            double width,
                            double height,
                            double angle)
        Creates a new GeoRectangle object according to the specified arguments.
        Parameters:
        center - Center
        width - The width of the front two-dimensional rectangular geometry.
        height - The height of the GeoRectangle object before rotating.
        angle - The rotation angle of the GeoRectangle object. The pivot point is the center of the GeoRectangle object.
      • GeoRectangle

        public GeoRectangle(Rectangle2D rectangle,
                            double rotation)
        Create a new Rectangle2D object according to a Rectangle2D object. the default rotation angle is 0.
        Parameters:
        rectangle - The Rectangle Object
        rotation - The rotation angle of the GeoRectangle object. The pivot point is the center of the GeoRectangle object.
    • Method Detail

      • convertToLine

        public GeoLine convertToLine()
        Converts the GeoRectangle object to the GeoLine object.
        Returns:
        The line geometrical object.
      • convertToRegion

        public GeoRegion convertToRegion()
        Converts the GeoRectangle object to the GeoRegion object.
        Returns:
        The region geometrical object.
      • getCenter

        public Point2D getCenter()
        Returns the center of the GeoRectangle object.
        Returns:
        the center of the GeoRectangle object.
        Default:
        The default value is {X = 0,Y = 0}.
      • setCenter

        public void setCenter(Point2D value)
        Sets the center point of the GeoLegend object.
        Parameters:
        value - The center of the GeoRectangle object.
      • getWidth

        public double getWidth()
        Returns the width of the GeoRectangle object, that is the width before rotating.
        Returns:
        Returns the width of the GeoRectangle object.
        Default:
        The default value is 1.
      • setWidth

        public void setWidth(double value)
        Sets the width of the GeoRectangle object, that is the width before rotating.
        Parameters:
        value - The width of the GeoRectangle object.
      • getHeight

        public double getHeight()
        Returns the height of the GeoRectangle object, that is the height before rotating.
        Returns:
        Returns the width of the GeoRectangle object.
        Default:
        The default value is 1.
      • setHeight

        public void setHeight(double value)
        Sets the height of the GeoRectangle object, that is the height before rotating.
        Parameters:
        value - The width of the GeoRectangle object.
      • getRotation

        public double getRotation()
        Returns the rotation angle of the GeoRectangle object. The pivot point is the center of the GeoRectangle object.

        The rotation angle of the GeoRectangle object after being stored with the data engine. The accuracy is 0.1 degrees. The rotation angle accuracy doesn't change for the GeoRectangle object constructed by the constructor.

        Returns:
        Return the rotation angle of the GeoRectangle object.
        Default:
        The default value is 0.
      • setRotation

        public void setRotation(double value)
        Sets the rotation angle of the GeoRectangle object. The pivot point is the center of the GeoRectangle object.
        Parameters:
        value - Return the rotation angle of the GeoRectangle object.
      • clone

        public GeoRectangle clone()
        Returns a copy of the current GeoRectangle object.
        Specified by:
        clone in class Geometry
        Returns:
        The new GeoText3D object generated from the clone operation.
      • dispose

        public void dispose()
        Disposes the resources occupied by the object. After calling this method, this object will not be usable.
        Overrides:
        dispose in class Geometry