Index: /trunk/packages/vizservers/nanovis/Command.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/Command.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/Command.cpp	(revision 3463)
@@ -68,4 +68,6 @@
 #include "Volume.h"
 #include "VolumeRenderer.h"
+
+using namespace nv::graphics;
 
 // default transfer function
@@ -137,13 +139,13 @@
 static int
 GetCullMode(Tcl_Interp *interp, Tcl_Obj *objPtr,
-            graphics::RenderContext::CullMode *modePtr)
+            RenderContext::CullMode *modePtr)
 {
     const char *string = Tcl_GetString(objPtr);
     if (strcmp(string, "none") == 0) {
-        *modePtr = graphics::RenderContext::NO_CULL;
+        *modePtr = RenderContext::NO_CULL;
     } else if (strcmp(string, "front") == 0) {
-        *modePtr = graphics::RenderContext::FRONT;
+        *modePtr = RenderContext::FRONT;
     } else if (strcmp(string, "back") == 0) {
-        *modePtr = graphics::RenderContext::BACK;
+        *modePtr = RenderContext::BACK;
     } else {
         Tcl_AppendResult(interp, "invalid cull mode \"", string,
@@ -156,12 +158,12 @@
 static int
 GetShadingModel(Tcl_Interp *interp, Tcl_Obj *objPtr,
-                graphics::RenderContext::ShadingModel *modelPtr)
+                RenderContext::ShadingModel *modelPtr)
 {
     const char *string = Tcl_GetString(objPtr);
 
     if (strcmp(string,"flat") == 0) {
-        *modelPtr = graphics::RenderContext::FLAT;
+        *modelPtr = RenderContext::FLAT;
     } else if (strcmp(string,"smooth") == 0) {
-        *modelPtr = graphics::RenderContext::SMOOTH;
+        *modelPtr = RenderContext::SMOOTH;
     } else {
         Tcl_AppendResult(interp, "bad shading model \"", string,
@@ -174,12 +176,12 @@
 static int
 GetPolygonMode(Tcl_Interp *interp, Tcl_Obj *objPtr,
-               graphics::RenderContext::PolygonMode *modePtr)
+               RenderContext::PolygonMode *modePtr)
 {
     const char *string = Tcl_GetString(objPtr);
 
     if (strcmp(string,"wireframe") == 0) {
-        *modePtr = graphics::RenderContext::LINE;
+        *modePtr = RenderContext::LINE;
     } else if (strcmp(string,"fill") == 0) {
-        *modePtr = graphics::RenderContext::FILL;
+        *modePtr = RenderContext::FILL;
     } else {
         Tcl_AppendResult(interp, "invalid polygon mode \"", string,
@@ -1849,5 +1851,5 @@
                 Tcl_Obj *const *objv)
 {
-    graphics::RenderContext::CullMode mode;
+    RenderContext::CullMode mode;
     if (GetCullMode(interp, objv[2], &mode) != TCL_OK) {
         return TCL_ERROR;
@@ -1919,5 +1921,5 @@
                    Tcl_Obj *const *objv)
 {
-    graphics::RenderContext::PolygonMode mode;
+    RenderContext::PolygonMode mode;
     if (GetPolygonMode(interp, objv[2], &mode) != TCL_OK) {
         return TCL_ERROR;
@@ -1932,5 +1934,5 @@
                  Tcl_Obj *const *objv)
 {
-    graphics::RenderContext::ShadingModel model;
+    RenderContext::ShadingModel model;
     if (GetShadingModel(interp, objv[2], &model) != TCL_OK) {
         return TCL_ERROR;
Index: /trunk/packages/vizservers/nanovis/ContourLineFilter.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/ContourLineFilter.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/ContourLineFilter.cpp	(revision 3463)
@@ -14,4 +14,6 @@
 #include "ContourLineFilter.h"
 
+using namespace nv::graphics;
+
 ContourLineFilter::ContourLineFilter()
     : _colorMap(0), _top(false)
@@ -30,5 +32,5 @@
 }
 
-R2Geometry* 
+Geometry * 
 ContourLineFilter::create(float min, float max, int linecount, 
 			  Vector3* vertices, int width, int height)
@@ -70,19 +72,19 @@
 	}
     }
-    R2VertexBuffer* vertexBuffer;
-    vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3, totalPoints,
-	totalPoints * sizeof(Vector3), vertexSet, false);
-    R2VertexBuffer* colorBuffer = NULL;
+    VertexBuffer *vertexBuffer = 
+        new VertexBuffer(VertexBuffer::POSITION3, totalPoints,
+                         totalPoints * sizeof(Vector3), vertexSet, false);
+    VertexBuffer *colorBuffer = NULL;
     if (_colorMap) {
-        colorBuffer  = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalPoints, 
-		totalPoints * sizeof(Vector3), colorSet, false);
-    }
-    R2Geometry* geometry;
-    geometry = new R2Geometry(R2Geometry::LINES, vertexBuffer, colorBuffer, 0);
+        colorBuffer =
+            new VertexBuffer(VertexBuffer::COLOR4, totalPoints, 
+                             totalPoints * sizeof(Vector3), colorSet, false);
+    }
+    Geometry *geometry = new Geometry(Geometry::LINES, vertexBuffer, colorBuffer, 0);
     clear();
     return geometry;
 }
 
-R2Geometry* 
+Geometry * 
 ContourLineFilter::create(float min, float max, int linecount, 
 			  Vector4* vertices, int width, int height)
@@ -124,12 +126,12 @@
 	}
     }
-    R2VertexBuffer* vertexBuffer;
-    vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3, totalPoints,
-	totalPoints * sizeof(Vector3), vertexSet, false);
-    R2VertexBuffer* colorBuffer;
-    colorBuffer = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalPoints,
-	totalPoints * sizeof(Vector3), colorSet, false);
-    R2Geometry* geometry;
-    geometry = new R2Geometry(R2Geometry::LINES, vertexBuffer, colorBuffer, 0);
+    VertexBuffer *vertexBuffer =
+        new VertexBuffer(VertexBuffer::POSITION3, totalPoints,
+                         totalPoints * sizeof(Vector3), vertexSet, false);
+    VertexBuffer *colorBuffer =
+        new VertexBuffer(VertexBuffer::COLOR4, totalPoints,
+                         totalPoints * sizeof(Vector3), colorSet, false);
+    Geometry *geometry =
+        new Geometry(Geometry::LINES, vertexBuffer, colorBuffer, 0);
     clear();
     return geometry;
