32 #include <MeshKernel/Entities.hpp>
33 #include <MeshKernel/LandBoundary.hpp>
34 #include <MeshKernel/UndoActions/UndoAction.hpp>
56 DoNotProjectToLandBoundary = 0,
57 ToOriginalNetBoundary = 1,
58 OuterMeshBoundaryToLandBoundary = 2,
59 InnerAndOuterMeshBoundaryToLandBoundary = 3,
101 void AssignLandBoundaryPolylineToMeshNodes(
UInt edgeIndex,
103 const std::vector<UInt>& nodes,
110 void AddLandBoundary(
const std::vector<UInt>& nodesLoc,
119 std::tuple<UInt, UInt> MakePath(
UInt landBoundaryIndex);
123 void ComputeMeshNodeMask(
UInt landBoundaryIndex);
136 void ComputeMask(
UInt segmentIndex,
138 UInt startLandBoundaryIndex,
139 UInt endLandBoundaryIndex,
142 double& leftEdgeRatio,
143 double& rightEdgeRatio);
148 void MaskMeshFaceMask(
UInt landBoundaryIndex,
const std::vector<UInt>& initialFaces);
154 [[nodiscard]]
UInt IsMeshEdgeCloseToLandBoundaries(
UInt landBoundaryIndex,
UInt edge);
162 std::tuple<UInt, UInt> FindStartEndMeshNodesDijkstraAlgorithm(
UInt landBoundaryIndex);
169 UInt FindStartEndMeshNodesFromEdges(
UInt edge,
Point point)
const;
175 std::vector<UInt> ShortestPath(
UInt landBoundaryIndex,
UInt startMeshNode);
182 std::tuple<double, Point, UInt, double> NearestLandBoundarySegment(
UInt landBoundaryIndex,
const Point& node)
const;
187 bool InitialiseNodeLocations(
const bool initialize,
188 const UInt edgeIndex,
189 const std::vector<UInt>& nodes,
191 std::vector<UInt>& nodesLoc,
192 UInt& numNodesLoc)
const;
195 UInt GetSegmentIndex(
const UInt nearestLandBoundaryNodeIndex)
const;
198 bool StopPathSearch(
const UInt landBoundaryIndex,
const UInt currentNode);
201 bool ContainsCrossedFace(
const UInt landBoundaryIndex,
const UInt otherFace);
204 void MaskFacesCloseToBoundary(
const UInt landBoundaryIndex);
207 void GetLandBoundaryNode(
const double closeDistance,
208 const Point& firstMeshNode,
209 const Point& secondMeshNode,
210 const UInt currentNode,
211 UInt& landBoundaryNode,
212 bool& isWithinSegment)
const;
217 std::vector<Point> m_polygonNodesCache;
218 std::vector<std::pair<UInt, UInt>> m_validLandBoundaries;
219 std::vector<UInt> m_nodeFaceIndices;
221 std::vector<UInt> m_nodeMask;
222 std::vector<bool> m_faceMask;
223 std::vector<UInt> m_edgeMask;
225 bool m_landMask =
true;
226 bool m_addLandboundaries =
true;
229 std::vector<double> m_nodesMinDistances;
232 const double m_closeToLandBoundaryFactor = 5.0;
233 const double m_closeWholeMeshFactor = 1.0;
234 const double m_minDistanceFromLandFactor = 2.0;
237 bool m_findOnlyOuterMeshBoundary =
false;