Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/MeshKernel/include/MeshKernel/Entities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace meshkernel
// t.IsValid
//};

/// @brief Describes an edge with two indices
/// @brief Describes an edge connecting two nodes.
using Edge = std::pair<UInt, UInt>;

//// @brief Determine if the value is a valid value (true) or is the undefined value (false)
Expand Down
36 changes: 27 additions & 9 deletions libs/MeshKernel/include/MeshKernel/Mesh2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,10 @@ namespace meshkernel
/// @return The resulting polygon mesh boundary
[[nodiscard]] std::vector<Point> ComputeBoundaryPolygons(const std::vector<Point>& polygon);

/// @brief Constructs a polygon from the meshboundary, by walking through the mesh
/// @param[in] polygon The input polygon
/// @param[in,out] isVisited the visited mesh nodes
/// @param[in,out] currentNode the current node
/// @param[out] meshBoundaryPolygon The resulting polygon points
void WalkBoundaryFromNode(const Polygon& polygon,
std::vector<bool>& isVisited,
UInt& currentNode,
std::vector<Point>& meshBoundaryPolygon) const;
/// @brief Convert all mesh boundaries to a vector of polygon nodes
/// @param[in] polygon The polygon where the operation is performed
/// @return The resulting set of polygons, describing interior mesh boundaries
std::vector<Point> ComputeInnerBoundaryPolygons() const;

/// @brief Gets the hanging edges
/// @return A vector with the indices of the hanging edges
Expand Down Expand Up @@ -378,6 +373,8 @@ namespace meshkernel
/// If no such element can be found then the null value will be returned.
UInt FindCommonFace(const UInt edge1, const UInt edge2) const;

[[nodiscard]] std::unique_ptr<UndoAction> DeleteMeshFaces2(const Polygons& polygon, bool invertDeletion);

private:
// orthogonalization
static constexpr double m_minimumEdgeLength = 1e-4; ///< Minimum edge length
Expand Down Expand Up @@ -435,6 +432,27 @@ namespace meshkernel
/// @brief Find the mesh faces that lie entirely within the polygon.
std::vector<bool> FindFacesEntirelyInsidePolygon(const std::vector<bool>& isNodeInsidePolygon) const;

/// @brief Constructs a polygon from the meshboundary, by walking through the mesh
void WalkBoundaryFromNode(const Polygon& polygon,
std::vector<bool>& isVisited,
UInt& currentNode,
std::vector<Point>& meshBoundaryPolygon) const;

/// @brief Constructs a polygon or polygons from the meshboundary, by walking through the mesh
///
/// If there are multiple polygons connected by a single node, then these will be separated into indicidual polygons
void WalkBoundaryFromNode(std::vector<bool>& edgeIsVisited,
std::vector<bool>& nodeIsVisited,
UInt& currentNode,
std::vector<Point>& meshBoundaryPolygon,
std::vector<UInt>& nodeIds,
std::vector<Point>& subsSequence) const;

/// @brief Removes the outer domain boundary polygon from the set of polygons
///
/// It is assumed that the outer domain polygon contains the most nodes
std::vector<Point> RemoveOuterDomainBoundaryPolygon(const std::vector<Point>& polygonNodes) const;

/// @brief Deletes the mesh faces inside a polygon
/// @param[in] polygon The polygon where to perform the operation
/// If this Polygons instance contains multiple polygons, the first one will be taken.
Expand Down
Loading
Loading