Changeset 5259
- Timestamp:
- May 1, 2008, 2:16:22 PM (17 years ago)
- Location:
- anuga_work/development/anugavis/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/Makefile.am
r5257 r5259 3 3 # Convenience library for the core visualiser code. 4 4 noinst_LIBRARIES = libanugavis.a 5 libanugavis_a_SOURCES = anugavis.h \ 6 error.c \ 5 libanugavis_a_SOURCES = error.c \ 7 6 error.h \ 8 7 globals.c \ … … 10 9 height_quantity.c \ 11 10 height_quantity.h \ 12 init.c 11 init.c \ 12 init.h 13 13 libanugavis_a_CFLAGS = @SDL_CFLAGS@ @GLU_CFLAGS@ 14 14 libanugavis_a_LIBADD = @LIBOBJS@ -
anuga_work/development/anugavis/src/anugavis.h
r5255 r5259 1 #ifndef ANUGAVIS_H2 #define ANUGAVIS_H3 4 /* Start and stop the visualiser. AnugaVis_Init() returns -1 on5 * error. To get detailed error information, use AnugaVis_GetError().6 */7 extern int AnugaVis_Init(int width, int height, const char *swwFilePath);8 extern void AnugaVis_DeInit(void);9 10 /* Define (or redefine if already defined a simple height quantity with the11 * given offset, scale, and color. Returns 0 on success, -1 on error.12 */13 extern int AnugaVis_DefineHeightQuantity(const char *name,14 double offset, double scale,15 int red, int green, int blue);16 /* Undefine a given simple height quantity.17 */18 extern void AnugaVis_UndefineHeightQuantity(char *name);19 20 /* Get detailed error information. The returned string should not be21 * freed by the caller.22 */23 extern char* AnugaVis_GetError(void);24 25 #endif -
anuga_work/development/anugavis/src/anugavis_simple.c
r5255 r5259 1 #include <anugavis.h> 1 #include "error.h" 2 #include "init.h" 3 #include "height_quantity.h" 2 4 #include <stdio.h> 3 5 #include "globals.h" 4 6 int main(int argc, char *argv[]){ 5 7 if(argc != 2){ -
anuga_work/development/anugavis/src/error.h
r5255 r5259 14 14 void AnugaVis_NetCDFError(int ncerr); 15 15 16 /* Get detailed error information. The returned string should not be 17 * freed by the caller. 18 */ 19 extern char* AnugaVis_GetError(void); 20 16 21 #endif -
anuga_work/development/anugavis/src/globals.h
r5255 r5259 8 8 SDL_Surface *screen; 9 9 int netcdfId; 10 size_t number_of_points; 10 11 struct height_quantity_simple *heights; 11 12 } ANUGAVIS; -
anuga_work/development/anugavis/src/height_quantity.h
r5255 r5259 13 13 }; 14 14 15 /* Define (or redefine if already defined a simple height quantity with the 16 * given offset, scale, and color. Returns 0 on success, -1 on error. 17 */ 18 extern int AnugaVis_DefineHeightQuantity(const char *name, 19 double offset, double scale, 20 int red, int green, int blue); 21 /* Undefine a given simple height quantity. 22 */ 23 extern void AnugaVis_UndefineHeightQuantity(char *name); 24 15 25 #endif -
anuga_work/development/anugavis/src/init.c
r5255 r5259 21 21 int AnugaVis_Init(int width, int height, const char *swwFilePath){ 22 22 int ncstatus; 23 int ncdimid; 23 24 if((SDL_Init(SDL_INIT_VIDEO) == -1) || 24 25 (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) || … … 42 43 43 44 if((ncstatus = nc_open(swwFilePath, NC_SHARE, 44 &anugavis.netcdfId)) != NC_NOERR){ 45 AnugaVis_NetCDFError(ncstatus); 46 SDL_Quit(); 47 return -1; 48 } 45 &anugavis.netcdfId)) != NC_NOERR) goto nc_err; 46 if((ncstatus = nc_inq_dimid(anugavis.netcdfId, "number_of_points", 47 &ncdimid)) != NC_NOERR) goto nc_err; 48 if((ncstatus = nc_inq_dimlen(anugavis.netcdfId, ncdimid, 49 &anugavis.number_of_points)) != NC_NOERR) 50 goto nc_err; 51 49 52 anugavis.heights = NULL; 50 53 return 0; 54 nc_err: 55 AnugaVis_NetCDFError(ncstatus); 56 SDL_Quit(); 57 return -1; 51 58 } 52 59
Note: See TracChangeset
for help on using the changeset viewer.