32#include <MeshKernel/BoundingBox.hpp>
33#include <MeshKernel/Exceptions.hpp>
34#include <MeshKernel/Polygon.hpp>
35#include <MeshKernel/PolygonalEnclosure.hpp>
157 double PerimeterClosedPolygon(
const std::vector<Point>& polygonNodes)
const;
162 std::vector<double> PolygonEdgeLengths(
const std::vector<Point>& polygonNodes)
const;
164 std::vector<PolygonalEnclosure> m_enclosures;
166 std::vector<std::pair<UInt, UInt>> m_outer_polygons_indices;
167 UInt m_numberOfNodes = 0;
178 if (index >= m_enclosures.size())
180 throw ConstraintError(
"Invalid enclosure index: {}, maximum index: {}", index, m_enclosures.size() - 1);
183 return m_enclosures[index];
188 return static_cast<UInt>(m_enclosures.size());
193 return m_numberOfNodes;
A class defining a bounding box.
Definition BoundingBox.hpp:40
An exception class thrown when an attempt is made that violates a range constraint.
Definition Exceptions.hpp:267
A class containing the land boundary polylines.
Definition LandBoundary.hpp:40
A struct describing a point in a two-dimensional space.
Definition Point.hpp:41
A region enclosed by a polygonal permieter.
Definition PolygonalEnclosure.hpp:46
A class containing a list of polygonaly enclosed regions.
Definition Polygons.hpp:45
std::tuple< bool, UInt > IsPointInPolygons(const Point &point) const
Checks if a point is included in any of the polygons (dbpinpol_optinside_perpol)
Polygons(const std::vector< Point > &polygon, Projection projection)
Constructor.
Polygons OffsetCopy(double distance, bool innerAndOuter) const
Makes a new polygon from an existing one, by offsetting it by a distance (copypol)
Polygons()=default
Default constructor.
const PolygonalEnclosure & Enclosure(const UInt index) const
Get the polygonal enclosure at the index.
Definition Polygons.hpp:171
bool IsPointInPolygon(Point const &point, UInt polygonIndex) const
Checks if a point is included in a given polygon. When the polygon is empty, the point is always incl...
UInt GetNumNodes() const
Gets the number of polygon nodes.
Definition Polygons.hpp:191
void SnapToLandBoundary(const LandBoundary &landBoundary, UInt startIndex, UInt endIndex)
Snap the polygon to the land boundary.
std::vector< bool > PointsInPolygons(const std::vector< Point > &point) const
For each point, compute the index of the polygon including it.
std::tuple< UInt, UInt, UInt > PolygonIndex(UInt startIndex, UInt endIndex) const
Get index of the polygon, and map the start- and end-index to the start- and end-index of the local p...
Projection GetProjection() const
Gets the projection.
Definition Polygons.hpp:143
UInt GetNumPolygons() const
Gives the number of polygons.
Definition Polygons.hpp:186
std::vector< std::vector< Point > > ComputePointsInPolygons() const
Creates points inside the polygon using triangulation (the edges size determines how many points will...
bool IsPointInAnyPolygon(const Point &point) const
Checks if a point is included in any of the polygonal enclosures contained.
std::vector< Point > LinearRefinePolygon(UInt polygonIndex, UInt startIndex, UInt endIndex) const
Linear refines the polygon edges with additional nodes, from the start to the end index.
std::vector< Point > RefinePolygon(UInt polygonIndex, UInt startIndex, UInt endIndex, double refinementDistance) const
Refines the polygon edges with additional nodes, from the start to the end index (refinepolygonpart)
BoundingBox GetBoundingBox(UInt polygonIndex) const
Gets the bounding box for the polygon index i.
bool IsEmpty() const
Checks if the polygon is empty.
std::vector< Point > GatherAllEnclosureNodes() const
Gets the nodes of all enclosures.
std::vector< Point > RefineFirstPolygon(UInt startIndex, UInt endIndex, double refinementDistance) const
Refines the polygon edges with additional nodes, from the start to the end index (refinepolygonpart)
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
Projection
Enumerator describing the supported projections.
Definition Definitions.hpp:43
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39