using System;
namespace Deltares.UGrid.Api
{
public interface IUGridApi : IDisposable
{
#region Generic
///
/// Checks if the file is a UGrid file
///
bool IsUGridFile();
///
/// Creates a UGrid file and opens it for writing
///
/// File name for NetCDF dataset to be opened.
/// The global metadata of the NetCDF file
bool CreateFile(string filePath, FileMetaData fileMetaData);
///
/// Tries to open a NetCDF file and initialize based on its specified conventions.
///
/// File name for netCDF dataset to be opened.
bool Open(string filePath);
///
/// Tries to close an open io_netcdf data set.
///
bool Close();
///
/// Read the version from the initialized grid nc file
///
/// The version in the initialized grid nc file (or NaN)
double GetVersion();
///
/// Gets the number of mesh from a data set.
///
/// Number of meshes.
int GetMeshCount();
///
/// Gets number of meshes of specified
///
/// Type of mesh to inquire for
int GetNumberOfMeshByType(UGridMeshType meshType);
///
/// Gets mesh ids of specified
///
/// Type of mesh to inquire for
int[] GetMeshIdsByMeshType(UGridMeshType meshType);
///
/// Gets number of variables depending on specified mesh () and
///
/// Id of the mesh
/// Data location type
int GetVarCount(int meshId, GridLocationType locationType);
///
/// Gets the names of variables depending on specified mesh () and
///
/// Id of the mesh
/// Location type
/// Variable indices
int[] GetVarIds(int meshId, GridLocationType locationType);
///
/// Gets the EPSG code (Coordinate system code)
///
int GetCoordinateSystemCode();
#endregion
#region Network geometry
///
/// Gets the network ids for all networks
///
int[] GetNetworkIds();
///
/// Gets the number of declared networks
///
int GetNumberOfNetworks();
///
/// Retrieves the network geometry for the specified
///
/// Id of the network to get
DisposableNetworkGeometry GetNetworkGeometry(int networkId);
///
/// Writes a network geometry
///
/// Network geometry to write
/// Network id
int WriteNetworkGeometry(DisposableNetworkGeometry geometry);
#endregion
#region Mesh 1D
///
/// Gets a network id on which the mesh () depends
///
/// Id of the mesh
int GetNetworkIdFromMeshId(int meshId);
///
/// Retrieves the network geometry for the specified
///
/// Id of the mesh
Disposable1DMeshGeometry GetMesh1D(int meshId);
///
/// Writes a network geometry
///
/// Network geometry to write
/// Network on which the mesh is based
/// Mesh id
int WriteMesh1D(Disposable1DMeshGeometry mesh, int networkId);
#endregion
#region Mesh 2D
///
/// Reads the 2d mesh for the specified
///
/// Id of the mesh to get
Disposable2DMeshGeometry GetMesh2D(int meshId);
///
/// Writes the provided 2d mesh
///
/// 2d mesh to write
/// Mesh id
int WriteMesh2D(Disposable2DMeshGeometry mesh);
#endregion
#region Links
///
/// Gets the id of the links
///
int GetLinksId();
///
/// Gets the links for the specified (see )
///
/// Id of the links
DisposableLinksGeometry GetLinks(int linksId);
///
/// Writes the links and returns the linksId
///
/// Links to write
int WriteLinks(DisposableLinksGeometry links);
#endregion
}
}