- Timestamp:
- Apr 22, 2008, 1:36:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/libanugavis/height_quantity.c
r5220 r5228 1 1 #include <stdlib.h> 2 2 #include <string.h> 3 #include <netcdf.h> 3 4 #include <SDL.h> 4 5 #include "anugavis.h" … … 7 8 #include "height_quantity.h" 8 9 9 int AnugaVis_DefineHeightQuantity(c har *name,10 int AnugaVis_DefineHeightQuantity(const char *name, 10 11 double offset, double scale, 11 12 int red, int green, int blue){ 12 13 struct height_quantity_simple *height; 14 int ncstatus; 15 int ncvarid; 16 int numdims; 17 /* Check that it's actually in the NetCDF file */ 18 if((ncstatus = nc_inq_varid(anugavis.netcdfId, name, &ncvarid)) != NC_NOERR){ 19 AnugaVis_NetCDFError(ncstatus); 20 return -1; 21 } 22 13 23 /* Redefining a quantity? */ 14 24 for(height = anugavis.heights ; height != NULL ; height = height->next) … … 26 36 } 27 37 28 /* TODO: use NetCDF to check if the quantity is dynamic */ 38 /* If the NetCDF variable is 2-dimensional, then it's dynamic. */ 39 if((ncstatus = nc_inq_varndims(anugavis.netcdfId, 40 ncvarid, &numdims)) != NC_NOERR){ 41 AnugaVis_NetCDFError(ncstatus); 42 return -1; 43 } 44 height->dynamic = (numdims == 2); 29 45 height->offset = offset; 30 46 height->scale = scale;
Note: See TracChangeset
for help on using the changeset viewer.