Changeset 5264
- Timestamp:
- May 1, 2008, 3:50:15 PM (17 years ago)
- Location:
- anuga_work/development/anugavis/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/anugavis_simple.c
r5263 r5264 14 14 return 1; 15 15 } 16 17 printf("points: %d\nvertices: %d\nvolumes: %d\n",18 anugavis.number_of_points,19 anugavis.number_of_vertices,20 anugavis.number_of_volumes);21 22 16 if(AnugaVis_DefineHeightQuantity("elevation", 0, 1, 128, 128, 128) == -1){ 23 17 printf("AnugaVis_DefineHeightQuantity() Error: %s\n", AnugaVis_GetError()); -
anuga_work/development/anugavis/src/globals.h
r5263 r5264 13 13 float *x; 14 14 float *y; 15 float *cells;15 int *volumes; 16 16 struct height_quantity_simple *heights; 17 17 } ANUGAVIS; -
anuga_work/development/anugavis/src/init.c
r5263 r5264 29 29 anugavis.x = NULL; 30 30 anugavis.y = NULL; 31 anugavis. cells = NULL;31 anugavis.volumes = NULL; 32 32 anugavis.heights = NULL; 33 33 if((SDL_Init(SDL_INIT_VIDEO) == -1) || … … 67 67 ((anugavis.y = xmalloc(sizeof(float) * anugavis.number_of_points, 68 68 "AnugaVis_Init()")) == NULL) || 69 ((anugavis.volumes = xmalloc(sizeof(int) 70 * anugavis.number_of_volumes 71 * anugavis.number_of_vertices, 72 "AnugaVis_Init()")) == NULL) || 69 73 (nc_get_var_float_by_name(anugavis.netcdfId, "x", 70 74 anugavis.x) != NC_NOERR) || 71 75 (nc_get_var_float_by_name(anugavis.netcdfId, "y", 72 anugavis.y) != NC_NOERR)){ 76 anugavis.y) != NC_NOERR) || 77 (nc_get_var_int_by_name(anugavis.netcdfId, "volumes", 78 anugavis.volumes) != NC_NOERR)){ 73 79 nc_close(anugavis.netcdfId); 74 80 if(anugavis.x != NULL) free(anugavis.x); 75 81 if(anugavis.y != NULL) free(anugavis.y); 82 if(anugavis.volumes != NULL) free(anugavis.volumes); 76 83 SDL_Quit(); 77 84 return -1; … … 86 93 free(anugavis.x); 87 94 free(anugavis.y); 95 free(anugavis.volumes); 88 96 SDL_Quit(); 89 97 } -
anuga_work/development/anugavis/src/netcdf_util.c
r5263 r5264 19 19 return status; 20 20 } 21 22 int nc_get_var_int_by_name(int ncid, const char *name, int *ip){ 23 int status; 24 int varid; 25 if(((status = nc_inq_varid(ncid, name, &varid)) != NC_NOERR) || 26 ((status = nc_get_var_int(ncid, varid, ip)) != NC_NOERR)) 27 AnugaVis_NetCDFError(status); 28 return status; 29 } -
anuga_work/development/anugavis/src/netcdf_util.h
r5263 r5264 5 5 extern int nc_inq_dimlen_by_name(int ncid, const char *name, size_t *size); 6 6 extern int nc_get_var_float_by_name(int ncid, const char *name, float *fp); 7 extern int nc_get_var_int_by_name(int ncid, const char *name, int *ip); 7 8 8 9 #endif
Note: See TracChangeset
for help on using the changeset viewer.