com.supermap.data
Class GeoRegion3D
- java.lang.Object
-
- com.supermap.data.Geometry
-
- com.supermap.data.Geometry3D
-
- com.supermap.data.GeoRegion3D
-
public class GeoRegion3D extends Geometry3D
The polygon geometry class is derived from theGeometry3D
class.This class is generally represented using one or more sets of points.he GeoRegion3D object can have one or multiple parts, and each part is represented by an ordered set of points . Note that the start point and endpoint in an ordered set of points that form a part is identical. You can add, delete and modify a part of the GeoRegion.
-
-
Constructor Summary
Constructors Constructor and Description GeoRegion3D()
Constructs a new GeoRegion3D object.GeoRegion3D(GeoRegion3D region3D)
Initializes a new instance identical to the given GeoRegion object.GeoRegion3D(Point3Ds points)
Creates a new GeoRegion object according to the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
addPart(Point3Ds points)
Appends a part to this GeoRegion object.GeoRegion3D
clone()
Returns a copy of the current GeoRegion3D object.GeoLine3D
convertToLine()
Converts the GeoRegion3D object to a GeoLine3D object.void
dispose()
Release the resource occupy by this object.double
getArea()
Returns the area of the GeoRegion3D 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 parts of the GeoRegion3D object.int
indexOf(Point3Ds part)
Gets the index of the specified part of the GeoRegion3D.boolean
isEmpty()
Returns whether the GeoRegion object is empty, that is whether it has on subobjects.-
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
-
GeoRegion3D
public GeoRegion3D()
Constructs a new GeoRegion3D object.
-
GeoRegion3D
public GeoRegion3D(Point3Ds points)
Creates a new GeoRegion object according to the specified arguments.- Parameters:
points
- The ordered set of points used to create the GeoRegion.- Throws:
java.lang.IllegalArgumentException
- if the count of points in the ordered point colection is less than 3.
-
GeoRegion3D
public GeoRegion3D(GeoRegion3D region3D)
Initializes a new instance identical to the given GeoRegion object.- Parameters:
region3D
- The specified GeoRegion object.
-
-
Method Detail
-
dispose
public void dispose()
Release the resource occupy by this object.
-
getArea
public double getArea()
Returns the area of the GeoRegion3D object. If a GeoRegion3D objects has many subobjects, its area is the sum of all the subobjects.- Returns:
- The area of the GeoRegion3D object.
- Default:
- The default value is 0.0.
-
getPartCount
public int getPartCount()
Returns the count of parts of the GeoRegion3D object. After being cleared, the count of the parts is 0.- Returns:
- The count of the parts of the GeoRegion3D object.
- Default:
- The default value is 0.0.
-
addPart
public int addPart(Point3Ds points)
Appends a part to this GeoRegion object.- Parameters:
points
- the ordered point collection that forms the parts.- Returns:
- If successful, this method will return the index number of the new added part, otherwise it will return -1.
- Throws:
java.lang.IllegalArgumentException
- if the count of points in the ordered point colection is less than 3.
-
convertToLine
public GeoLine3D convertToLine()
Converts the GeoRegion3D object to a GeoLine3D object. Returns the GeoLine3D object if succeed.- Returns:
- A GeoLine3D object, if succeeded.
-
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:
- the ordered point collection that composes the parts.
- Throws:
java.lang.IndexOutOfBoundsException
- If the serial number crossed.
-
indexOf
public int indexOf(Point3Ds part)
Gets the index of the specified part of the GeoRegion3D.- Parameters:
part
- The specified subobject.- Returns:
- Returns the index of the specified TextPart3D object.
-
clone
public GeoRegion3D clone()
Returns a copy of the current GeoRegion3D object.
-
isEmpty
public boolean isEmpty()
Returns whether the GeoRegion object is empty, that is whether it has on subobjects. For the number of sub objects, see thegetPartCount()
method.
-
-