#ifndef SWW_FILE_HH #define SWW_FILE_HH /* A simple read-only wrapper around the NetCDF C calls, since it's difficult to build the C++ binding on Win32 (further, it fails its test suite. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #ifdef HAVE_SYS_TYPES_H # include #endif #include using boost::shared_array; using std::string; class SWWFile{ friend class AnugaVis; friend class HeightQuantity; public: SWWFile(const string &file_name); ~SWWFile(void); int nc_inq_varndims_by_name(const string &name) const; private: void nc_get_var_float_by_name(const string &name, float array[]) const; void nc_get_var_int_by_name(const string &name, int array[]) const; size_t nc_inq_dimlen_by_name(const string &name) const; void compute_extents(void); int netcdf_id; int number_of_points; int number_of_timesteps; int number_of_vertices; int number_of_volumes; shared_array x; shared_array y; shared_array volumes; float minX; float maxX; float minY; float maxY; }; #endif