Index: /trunk/packages/vizservers/nanovis/ContourLineFilter.h
===================================================================
--- /trunk/packages/vizservers/nanovis/ContourLineFilter.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/ContourLineFilter.h	(revision 3463)
@@ -41,6 +41,6 @@
     ContourLineFilter();
 
-    R2Geometry *create(float min, float max, int linecount, Vector3 *vertices, int width, int height);
-    R2Geometry *create(float min, float max, int linecount, Vector4 *vertices, int width, int height);
+    nv::graphics::Geometry *create(float min, float max, int linecount, Vector3 *vertices, int width, int height);
+    nv::graphics::Geometry *create(float min, float max, int linecount, Vector4 *vertices, int width, int height);
 
     void setColorMap(Vector3Array *colorMap);
Index: /trunk/packages/vizservers/nanovis/Grid.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/Grid.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/Grid.cpp	(revision 3463)
@@ -8,4 +8,6 @@
 #include "Grid.h"
 #include "Trace.h"
+
+using namespace nv::util;
 
 #define NUMDIGITS	6
@@ -246,5 +248,5 @@
 }
 
-void Grid::setFont(R2Fonts *font)
+void Grid::setFont(Fonts *font)
 {
 //    if (font == _font) return;
Index: /trunk/packages/vizservers/nanovis/Grid.h
===================================================================
--- /trunk/packages/vizservers/nanovis/Grid.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/Grid.h	(revision 3463)
@@ -58,5 +58,5 @@
     void render();
 
-    void setFont(R2Fonts *font);
+    void setFont(nv::util::Fonts *font);
 
     Axis xAxis;
@@ -66,5 +66,5 @@
 private:
     RGBA _axisColor, _majorColor, _minorColor;
-    R2Fonts *_font;
+    nv::util::Fonts *_font;
     bool _visible;
 };
Index: /trunk/packages/vizservers/nanovis/HeightMap.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/HeightMap.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/HeightMap.cpp	(revision 3463)
@@ -11,4 +11,6 @@
 double HeightMap::valueMin = 0.0;
 double HeightMap::valueMax = 1.0;
+
+using namespace nv::graphics;
 
 HeightMap::HeightMap() : 
@@ -45,9 +47,9 @@
 
 void 
-HeightMap::render(graphics::RenderContext *renderContext)
+HeightMap::render(RenderContext *renderContext)
 {
     glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LIGHTING_BIT);
 
