MeshKernel
|
A region enclosed by a polygonal permieter. More...
#include <PolygonalEnclosure.hpp>
Public Types | |
enum | Region { Region::None, Region::Exterior, Region::Interior } |
The part of the enclosure a point is found. More... | |
Public Member Functions | |
PolygonalEnclosure (const std::vector< Point > &points, Projection projection) | |
Constructor. | |
const Polygon & | Outer () const |
The outer perimeter polygon. | |
UInt | NumberOfInner () const |
The number of inner hole regions. | |
const Polygon & | Inner (size_t i) const |
Get an inner polygon. | |
UInt | GetNumberOfNodes () const |
Get the number of nodes in the enclosure, both outer and all inner polygons. More... | |
bool | Contains (const Point &pnt) const |
Determine if the point lies in the polygon. More... | |
Region | ContainsRegion (const Point &pnt) const |
Determine in which part of the enclosure the point is. | |
UInt | NumberOfPoints (const bool includeInterior) const |
Get the number of points making up the polygon, including interior if requested. | |
void | SnapToLandBoundary (size_t startIndex, size_t endIndex, const LandBoundary &landBoundary) |
Snap all or part of the outer perimeter polygon to the land boundary. | |
std::vector< Point > | Refine (UInt startIndex, UInt endIndex, double refinementDistance) const |
Refine the polygon. More... | |
std::vector< Point > | LinearRefine (UInt startIndex, UInt endIndex) const |
Linear refine the outer polygon. More... | |
std::tuple< std::unique_ptr< PolygonalEnclosure >, std::unique_ptr< PolygonalEnclosure > > | OffsetCopy (double distance, bool outwardsAndInwards) const |
Makes a new polygonal enclosure from an existing one, by offsetting it by a distance (copypol) More... | |
A region enclosed by a polygonal permieter.
Each region is described by an outer perimeter polygon. It may contain 0 or more holes, each described by an inner polygon.
|
strong |
bool meshkernel::PolygonalEnclosure::Contains | ( | const Point & | pnt | ) | const |
Determine if the point lies in the polygon.
If the point lies within the outer polygon but outside any inner polygons
UInt meshkernel::PolygonalEnclosure::GetNumberOfNodes | ( | ) | const |
Get the number of nodes in the enclosure, both outer and all inner polygons.
std::vector<Point> meshkernel::PolygonalEnclosure::LinearRefine | ( | UInt | startIndex, |
UInt | endIndex | ||
) | const |
Linear refine the outer polygon.
[in] | startIndex | The start index of the sections to be refined |
[in] | endIndex | The end index of the sections to be refined |
std::tuple<std::unique_ptr<PolygonalEnclosure>, std::unique_ptr<PolygonalEnclosure> > meshkernel::PolygonalEnclosure::OffsetCopy | ( | double | distance, |
bool | outwardsAndInwards | ||
) | const |
Makes a new polygonal enclosure from an existing one, by offsetting it by a distance (copypol)
[in] | distance | The offset distance |
[in] | outwardsAndInwards | Offset outwards only or both outwards and inwards |
std::vector<Point> meshkernel::PolygonalEnclosure::Refine | ( | UInt | startIndex, |
UInt | endIndex, | ||
double | refinementDistance | ||
) | const |
Refine the polygon.
[in] | startIndex | The start index of the sections to be refined |
[in] | endIndex | The end index of the sections to be refined |
[in] | refinementDistance | The maximum distance between points. |