Skip to content
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-1372 Add Mesh2dConnectMeshes #78

Merged
merged 2 commits into from
Aug 19, 2024
Merged
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
10 changes: 10 additions & 0 deletions src/MeshKernelNET/Api/IMeshKernelApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,16 @@ int Mesh2dComputeOrthogonalization(int meshKernelId,
in DisposableGeometryList geometryListPolygon,
in DisposableGeometryList geometryListLandBoundaries);


/// <summary>
/// Connect two disconnected regions along boundary
/// </summary>
/// <param name="meshKernelId">Id of the mesh state pertaining to the current domain</param>
/// <param name="disposableMesh2D">The mesh to merge to the the current domain</param>
/// <param name="searchFraction">Fraction of the shortest edge (along an edge to be connected) to use when determining neighbour edge closeness</param>
/// <returns>Error code</returns>
int Mesh2dConnectMeshes([In] int meshKernelId, in DisposableMesh2D disposableMesh2D, double searchFraction);

/// <summary>
/// Converts the projection of a mesh2d
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions src/MeshKernelNET/Api/MeshKernelApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,14 @@ public int Mesh2dComputeOrthogonalization(int meshKernelId,
ref geometryListLandBoundariesNative);
}

public int Mesh2dConnectMeshes(int meshKernelId, in DisposableMesh2D disposableMesh2D, double searchFraction)
{
Mesh2DNative mesh2D = disposableMesh2D.CreateNativeObject();
return MeshKernelDll.Mesh2dConnectMeshes(meshKernelId,
ref mesh2D,
searchFraction);
}

public int Mesh2dConvertProjection([In] int meshKernelId,
[In] ProjectionOptions projection,
[In] string zone)
Expand Down
10 changes: 10 additions & 0 deletions src/MeshKernelNET/Native/MeshKernelDll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,16 @@ internal static extern int Mesh2dComputeOrthogonalization([In] int meshKernelId,
[In] ref GeometryListNative geometryListNativePolygon,
[In] ref GeometryListNative geometryListNativeLandBoundaries);

/// <summary>
/// Connect two disconnected regions along boundary
/// </summary>
/// <param name="meshKernelId">Id of the mesh state pertaining to the current domain</param>
/// <param name="mesh2DNative">The mesh to merge to the the current domain</param>
/// <param name="searchFraction">Fraction of the shortest edge (along an edge to be connected) to use when determining neighbour edge closeness</param>
/// <returns>Error code</returns>
[DllImport(MeshKernelDllName, EntryPoint = "mkernel_mesh2d_connect_meshes", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Mesh2dConnectMeshes([In] int meshKernelId, [In] ref Mesh2DNative mesh2DNative, [In] double searchFraction);

/// <summary>
/// Converts the projection of a mesh2d
/// </summary>
Expand Down
Loading