-    if (renderContext->getCullMode() == graphics::RenderContext::NO_CULL) {
+    if (renderContext->getCullMode() == RenderContext::NO_CULL) {
         glDisable(GL_CULL_FACE);
     } else {
Index: /trunk/packages/vizservers/nanovis/HeightMap.h
===================================================================
--- /trunk/packages/vizservers/nanovis/HeightMap.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/HeightMap.h	(revision 3463)
@@ -10,8 +10,4 @@
 #include "RenderContext.h"
 #include "AxisRange.h"
-
-namespace graphics {
-    class RenderContext;
-}
 
 class Grid;
@@ -27,5 +23,5 @@
     ~HeightMap();
 
-    void render(graphics::RenderContext *renderContext);
+    void render(nv::graphics::RenderContext *renderContext);
 
     /**
@@ -125,5 +121,5 @@
     unsigned int _texcoordBufferObjectID;
     int _vertexCount;
-    R2Geometry *_contour;
+    nv::graphics::Geometry *_contour;
     TransferFunction *_tfPtr;
     float _opacity;
Index: /trunk/packages/vizservers/nanovis/NvColorTableRenderer.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/NvColorTableRenderer.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/NvColorTableRenderer.cpp	(revision 3463)
@@ -7,4 +7,6 @@
 
 #include "NvColorTableRenderer.h"
+
+using namespace nv::util;
 
 NvColorTableRenderer::NvColorTableRenderer() :
Index: /trunk/packages/vizservers/nanovis/NvColorTableRenderer.h
===================================================================
--- /trunk/packages/vizservers/nanovis/NvColorTableRenderer.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/NvColorTableRenderer.h	(revision 3463)
@@ -17,7 +17,7 @@
     void render(int width, int height,
                 Texture2D *texture, TransferFunction *tf,
-                double rangeMin, double rageMax);
+                double rangeMin, double rangeMax);
 
-    void setFonts(R2Fonts *fonts)
+    void setFonts(nv::util::Fonts *fonts)
     {
         _fonts = fonts;
@@ -25,5 +25,5 @@
 
 private:
-    R2Fonts *_fonts;
+    nv::util::Fonts *_fonts;
     NvColorTableShader *_shader;
 };
Index: /trunk/packages/vizservers/nanovis/NvShader.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/NvShader.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/NvShader.cpp	(revision 3463)
@@ -10,4 +10,6 @@
 #include "NvShader.h"
 #include "Trace.h"
+
+using namespace nv::util;
 
 CGprofile NvShader::_defaultVertexProfile = CG_PROFILE_VP40;
@@ -52,5 +54,5 @@
                               CGprofile profile, const char *entryPoint)
 {
-    std::string path = R2FilePath::getInstance()->getPath(fileName);
+    std::string path = FilePath::getInstance()->getPath(fileName);
     if (path.empty()) {
         ERROR("can't find program \"%s\"", fileName);
Index: /trunk/packages/vizservers/nanovis/ParticleSystem.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/ParticleSystem.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/ParticleSystem.cpp	(revision 3463)
@@ -29,4 +29,6 @@
 #include "Trace.h"
 
+using namespace nv::util;
+
 #define USE_RGBA_ARROW
 
@@ -84,5 +86,5 @@
             if (tail != -1) {
                 sprintf(buff, fileNameFormat, curIndex);
-                //std::string path = R2FilePath::getInstance()->getPath(buff);
+                //std::string path = FilePath::getInstance()->getPath(buff);
 #ifdef WANT_TRACE
                 float t = clock() /(float) CLOCKS_PER_SEC;
@@ -285,5 +287,5 @@
     }
 
-    std::string path = R2FilePath::getInstance()->getPath("arrows.bmp");
+    std::string path = FilePath::getInstance()->getPath("arrows.bmp");
 
     if (!path.empty()) {
@@ -419,5 +421,5 @@
     _context = NvShader::getCgContext();
 
-    std::string path = R2FilePath::getInstance()->getPath("distance.cg");
+    std::string path = FilePath::getInstance()->getPath("distance.cg");
     _distanceInitFP =  
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
@@ -436,5 +438,5 @@
     cgGLLoadProgram(_distanceSortLookupFP);
 
-    path = R2FilePath::getInstance()->getPath("mergesort.cg");
+    path = FilePath::getInstance()->getPath("mergesort.cg");
     _sortRecursionFP = 
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
@@ -454,5 +456,5 @@
     _seStepParam = cgGetNamedParameter(_sortEndFP, "step");
 
-    path = R2FilePath::getInstance()->getPath("passthrough.cg");
+    path = FilePath::getInstance()->getPath("passthrough.cg");
     _passthroughFP = 
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
@@ -463,5 +465,5 @@
     _biasParam = cgGetNamedParameter(_passthroughFP, "bias");
 
-    path = R2FilePath::getInstance()->getPath("moveparticles.cg");
+    path = FilePath::getInstance()->getPath("moveparticles.cg");
     _moveParticlesFP = 
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
@@ -475,5 +477,5 @@
     _mpScale= cgGetNamedParameter(_moveParticlesFP, "scale");
 
-    path = R2FilePath::getInstance()->getPath("particlevp.cg");
+    path = FilePath::getInstance()->getPath("particlevp.cg");
     _particleVP = 
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
@@ -485,5 +487,5 @@
     _mvCurrentTimeParam =  cgGetNamedParameter(_particleVP, "currentTime");
 
-    path = R2FilePath::getInstance()->getPath("particlefp.cg");
+    path = FilePath::getInstance()->getPath("particlefp.cg");
     _particleFP = 
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
@@ -492,5 +494,5 @@
     _vectorParticleParam = cgGetNamedParameter(_particleVP, "vfield");
 
-    path = R2FilePath::getInstance()->getPath("moveparticles.cg");
+    path = FilePath::getInstance()->getPath("moveparticles.cg");
     _initParticlePosFP = 
         cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
Index: /trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp	(revision 3463)
@@ -10,4 +10,6 @@
 #include "ParticleSystem.h"
 #include "Trace.h"
+
+using namespace nv::util;
 
 #define BUFSIZE 4096
@@ -144,5 +146,5 @@
         char buff[256];
         sprintf(buff, fileName.c_str(), startIndex);
-        std::string path = R2FilePath::getInstance()->getPath(buff);
+        std::string path = FilePath::getInstance()->getPath(buff);
         if (path.size()) {
             std::string dir;
@@ -169,5 +171,5 @@
         }
     } else {
-        std::string path = R2FilePath::getInstance()->getPath(fileName.c_str());
+        std::string path = FilePath::getInstance()->getPath(fileName.c_str());
         _newParticleSystem =
             new ParticleSystem(width, height, path.c_str(),
Index: /trunk/packages/vizservers/nanovis/PointSetRenderer.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/PointSetRenderer.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/PointSetRenderer.cpp	(revision 3463)
@@ -10,4 +10,6 @@
 #include "PCASplit.h"
 
+using namespace nv::util;
+
 #define USE_TEXTURE 
 //#define USE_SHADER 
@@ -17,5 +19,5 @@
 {
     _shader = new PointShader();
-    std::string path = R2FilePath::getInstance()->getPath("particle2.bmp");
+    std::string path = FilePath::getInstance()->getPath("particle2.bmp");
     if (path.empty()) {
         ERROR("Particle image not found");
Index: unk/packages/vizservers/nanovis/R2/include/R2/R2.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/R2.h	(revision 3462)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_H
-#define R2_H
-
-#endif
-
Index: /trunk/packages/vizservers/nanovis/R2/include/R2/R2FilePath.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/R2FilePath.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/include/R2/R2FilePath.h	(revision 3463)
@@ -1,13 +1,16 @@
 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_FILE_PATH_H
-#define R2_FILE_PATH_H
+#ifndef NV_UTIL_FILE_PATH_H
+#define NV_UTIL_FILE_PATH_H
 
 #include <list>
 #include <string>
 
-class R2FilePath
+namespace nv {
+namespace util {
+
+class FilePath
 {
 public:
-    R2FilePath();
+    FilePath();
 
     /**
@@ -26,6 +29,6 @@
     void setWorkingDirectory(int argc, const char **argv);
 
-    /// get R2FilePath instance
-    static R2FilePath *getInstance();
+    /// get FilePath instance
+    static FilePath *getInstance();
 
 private:
@@ -36,6 +39,6 @@
     static std::string _curDirectory;
 
-    /// R2FilePath instance
-    static R2FilePath _instance;
+    /// FilePath instance
+    static FilePath _instance;
 
     /// all default file paths
@@ -43,4 +46,7 @@
 };
 
+}
+}
+
 #endif
 
Index: /trunk/packages/vizservers/nanovis/R2/include/R2/R2Fonts.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/R2Fonts.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/include/R2/R2Fonts.h	(revision 3463)
@@ -1,15 +1,17 @@
 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_FONTS_H
-#define R2_FONTS_H
+#ifndef NV_UTIL_FONTS_H
+#define NV_UTIL_FONTS_H
 
 #include <vector>
 #include <string>
 
-#include <R2/R2.h>
 #include <R2/R2Object.h>
 
-class R2Fonts : public R2Object
+namespace nv {
+namespace util {
+
+class Fonts : public Object
 {
-    struct R2FontAttributes {
+    struct FontAttributes {
         std::string _fontName;
         int _textureWidth;
@@ -19,5 +21,5 @@
         unsigned int _displayLists;
 
-        struct R2CharInfo {
+        struct CharInfo {
             float _left;
             float _right;
@@ -27,11 +29,11 @@
             float _width;
         };
-        R2CharInfo _chars[256];
+        CharInfo _chars[256];
     };
 
-    typedef std::vector<R2FontAttributes>  R2FontVector;
+    typedef std::vector<FontAttributes>  FontVector;
 
 public:
-    R2Fonts();
+    Fonts();
 
     /// set projection to orthographic
@@ -41,11 +43,11 @@
     void end();
 
-    /// initialize R2FontAttributes
-    void initializeFont(R2FontAttributes& attr);
+    /// initialize FontAttributes
+    void initializeFont(FontAttributes& attr);
 
     /**
      * @brief load font data
      */
-    bool loadFont(const char *fontName, const char *fontFileName, R2FontAttributes& sFont);
+    bool loadFont(const char *fontName, const char *fontFileName, FontAttributes& sFont);
 
     void addFont(const char *fontName, const char *fontFileName);
@@ -61,7 +63,7 @@
 
 private:
-    ~R2Fonts();
+    ~Fonts();
 
-    R2FontVector _fonts;
+    FontVector _fonts;
     /// current font index
     int _fontIndex;
@@ -72,9 +74,12 @@
 };
 
-inline int R2Fonts::getFontHeight() const
+inline int Fonts::getFontHeight() const
 {
     return _fonts[_fontIndex]._fontHeight;
 }
 
+}
+}
+
 #endif
 
