33 #include "MeshKernel/BoundingBox.hpp"
34 #include "MeshKernel/Entities.hpp"
35 #include "MeshKernel/Point.hpp"
36 #include "MeshKernel/Polygon.hpp"
92 std::vector<Point>
Refine(
UInt startIndex,
UInt endIndex,
double refinementDistance)
const;
105 std::tuple<std::unique_ptr<PolygonalEnclosure>, std::unique_ptr<PolygonalEnclosure>>
OffsetCopy(
double distance,
bool outwardsAndInwards)
const;
110 using IndexRange = std::pair<UInt, UInt>;
114 using IndexRangeArray = std::vector<IndexRange>;
117 static Polygon ConstructPolygon(
const std::vector<Point>& points,
128 static void CopyPoints(
const std::vector<Point>& source,
132 std::vector<Point>& target);
135 void ConstructOuterPolygon(
const std::vector<Point>& points,
136 size_t start,
size_t end,
137 const IndexRangeArray& innerIndices,
141 void ConstructInnerPolygons(
const std::vector<Point>& points,
142 const IndexRangeArray& innerIndices,
149 std::vector<Polygon> m_inner;
161 return static_cast<UInt>(m_inner.size());
Projection
Enumerator describing the supported projections.
Definition: Definitions.hpp:41
PolygonalEnclosure(const std::vector< Point > &points, Projection projection)
Constructor.
const Polygon & Inner(size_t i) const
Get an inner polygon.
Definition: PolygonalEnclosure.hpp:164
@ Interior
The point is contained within one of the island, interior perimeters of the enclosure.
A struct describing a point in a two-dimensional space.
Definition: Point.hpp:40
bool Contains(const Point &pnt) const
Determine if the point lies in the polygon.
A class containing the land boundary polylines.
Definition: LandBoundary.hpp:39
A closed polygon.
Definition: Polygon.hpp:45
UInt NumberOfInner() const
The number of inner hole regions.
Definition: PolygonalEnclosure.hpp:159
std::vector< Point > LinearRefine(UInt startIndex, UInt endIndex) const
Linear refine the outer polygon.
UInt GetNumberOfNodes() const
Get the number of nodes in the enclosure, both outer and all inner polygons.
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)
Contains the logic of the C++ static library.
Definition: AveragingInterpolation.hpp:36
A region enclosed by a polygonal permieter.
Definition: PolygonalEnclosure.hpp:45
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition: Definitions.hpp:38
Region ContainsRegion(const Point &pnt) const
Determine in which part of the enclosure the point is.
Region
The part of the enclosure a point is found.
Definition: PolygonalEnclosure.hpp:49
std::vector< Point > Refine(UInt startIndex, UInt endIndex, double refinementDistance) const
Refine the polygon.
UInt NumberOfPoints(const bool includeInterior) const
Get the number of points making up the polygon, including interior if requested.
const Polygon & Outer() const
The outer perimeter polygon.
Definition: PolygonalEnclosure.hpp:154
void SnapToLandBoundary(size_t startIndex, size_t endIndex, const LandBoundary &landBoundary)
Snap all or part of the outer perimeter polygon to the land boundary.
@ Exterior
The point is contained within the outer perimeter of the enclosure.
@ None
The point is not contained with the enclosure.