Index: /anuga_work/development/anugavis/src/anugavis.cc
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.cc	(revision 5599)
+++ /anuga_work/development/anugavis/src/anugavis.cc	(revision 5600)
@@ -5,4 +5,5 @@
 #include <iostream>
 #include <string>
+#include <boost/shared_ptr.hpp>
 #ifdef HAVE_GL_GL_H
 #  include <GL/gl.h>
@@ -18,9 +19,11 @@
 #include "anugavis.hh"
 #include "height_quantity.hh"
+#include "sww_file.hh"
 
+using boost::shared_ptr;
 using std::string;
 
 AnugaVis::AnugaVis(const string &file_name, int width, int height):
-  screen(NULL), sww_file(file_name){
+  screen(NULL), sww_file(new SWWFile(file_name)){
   init_SDL(width, height);
   init_OpenGL(width, height);
@@ -31,7 +34,6 @@
 }
 
-void AnugaVis::add_HeightQuantity(HeightQuantity &height){
-  height.set_dynamic(this->sww_file.nc_inq_varndims_by_name(height.get_name()) \
-		     == 2);
+void AnugaVis::add_HeightQuantity(shared_ptr<HeightQuantity> &height){
+  height->set_SWWFile(this->sww_file);
   this->heights.push_back(height);
 }
Index: /anuga_work/development/anugavis/src/anugavis.hh
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.hh	(revision 5599)
+++ /anuga_work/development/anugavis/src/anugavis.hh	(revision 5600)
@@ -6,8 +6,10 @@
 #include <list>
 #include <string>
+#include <boost/shared_ptr.hpp>
 #include <SDL.h>
 #include "height_quantity.hh"
 #include "sww_file.hh"
 
+using boost::shared_ptr;
 using std::list;
 using std::string;
@@ -17,5 +19,5 @@
   AnugaVis(const string &sww_file, int width, int height);
   ~AnugaVis(void);
-  void add_HeightQuantity(HeightQuantity &height);
+  void add_HeightQuantity(shared_ptr<HeightQuantity> &height);
   void run(void);
 private:
@@ -23,6 +25,6 @@
   void init_OpenGL(int width, int height);
   SDL_Surface *screen;
-  SWWFile sww_file;
-  list<HeightQuantity> heights;
+  shared_ptr<SWWFile> sww_file;
+  list<shared_ptr<HeightQuantity> > heights;
 };
 
Index: /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc
===================================================================
--- /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc	(revision 5599)
+++ /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc	(revision 5600)
@@ -1,8 +1,10 @@
 #include <iostream>
 #include <sstream>
+#include <boost/shared_ptr.hpp>
 #include <SDL.h>
 #include "anugavis.hh"
 #include "output.hh"
 
+using boost::shared_ptr;
 using std::cout;
 using std::endl;
@@ -19,6 +21,8 @@
   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);
+    shared_ptr<HeightQuantity> elevation(new HeightQuantity("elevation", 0, 1,
+							    0.5, 0.5, 0.5));
+    shared_ptr<HeightQuantity> stage(new HeightQuantity("stage", 0, 1,
+							0, 0, 0.8));
     anuga.add_HeightQuantity(elevation);
     anuga.add_HeightQuantity(stage);
Index: /anuga_work/development/anugavis/src/height_quantity.cc
===================================================================
--- /anuga_work/development/anugavis/src/height_quantity.cc	(revision 5599)
+++ /anuga_work/development/anugavis/src/height_quantity.cc	(revision 5600)
@@ -45,10 +45,9 @@
 }
 
-const string &HeightQuantity::get_name(void){
-  return this->name;
-}
-
-void HeightQuantity::set_dynamic(bool dynamic){
-  this->dynamic = dynamic;
+void HeightQuantity::set_SWWFile(const shared_ptr<SWWFile> &file){
+  this->sww_file = file;
+  this->points = \
+    shared_array<float>(new float[this->sww_file->number_of_points]);
+  this->dynamic = this->sww_file->nc_inq_varndims_by_name(this->name) == 2;
 }
 
Index: /anuga_work/development/anugavis/src/height_quantity.hh
===================================================================
--- /anuga_work/development/anugavis/src/height_quantity.hh	(revision 5599)
+++ /anuga_work/development/anugavis/src/height_quantity.hh	(revision 5600)
@@ -9,5 +9,6 @@
 
 #include <string>
-
+#include <boost/shared_array.hpp>
+#include <boost/shared_ptr.hpp>
 #ifdef HAVE_GL_GL_H
 #  include <GL/gl.h>
@@ -15,5 +16,8 @@
 #  include <OpenGL/gl.h>
 #endif
+#include "sww_file.hh"
 
+using boost::shared_array;
+using boost::shared_ptr;
 using std::string;
 
@@ -31,6 +35,5 @@
   ~HeightQuantity(void);
   void draw(int frame);
-  const string &get_name(void);
-  void set_dynamic(bool dynamic);
+  void set_SWWFile(const shared_ptr<SWWFile> &file);
   GLdouble offset;
   GLdouble scale;
@@ -45,4 +48,6 @@
   bool dynamic;
   GLuint display_list;
+  shared_array<float> points;
+  shared_ptr<SWWFile> sww_file;
 };
 
Index: /anuga_work/development/anugavis/src/sww_file.hh
===================================================================
--- /anuga_work/development/anugavis/src/sww_file.hh	(revision 5599)
+++ /anuga_work/development/anugavis/src/sww_file.hh	(revision 5600)
@@ -18,4 +18,5 @@
 
 class SWWFile{
+  friend class HeightQuantity;
 public:
   SWWFile(const string &file_name);