Index: /trunk/packages/vizservers/nanovis/R2/include/R2/R2Object.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/R2Object.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/include/R2/R2Object.h	(revision 3463)
@@ -1,12 +1,13 @@
 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_OBJECT_H
-#define R2_OBJECT_H
+#ifndef NV_UTIL_OBJECT_H
+#define NV_UTIL_OBJECT_H
 
-#include <R2/R2.h>
+namespace nv {
+namespace util {
 
-class R2Object
+class Object
 {
 public:
-    R2Object();
+    Object();
 
     int getRef();
@@ -15,5 +16,5 @@
 
 protected:
-    virtual ~R2Object();
+    virtual ~Object();
 
 private:
@@ -22,15 +23,15 @@
 };
 
-inline int R2Object::getRef()
+inline int Object::getRef()
 {
     return _refCount;
 }
 
-inline int R2Object::ref()
+inline int Object::ref()
 {
     return ++_refCount;
 }
 
-inline void R2Object::unref()
+inline void Object::unref()
 {
     _refCount--;
@@ -40,4 +41,7 @@
 }
 
+}
+}
+
 #endif
 
Index: /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2Geometry.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2Geometry.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2Geometry.h	(revision 3463)
@@ -1,5 +1,5 @@
  /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_GEOMETRY_H
