Skip to content

Commit

Permalink
Improved naming and fixed doc in mkernel_mesh2d_intersections_from_p…
Browse files Browse the repository at this point in the history
…olygon (#240 | GRIDEDIT-708)
  • Loading branch information
ahmad-el-sayed authored Oct 16, 2023
1 parent 4bd6fec commit 9db2f18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions libs/MeshKernelApi/include/MeshKernelApi/MeshKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,20 +1002,20 @@ namespace meshkernelapi
/// @returns Error code
MKERNEL_API int mkernel_mesh2d_insert_node(int meshKernelId, double xCoordinate, double yCoordinate, int& nodeIndex);

/// @brief Gets the edges intersected by a polyline, with additional information on the intersections
/// @brief Gets the edges intersected by a polygon, with additional information on the intersections
/// @param[in] meshKernelId The id of the mesh state
/// @param[in] boundaryPolyLine An input polyline, defined as a series of points
/// @param[in] boundaryPolygon An input polygon, defined as a series of points
/// @param[out] edgeNodes The indices of the intersected edge nodes. The first node of the edge is on the left (the virtual node), the second node of the edge is on the right (the inner node)
/// @param[out] edgeIndex For each intersected edge, the edge index
/// @param[out] edgeDistances For each intersection, the location of the intersection expressed as adimensional distance from the edge starting node
/// @param[out] segmentDistances For each intersection, the location of the intersection expressed as adimensional distance from the polyline segment start
/// @param[out] segmentDistances For each intersection, the location of the intersection expressed as adimensional distance from the polygon segment start
/// @param[out] segmentIndexes For each intersection, the segment index
/// @param[out] faceIndexes For each intersection, the face index
/// @param[out] faceNumEdges For each intersection, the number of intersections
/// @param[out] faceEdgeIndex For each intersection, the index of the intersected edge
/// @returns Error code
MKERNEL_API int mkernel_mesh2d_intersections_from_polygon(int meshKernelId,
const GeometryList& boundaryPolyLine,
const GeometryList& boundaryPolygon,
int* edgeNodes,
int* edgeIndex,
double* edgeDistances,
Expand Down
8 changes: 4 additions & 4 deletions libs/MeshKernelApi/src/MeshKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ namespace meshkernelapi
}

MKERNEL_API int mkernel_mesh2d_intersections_from_polygon(int meshKernelId,
const GeometryList& boundaryPolyLine,
const GeometryList& boundaryPolygon,
int* edgeNodes,
int* edgeIndex,
double* edgeDistances,
Expand All @@ -1069,12 +1069,12 @@ namespace meshkernelapi
throw meshkernel::MeshKernelError("The selected mesh kernel id does not exist.");
}

auto const boundaryPolygonPoints = ConvertGeometryListToPointVector(boundaryPolyLine);
auto const boundaryPolygonPoints = ConvertGeometryListToPointVector(boundaryPolygon);

const meshkernel::Polygons boundaryPolygon(boundaryPolygonPoints, meshKernelState[meshKernelId].m_projection);
const meshkernel::Polygons polygons(boundaryPolygonPoints, meshKernelState[meshKernelId].m_projection);

meshkernel::Mesh2DIntersections mesh2DIntersections(*meshKernelState[meshKernelId].m_mesh2d);
mesh2DIntersections.Compute(boundaryPolygon);
mesh2DIntersections.Compute(polygons);
auto edgeIntersections = mesh2DIntersections.EdgeIntersections();
auto faceIntersections = mesh2DIntersections.FaceIntersections();

Expand Down

0 comments on commit 9db2f18

Please sign in to comment.