com.supermap.data
Class GeoLine3D
- java.lang.Object
-
- com.supermap.data.Geometry
-
- com.supermap.data.Geometry3D
-
- com.supermap.data.GeoLine3D
-
public class GeoLine3D extends Geometry3D
The GeoLine class is derived from theGeometry3D
class.This class inherits from the Geometry3D class.
-
-
Constructor Summary
Constructors Constructor and Description GeoLine3D()
Constructs a GeoLine3D object by default.GeoLine3D(GeoLine3D geoLine3D)
Initializes a new instance according to the specified GeoLine3D object.GeoLine3D(Point3Ds points)
Creates a new GeoLine3D object according to the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
addPart(Point3Ds points)
Adds a part to the GeoLine3D object.GeoLine3D
clone()
Returns a copy of the current GeoLine object.GeoRegion3D
convertToRegion()
Converts 3D line object into 3D polygon object and returns 3D polygon object if successful.void
dispose()
Release the resource occupy by this object.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.int
getPartCount()
Returns the count of the parts of the GeoLine3D object.int
indexOf(Point3Ds points)
Returns the index of the specified 3D point collection in the 3D line object.boolean
insertPart(int index, Point3Ds points)
Inserts a subobject to the GeoLine object at specified place.boolean
isEmpty()
Returns a value indicating whether the count of the subobjects of this GeoLine object is zero.boolean
removePart(int index)
Removes the subobject of the GeoLine object with the specified index.boolean
setPart(int index, Point3Ds points)
Modify the subobject with the given index of the GeoLine3D object.-
Methods inherited from class com.supermap.data.Geometry3D
getGeoModel, getInnerPoint3D, getPosition, getRotationX, getRotationY, getRotationZ, getScaleX, getScaleY, getScaleZ, getStyle3D, getVolume, offset, setPosition, setRotationX, setRotationY, setRotationZ, setScaleX, setScaleY, setScaleZ, setStyle3D
-
-
-
-
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.
-
-
Method Detail
-
dispose
public void dispose()
Release the resource occupy by this object.
-
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 positionpoints
- 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.
-
-