com.supermap.data

Class GeoCompound



  • public class GeoCompound
    extends Geometry
    The GeoCompound class.
    • Constructor Summary

      Constructors 
      Constructor and Description
      GeoCompound()
      Constructs a new GeoCompound object.
      GeoCompound(GeoCompound geoCompound)
      Initializes a new instance according to the specified GeoCompound object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int addPart(Geometry geometry)
      Appends a part to this GeoCompound object.
      void adjust(boolean isMinGeometryMovedUp)
      Adjust the stacking order of subobjects in composite geometric objects.
      GeoCompound clone()
      Clone object
      void dispose()
      Destructor.object.
      Geometry[] divide(boolean isTopOnly)
      Decompose GeoCompound objects.
      Geometry getPart(int index)
      Returns the subobject of the GeoCompound object with the specified index.
      int getPartCount()
      Returns the count of the subobjects of the GeoCompound object.
      boolean insertPart(int index, Geometry geometry)
      Insert a subobject at the location of the specified serial number in the GeoCompound object.
      boolean isEmpty()
      Returns a value indicating whether the count of the subobjects of this GeoCompound object is zero.
      void offset(double dx, double dy)
      Offset geometry object.
      boolean removePart(int index)
      Removes the subobject of the GeoCompound object with the specified index.
      void rotate(Point2D basePoint, double angle)
      Rotate geometry object.
      void setEmpty()
      Empty the geometry object.
      boolean setPart(int index, Geometry geometry)
      Replaces the subobject at the specified ordinal in the GeoCompound object with the specified geometric object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeoCompound

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

        public GeoCompound(GeoCompound geoCompound)
        Initializes a new instance according to the specified GeoCompound object.
        Parameters:
        geoCompound - the specified eoCompound object.
    • Method Detail

      • addPart

        public int addPart(Geometry geometry)
        Appends a part to this GeoCompound object.
        Parameters:
        geometry - the subobject to add.
        Returns:
        Returns the added index ,If succeed ,otherwise, returns -1 .
      • getPartCount

        public int getPartCount()
        Returns the count of the subobjects of the GeoCompound object.
        Returns:
        the count of the subobjects of the GeoCompound object.
        Default:
        The default value is 0.
      • removePart

        public boolean removePart(int index)
        Removes the subobject of the GeoCompound object with the specified index.
        Parameters:
        index - int The index number of the specified part.
        Returns:
        Returns true, if successful; otherwise false.
      • getPart

        public Geometry getPart(int index)
        Returns the subobject of the GeoCompound object with the specified index.
        Parameters:
        index - Specifies the number of subobjects to get.
        Returns:
        Returns the Geometry object if succeed, return null if failed.
      • insertPart

        public boolean insertPart(int index,
                                  Geometry geometry)
        Insert a subobject at the location of the specified serial number in the GeoCompound object.
        Parameters:
        index - The specified insertion position, the default value is 1.
        geometry - The subobject to be inserted.
        Returns:
        Return true if insert successful; otherwise false.
      • setPart

        public boolean setPart(int index,
                               Geometry geometry)
        Replaces the subobject at the specified ordinal in the GeoCompound object with the specified geometric object.
        Parameters:
        index - The sequence number of the replaced subobject must be greater than or equal to zero.
        geometry - The specified Geometry object.
        Returns:
        Returns true, if successful; otherwise false.
      • adjust

        public void adjust(boolean isMinGeometryMovedUp)
        Adjust the stacking order of subobjects in composite geometric objects.
        Parameters:
        isMinGeometryMovedUp - Whether to move smaller subobjects to the top.
      • divide

        public Geometry[] divide(boolean isTopOnly)
        Decompose GeoCompound objects.

        If isTopOnly is true, then the return geometry object, there may be a composite geometric object, otherwise, will not.

        Parameters:
        isTopOnly - Whether to split only the top object.
        Returns:
        Subobject list.
      • clone

        public GeoCompound clone()
        Clone object
        Specified by:
        clone in class Geometry
        Returns:
        Gets a new geometry object by clone.
      • dispose

        public void dispose()
        Destructor.object.
        Overrides:
        dispose in class Geometry
      • isEmpty

        public boolean isEmpty()
        Returns a value indicating whether the count of the subobjects of this GeoCompound object is zero.
        Overrides:
        isEmpty in class Geometry
        Returns:
        Rreturns true it the GeoCompound object is empty.
      • rotate

        public void rotate(Point2D basePoint,
                           double angle)
        Rotate geometry object.
        Overrides:
        rotate in class Geometry
        Parameters:
        basePoint - The base point of rotation
        angle - The angle point of rotation
      • offset

        public void offset(double dx,
                           double dy)
        Offset geometry object.
        Overrides:
        offset in class Geometry
        Parameters:
        dx - X axis offset
        dy - Y axis offset
      • setEmpty

        public void setEmpty()
        Empty the geometry object.
        Overrides:
        setEmpty in class Geometry