-#define R2_GEOMETRY_H
+#ifndef NV_GRAPHICS_GEOMETRY_H
+#define NV_GRAPHICS_GEOMETRY_H
 
 #include <GL/glew.h>
@@ -7,7 +7,10 @@
 #include <R2/graphics/R2IndexBuffer.h>
 
-class R2Geometry
+namespace nv {
+namespace graphics {
+
+class Geometry
 {
-public :
+public:
     enum {
         LINES = GL_LINES,
@@ -18,19 +21,21 @@
     };
 
-public :
-    R2Geometry(int primitive, R2VertexBuffer *vertexBuffer, 
-               R2IndexBuffer *indexBuffer);
-    R2Geometry(int primitive, R2VertexBuffer *pointBuffer, 
-               R2VertexBuffer *colorBuffer, R2IndexBuffer *indexBuffer);
-    ~R2Geometry();
+    Geometry(int primitive, VertexBuffer *vertexBuffer, 
+             IndexBuffer *indexBuffer);
+    Geometry(int primitive, VertexBuffer *pointBuffer, 
+             VertexBuffer *colorBuffer, IndexBuffer *indexBuffer);
+    ~Geometry();
 
     void render();
 
-private :
-    R2VertexBuffer *_vertexBuffer;
-    R2VertexBuffer *_colorBuffer;
-    R2IndexBuffer *_indexBuffer;
+private:
+    VertexBuffer *_vertexBuffer;
+    VertexBuffer *_colorBuffer;
+    IndexBuffer *_indexBuffer;
     int _primitiveType;
 };
 
-#endif /*_R2_GEOMETRY_H_*/
+}
+}
+
+#endif
Index: /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2IndexBuffer.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2IndexBuffer.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2IndexBuffer.h	(revision 3463)
@@ -1,11 +1,14 @@
 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_INDEX_BUFFER_H
-#define R2_INDEX_BUFFER_H
+#ifndef NV_GRAPHICS_INDEX_BUFFER_H
+#define NV_GRAPHICS_INDEX_BUFFER_H
 
-class R2IndexBuffer
+namespace nv {
+namespace graphics {
+
+class IndexBuffer
 {
 public:
-    R2IndexBuffer(int indexCount, int *data, bool copy = true);
-    ~R2IndexBuffer();
+    IndexBuffer(int indexCount, int *data, bool copy = true);
+    ~IndexBuffer();
 
     int getIndexCount() const;
@@ -17,13 +20,16 @@
 };
 
-inline int R2IndexBuffer::getIndexCount() const
+inline int IndexBuffer::getIndexCount() const
 {
     return _indexCount;
 }
 
-inline const int* R2IndexBuffer::getData() const
+inline const int *IndexBuffer::getData() const
 {
     return _data;
 }
 
+}
+}
+
 #endif
Index: /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2VertexBuffer.h
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2VertexBuffer.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2VertexBuffer.h	(revision 3463)
@@ -1,7 +1,10 @@
 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-#ifndef R2_VERTEXBUFFER_H
