Index: /trunk/gui/vizservers/nanovis/Lic.cpp
===================================================================
--- /trunk/gui/vizservers/nanovis/Lic.cpp	(revision 400)
+++ /trunk/gui/vizservers/nanovis/Lic.cpp	(revision 401)
@@ -24,9 +24,10 @@
 		CGcontext _context, NVISid _vector_field,
 		float scalex, float scaley, float scalez):
+        Renderable(Vector3(0.,0.,0.)),
 	size(_size),
 	offset(_offset),
 	m_g_context(_context),
-	display_width(_width),
-	display_height(_height),
+	width(_width),
+	height(_height),
         iframe(0),
 	Npat(64),
@@ -78,5 +79,5 @@
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, display_width, display_height, 0,
+  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, 0,
                GL_RGB, GL_INT, NULL);
   glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
@@ -293,4 +294,7 @@
 }
 
+void Lic::render(){ display(); }
+
+
 void Lic::display(){
 
Index: /trunk/gui/vizservers/nanovis/Lic.h
===================================================================
--- /trunk/gui/vizservers/nanovis/Lic.h	(revision 400)
+++ /trunk/gui/vizservers/nanovis/Lic.h	(revision 401)
@@ -25,7 +25,7 @@
 #include "global.h"
 
+#include "Renderable.h"
 #include "Vector3.h"
 #include "Volume.h"
-
 
 #define NPN 256   //resolution of background pattern
@@ -35,8 +35,8 @@
 #define SCALE 3.0 //scale for background pattern. small value -> fine texture
 
-class Lic{
+class Lic : public Renderable { 
 
 private:
-  int display_width, display_height;
+  int width, height;
   int size; 		//the lic is a square of size, it can be stretched
   float* slice_vector; //storage for the per slice vectors driving the follow
@@ -64,12 +64,14 @@
 
 public:
-  Vector3 normal;
+  Vector3 normal; //the normal vector of the Lic plane, 
+  		// the inherited Vector3 location is its center
   Lic(int _size, int _width, int _height, float _offset,
-		  CGcontext _context, NVISid _vector_field,
-		  float scalex, float scaley, float scalez);
+	  CGcontext _context, NVISid _vector_field,
+	  float scalex, float scaley, float scalez);
   ~Lic();
 
   void convolve();
   void display();	//display the convolution result
+  void render();
   void make_patterns();
   void make_magnitudes();
Index: /trunk/gui/vizservers/nanovis/Makefile
===================================================================
--- /trunk/gui/vizservers/nanovis/Makefile	(revision 400)
+++ /trunk/gui/vizservers/nanovis/Makefile	(revision 401)
@@ -3,5 +3,5 @@
 		PerfQuery.o TransferFunction.o ControlPoint.o ColorGradient.o ColorPaletteWindow.o\
 		ColorGradientGLUTWindow.o TransferFunctionGLUTWindow.o MainWindow.o Event.o \
-		Lic.o
+		Lic.o Renderable.o
 
 OBJ_CLIENT = Socket.o ClientSocket.o RenderClient.o Event.o
@@ -70,5 +70,5 @@
 	gcc $(CFLAG) $(TFSRC)/ControlPoint.cpp
 
-Sphere.o: Vector3.o Color.o
+Sphere.o: Renderable.o Color.o
 	gcc $(CFLAG) Sphere.cpp
 
@@ -85,8 +85,11 @@
 	gcc $(CFLAG) Texture3D.cpp
 
-ParticleSystem.o: ParticleSystem.cpp $(AUXSRC)
+ParticleSystem.o: Renderable.o ParticleSystem.cpp $(AUXSRC)
 	gcc $(CFLAG) ParticleSystem.cpp
 
-Lic.o: Lic.cpp Lic.h $(AUXSRC)
+Renderable.o: Renderable.cpp
+	gcc $(CFLAG) Renderable.cpp
+
+Lic.o: Renderable.o Lic.cpp Lic.h $(AUXSRC)
 	gcc $(CFLAG) Lic.cpp
 
Index: /trunk/gui/vizservers/nanovis/ParticleSystem.cpp
===================================================================
--- /trunk/gui/vizservers/nanovis/ParticleSystem.cpp	(revision 400)
+++ /trunk/gui/vizservers/nanovis/ParticleSystem.cpp	(revision 401)
@@ -203,4 +203,6 @@
 
 
+void ParticleSystem::render(){ display_vertices(); }
+
 void ParticleSystem::display_vertices(){
   glDisable(GL_TEXTURE_2D);
Index: /trunk/gui/vizservers/nanovis/ParticleSystem.h
===================================================================
--- /trunk/gui/vizservers/nanovis/ParticleSystem.h	(revision 400)
+++ /trunk/gui/vizservers/nanovis/ParticleSystem.h	(revision 401)
@@ -25,4 +25,5 @@
 #include "global.h"
 
+#include "Renderable.h"
 #include "RenderVertexArray.h"
 #include "Vector3.h"
@@ -40,5 +41,5 @@
 
 
-class ParticleSystem{
+class ParticleSystem : public Renderable{
 
   NVISid psys_fbo[2]; 	//frame buffer objects: two are defined, flip them as input output every step
@@ -74,4 +75,5 @@
   void display_vertices();
   void reset();
+  void render();
 
 };
Index: /trunk/gui/vizservers/nanovis/Renderable.cpp
===================================================================
--- /trunk/gui/vizservers/nanovis/Renderable.cpp	(revision 401)
+++ /trunk/gui/vizservers/nanovis/Renderable.cpp	(revision 401)
@@ -0,0 +1,30 @@
+/*
+ * ----------------------------------------------------------------------
+ * Renderable.cpp: abstract class, a drawable thing 
+ *
+ * ======================================================================
+ *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
+ *           Purdue Rendering and Perceptualization Lab (PURPL)
+ *
+ *  Copyright (c) 2004-2006  Purdue Research Foundation
+ *
+ *  See the file "license.terms" for information on usage and
+ *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * ======================================================================
+ */
+
+
+#include "Renderable.h"
+
+Renderable::Renderable(){}
+Renderable::Renderable(Vector3 loc):
+  location(loc),
+  enabled(true){ }
+
+  
+void Renderable::move(Vector3 new_loc) { location = new_loc; }
+
+void Renderable::enable() { enabled = true; }
+void Renderable::disable() { enabled = false; }
+bool Renderable::is_enabled() { return enabled; }
+
Index: /trunk/gui/vizservers/nanovis/Renderable.h
===================================================================
--- /trunk/gui/vizservers/nanovis/Renderable.h	(revision 401)
+++ /trunk/gui/vizservers/nanovis/Renderable.h	(revision 401)
@@ -0,0 +1,41 @@
+/*
+ * ----------------------------------------------------------------------
+ * Renderable.h: abstract class, a drawable thing 
+ *
+ * ======================================================================
+ *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
+ *           Purdue Rendering and Perceptualization Lab (PURPL)
+ *
+ *  Copyright (c) 2004-2006  Purdue Research Foundation
+ *
+ *  See the file "license.terms" for information on usage and
+ *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * ======================================================================
+ */
+
+
+#ifndef _RENDERABLE_H_
+#define _RENDERABLE_H_
+
+
+#include "Vector3.h"
+
+class Renderable{
+protected:
+  Vector3 location;	//the location (x,y,z) of the object
+  bool enabled;		//display is enabled
+
+public:
+  Renderable(Vector3 loc);
+  Renderable();
+  //~Renderable();
+
+  void move(Vector3 new_loc);
+  virtual void render() = 0;
+  void enable();
+  void disable();
+  bool is_enabled();
+};
+
+
+#endif
Index: /trunk/gui/vizservers/nanovis/Sphere.cpp
===================================================================
--- /trunk/gui/vizservers/nanovis/Sphere.cpp	(revision 400)
+++ /trunk/gui/vizservers/nanovis/Sphere.cpp	(revision 401)
@@ -22,11 +22,13 @@
 		int _stack,
 		int _slice):
+        Renderable(Vector3(x, y, z)),
 	radius(_radius),
 	stack(_stack),
 	slice(_slice),
-	center(Vector3(x,y,z)),
-	color(Color(r,g,b))
-{ }
+	color(Color(r,g,b)) { }
 
+Sphere::~Sphere(){}
+
+void Sphere::render(){}
 
 void Sphere::draw(GLUquadric* quad){
@@ -35,5 +37,5 @@
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
-  glTranslatef(center.x, center.y, center.z);
+  glTranslatef(location.x, location.y, location.z);
 
   //draw it
Index: /trunk/gui/vizservers/nanovis/Sphere.h
===================================================================
--- /trunk/gui/vizservers/nanovis/Sphere.h	(revision 400)
+++ /trunk/gui/vizservers/nanovis/Sphere.h	(revision 401)
@@ -13,15 +13,16 @@
  * ======================================================================
  */
+
 #ifndef _SPHERE_H_
 #define _SPHERE_H_
 
 #include <GL/glut.h>
+
 #include "Color.h"
-#include "Vector3.h"
+#include "Renderable.h"
 
-class Sphere{
+class Sphere : public Renderable{
 
 public:
-	Vector3 center;
 	float radius;
 	Color color;
@@ -29,6 +30,5 @@
 	int slice;
 
-	Sphere(){};
-	~Sphere(){};
+	~Sphere();
 	Sphere(float x, float y, float z, float r, float g, float b, float _radius, int _stack, int _slice);
 	void set_vertical_res(int _stack);
@@ -37,4 +37,5 @@
 	//display the sphere
 	void draw(GLUquadric* q);
+	void render();
 };
 
Index: /trunk/gui/vizservers/nanovis/nanovis.cpp
===================================================================
--- /trunk/gui/vizservers/nanovis/nanovis.cpp	(revision 400)
+++ /trunk/gui/vizservers/nanovis/nanovis.cpp	(revision 401)
@@ -1655,9 +1655,9 @@
    draw_3d_axis();
    
-   lic->display(); 	//display the line integral convolution result
+   lic->render(); 	//display the line integral convolution result
    
    //soft_display_verts();
    perf->enable();
-     psys->display_vertices();
+     psys->render();
    perf->disable();
    //fprintf(stderr, "particle pixels: %d\n", perf->get_pixel_count());
Index: /trunk/gui/vizservers/nanovis/scripts/capture
===================================================================
--- /trunk/gui/vizservers/nanovis/scripts/capture	(revision 401)
+++ /trunk/gui/vizservers/nanovis/scripts/capture	(revision 401)
@@ -0,0 +1,34 @@
+#!/bin/sh
+# A simple bash script to screen capture
+#
+# Supply arguments: 
+#	window id
+#	number of captures
+#	delay in animation
+#	quality of encoding
+
+let x=1
+
+# loop until it has captured the number of captures requested
+while [ $x -le $2 ]
+do
+  if [ $x -lt 100 ]
+  then
+    if [ $x -lt 10 ]
+    then
+      import -window $1 "capture00$x.miff"
+    else
+      import -window $1 "capture0$x.miff"
+    fi
+  else
+    import -window $1 "capture$x.miff"
+  fi
+  
+  # uncomment the line below
+  # if you want more time in between screen captures
+# sleep 2s  
+  let x+=1
+done
+
+#animate -delay $3 *.miff
+#convert -delay $3 -quality $4 *.miff capture.mpg
Index: /trunk/gui/vizservers/nanovis/shaders/one_volume.cg
===================================================================
--- /trunk/gui/vizservers/nanovis/shaders/one_volume.cg	(revision 400)
+++ /trunk/gui/vizservers/nanovis/shaders/one_volume.cg	(revision 401)
@@ -18,5 +18,5 @@
 
 
-//#define PHONG_SHADING
+#define PHONG_SHADING
 
 PixelOut main(v2f IN, /* uniform sampler1D tf,*/
@@ -37,5 +37,8 @@
 #ifdef PHONG_SHADING
       //lighting parameters 
-      float3 normal = normalize(sample.yzw);
+      float3 normal;
+      if(length(sample.yzw)>0.0)
+        normal = normalize(sample.yzw);
+
       float3 light_vector = normalize(IN.Light);
       float3 eye_vector = normalize(IN.EyeVector);
@@ -46,5 +49,5 @@
       //sample the transfer function texture
       float4 color = tex1D(tf, sample.x);
-      color.w = 5*color.w/renderParameters.x;
+      color.w = 30*color.w/renderParameters.x;
 
       //float4 color = float4(sample.x, 0, 0, 1);
