Changeset 5605
- Timestamp:
- Aug 5, 2008, 11:12:01 AM (16 years ago)
- Location:
- anuga_work/development/anugavis/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/height_quantity.cc
r5600 r5605 14 14 # include <OpenGL/glu.h> 15 15 #endif 16 #include <netcdf.h> 16 17 #include "height_quantity.hh" 17 18 … … 46 47 47 48 void HeightQuantity::set_SWWFile(const shared_ptr<SWWFile> &file){ 49 int ncstatus; 48 50 this->sww_file = file; 49 51 this->points = \ 50 52 shared_array<float>(new float[this->sww_file->number_of_points]); 51 53 this->dynamic = this->sww_file->nc_inq_varndims_by_name(this->name) == 2; 54 if((ncstatus = nc_inq_varid(this->sww_file->netcdf_id, this->name.c_str(), 55 &this->varid)) != NC_NOERR) 56 throw nc_strerror(ncstatus); 52 57 } 53 58 54 59 void HeightQuantity::compile(int frame){ 55 60 size_t start_1[1] = {0}; 61 size_t start_2[2] = {0, 0}; 62 size_t span_1[1]; 63 size_t span_2[2] = {1, 0}; 64 int ncstatus; 65 if(this->dynamic){ 66 span_2[1] = this->sww_file->number_of_points; 67 ncstatus = nc_get_vara_float(this->sww_file->netcdf_id, this->varid, 68 start_2, span_2, this->points.get()); 69 }else{ 70 span_1[0] = this->sww_file->number_of_points; 71 ncstatus = nc_get_vara_float(this->sww_file->netcdf_id, this->varid, 72 start_1, span_1, this->points.get()); 73 } 74 if(ncstatus != NC_NOERR) throw nc_strerror(ncstatus); 75 /* TODO: Compile the triangles into an OGL displaylist. */ 56 76 } -
anuga_work/development/anugavis/src/height_quantity.hh
r5600 r5605 46 46 int frame_number; /* The most recently drawn frame (i.e., the one 47 47 cached in the display list. */ 48 int varid; 48 49 bool dynamic; 49 50 GLuint display_list;
Note: See TracChangeset
for help on using the changeset viewer.