-#define R2_VERTEXBUFFER_H
+#ifndef NV_GRAPHICS_VERTEXBUFFER_H
+#define NV_GRAPHICS_VERTEXBUFFER_H
 
-class R2VertexBuffer
+namespace nv {
+namespace graphics {
+
+class VertexBuffer
 {
 public:
@@ -13,8 +16,8 @@
     };
 
-    R2VertexBuffer(int type, int vertexCount,
-                   int byteSize, void *data, bool copy = true);
+    VertexBuffer(int type, int vertexCount,
+                 int byteSize, void *data, bool copy = true);
 
-    ~R2VertexBuffer();
+    ~VertexBuffer();
 
     unsigned int getGraphicObjectID() const;
@@ -32,13 +35,16 @@
 };
 
-inline int R2VertexBuffer::getVertexCount() const
+inline int VertexBuffer::getVertexCount() const
 {
     return _vertexCount;
 }
 
-inline unsigned int R2VertexBuffer::getGraphicObjectID() const
+inline unsigned int VertexBuffer::getGraphicObjectID() const
 {
     return _graphicObjectID;
 }
 
+}
+}
+
 #endif
Index: /trunk/packages/vizservers/nanovis/R2/src/R2FilePath.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/src/R2FilePath.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/src/R2FilePath.cpp	(revision 3463)
@@ -13,10 +13,12 @@
 #include "Trace.h"
 
-std::string R2FilePath::_curDirectory;
-R2FilePath R2FilePath::_instance;
+using namespace nv::util;
+
+std::string FilePath::_curDirectory;
+FilePath FilePath::_instance;
 
 static char seps[] = ":";
 
-R2FilePath::R2FilePath()
+FilePath::FilePath()
 {
     char buff[BUFSIZ+2];
@@ -35,5 +37,5 @@
 
 bool 
-R2FilePath::setPath(const char *filePath)
+FilePath::setPath(const char *filePath)
 {
     char buff[256];
@@ -70,6 +72,6 @@
 }
 
-R2FilePath *
-R2FilePath::getInstance()
+FilePath *
+FilePath::getInstance()
 {
     return &_instance;
@@ -77,5 +79,5 @@
 
 std::string
-R2FilePath::getPath(const char* fileName)
+FilePath::getPath(const char* fileName)
 {
     std::string path;
@@ -95,5 +97,5 @@
 
 void 
-R2FilePath::setWorkingDirectory(int argc, const char **argv)
+FilePath::setWorkingDirectory(int argc, const char **argv)
 {
     char buff[256];
Index: /trunk/packages/vizservers/nanovis/R2/src/R2Fonts.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/src/R2Fonts.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/src/R2Fonts.cpp	(revision 3463)
@@ -10,8 +10,10 @@
 #include <R2/R2FilePath.h>
 
+using namespace nv::util;
+
 // constants
 const int c_nFileMagicHeader = 6666;
 
-R2Fonts::R2Fonts() : 
+Fonts::Fonts() : 
     _fontIndex(-1), 
     _screenWidth(512), 
@@ -20,5 +22,5 @@
 }
 
-R2Fonts::~R2Fonts()
+Fonts::~Fonts()
 {
     for (unsigned index = 0; index < _fonts.size(); ++index) {
@@ -29,5 +31,5 @@
 
 void 
-R2Fonts::setFont(const char *fontName)
+Fonts::setFont(const char *fontName)
 {
     if (fontName != NULL) {
@@ -43,7 +45,7 @@
 
 void 
-R2Fonts::addFont(const char *fontName, const char *fontFileName)
-{
-    R2FontAttributes sFont;
+Fonts::addFont(const char *fontName, const char *fontFileName)
+{
+    FontAttributes sFont;
     
     loadFont(fontName, fontFileName, sFont);
@@ -53,5 +55,5 @@
 
 void 
-R2Fonts::draw(const char *pString, ...) const
+Fonts::draw(const char *pString, ...) const
 {
     va_list vlArgs;
@@ -71,5 +73,5 @@
 
 void 
-R2Fonts::begin()
+Fonts::begin()
 {
     glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT);
@@ -92,5 +94,5 @@
 
 void 
-R2Fonts::end()
+Fonts::end()
 {
     glBindTexture(GL_TEXTURE_2D, 0);
@@ -106,5 +108,5 @@
 
 void 
-R2Fonts::initializeFont(R2FontAttributes& attr)
+Fonts::initializeFont(FontAttributes& attr)
 {
     attr._displayLists = glGenLists(256);
@@ -112,5 +114,5 @@
     int index;
     for (index = 0; index < 256; ++index) {
-        R2FontAttributes::R2CharInfo& charInfo = attr._chars[index];
+        FontAttributes::CharInfo& charInfo = attr._chars[index];
         glNewList(attr._displayLists + index, GL_COMPILE);
         if (charInfo._valid) {
@@ -137,10 +139,10 @@
 
 bool 
-R2Fonts::loadFont(const char *fontName, const char *fontFileName, 
-                  R2FontAttributes& sFont)
+Fonts::loadFont(const char *fontName, const char *fontFileName, 
+                FontAttributes& sFont)
 {
     bool bSuccess = false;
 
-    std::string path = R2FilePath::getInstance()->getPath(fontFileName);
+    std::string path = FilePath::getInstance()->getPath(fontFileName);
     if (path.empty()) {
         return false;
@@ -233,5 +235,5 @@
 
 void 
-R2Fonts::resize(int width, int height)
+Fonts::resize(int width, int height)
 {
     _screenWidth = width;
Index: /trunk/packages/vizservers/nanovis/R2/src/R2Geometry.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/src/R2Geometry.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/src/R2Geometry.cpp	(revision 3463)
@@ -5,6 +5,9 @@
 #include <R2/graphics/R2Geometry.h>
 
-R2Geometry::R2Geometry(int primitive, R2VertexBuffer *vertexBuffer, 
-                       R2IndexBuffer *indexBuffer) : 
+using namespace nv::graphics;
+
+Geometry::Geometry(int primitive,
+                   VertexBuffer *vertexBuffer, 
+                   IndexBuffer *indexBuffer) : 
     _vertexBuffer(vertexBuffer), 
     _colorBuffer(0),
@@ -14,6 +17,8 @@
 }
 
-R2Geometry::R2Geometry(int primitive, R2VertexBuffer *vertexBuffer, 
-                       R2VertexBuffer *colorBuffer, R2IndexBuffer *indexBuffer) : 
+Geometry::Geometry(int primitive,
+                   VertexBuffer *vertexBuffer, 
+                   VertexBuffer *colorBuffer,
+                   IndexBuffer *indexBuffer) : 
     _vertexBuffer(vertexBuffer), 
     _colorBuffer(colorBuffer),
@@ -23,10 +28,10 @@
 }
 
-R2Geometry::~R2Geometry()
+Geometry::~Geometry()
 {
 }
 
 void 
-R2Geometry::render()
+Geometry::render()
 {
     //glDisableClientState(GL_NORMAL_ARRAY);
Index: /trunk/packages/vizservers/nanovis/R2/src/R2IndexBuffer.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/src/R2IndexBuffer.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/src/R2IndexBuffer.cpp	(revision 3463)
@@ -5,5 +5,7 @@
 #include <R2/graphics/R2IndexBuffer.h>
 
-R2IndexBuffer::R2IndexBuffer(int indexCount, int* data, bool copy) :
+using namespace nv::graphics;
+
+IndexBuffer::IndexBuffer(int indexCount, int* data, bool copy) :
     _indexCount(indexCount)
 {
@@ -16,5 +18,5 @@
 }
 
-R2IndexBuffer::~R2IndexBuffer()
+IndexBuffer::~IndexBuffer()
 {
     if (_data) {
Index: /trunk/packages/vizservers/nanovis/R2/src/R2Object.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/src/R2Object.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/src/R2Object.cpp	(revision 3463)
@@ -2,10 +2,12 @@
 #include <R2/R2Object.h>
 
-R2Object::R2Object() : 
+using namespace nv::util;
+
+Object::Object() :
     _refCount(0)
 {
 }
 
-R2Object::~R2Object()
+Object::~Object()
 {
 }
Index: /trunk/packages/vizservers/nanovis/R2/src/R2VertexBuffer.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/R2/src/R2VertexBuffer.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/R2/src/R2VertexBuffer.cpp	(revision 3463)
@@ -8,7 +8,11 @@
 #include <R2/graphics/R2VertexBuffer.h>
 
-R2VertexBuffer::R2VertexBuffer(int type, int vertexCount,
-                               int byteSize, void *data, bool copy) :
-    _graphicObjectID(0), _byteSize(byteSize), _vertexCount(vertexCount)
+using namespace nv::graphics;
+
+VertexBuffer::VertexBuffer(int type, int vertexCount,
+                           int byteSize, void *data, bool copy) :
+    _graphicObjectID(0),
+    _byteSize(byteSize),
+    _vertexCount(vertexCount)
 {
     if (copy) {
@@ -27,5 +31,5 @@
 }
 
-R2VertexBuffer::~R2VertexBuffer()
+VertexBuffer::~VertexBuffer()
 {
     if (_graphicObjectID != 0) {
Index: /trunk/packages/vizservers/nanovis/RenderContext.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/RenderContext.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/RenderContext.cpp	(revision 3463)
@@ -2,5 +2,5 @@
 #include "RenderContext.h"
 
-namespace graphics {
+using namespace nv::graphics;
 
 RenderContext::RenderContext() :
@@ -15,3 +15,2 @@
 }
 
-}
Index: /trunk/packages/vizservers/nanovis/RenderContext.h
===================================================================
--- /trunk/packages/vizservers/nanovis/RenderContext.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/RenderContext.h	(revision 3463)
@@ -5,4 +5,5 @@
 #include <GL/gl.h>
 
+namespace nv {
 namespace graphics {
 
@@ -70,4 +71,5 @@
 
 }
+}
 
 #endif
Index: /trunk/packages/vizservers/nanovis/TransferFunction.h
===================================================================
--- /trunk/packages/vizservers/nanovis/TransferFunction.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/TransferFunction.h	(revision 3463)
@@ -22,5 +22,5 @@
 #include "Vector3.h"
 
-class TransferFunction : public R2Object
+class TransferFunction
 {
 public:
Index: /trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp	(revision 3463)
@@ -16,4 +16,6 @@
 #include "NvShader.h"
 #include "NvCamera.h"
+
+using namespace nv::util;
 
 static inline float deg2rad(float deg)
@@ -63,5 +65,5 @@
     createRenderTarget();
 
-    std::string path = R2FilePath::getInstance()->getPath("arrows.bmp");
+    std::string path = FilePath::getInstance()->getPath("arrows.bmp");
     if (!path.empty()) {
         ImageLoader *loader = ImageLoaderFactory::getInstance()->createLoader("bmp");
Index: /trunk/packages/vizservers/nanovis/Volume.h
===================================================================
--- /trunk/packages/vizservers/nanovis/Volume.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/Volume.h	(revision 3463)
@@ -19,6 +19,4 @@
 #include <string>
 #include <vector>
-
-#include <R2/R2Object.h>
 
 #include "Color.h"
Index: /trunk/packages/vizservers/nanovis/config.h
===================================================================
--- /trunk/packages/vizservers/nanovis/config.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/config.h	(revision 3463)
@@ -50,5 +50,5 @@
  * Controls if debug trace logging is enabled
  */
-//#define WANT_TRACE
+#define WANT_TRACE
 
 /*
Index: /trunk/packages/vizservers/nanovis/nanovis.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/nanovis.cpp	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/nanovis.cpp	(revision 3463)
@@ -80,4 +80,7 @@
 #include "ZincBlendeVolume.h"
 
+using namespace nv::graphics;
+using namespace nv::util;
+
 #define SIZEOF_BMP_HEADER   54
 
@@ -135,7 +138,7 @@
 VelocityArrowsSlice *NanoVis::velocityArrowsSlice = NULL;
 
-graphics::RenderContext *NanoVis::renderContext = NULL;
+RenderContext *NanoVis::renderContext = NULL;
 NvLIC *NanoVis::licRenderer = NULL;
-R2Fonts *NanoVis::fonts;
+Fonts *NanoVis::fonts;
 
 FILE *NanoVis::stdin = NULL;
@@ -895,5 +898,5 @@
     }
 
-    if (!R2FilePath::getInstance()->setPath(path)) {
+    if (!FilePath::getInstance()->setPath(path)) {
         ERROR("can't set file path to %s", path);
         exitService(1);
@@ -905,5 +908,5 @@
     NvShader::setErrorCallback(cgErrorCallback);
 
-    fonts = new R2Fonts();
+    fonts = new Fonts();
     fonts->addFont("verdana", "verdana.fnt");
     fonts->setFont("verdana");
@@ -976,5 +979,5 @@
 
     // create
-    renderContext = new graphics::RenderContext();
+    renderContext = new RenderContext();
 
     //create a 2D plane renderer
@@ -1909,5 +1912,5 @@
     }
 
-    R2FilePath::getInstance()->setWorkingDirectory(argc, (const char**) argv);
+    FilePath::getInstance()->setWorkingDirectory(argc, (const char**) argv);
 
 #ifdef notdef
Index: /trunk/packages/vizservers/nanovis/nanovis.h
===================================================================
--- /trunk/packages/vizservers/nanovis/nanovis.h	(revision 3462)
+++ /trunk/packages/vizservers/nanovis/nanovis.h	(revision 3463)
@@ -38,6 +38,11 @@
 #define NPIX  512	//display size
 
+namespace nv {
 namespace graphics {
     class RenderContext;
+}
+namespace util {
+    class Fonts;
+}
 }
 
@@ -55,5 +60,4 @@
 class NvVectorField;
 class Grid;
-class R2Fonts;
 class NvCamera;
 class TransferFunction;
@@ -152,8 +156,8 @@
     static Texture2D *legendTexture;
     static Grid *grid;
-    static R2Fonts *fonts;
+    static nv::util::Fonts *fonts;
     static int updir;
     static NvCamera *cam;
-    static graphics::RenderContext *renderContext;
+    static nv::graphics::RenderContext *renderContext;
 
     static Tcl_HashTable tfTable;
