Package com.esri.core.geometry
Class ConvexHull
- java.lang.Object
-
- com.esri.core.geometry.ConvexHull
-
class ConvexHull extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ConvexHull.CallBack
private static class
ConvexHull.CallBackPoints
private static class
ConvexHull.CallBackShape
private static class
ConvexHull.CallBackStream
-
Field Summary
Fields Modifier and Type Field Description private ConvexHull.CallBack
m_call_back
private int
m_geometry_handle
private Line
m_line
private int
m_path_handle
private Point2D[]
m_points
private EditShape
m_shape
private AttributeStreamOfDbl
m_stream
private Treap
m_tree_hull
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
ConvexHull()
private
ConvexHull(AttributeStreamOfDbl stream, int n)
private
ConvexHull(Point2D[] points, int n)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addEnvelope_(Envelope envelope)
(package private) void
addGeometry(Geometry geometry)
Adds a geometry to the current bounding geometry using an incremental algorithm for dynamic insertion.private void
addMultiVertexGeometry_(MultiVertexGeometry mvg)
private void
addPoint_(Point point)
private int
addPoint_(Point2D pt_p)
private void
addSegment_(Segment segment)
(package private) static Geometry
construct(MultiVertexGeometry mvg)
Static method to construct the convex hull of a Multi_vertex_geometry.(package private) static int
construct(Point2D[] points, int count, int[] out_convex_hull)
Static method to construct the convex hull from an array of points.private static ECoordinate
determinant_(Point2D p, Point2D q, Point2D r)
(package private) Geometry
getBoundingGeometry()
Gets the current bounding geometry.private static int
isBetween_(Point2D pt_pivot, Point2D pt_m, Point2D pt_0)
private static boolean
isClockwise_(double det)
private static boolean
isClockwise_(int orientation)
private static boolean
isCounterClockwise_(double det)
private static boolean
isCounterClockwise_(int orientation)
private static boolean
isDegenerate_(double det)
private static boolean
isDegenerate_(int orientation)
(package private) static boolean
isPathConvex(MultiPath multi_path, int path_index, ProgressTracker progress_tracker)
Returns true if the given path of the input MultiPath is convex.private int
treeHull_(Point2D pt_pivot)
private int
treeHullWalkBackward_(Point2D pt_pivot, int start, int end)
private int
treeHullWalkForward_(Point2D pt_pivot, int start, int end)
-
-
-
Field Detail
-
m_tree_hull
private Treap m_tree_hull
-
m_shape
private EditShape m_shape
-
m_stream
private AttributeStreamOfDbl m_stream
-
m_points
private Point2D[] m_points
-
m_geometry_handle
private int m_geometry_handle
-
m_path_handle
private int m_path_handle
-
m_line
private Line m_line
-
m_call_back
private ConvexHull.CallBack m_call_back
-
-
Constructor Detail
-
ConvexHull
ConvexHull()
-
ConvexHull
private ConvexHull(AttributeStreamOfDbl stream, int n)
-
ConvexHull
private ConvexHull(Point2D[] points, int n)
-
-
Method Detail
-
addGeometry
void addGeometry(Geometry geometry)
Adds a geometry to the current bounding geometry using an incremental algorithm for dynamic insertion.- Parameters:
geometry
- The geometry to add to the bounding geometry.
-
getBoundingGeometry
Geometry getBoundingGeometry()
Gets the current bounding geometry. Returns a Geometry.
-
construct
static Geometry construct(MultiVertexGeometry mvg)
Static method to construct the convex hull of a Multi_vertex_geometry. Returns a Geometry. \param mvg The geometry used to create the convex hull.
-
construct
static int construct(Point2D[] points, int count, int[] out_convex_hull)
Static method to construct the convex hull from an array of points. The out_convex_hull array will be populated with the subset of index positions which contribute to the convex hull. Returns the number of points in the convex hull. \param points The points used to create the convex hull. \param count The number of points in the input Point2D array. \param out_convex_hull An index array allocated by the user at least as big as the size of the input points array.
-
isPathConvex
static boolean isPathConvex(MultiPath multi_path, int path_index, ProgressTracker progress_tracker)
Returns true if the given path of the input MultiPath is convex. Returns false otherwise. \param multi_path The MultiPath to check if the path is convex. \param path_index The path of the MultiPath to check if its convex.
-
addMultiVertexGeometry_
private void addMultiVertexGeometry_(MultiVertexGeometry mvg)
-
addEnvelope_
private void addEnvelope_(Envelope envelope)
-
addSegment_
private void addSegment_(Segment segment)
-
addPoint_
private void addPoint_(Point point)
-
addPoint_
private int addPoint_(Point2D pt_p)
-
treeHull_
private int treeHull_(Point2D pt_pivot)
-
treeHullWalkForward_
private int treeHullWalkForward_(Point2D pt_pivot, int start, int end)
-
treeHullWalkBackward_
private int treeHullWalkBackward_(Point2D pt_pivot, int start, int end)
-
determinant_
private static ECoordinate determinant_(Point2D p, Point2D q, Point2D r)
-
isClockwise_
private static boolean isClockwise_(double det)
-
isCounterClockwise_
private static boolean isCounterClockwise_(double det)
-
isDegenerate_
private static boolean isDegenerate_(double det)
-
isClockwise_
private static boolean isClockwise_(int orientation)
-
isCounterClockwise_
private static boolean isCounterClockwise_(int orientation)
-
isDegenerate_
private static boolean isDegenerate_(int orientation)
-
-