com.supermap.data

Class GeoLine3D



  • public class GeoLine3D
    extends Geometry3D
    The GeoLine class is derived from the Geometry3D class.

    This class inherits from the Geometry3D class.

    • Constructor Detail

      • GeoLine3D

        public GeoLine3D()
        Constructs a GeoLine3D object by default.
      • GeoLine3D

        public GeoLine3D(Point3Ds points)
        Creates a new GeoLine3D object according to the specified arguments.
        Parameters:
        points - The ordered 3D point collection that compose the line.
        Throws:
        java.lang.IllegalArgumentException - If the count of points is less than 2.
      • GeoLine3D

        public GeoLine3D(GeoLine3D geoLine3D)
        Initializes a new instance according to the specified GeoLine3D object.
        Parameters:
        geoLine3D - The specified GeoLine3D object.
        Throws:
        ObjectDisposedException - If the original GeoLine object to copy has called the dispose() method.
    • Method Detail

      • dispose

        public void dispose()
        Release the resource occupy by this object.
        Overrides:
        dispose in class Geometry
      • getPartCount

        public int getPartCount()
        Returns the count of the parts of the GeoLine3D object. If the GeoLine object is cleared, the count of the parts of this GeoLine is zero.
        Returns:
        the count of the subobjects of the GeoLine object.
        Default:
        The default value is 0.
      • addPart

        public int addPart(Point3Ds points)
        Adds a part to the GeoLine3D object.
        Parameters:
        points - the ordered point collection.
        Returns:
        Rreturns the index of the successfully added subobject.
        Throws:
        java.lang.IllegalArgumentException - If the count of points is less than 2.
      • removePart

        public boolean removePart(int index)
        Removes the subobject of the GeoLine object with the specified index.
        Parameters:
        index - int The index number of the specified part.
        Returns:
        Returns true, if successful; otherwise false.
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is larger than or equal to the count of subobjects or less than 0.
      • getPart

        public Point3Ds getPart(int index)
        Returns the subobject with the specified index in the GeoLine object, return the subobject in form of a ordered point collection.
        Parameters:
        index - The subobject index.
        Returns:
        Returns the Point3Ds object if succeed, return null if failed.
      • insertPart

        public boolean insertPart(int index,
                                  Point3Ds points)
        Inserts a subobject to the GeoLine object at specified place. If succeeded, this method will return true; otherwise false.
        Parameters:
        index - Inserted position
        points - the ordered set of points that will be inserted.
        Returns:
        Returns true, if successful; otherwise false.
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is greater than the count of the subobjects in the GeoLine object or a negative value.
        java.lang.IllegalArgumentException - If the count of points is less than 2.
      • setPart

        public boolean setPart(int index,
                               Point3Ds points)
        Modify the subobject with the given index of the GeoLine3D object.
        Parameters:
        index - The index number of the part to be modify.
        points - the ordered point collection.
        Returns:
        Returns true, if successful; otherwise false.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is not less than the count of the subobjects or it is a negative value.
        java.lang.IllegalArgumentException - If the count of points is less than 2.
      • indexOf

        public int indexOf(Point3Ds points)
        Returns the index of the specified 3D point collection in the 3D line object. If the GeoLine object is cleared, the count of the parts of this GeoLine is zero.
        Parameters:
        points - the ordered point collection.
        Returns:
        The index of the specified 3D point collection in the 3D line object.
      • convertToRegion

        public GeoRegion3D convertToRegion()
        Converts 3D line object into 3D polygon object and returns 3D polygon object if successful. For 3D line objects that are not closed, the head and tail will be connected while being converted into 3D polygon object.
        Returns:
        Returns GeoRegion3D object.
      • clone

        public GeoLine3D clone()
        Returns a copy of the current GeoLine object.
        Specified by:
        clone in class Geometry
        Returns:
        The new GeoLineM object generated from the clone operation.
      • isEmpty

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