20 #ifndef GEOS_ALGORITHM_CONSTRUCT_LARGESTCIRCLE_H 21 #define GEOS_ALGORITHM_CONSTRUCT_LARGESTCIRCLE_H 23 #include <geos/geom/Coordinate.h> 24 #include <geos/geom/Point.h> 25 #include <geos/geom/Envelope.h> 26 #include <geos/algorithm/locate/IndexedPointInAreaLocator.h> 27 #include <geos/operation/distance/IndexedFacetDistance.h> 39 class GeometryFactory;
82 static std::unique_ptr<geom::Point> getCenter(
const geom::Geometry* p_obstacles,
double p_tolerance);
92 static std::unique_ptr<geom::LineString> getRadiusLine(
const geom::Geometry* p_obstacles,
double p_tolerance);
94 std::unique_ptr<geom::Point> getCenter();
95 std::unique_ptr<geom::Point> getRadiusPoint();
96 std::unique_ptr<geom::LineString> getRadiusLine();
105 std::unique_ptr<geom::Geometry> boundary;
108 std::unique_ptr<algorithm::locate::IndexedPointInAreaLocator> ptLocator;
109 std::unique_ptr<operation::distance::IndexedFacetDistance> boundaryDistance;
127 double distanceToConstraints(
double x,
double y);
133 static constexpr
double SQRT2 = 1.4142135623730951;
141 Cell(
double p_x,
double p_y,
double p_hSize,
double p_distanceToConstraints)
145 , distance(p_distanceToConstraints)
146 , maxDist(p_distanceToConstraints + (p_hSize*SQRT2))
155 bool isFullyOutside()
const 157 return maxDist < 0.0;
159 bool isOutside()
const 161 return distance < 0.0;
163 double getMaxDistance()
const 167 double getDistance()
const 171 double getHSize()
const 185 return maxDist < rhs.maxDist;
187 bool operator> (
const Cell& rhs)
const 189 return maxDist > rhs.maxDist;
193 return maxDist == rhs.maxDist;
197 bool mayContainCircleCenter(
const Cell& cell,
const Cell& farthestCell);
198 void createInitialGrid(
const geom::Envelope* env, std::priority_queue<Cell>& cellQueue);
208 #endif // GEOS_ALGORITHM_CONSTRUCT_LARGESTCIRCLE_H An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Computes the distance between the facets (segments and vertices) of two Geometrys using a Branch-and-...
Definition: IndexedFacetDistance.h:47
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Definition: LargestEmptyCircle.h:60
bool operator<(const Coordinate &a, const Coordinate &b)
Strict weak ordering operator for Coordinate.
Definition: Coordinate.h:134
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26
bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.