Skip to content
Open
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
123 changes: 25 additions & 98 deletions src/MeshKernelNET/Api/IMeshKernelApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,52 +246,21 @@ int CurvilinearComputeTransfiniteFromTriangle(int meshKernelId,
int CurvilinearGetBoundariesAsPolygons(int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, out DisposableGeometryList boundaryPolygons);

/// <summary>
/// Gets the index of the closest curvilinear edge
/// Gets the index of the closest curvilinear location type
/// </summary>
///
/// <param name="meshKernelId"> meshKernelId The id of the mesh state </param>
/// <param name="locationType">The location (nodes, edges, or faces) at which the index should be retrieved</param>
/// <param name="xCoordinate">The input point coordinates</param>
/// <param name="yCoordinate">The input point coordinates</param>
/// <param name="boundingBox">The input bounding box</param>
/// <param name="locationIndex">The location index</param>
/// <returns>Error code</returns>
int CurvilinearGetEdgeLocationIndex(int meshKernelId,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
ref int locationIndex);

/// <summary>
/// Gets the index of the closest curvilinear face
/// </summary>
///
/// <param name="meshKernelId"> meshKernelId The id of the mesh state </param>
/// <param name="xCoordinate">The input point coordinates</param>
/// <param name="yCoordinate">The input point coordinates</param>
/// <param name="boundingBox">The input bounding box</param>
/// <param name="locationIndex">The location index</param>
/// <returns>Error code</returns>
int CurvilinearGetFaceLocationIndex(int meshKernelId,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
ref int locationIndex);

/// <summary>
/// Gets the index of the closest curvilinear node
/// </summary>
///
/// <param name="meshKernelId"> meshKernelId The id of the mesh state </param>
/// <param name="xCoordinate">The input point coordinates</param>
/// <param name="yCoordinate">The input point coordinates</param>
/// <param name="boundingBox">The input bounding box</param>
/// <param name="locationIndex">The location index</param>
/// <returns>Error code</returns>
int CurvilinearGetNodeLocationIndex(int meshKernelId,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
ref int locationIndex);
int CurvilinearGetLocationIndex(int meshKernelId,
LocationType locationType,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
ref int locationIndex);

/// <summary>
/// Initializes the curvilinear line shift algorithm
Expand Down Expand Up @@ -737,14 +706,7 @@ int CurvilinearSnapToSpline(int meshKernelId,
/// <param name="method">The int indicating the averaging method type</param>
/// <returns>Error code</returns>
int GetAveragingMethodSimpleAveraging(ref int method);

/// <summary>
/// Gets an int indicating the edge location type
/// </summary>
/// <param name="type">The int indicating the edge location type</param>
/// <returns>Error code</returns>
int GetEdgesLocationType(ref int type);


/// <summary>
/// Gets a pointer to error message
/// </summary>
Expand Down Expand Up @@ -822,13 +784,6 @@ int CurvilinearSnapToSpline(int meshKernelId,
/// <returns>Error code</returns>
int GetExitCodeUnknownException(ref int exitCode);

/// <summary>
/// Gets an int indicating the faces location type
/// </summary>
/// <param name="type">The int indicating the face location type</param>
/// <returns>Error code</returns>
int GetFacesLocationType(ref int type);

/// <summary>
/// get geometry error
/// </summary>
Expand All @@ -837,13 +792,6 @@ int CurvilinearSnapToSpline(int meshKernelId,
/// <returns>Error code</returns>
int GetGeometryError(ref int invalidIndex, ref int type);

/// <summary>
/// Gets an int indicating the node location type
/// </summary>
/// <param name="type">The int indicating the node location type</param>
/// <returns>Error code</returns>
int GetNodesLocationType(ref int type);

/// <summary>
/// Gets the coordinate projection of the meshkernel state
/// </summary>
Expand Down Expand Up @@ -922,7 +870,7 @@ int GetSplines(DisposableGeometryList disposableGeometryListIn,
/// <returns>Error code</returns>
int Mesh2dAveragingInterpolation(int meshKernelId,
DisposableGeometryList samples,
int locationType,
LocationType locationType,
int averagingMethodType,
double relativeSearchSize,
int minNumSamples,
Expand Down Expand Up @@ -1232,48 +1180,17 @@ int Mesh2dGetEdge(int meshKernelId, double xCoordinate, double yCoordinate, doub
int Mesh2dGetHangingEdges(int meshKernelId, out IntArrayWrapper hangingEdges);

/// <summary>
/// Gets the index of the closest mesh edge
/// Gets the index of the closest mesh location type
/// </summary>
///
/// <param name="meshKernelId"> meshKernelId The id of the mesh state </param>
/// <param name="locationType">The location (nodes, edges, or faces) at which the index should be retrieved</param>
/// <param name="xCoordinate">The input point coordinates</param>
/// <param name="yCoordinate">The input point coordinates</param>
/// <param name="boundingBox">The input bounding box</param>
/// <param name="locationIndex">The location index</param>
/// <returns>Error code</returns>
int Mesh2dGetEdgeLocationIndex(int meshKernelId,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
ref int locationIndex);

/// <summary>
/// Gets the index of the closest mesh face.
/// </summary>
///
/// <param name="meshKernelId"> meshKernelId The id of the mesh state </param>
/// <param name="xCoordinate">The input point coordinates</param>
/// <param name="yCoordinate">The input point coordinates</param>
/// <param name="boundingBox">The input bounding box</param>
/// <param name="locationIndex">The location index</param>
/// <returns>Error code</returns>
int Mesh2dGetFaceLocationIndex(int meshKernelId,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
ref int locationIndex);

/// <summary>
/// Gets the index of the closest mesh node
/// </summary>
///
/// <param name="meshKernelId"> meshKernelId The id of the mesh state </param>
/// <param name="xCoordinate">The input point coordinates</param>
/// <param name="yCoordinate">The input point coordinates</param>
/// <param name="boundingBox">The input bounding box</param>
/// <param name="locationIndex">The location index</param>
/// <returns>Error code</returns>
int Mesh2dGetNodeLocationIndex(int meshKernelId,
int Mesh2dGetLocationIndex(int meshKernelId,
LocationType locationType,
double xCoordinate,
double yCoordinate,
BoundingBox boundingBox,
Expand Down Expand Up @@ -1333,6 +1250,16 @@ int GetSelectedVerticesInPolygon(int meshKernelId, DisposableGeometryList dispos
/// <returns>Error code</returns>
int Mesh2dGetOrthogonality(int meshKernelId, ref DisposableGeometryList disposableGeometryListOut);

/// <summary>
/// Retrieves a specified property of a 2D mesh.
/// </summary>
/// <param name="meshKernelId">The id of the mesh state</param>
/// <param name="propertyType">The type of property values to retrieve</param>
/// <param name="locationType">The location (nodes, edges, or faces) at which the property should be retrieved</param>
/// <param name="propertyValues">The geometry list populated with the values of the requested property</param>
/// <returns>Error code</returns>
int Mesh2dGetProperty(int meshKernelId, PropertyType propertyType, LocationType locationType, out DisposableGeometryList propertyValues);

/// <summary>
/// Counts the number of polygon nodes contained in the mesh boundary polygons computed in function
/// `mkernel_mesh2d_get_mesh_boundaries_as_polygons`
Expand Down Expand Up @@ -1658,7 +1585,7 @@ int Mesh2dRefineBasedOnSamples(int meshKernelId,
/// <param name="locationType">The location type</param>
/// <param name="results">The interpolation results with x and y coordinates</param>
/// <returns>Error code</returns>
int Mesh2dTriangulationInterpolation(int meshKernelId, DisposableGeometryList samples, int locationType, ref DisposableGeometryList results);
int Mesh2dTriangulationInterpolation(int meshKernelId, DisposableGeometryList samples, LocationType locationType, ref DisposableGeometryList results);

/// <summary>Compute the network chainages from fixed point locations</summary>
/// <param name="meshKernelId">The id of the mesh state</param>
Expand Down
23 changes: 23 additions & 0 deletions src/MeshKernelNET/Api/LocationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace MeshKernelNET.Api
{
/// <summary>
/// Enum for the location type on a mesh.
/// </summary>
public enum LocationType
{
/// <summary>
/// The faces location type.
/// </summary>
Faces = 0,

/// <summary>
/// The nodes location type.
/// </summary>
Nodes = 1,

/// <summary>
/// The edges location type.
/// </summary>
Edges = 2
}
}
Loading