GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::algorithm::MinimumBoundingCircle Class Reference

#include <MinimumBoundingCircle.h>

Collaboration diagram for geos::algorithm::MinimumBoundingCircle:
[legend]

Public Member Functions

 MinimumBoundingCircle (const geom::Geometry *geom)
 
 ~MinimumBoundingCircle ()
 
std::unique_ptr< geom::GeometrygetCircle ()
 
std::unique_ptr< geom::GeometrygetMaximumDiameter ()
 
std::unique_ptr< geom::GeometrygetDiameter ()
 
std::vector< geom::CoordinategetExtremalPoints ()
 
geom::Coordinate getCentre ()
 
double getRadius ()
 

Private Member Functions

void computeCentre ()
 
void compute ()
 
void computeCirclePoints ()
 
geom::Coordinate lowestPoint (std::vector< geom::Coordinate > &pts)
 
geom::Coordinate pointWitMinAngleWithX (std::vector< geom::Coordinate > &pts, geom::Coordinate &P)
 
geom::Coordinate pointWithMinAngleWithSegment (std::vector< geom::Coordinate > &pts, geom::Coordinate &P, geom::Coordinate &Q)
 
std::vector< geom::CoordinatefarthestPoints (std::vector< geom::Coordinate > &pts)
 

Private Attributes

const geom::Geometryinput
 
std::vector< geom::CoordinateextremalPts
 
geom::Coordinate centre
 
double radius
 

Detailed Description

Definition at line 42 of file MinimumBoundingCircle.h.

Constructor & Destructor Documentation

geos::algorithm::MinimumBoundingCircle::MinimumBoundingCircle ( const geom::Geometry geom)
inline

Definition at line 64 of file MinimumBoundingCircle.h.

References geos::geom::Coordinate::setNull().

Here is the call graph for this function:

geos::algorithm::MinimumBoundingCircle::~MinimumBoundingCircle ( )
inline

Definition at line 72 of file MinimumBoundingCircle.h.

Member Function Documentation

void geos::algorithm::MinimumBoundingCircle::compute ( )
private
void geos::algorithm::MinimumBoundingCircle::computeCentre ( )
private
void geos::algorithm::MinimumBoundingCircle::computeCirclePoints ( )
private
std::vector<geom::Coordinate> geos::algorithm::MinimumBoundingCircle::farthestPoints ( std::vector< geom::Coordinate > &  pts)
private
geom::Coordinate geos::algorithm::MinimumBoundingCircle::getCentre ( )

Gets the centre point of the computed Minimum Bounding Circle.

Returns
the centre point of the Minimum Bounding Circle
null if the input is empty
std::unique_ptr<geom::Geometry> geos::algorithm::MinimumBoundingCircle::getCircle ( )

Gets a geometry which represents the Minimum Bounding Circle. If the input is degenerate (empty or a single unique point), this method will return an empty geometry or a single Point geometry. Otherwise, a Polygon will be returned which approximates the Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.)

Returns
a Geometry representing the Minimum Bounding Circle.
std::unique_ptr<geom::Geometry> geos::algorithm::MinimumBoundingCircle::getDiameter ( )

Gets a geometry representing the diameter of the computed Minimum Bounding Circle.

Returns
the diameter LineString of the Minimum Bounding Circle
a empty LineString if the input is empty
a Point if the input is a point
std::vector<geom::Coordinate> geos::algorithm::MinimumBoundingCircle::getExtremalPoints ( )

Gets the extremal points which define the computed Minimum Bounding Circle. There may be zero, one, two or three of these points, depending on the number of points in the input and the geometry of those points.

Returns
the points defining the Minimum Bounding Circle
std::unique_ptr<geom::Geometry> geos::algorithm::MinimumBoundingCircle::getMaximumDiameter ( )

Gets a geometry representing a line between the two farthest points in the input. These points will be two of the extremal points of the Minimum Bounding Circle. They also lie on the convex hull of the input.

Returns
a LineString between the two farthest points of the input
a empty LineString if the input is empty
a Point if the input is a point
double geos::algorithm::MinimumBoundingCircle::getRadius ( )

Gets the radius of the computed Minimum Bounding Circle.

Returns
the radius of the Minimum Bounding Circle
geom::Coordinate geos::algorithm::MinimumBoundingCircle::lowestPoint ( std::vector< geom::Coordinate > &  pts)
private
geom::Coordinate geos::algorithm::MinimumBoundingCircle::pointWithMinAngleWithSegment ( std::vector< geom::Coordinate > &  pts,
geom::Coordinate P,
geom::Coordinate Q 
)
private
geom::Coordinate geos::algorithm::MinimumBoundingCircle::pointWitMinAngleWithX ( std::vector< geom::Coordinate > &  pts,
geom::Coordinate P 
)
private

Member Data Documentation

geom::Coordinate geos::algorithm::MinimumBoundingCircle::centre
private

Definition at line 49 of file MinimumBoundingCircle.h.

std::vector<geom::Coordinate> geos::algorithm::MinimumBoundingCircle::extremalPts
private

Definition at line 48 of file MinimumBoundingCircle.h.

const geom::Geometry* geos::algorithm::MinimumBoundingCircle::input
private

Definition at line 47 of file MinimumBoundingCircle.h.

double geos::algorithm::MinimumBoundingCircle::radius
private

Definition at line 50 of file MinimumBoundingCircle.h.


The documentation for this class was generated from the following file: