-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GRIDEDIT-1491 Added api function to retrieve node, edge and face-node data only #375
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1182,6 +1182,16 @@ namespace meshkernelapi | |
/// @returns Error code | ||
MKERNEL_API int mkernel_mesh2d_get_data(int meshKernelId, Mesh2D& mesh2d); | ||
|
||
/// @brief Gets the reduced Mesh2D data | ||
/// | ||
/// This function ought to be called after `mkernel_mesh2d_get_dimensions` has been called | ||
/// and the pointers have been set to correctly sized memory. | ||
/// @param[in] meshKernelId The id of the mesh state | ||
/// @param[in,out] mesh2d The Mesh2D data | ||
/// @returns Error code | ||
/// @note Only node, edge, face-node data will be retrieved (face node data include the number of nodes per face mesh2d.nodes_per_face) | ||
MKERNEL_API int mkernel_mesh2d_get_data_reduced(int meshKernelId, Mesh2D& mesh2d); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to have more descriptive names, e.g. The .._get_data can then call both (or be made obsolete). |
||
|
||
/// @brief Gets an int indicating the orthogonality property type for mesh2d | ||
/// @param[out] type The int indicating the orthogonality property type | ||
/// @returns Error code | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -782,6 +782,32 @@ namespace meshkernelapi | |
return lastExitCode; | ||
} | ||
|
||
MKERNEL_API int mkernel_mesh2d_get_data_reduced(int meshKernelId, Mesh2D& mesh2d) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should mkernel_mesh2d_get_data be substituted with mkernel_mesh2d_get_data_reduced? if this is possible we have one api less to maintain in the other layers |
||
{ | ||
lastExitCode = meshkernel::ExitCode::Success; | ||
try | ||
{ | ||
if (!meshKernelState.contains(meshKernelId)) | ||
{ | ||
throw meshkernel::MeshKernelError("The selected mesh kernel id does not exist."); | ||
} | ||
|
||
if (mesh2d.node_x == nullptr || mesh2d.node_y == nullptr || | ||
mesh2d.edge_nodes == nullptr || | ||
mesh2d.nodes_per_face == nullptr || mesh2d.face_nodes == nullptr) | ||
{ | ||
throw meshkernel::MeshKernelError("The meshkernel api Mesh2D has not been initialised correctly."); | ||
} | ||
|
||
SetMesh2dApiNodeEdgeFaceNodeData(*meshKernelState[meshKernelId].m_mesh2d, mesh2d); | ||
} | ||
catch (...) | ||
{ | ||
lastExitCode = HandleException(); | ||
} | ||
return lastExitCode; | ||
} | ||
|
||
MKERNEL_API int mkernel_mesh2d_get_data(int meshKernelId, Mesh2D& mesh2d) | ||
{ | ||
lastExitCode = meshkernel::ExitCode::Success; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do the changes in this file belong to this PR?