Index: /anuga_work/development/anugavis/src/anugavis.cc
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.cc	(revision 5597)
+++ /anuga_work/development/anugavis/src/anugavis.cc	(revision 5598)
@@ -17,4 +17,5 @@
 #include <SDL.h>
 #include "anugavis.hh"
+#include "height_quantity.hh"
 
 using std::string;
@@ -28,4 +29,14 @@
 AnugaVis::~AnugaVis(void){
   if(this->screen != NULL) SDL_Quit();
+}
+
+void AnugaVis::add_HeightQuantity(HeightQuantity &height){
+  height.set_dynamic(this->sww_file.nc_inq_varndims_by_name(height.get_name()) \
+		     == 2);
+  this->heights.push_back(height);
+}
+
+void AnugaVis::run(void){
+
 }
 
Index: /anuga_work/development/anugavis/src/anugavis.hh
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.hh	(revision 5597)
+++ /anuga_work/development/anugavis/src/anugavis.hh	(revision 5598)
@@ -4,8 +4,11 @@
 /* The main controller object. */
 
+#include <list>
 #include <string>
 #include <SDL.h>
+#include "height_quantity.hh"
 #include "sww_file.hh"
 
+using std::list;
 using std::string;
 
@@ -14,4 +17,6 @@
   AnugaVis(const string &sww_file, int width, int height);
   ~AnugaVis(void);
+  void add_HeightQuantity(HeightQuantity &height);
+  void run(void);
 private:
   void init_SDL(int width, int height);
@@ -19,4 +24,5 @@
   SDL_Surface *screen;
   SWWFile sww_file;
+  list<HeightQuantity> heights;
 };
 
Index: /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc
===================================================================
--- /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc	(revision 5597)
+++ /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc	(revision 5598)
@@ -19,4 +19,9 @@
   try{
     AnugaVis anuga(argv[1], 640, 480);
+    HeightQuantity elevation("elevation", 0, 1, 0.5, 0.5, 0.5);
+    HeightQuantity stage("stage", 0, 1, 0, 0, 0.8);
+    anuga.add_HeightQuantity(elevation);
+    anuga.add_HeightQuantity(stage);
+    anuga.run();
   }catch(const char *str){
     output_string(string(str));
Index: /anuga_work/development/anugavis/src/height_quantity.cc
===================================================================
--- /anuga_work/development/anugavis/src/height_quantity.cc	(revision 5597)
+++ /anuga_work/development/anugavis/src/height_quantity.cc	(revision 5598)
@@ -15,18 +15,15 @@
 #endif
 #include "height_quantity.hh"
-#include "sww_file.hh"
 
 using std::string;
 
-HeightQuantity::HeightQuantity(const SWWFile &sww, const string &name,
+HeightQuantity::HeightQuantity(const string &name,
 			       GLdouble offset, GLdouble scale,
 			       GLfloat red, GLfloat green, GLfloat blue):
   offset(offset), scale(scale), red(red), green(green), blue(blue), name(name),
-  frame_number(-1), sww(sww){
+  frame_number(-1){
   GLenum glerror;
-  this->dynamic = (sww.nc_inq_varndims_by_name(name) == 2);
   this->display_list = glGenLists(1);
   if((glerror = glGetError()) != GL_NO_ERROR) throw gluErrorString(glerror);
-  
 }
 
@@ -48,4 +45,12 @@
 }
 
+const string &HeightQuantity::get_name(void){
+  return this->name;
+}
+
+void HeightQuantity::set_dynamic(bool dynamic){
+  this->dynamic = dynamic;
+}
+
 void HeightQuantity::compile(int frame){
   
Index: /anuga_work/development/anugavis/src/height_quantity.hh
===================================================================
--- /anuga_work/development/anugavis/src/height_quantity.hh	(revision 5597)
+++ /anuga_work/development/anugavis/src/height_quantity.hh	(revision 5598)
@@ -15,15 +15,22 @@
 #  include <OpenGL/gl.h>
 #endif
-#include "sww_file.hh"
 
 using std::string;
 
+/* HeightQuantity instances cannot be shared amongst different
+   AnugaVis instances. This shouldn't matter since AnugaVis'
+   initialisation does SDL initialisation and that should only happen
+   once.
+*/
+
 class HeightQuantity {
 public:
-  HeightQuantity(const SWWFile &sww, const string &name,
+  HeightQuantity(const string &name,
 		 const GLdouble offset, GLdouble scale,
 		 GLfloat red, GLfloat green, GLfloat blue);
   ~HeightQuantity(void);
   void draw(int frame);
+  const string &get_name(void);
+  void set_dynamic(bool dynamic);
   GLdouble offset;
   GLdouble scale;
@@ -38,5 +45,4 @@
   bool dynamic;
   GLuint display_list;
-  const SWWFile &sww;
 };
 
Index: /anuga_work/development/anugavis/src/sww_file.cc
===================================================================
--- /anuga_work/development/anugavis/src/sww_file.cc	(revision 5597)
+++ /anuga_work/development/anugavis/src/sww_file.cc	(revision 5598)
@@ -38,10 +38,9 @@
 }
 
-
 int SWWFile::nc_inq_varndims_by_name(const string &name) const{
   int ncstatus;
   int dimid;
   int ndims;
-  if(((ncstatus = nc_inq_dimid(this->netcdf_id,
+  if(((ncstatus = nc_inq_varid(this->netcdf_id,
 			       name.c_str(), &dimid)) != NC_NOERR) ||
      ((ncstatus = nc_inq_varndims(this->netcdf_id,
