[cig-commits] commit: patching this test because of the addition of the new lighting stuff that Cecile was working on.

Mercurial hg at geodynamics.org
Mon Nov 24 11:28:36 PST 2008


changeset:   1:28d655bec240
user:        RobertTurnbull
date:        Wed Apr 04 14:50:57 2007 +0000
files:       Base/makefile Base/src/Base.h Base/src/Camera.c Base/src/Camera.h Base/src/Camera.meta Base/src/ColourMap.c Base/src/ColourMap.h Base/src/ColourMap.meta Base/src/DrawingObject.c Base/src/DrawingObject.h Base/src/DrawingObject.meta Base/src/DrawingObject_Register.c Base/src/DrawingObject_Register.h Base/src/Finalise.c Base/src/Finalise.h Base/src/Init.c Base/src/Init.h Base/src/InputFormat.c Base/src/InputFormat.h Base/src/InputFormat.meta Base/src/InputFormat_Register.c Base/src/InputFormat_Register.h Base/src/Light.c Base/src/Light.h Base/src/Light.meta Base/src/Light_Register.c Base/src/Light_Register.h Base/src/Light_Register.meta Base/src/OutputFormat.c Base/src/OutputFormat.h Base/src/OutputFormat.meta Base/src/OutputFormat_Register.c Base/src/OutputFormat_Register.h Base/src/RenderingEngine.c Base/src/RenderingEngine.h Base/src/RenderingEngine.meta Base/src/Viewport.c Base/src/Viewport.h Base/src/Viewport.meta Base/src/ViewportInfo.h Base/src/Window.c Base/src/Window.h Base/src/Window.meta Base/src/WindowInteraction.c Base/src/WindowInteraction.h Base/src/WindowInteraction.meta Base/src/WindowInteraction_Register.c Base/src/WindowInteraction_Register.h Base/src/X11Colours.c Base/src/X11Colours.h Base/src/makefile Base/src/types.h Base/tests/expected/testCameras.0of1.camera.txt.expected Base/tests/expected/testCameras.0of3.camera.txt.expected Base/tests/expected/testColourMaps.0of1.colourMap.txt.expected Base/tests/makefile Base/tests/plugins/Others/lucTestColourMaps.c Base/tests/plugins/Others/lucTestOutputing.c Base/tests/plugins/Others/lucTestPlottingObjects.c Base/tests/plugins/RenderingEngineTest.c Base/tests/plugins/RenderingEngineTest.h Base/tests/plugins/RenderingEngineTest.meta Base/tests/plugins/lucTestCameras.c Base/tests/plugins/lucTestColourMaps.c Base/tests/plugins/makefile Base/tests/testCameras.0of1.sh Base/tests/testCameras.0of3.sh Base/tests/testCameras.xml Base/tests/testColourMaps.0of1.sh Base/tests/testColourMaps.xml Base/tests/testlucBase.c DrawingObjects/makefile DrawingObjects/src/Axis.c DrawingObjects/src/Axis.h DrawingObjects/src/Axis.meta DrawingObjects/src/ColourBar.c DrawingObjects/src/ColourBar.h DrawingObjects/src/ColourBar.meta DrawingObjects/src/Contour.c DrawingObjects/src/Contour.h DrawingObjects/src/Contour.meta DrawingObjects/src/DrawingObjects.h DrawingObjects/src/Eigenvectors.c DrawingObjects/src/Eigenvectors.h DrawingObjects/src/Eigenvectors.meta DrawingObjects/src/EigenvectorsCrossSection.c DrawingObjects/src/EigenvectorsCrossSection.h DrawingObjects/src/EigenvectorsCrossSection.meta DrawingObjects/src/FeVariableSurface.c DrawingObjects/src/FeVariableSurface.h DrawingObjects/src/FeVariableSurface.meta DrawingObjects/src/FieldVariableBorder.c DrawingObjects/src/FieldVariableBorder.h DrawingObjects/src/FieldVariableBorder.meta DrawingObjects/src/Finalise.c DrawingObjects/src/Finalise.h DrawingObjects/src/HistoricalSwarmTrajectory.c DrawingObjects/src/HistoricalSwarmTrajectory.h DrawingObjects/src/HistoricalSwarmTrajectory.meta DrawingObjects/src/Init.c DrawingObjects/src/Init.h DrawingObjects/src/Isosurface.c DrawingObjects/src/Isosurface.h DrawingObjects/src/Isosurface.meta DrawingObjects/src/MeshViewer.c DrawingObjects/src/MeshViewer.h DrawingObjects/src/MeshViewer.meta DrawingObjects/src/OpenGLDrawingObject.c DrawingObjects/src/OpenGLDrawingObject.h DrawingObjects/src/OpenGLDrawingObject.meta DrawingObjects/src/ScalarField.c DrawingObjects/src/ScalarField.h DrawingObjects/src/ScalarField.meta DrawingObjects/src/ScalarFieldCrossSection.c DrawingObjects/src/ScalarFieldCrossSection.h DrawingObjects/src/ScalarFieldCrossSection.meta DrawingObjects/src/ScalarFieldOnMesh.c DrawingObjects/src/ScalarFieldOnMesh.h DrawingObjects/src/ScalarFieldOnMesh.meta DrawingObjects/src/ScalarFieldOnMeshCrossSection.c DrawingObjects/src/ScalarFieldOnMeshCrossSection.h DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta DrawingObjects/src/SwarmRGBColourViewer.c DrawingObjects/src/SwarmRGBColourViewer.h DrawingObjects/src/SwarmRGBColourViewer.meta DrawingObjects/src/SwarmSquares.c DrawingObjects/src/SwarmSquares.h DrawingObjects/src/SwarmSquares.meta DrawingObjects/src/SwarmVectors.c DrawingObjects/src/SwarmVectors.h DrawingObjects/src/SwarmVectors.meta DrawingObjects/src/SwarmViewer.c DrawingObjects/src/SwarmViewer.h DrawingObjects/src/SwarmViewer.meta DrawingObjects/src/SwarmViewerBase.c DrawingObjects/src/SwarmViewerBase.h DrawingObjects/src/SwarmViewerBase.meta DrawingObjects/src/TextureMap.c DrawingObjects/src/TextureMap.h DrawingObjects/src/TextureMap.meta DrawingObjects/src/TimeStep.c DrawingObjects/src/TimeStep.h DrawingObjects/src/TimeStep.meta DrawingObjects/src/Title.c DrawingObjects/src/Title.h DrawingObjects/src/Title.meta DrawingObjects/src/VectorArrowCrossSection.c DrawingObjects/src/VectorArrowCrossSection.h DrawingObjects/src/VectorArrowCrossSection.meta DrawingObjects/src/VectorArrows.c DrawingObjects/src/VectorArrows.h DrawingObjects/src/VectorArrows.meta DrawingObjects/src/makefile DrawingObjects/src/types.h DrawingObjects/tests/Bathymetry.ppm DrawingObjects/tests/CleanOpenGLDiffFile.pl DrawingObjects/tests/DummyFieldVariable/DummyFieldVariable.c DrawingObjects/tests/DummyFieldVariable/makefile DrawingObjects/tests/DummySwarmVariable/DummySwarmVariable.c DrawingObjects/tests/DummySwarmVariable/makefile DrawingObjects/tests/OpenGL-diff.sh DrawingObjects/tests/expected/testColourBar.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testColourBar.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testColourBar.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testFieldVariableBorder2D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testFieldVariableBorder2D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testFieldVariableBorder2D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testFieldVariableBorder3D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testFieldVariableBorder3D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testFieldVariableBorder3D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testIsosurface.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testIsosurface.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testIsosurface.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testScalarField2D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testScalarField2D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testScalarField2D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testScalarField3D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testScalarField3D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testScalarField3D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testSwarmSquares2D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmSquares2D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmSquares2D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testSwarmSquares3D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmSquares3D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmSquares3D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testSwarmVector2D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmVector2D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmVector2D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testSwarmVector3D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmVector3D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmVector3D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testSwarmViewer2D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmViewer2D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmViewer2D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testSwarmViewer3D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmViewer3D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testSwarmViewer3D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testTextureMap.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testTextureMap.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testTextureMap.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testVectorArrow2D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testVectorArrow2D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testVectorArrow2D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/expected/testVectorArrow3D.0of1.OpenGL.0.txt.expected DrawingObjects/tests/expected/testVectorArrow3D.0of2.OpenGL.0.txt.expected DrawingObjects/tests/expected/testVectorArrow3D.0of2.OpenGL.1.txt.expected DrawingObjects/tests/makefile DrawingObjects/tests/testColourBar.0of1.sh DrawingObjects/tests/testColourBar.0of2.sh DrawingObjects/tests/testColourBar.xml DrawingObjects/tests/testDrawingObject.c DrawingObjects/tests/testDrawingObject.xml DrawingObjects/tests/testFieldVariableBorder.xml DrawingObjects/tests/testFieldVariableBorder2D.0of1.sh DrawingObjects/tests/testFieldVariableBorder2D.0of2.sh DrawingObjects/tests/testFieldVariableBorder3D.0of1.sh DrawingObjects/tests/testFieldVariableBorder3D.0of2.sh DrawingObjects/tests/testIsosurface.0of1.sh DrawingObjects/tests/testIsosurface.0of2.sh DrawingObjects/tests/testIsosurface.xml DrawingObjects/tests/testScalarField.xml DrawingObjects/tests/testScalarField2D.0of1.sh DrawingObjects/tests/testScalarField2D.0of2.sh DrawingObjects/tests/testScalarField3D.0of1.sh DrawingObjects/tests/testScalarField3D.0of2.sh DrawingObjects/tests/testSwarm.xml DrawingObjects/tests/testSwarmSquares.xml DrawingObjects/tests/testSwarmSquares2D.0of1.sh DrawingObjects/tests/testSwarmSquares2D.0of2.sh DrawingObjects/tests/testSwarmSquares3D.0of1.sh DrawingObjects/tests/testSwarmSquares3D.0of2.sh DrawingObjects/tests/testSwarmVector.xml DrawingObjects/tests/testSwarmVector2D.0of1.sh DrawingObjects/tests/testSwarmVector2D.0of2.sh DrawingObjects/tests/testSwarmVector3D.0of1.sh DrawingObjects/tests/testSwarmVector3D.0of2.sh DrawingObjects/tests/testSwarmViewer.xml DrawingObjects/tests/testSwarmViewer2D.0of1.sh DrawingObjects/tests/testSwarmViewer2D.0of2.sh DrawingObjects/tests/testSwarmViewer3D.0of1.sh DrawingObjects/tests/testSwarmViewer3D.0of2.sh DrawingObjects/tests/testTextureMap.0of1.sh DrawingObjects/tests/testTextureMap.0of2.sh DrawingObjects/tests/testTextureMap.xml DrawingObjects/tests/testVectorArrow.xml DrawingObjects/tests/testVectorArrow2D.0of1.sh DrawingObjects/tests/testVectorArrow2D.0of2.sh DrawingObjects/tests/testVectorArrow3D.0of1.sh DrawingObjects/tests/testVectorArrow3D.0of2.sh InputFormats/makefile InputFormats/src/Finalise.c InputFormats/src/Finalise.h InputFormats/src/Init.c InputFormats/src/Init.h InputFormats/src/InputFormats.h InputFormats/src/InputPPM.c InputFormats/src/InputPPM.h InputFormats/src/InputPPM.meta InputFormats/src/InputTIFF.c InputFormats/src/InputTIFF.h InputFormats/src/InputTIFF.meta InputFormats/src/makefile InputFormats/src/types.h InputFormats/tests/data/input.ppm InputFormats/tests/data/input.tiff InputFormats/tests/expected/testInputPPM.0of1.output.ppm.expected InputFormats/tests/expected/testInputTIFF.0of1.output.ppm.expected InputFormats/tests/makefile InputFormats/tests/plugins/lucTestInputFormat.c InputFormats/tests/plugins/makefile InputFormats/tests/testInputPPM.0of1.sh InputFormats/tests/testInputPPM.xml InputFormats/tests/testInputTIFF.0of1.sh InputFormats/tests/testInputTIFF.xml Makefile.vmake OutputFormats/makefile OutputFormats/src/EncoderLibavcodec.c OutputFormats/src/EncoderLibavcodec.h OutputFormats/src/EncoderLibavcodec.meta OutputFormats/src/EncoderLibfame.c OutputFormats/src/EncoderLibfame.h OutputFormats/src/EncoderLibfame.meta OutputFormats/src/Finalise.c OutputFormats/src/Finalise.h OutputFormats/src/Init.c OutputFormats/src/Init.h OutputFormats/src/OutputFormats.h OutputFormats/src/OutputJPEG.c OutputFormats/src/OutputJPEG.h OutputFormats/src/OutputJPEG.meta OutputFormats/src/OutputPNG.c OutputFormats/src/OutputPNG.h OutputFormats/src/OutputPNG.meta OutputFormats/src/OutputPPM.c OutputFormats/src/OutputPPM.h OutputFormats/src/OutputPPM.meta OutputFormats/src/OutputTIFF.c OutputFormats/src/OutputTIFF.h OutputFormats/src/OutputTIFF.meta OutputFormats/src/makefile OutputFormats/src/types.h OutputFormats/tests/expected/testEncoderLibfame-64bit.0of1.window.mpeg.expected OutputFormats/tests/expected/testEncoderLibfame.0of1.window.mpeg.expected OutputFormats/tests/expected/testOutputJPEG.0of1.window.00000.jpeg.expected OutputFormats/tests/expected/testOutputPNG.0of1.window.00000.png.expected OutputFormats/tests/expected/testOutputPPM.0of1.window.00000.ppm.expected OutputFormats/tests/expected/testOutputTIFF-bigendian.0of1.window.00000.tiff.expected OutputFormats/tests/expected/testOutputTIFF-littleendian.0of1.window.00000.tiff.expected OutputFormats/tests/makefile OutputFormats/tests/testEncoderLibfame-64bit.0of1.sh OutputFormats/tests/testEncoderLibfame.0of1.sh OutputFormats/tests/testEncoderLibfame.xml OutputFormats/tests/testOutput.xml OutputFormats/tests/testOutputJPEG.0of1.sh OutputFormats/tests/testOutputJPEG.xml OutputFormats/tests/testOutputPNG.0of1.sh OutputFormats/tests/testOutputPNG.xml OutputFormats/tests/testOutputPPM.0of1.sh OutputFormats/tests/testOutputPPM.xml OutputFormats/tests/testOutputTIFF-bigendian.0of1.sh OutputFormats/tests/testOutputTIFF-littleendian.0of1.sh OutputFormats/tests/testOutputTIFF.xml RenderingEngines/makefile RenderingEngines/src/Finalise.c RenderingEngines/src/Finalise.h RenderingEngines/src/Init.c RenderingEngines/src/Init.h RenderingEngines/src/OpenGlUtil.c RenderingEngines/src/OpenGlUtil.h RenderingEngines/src/RenderingEngineGL.c RenderingEngines/src/RenderingEngineGL.h RenderingEngines/src/RenderingEngineGL.meta RenderingEngines/src/RenderingEngineVTK.cxx RenderingEngines/src/RenderingEngineVTK.h RenderingEngines/src/RenderingEngineVTK.meta RenderingEngines/src/RenderingEngines.h RenderingEngines/src/makefile RenderingEngines/src/types.h RenderingEngines/tests/DummyOpenGL/DummyOpenGL.c RenderingEngines/tests/DummyOpenGL/makefile RenderingEngines/tests/expected/testRenderingEngineGL.0of1.OpenGL.txt.expected RenderingEngines/tests/makefile RenderingEngines/tests/testRenderingEngineGL.0of1.sh RenderingEngines/tests/testRenderingEngineGL.c RenderingEngines/tests/testRenderingEngineGL.xml WindowInteractions/makefile WindowInteractions/src/ColourBarInteraction.c WindowInteractions/src/ColourBarInteraction.h WindowInteractions/src/ColourBarInteraction.meta WindowInteractions/src/FieldValueInteraction.c WindowInteractions/src/FieldValueInteraction.h WindowInteractions/src/FieldValueInteraction.meta WindowInteractions/src/Finalise.c WindowInteractions/src/Finalise.h WindowInteractions/src/Init.c WindowInteractions/src/Init.h WindowInteractions/src/LightInteraction.c WindowInteractions/src/LightInteraction.h WindowInteractions/src/LightInteraction.meta WindowInteractions/src/MeshViewerInteraction.c WindowInteractions/src/MeshViewerInteraction.h WindowInteractions/src/MeshViewerInteraction.meta WindowInteractions/src/SwarmViewerInteraction.c WindowInteractions/src/SwarmViewerInteraction.h WindowInteractions/src/SwarmViewerInteraction.meta WindowInteractions/src/WindowInteractions.h WindowInteractions/src/makefile WindowInteractions/src/types.h Windowing/makefile Windowing/src/CarbonWindow.c Windowing/src/CarbonWindow.h Windowing/src/CarbonWindow.meta Windowing/src/Finalise.c Windowing/src/Finalise.h Windowing/src/Init.c Windowing/src/Init.h Windowing/src/OSMesaWindow.c Windowing/src/OSMesaWindow.h Windowing/src/OSMesaWindow.meta Windowing/src/SDLWindow.c Windowing/src/SDLWindow.h Windowing/src/SDLWindow.meta Windowing/src/VTKWindow.cxx Windowing/src/VTKWindow.h Windowing/src/VTKWindow.xml Windowing/src/Windowing.h Windowing/src/X11Window.c Windowing/src/X11Window.h Windowing/src/X11Window.meta Windowing/src/makefile Windowing/src/types.h build-functions.sh configure.sh doc/C_full.doxyconf.in doc/Makefile.def doc/doxygen.css doc/footer.html doc/generateForWeb.sh doc/header.html doc/makefile doc/web.doxyconf.in libglucifer/makefile libglucifer/src/Finalise.c libglucifer/src/Finalise.h libglucifer/src/Init.c libglucifer/src/Init.h libglucifer/src/glucifer.h libglucifer/src/makefile makefile plugins/lucPlugin/lucPlugin.c plugins/lucPlugin/makefile plugins/makefile project-config.sh src/main.c src/makefile
description:
patching this test because of the addition of the new lighting stuff that Cecile was working on.


diff -r c3d217e50ce0 -r 28d655bec240 Base/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/makefile	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,9 @@
+
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Base.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Base.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,105 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Base.h 540 2006-04-27 05:26:37Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Initialises this library ready for use.
+**
+** Assumptions:
+**	The Init() function will be run before any other function in the library.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Base.h 540 2006-04-27 05:26:37Z CecileDuboz $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucBase_h__
+#define __lucBase_h__
+	
+#include "types.h"
+#include "Camera.h"
+#include "ColourMap.h"
+#include "ViewportInfo.h"
+#include "Window.h"
+#include "DrawingObject.h"
+#include "DrawingObject_Register.h"
+#include "OutputFormat.h"
+#include "OutputFormat_Register.h"
+#include "InputFormat.h"
+#include "InputFormat_Register.h"
+#include "X11Colours.h"
+#include "Viewport.h"
+#include "RenderingEngine.h"
+#include "WindowInteraction.h"
+#include "WindowInteraction_Register.h"
+#include "Light.h"
+#include "Light_Register.h"
+
+
+#include "Init.h"
+#include "Finalise.h"
+	
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Camera.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Camera.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,515 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Camera.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "types.h"
+#include "Camera.h"
+#include "Init.h"
+
+#include <string.h>
+#include <assert.h>
+
+const Type lucCamera_Type = "lucCamera";
+
+MPI_Datatype lucCamera_MPI_Datatype;
+
+lucCamera* lucCamera_New( 
+		Name                                               name,
+		Coord                                              coord, 
+		Coord                                              focalPoint,
+		XYZ                                                upDirection,
+		double                                             focalLength,
+		double                                             aperture,
+		double                                             eyeSeparation,
+		lucStereoType                                      stereoType,
+		FieldVariable*                                     centreFieldVariable )
+{
+	lucCamera* self = (lucCamera*) _lucCamera_DefaultNew( name );
+
+	lucCamera_InitAll( self, coord, focalPoint, upDirection, focalLength, aperture, eyeSeparation, stereoType, centreFieldVariable );
+
+	return self;
+}
+
+lucCamera* _lucCamera_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name )
+{
+	lucCamera*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucCamera) );
+	self = (lucCamera*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+	
+	return self;
+}
+
+void lucCamera_Init(		
+		lucCamera*                                         self,
+		Coord                                              coord, 
+		Coord                                              focalPoint,
+		XYZ                                                upDirection,
+		double                                             focalLength,
+		double                                             aperture,
+		double                                             eyeSeparation,
+		lucStereoType                                      stereoType,
+		FieldVariable*                                     centreFieldVariable )
+{
+	memcpy( self->coord, coord, sizeof(Coord) );
+	memcpy( self->focalPoint, focalPoint, sizeof(Coord) );
+	memcpy( self->upDirection, upDirection, sizeof(XYZ) );
+
+	self->focalLength         = focalLength;
+	self->aperture            = aperture;
+	self->eyeSeparation       = eyeSeparation;
+	self->stereoType          = stereoType;
+	self->centreFieldVariable = centreFieldVariable;
+
+	/* Store Original Values */
+	self->needsToDraw   = True;
+	self->buffer        = lucLeft;
+	self->originalCamera = lucCamera_Copy( self );
+}
+
+void lucCamera_InitAll( 
+		void*                                              camera,
+		Coord                                              coord, 
+		Coord                                              focalPoint,
+		XYZ                                                upDirection,
+		double                                             focalLength,
+		double                                             aperture,
+		double                                             eyeSeparation,
+		lucStereoType                                      stereoType,
+		FieldVariable*                                     centreFieldVariable )
+{
+	lucCamera* self        = camera;
+
+	/* TODO Init parent */
+	lucCamera_Init( self, coord, focalPoint, upDirection, focalLength, aperture, eyeSeparation, stereoType, centreFieldVariable );
+}
+
+void _lucCamera_Delete( void* camera ) {
+	lucCamera* self        = camera;
+	
+	if ( self->originalCamera != NULL );
+		Stg_Class_Delete( self->originalCamera );
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucCamera_Print( void* camera, Stream* stream ) {
+	lucCamera* self        = camera;
+	
+	Journal_Printf( stream, "lucCamera: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintArray( stream, self->coord, 3 );
+	Journal_PrintArray( stream, self->focalPoint, 3 );
+	Journal_PrintArray( stream, self->upDirection, 3 );
+	
+	Journal_PrintValue( stream, self->aperture );
+
+	Journal_Printf( stream, "self->stereoType = ");
+	switch ( self->stereoType ) {
+		case lucMono:
+			Journal_Printf( stream, "lucMono\n" ); break;
+		case lucStereoToeIn:
+			Journal_Printf( stream, "lucStereoToeIn\n" ); break;
+		case lucStereoAsymmetric:
+			Journal_Printf( stream, "lucStereoAsymmetric\n" ); break;
+	}
+	
+	Journal_Printf( stream, "self->buffer = ");
+	switch ( self->buffer ) {
+		case lucLeft:
+			Journal_Printf( stream, "lucLeft\n" ); break;
+		case lucRight:
+			Journal_Printf( stream, "lucRight\n" ); break;
+	}
+	Journal_PrintValue( stream, self->eyeSeparation );
+
+	Stream_UnIndent( stream );
+}
+
+void* _lucCamera_Copy( void* camera, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucCamera* self        = camera;
+	lucCamera* newCamera;
+
+	newCamera = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	memcpy( newCamera->coord,       self->coord,       sizeof(Coord) );
+	memcpy( newCamera->focalPoint,  self->focalPoint,  sizeof(Coord) );
+	memcpy( newCamera->upDirection, self->upDirection, sizeof(XYZ) );
+	
+	newCamera->aperture      = self->aperture;
+	newCamera->stereoType    = self->stereoType;
+	newCamera->eyeSeparation = self->eyeSeparation;
+	newCamera->buffer        = self->buffer;
+	
+	return (void*) newCamera;
+}
+
+void* _lucCamera_DefaultNew( Name name ) {
+	return _lucCamera_New( 
+			sizeof( lucCamera ),
+			lucCamera_Type,
+			_lucCamera_Delete,
+			_lucCamera_Print,
+			_lucCamera_Copy,
+			_lucCamera_DefaultNew,
+			_lucCamera_Construct,
+			_lucCamera_Build,
+			_lucCamera_Initialise,
+			_lucCamera_Execute,
+			_lucCamera_Destroy,
+			name );
+}
+
+void _lucCamera_Construct( void* camera, Stg_ComponentFactory* cf, void* data ) {
+	lucCamera*             self               = (lucCamera*) camera;
+	Coord                  coord;
+	Coord                  focalPoint;
+	XYZ                    upDirection;
+	FieldVariable*         centreFieldVariable;
+	double                 focalLength;
+	double                 aperture;
+	double                 eyeSeparation;
+	lucStereoType          stereoType;
+	Name                   stereoTypeName;
+
+  #define DTOR 0.0174532925
+	focalPoint[I_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "focalPointX", 0.0 );
+	focalPoint[J_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "focalPointY", 0.0 );
+	focalPoint[K_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "focalPointZ", 0.0 );
+
+	upDirection[I_AXIS] = Stg_ComponentFactory_GetDouble( cf, self->name, "upDirectionX", 0.0 );
+	upDirection[J_AXIS] = Stg_ComponentFactory_GetDouble( cf, self->name, "upDirectionY", 1.0 );
+	upDirection[K_AXIS] = Stg_ComponentFactory_GetDouble( cf, self->name, "upDirectionZ", 0.0 );
+	
+	focalLength = Stg_ComponentFactory_GetDouble( cf, self->name, "focalLength", 0.0 );
+
+	coord[I_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "coordX", 0.0 );
+	coord[J_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "coordY", 0.0 );
+	coord[K_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "coordZ", 1.0 );
+
+	aperture = Stg_ComponentFactory_GetDouble( cf, self->name, "aperture", 45.0 );
+
+	/* Get Stereo Type */
+	stereoTypeName = Stg_ComponentFactory_GetString( cf, self->name, "stereoType", "lucMono" );
+	if ( strcasecmp( stereoTypeName, "ToeIn" ) == 0 ) 
+		stereoType = lucStereoToeIn;
+	else if ( strcasecmp( stereoTypeName, "Asymmetric" ) == 0 ) 
+		stereoType = lucStereoAsymmetric;
+	else 
+		stereoType = lucMono;
+
+	eyeSeparation  = Stg_ComponentFactory_GetDouble( cf, self->name, "eyeSeparation", 0.2 );
+
+	centreFieldVariable = Stg_ComponentFactory_ConstructByKey( cf, self->name, "CentreFieldVariable", FieldVariable,False,data);
+
+	lucCamera_Init( self, coord, focalPoint, upDirection, focalLength, aperture, eyeSeparation, stereoType, centreFieldVariable );
+}
+
+void _lucCamera_Build( void* camera, void* data ) { }
+void _lucCamera_Initialise( void* camera, void* data ) { }
+void _lucCamera_Execute( void* camera, void* data ) { }
+void _lucCamera_Destroy( void* camera, void* data ) { }
+
+void lucCamera_Zoom( void* camera, double zoomFactor ) {
+	lucCamera* self                = camera;
+	XYZ        vectorFocusToCamera;
+	
+	StGermain_VectorSubtraction( vectorFocusToCamera, self->coord, self->focalPoint, 3 );
+	vectorFocusToCamera[ I_AXIS ] *= zoomFactor;
+	vectorFocusToCamera[ J_AXIS ] *= zoomFactor;
+	vectorFocusToCamera[ K_AXIS ] *= zoomFactor;
+	StGermain_VectorAddition( self->coord, vectorFocusToCamera, self->focalPoint, 3 );
+	
+	self->needsToDraw = True;
+}
+
+void lucCamera_RotateAroundUpDirection( void* camera, double deltaTheta ) {
+	lucCamera* self                = camera;
+	XYZ        vectorFocusToCamera;
+	XYZ        rotatedVectorFocusToCamera;
+
+	StGermain_VectorSubtraction( vectorFocusToCamera, self->coord, self->focalPoint, 3 );
+	StGermain_RotateVector( rotatedVectorFocusToCamera, vectorFocusToCamera, self->upDirection, deltaTheta );
+	StGermain_VectorAddition( self->coord, rotatedVectorFocusToCamera, self->focalPoint, 3 );
+	
+	self->needsToDraw = True;
+}
+
+void lucCamera_RotateTowardsUpDirection( void* camera, double deltaTheta ) {
+	lucCamera*   self                = camera;
+	XYZ          rotationAxis;
+	XYZ          vectorFocusToCamera;
+	XYZ          rotatedVectorFocusToCamera;
+	double       angleBetween;
+	double       predictedAngle;
+	const double minAngle            = M_PI/180.0 * 0.1; /* A tenth of a degree */
+	const double maxAngle            = M_PI - minAngle;
+
+	StGermain_VectorSubtraction( vectorFocusToCamera, self->coord, self->focalPoint, 3 );
+	StGermain_VectorCrossProduct( rotationAxis, vectorFocusToCamera, self->upDirection );
+	StGermain_VectorNormalise( rotationAxis, 3 );
+
+	/* Check if angle is too large */
+	angleBetween = StGermain_AngleBetweenVectors( vectorFocusToCamera, self->upDirection, 3 );
+	predictedAngle = angleBetween - deltaTheta;
+	if ( predictedAngle < minAngle ) 
+		deltaTheta = angleBetween - minAngle;
+	else if ( predictedAngle > maxAngle ) 
+		deltaTheta = angleBetween - maxAngle;
+		
+	StGermain_RotateVector( rotatedVectorFocusToCamera, vectorFocusToCamera, rotationAxis, deltaTheta );
+	
+	StGermain_VectorAddition( self->coord, rotatedVectorFocusToCamera, self->focalPoint, 3 );
+	self->needsToDraw = True;
+}
+
+void lucCamera_Reset( void* camera ) {
+	lucCamera* self                = camera;
+	lucCamera* originalCamera      = self->originalCamera;
+	
+	Stg_Class_Copy( originalCamera, self, False, NULL, NULL );
+	self->originalCamera = originalCamera;
+	self->needsToDraw = True;
+}
+
+void lucCamera_SetOriginal( void* camera ) {
+	lucCamera* self                = camera;
+	
+	Stg_Class_Copy( self, self->originalCamera, False, NULL, NULL );
+	self->originalCamera->originalCamera = NULL;
+}
+
+void lucCamera_Broadcast( void* camera, int rootRank, MPI_Comm comm ) {
+	lucCamera* self                = camera;
+
+	Journal_DPrintfL( lucDebug, 2, "In %s for %s '%s'.\n", __func__, self->type, self->name );
+
+	MPI_Bcast( self, 1, lucCamera_MPI_Datatype, rootRank, comm );
+}
+
+void lucCamera_GetFocusDirection( void* camera, XYZ focusDirection ) {
+	lucCamera*   self                = camera;
+	
+	StGermain_VectorSubtraction( focusDirection, self->focalPoint, self->coord, 3 );
+	StGermain_VectorNormalise( focusDirection, 3 );
+}
+
+void lucCamera_GetLeftDirection( void* camera, XYZ leftDirection ) {
+	lucCamera*   self                = camera;
+	XYZ          focusDirection;
+	
+	lucCamera_GetFocusDirection( self, focusDirection );
+	StGermain_VectorCrossProduct( leftDirection, self->upDirection, focusDirection );
+	StGermain_VectorNormalise( leftDirection, 3 );
+}
+
+void lucCamera_SwapStereoBuffer( void* camera ) {
+	lucCamera* self                = camera;
+
+	if ( self->buffer == lucLeft )
+		self->buffer = lucRight;
+	else 
+		self->buffer = lucLeft;
+	self->needsToDraw = True;
+}
+
+void lucCamera_CurrentEyePosition( void* camera, Coord currEyePos ) {
+	lucCamera* self                = camera;
+	XYZ        leftDirection;
+	double     factor;
+
+	memcpy( currEyePos, self->coord, sizeof(Coord) );
+	if ( self->stereoType == lucMono )
+		return;
+
+	lucCamera_GetLeftDirection( camera, leftDirection );
+
+	factor = 0.5 * self->eyeSeparation;
+	if ( self->buffer == lucRight )
+		factor *= -1.0; 
+
+	currEyePos[ I_AXIS ] += factor * leftDirection[ I_AXIS ];
+	currEyePos[ J_AXIS ] += factor * leftDirection[ J_AXIS ];
+	currEyePos[ K_AXIS ] += factor * leftDirection[ K_AXIS ];
+}
+
+
+void lucCamera_CentreFromFieldVariable( void* camera ) {
+	lucCamera*     self = (lucCamera*) camera;
+	Coord          min, max;
+	Coord          oldFocalPoint;
+	XYZ            difference = {0.0,0.0,0.0};
+	FieldVariable* fieldVariable = self->centreFieldVariable;
+
+	if ( !fieldVariable )
+		return;
+
+	FieldVariable_GetMinAndMaxGlobalCoords( fieldVariable, min, max );
+  
+		
+	/* Set up focal point */
+	memcpy( oldFocalPoint, self->focalPoint, sizeof(Coord) );
+	self->focalPoint[I_AXIS] = 0.5 * (min[ I_AXIS ] + max[ I_AXIS ]);
+	self->focalPoint[J_AXIS] = 0.5 * (min[ J_AXIS ] + max[ J_AXIS ]);
+	if (fieldVariable->dim == 2) 
+		self->focalPoint[K_AXIS] = 0.0;
+	else 
+		self->focalPoint[K_AXIS] = 0.5 * (min[ K_AXIS ] + max[ K_AXIS ]);
+	
+	/* Set up camera */
+	StGermain_VectorSubtraction( difference, self->focalPoint, oldFocalPoint, fieldVariable->dim );
+	self->coord[ I_AXIS ] += difference[ I_AXIS ] ;
+	self->coord[ J_AXIS ] += difference[ J_AXIS ] ;
+	self->coord[ K_AXIS ] += difference[ K_AXIS ] ;
+
+	/* Adjust Original Camera */
+	self->originalCamera->coord[ I_AXIS ] += difference[ I_AXIS ] ;
+	self->originalCamera->coord[ J_AXIS ] += difference[ J_AXIS ] ;
+	self->originalCamera->coord[ K_AXIS ] += difference[ K_AXIS ] ;
+	memcpy( self->originalCamera->focalPoint, self->focalPoint, sizeof( Coord ) );
+}
+
+void lucCamera_ChangeFocalPoint( void* camera, Pixel_Index startx, Pixel_Index starty, Pixel_Index xpos, Pixel_Index ypos ){
+	lucCamera*     self = (lucCamera*) camera;
+	XYZ             leftDirection;
+	Dimension_Index dim_I;
+
+	lucCamera_GetLeftDirection( camera, leftDirection );
+	for ( dim_I = 0 ; dim_I < 3 ; dim_I++ ) {
+		self->focalPoint[ dim_I ] -= 0.01 * ((double)xpos - (double)startx) * leftDirection[ dim_I ];
+		self->focalPoint[ dim_I ] -= 0.01 * ((double)ypos - (double)starty) * self->upDirection[ dim_I ];
+	}
+	memcpy( self->originalCamera->focalPoint, self->focalPoint, sizeof( Coord ) );
+
+	self->needsToDraw = True;
+}
+
+void lucCamera_Pickle( void* camera, Stream* stream ) {
+	lucCamera* self                = camera;
+	       
+	Journal_Printf( stream, "<struct name=\"%s\">\n", self->name);
+	Stream_Indent( stream );
+
+	Journal_Printf( stream, "<param name=\"Type\">%s</param>\n", self->type );
+	Journal_Printf( stream, "<param name=\"coordX\">%.5g</param>\n", self->coord[ I_AXIS ] );
+	Journal_Printf( stream, "<param name=\"coordY\">%.5g</param>\n", self->coord[ J_AXIS ] );
+	Journal_Printf( stream, "<param name=\"coordZ\">%.5g</param>\n", self->coord[ K_AXIS ] );
+
+	Journal_Printf( stream, "<param name=\"focalPointX\">%.5g</param>\n", self->focalPoint[ I_AXIS ] );
+	Journal_Printf( stream, "<param name=\"focalPointY\">%.5g</param>\n", self->focalPoint[ J_AXIS ] );
+	Journal_Printf( stream, "<param name=\"focalPointZ\">%.5g</param>\n", self->focalPoint[ K_AXIS ] );
+
+	Journal_Printf( stream, "<param name=\"upDirectionX\">%.5g</param>\n", self->upDirection[ I_AXIS ] );
+	Journal_Printf( stream, "<param name=\"upDirectionY\">%.5g</param>\n", self->upDirection[ J_AXIS ] );
+	Journal_Printf( stream, "<param name=\"upDirectionZ\">%.5g</param>\n", self->upDirection[ K_AXIS ] );
+
+	Journal_Printf( stream, "<param name=\"stereoType\">%s</param>\n", 
+			self->stereoType == lucStereoToeIn      ? "ToeIn" :
+			self->stereoType == lucStereoAsymmetric ? "Asymmetric" : "Mono" );
+	
+	Journal_Printf( stream, "<param name=\"eyeSeparation\">%.5g</param>\n", self->eyeSeparation );
+	Journal_Printf( stream, "<param name=\"focalLength\">%.5g</param>\n", self->focalLength );
+	Stream_UnIndent( stream );
+	Journal_Printf( stream, "</struct>\n");
+}
+void lucCamera_SetNeedsToDraw( void * camera ){
+	lucCamera* self = (lucCamera*) camera;
+	self->needsToDraw = True;
+}
+
+#define lucCamera_TypesCount 9
+void lucCamera_Create_MPI_Datatype() {
+	MPI_Datatype        typeList[lucCamera_TypesCount]     = 
+		{ MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_INT, MPI_INT, MPI_INT };
+	int                 blocklen[lucCamera_TypesCount]     = {3, 3, 3, 1, 1, 1, 1, 1, 1};
+	MPI_Aint            displacement[lucCamera_TypesCount];
+	lucCamera           camera;
+
+	displacement[0] = GetOffsetOfMember( camera, coord );
+	displacement[1] = GetOffsetOfMember( camera, focalPoint );
+	displacement[2] = GetOffsetOfMember( camera, upDirection );
+	displacement[3] = GetOffsetOfMember( camera, focalLength );
+	displacement[4] = GetOffsetOfMember( camera, aperture );
+	displacement[5] = GetOffsetOfMember( camera, eyeSeparation );
+	displacement[6] = GetOffsetOfMember( camera, buffer );
+	displacement[7] = GetOffsetOfMember( camera, stereoType );
+	displacement[8] = GetOffsetOfMember( camera, needsToDraw );
+	
+	MPI_Type_struct( lucCamera_TypesCount, blocklen, displacement, typeList, &lucCamera_MPI_Datatype );
+	MPI_Type_commit( & lucCamera_MPI_Datatype );
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Camera.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Camera.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,137 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Camera.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+
+#ifndef __lucCamera_h__
+#define __lucCamera_h__
+
+	extern const Type lucCamera_Type;
+	extern MPI_Datatype lucCamera_MPI_Datatype;
+
+	#define __lucCamera                                  \
+		__Stg_Component                                 \
+		lucCamera*                                         originalCamera;       \
+		FieldVariable*                                     centreFieldVariable;  \
+		Coord                                              coord;                \
+		Coord                                              focalPoint;           \
+		XYZ                                                upDirection;          \
+		double                                             focalLength;          \
+		double                                             aperture;             \
+		double                                             eyeSeparation;        \
+		lucStereoBuffer                                    buffer;               \
+		lucStereoType                                      stereoType;           \
+		Bool                                               needsToDraw;          \
+
+	struct lucCamera {__lucCamera};
+
+	/** Constructors */
+	lucCamera* lucCamera_New( 
+		Name                                               name,
+		Coord                                              coord, 
+		Coord                                              focalPoint,
+		XYZ                                                upDirection,
+		double                                             focalLength,
+		double                                             aperture,
+		double                                             eyeSeparation,
+		lucStereoType                                      stereoType,
+		FieldVariable*                                     centreFieldVariable );
+
+	lucCamera* _lucCamera_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name );
+
+	void lucCamera_InitAll( 
+		void*                                              camera,
+		Coord                                              coord, 
+		Coord                                              focalPoint,
+		XYZ                                                upDirection,
+		double                                             focalLength,
+		double                                             aperture,
+		double                                             eyeSeparation,
+		lucStereoType                                      stereoType,
+		FieldVariable*                                     centreFieldVariable );
+	
+	/** Virtual Functions */
+	void _lucCamera_Delete( void* camera ) ;
+	void _lucCamera_Print( void* camera, Stream* stream ) ;
+	void* _lucCamera_Copy( void* camera, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+	#define lucCamera_Copy( self ) \
+		(lucCamera*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	void* _lucCamera_DefaultNew( Name name ) ;
+void _lucCamera_Construct( void* camera, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucCamera_Build( void* camera, void* data );
+	void _lucCamera_Initialise( void* camera, void* data );
+	void _lucCamera_Execute( void* camera, void* data );
+	void _lucCamera_Destroy( void* camera, void* data );
+
+	/** Public Functions */
+	void lucCamera_Zoom( void* camera, double zoomFactor ) ;
+	void lucCamera_RotateAroundUpDirection( void* camera, double deltaTheta ) ;
+	void lucCamera_RotateTowardsUpDirection( void* camera, double deltaTheta ) ;
+	void lucCamera_GetFocusDirection( void* camera, XYZ focusDirection ) ;
+	void lucCamera_GetLeftDirection( void* camera, XYZ leftDirection ) ;
+	void lucCamera_Reset( void* camera ) ;
+	void lucCamera_SetOriginal( void* camera ) ;
+	void lucCamera_Broadcast( void* camera, int rootRank, MPI_Comm comm ) ;
+	void lucCamera_SwapStereoBuffer( void* camera ) ;
+	void lucCamera_CurrentEyePosition( void* camera, Coord currEyePos ) ;
+	void lucCamera_CentreFromFieldVariable( void* camera ) ;
+	void lucCamera_SetNeedsToDraw( void * camera );
+	void lucCamera_ChangeFocalPoint( void* camera, Pixel_Index startx, Pixel_Index starty, Pixel_Index posx, Pixel_Index posy );
+	void lucCamera_Pickle( void* camera, Stream* stream ) ;
+	
+	void lucCamera_Create_MPI_Datatype() ;
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Camera.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Camera.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucCamera</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Contols how the user views the visualisation scene in a lucViewport.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">focalPointX</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The X component of the coordinate of the point that the camera is centred on.</param>
+	</struct>
+	<struct>
+		<param name="Name">focalPointY</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The Y component of the coordinate of the point that the camera is centred on.</param>
+	</struct>
+	<struct>
+		<param name="Name">focalPointZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The Z component of the coordinate of the point that the camera is centred on.</param>
+	</struct>
+	<struct>
+		<param name="Name">upDirectionX</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The X component of the vector which describes which direction is up for the camera.</param>
+	</struct>
+	<struct>
+		<param name="Name">upDirectionY</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">The Y component of the vector which describes which direction is up for the camera.</param>
+	</struct>
+	<struct>
+		<param name="Name">upDirectionZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The Z component of the vector which describes which direction is up for the camera.</param>
+	</struct>
+	<struct>
+		<param name="Name">focalLength</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">Parameter only used for stereo cameras.</param>
+	</struct>
+	<struct>
+		<param name="Name">coordX</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The X component of the coordinate of where the camera initially is in space.</param>
+	</struct>
+	<struct>
+		<param name="Name">coordY</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The Y component of the coordinate of where the camera initially is in space.</param>
+	</struct>
+	<struct>
+		<param name="Name">coordZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">The Z component of the coordinate of where the camera initially is in space.</param>
+	</struct>
+	<struct>
+		<param name="Name">aperture</param>
+		<param name="Type">Double</param>
+		<param name="Default">45.0</param>
+		<param name="Description">The field-of-view angle, in degrees.</param>
+	</struct>
+	<struct>
+		<param name="Name">stereoType</param>
+		<param name="Type">String</param>
+		<param name="Default">"lucMono"</param>
+		<param name="Description">There are three options for how the camera behaves in stereo: lucMono (No stereo behaviour), lucStereoToeIn (simplified stereo behaviour), lucStereoAsymmetric (true stereo behaviour).</param>
+	</struct>
+	<struct>
+		<param name="Name">eyeSeparation</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.2</param>
+		<param name="Description">If your camera is working in stereo, then this is distance between the "left eye" and the "right eye", otherwise this parameter is not used.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">CentreFieldVariable</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">If a CentreFieldVariable is specified, then it overrides the values given by the focalPoint[X,Y,Z] parameters and just sets the focal point to be the middle of the field given by this FieldVariable.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/ColourMap.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/ColourMap.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,520 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ColourMap.c 639 2006-11-15 05:29:51Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "types.h"
+#include "ColourMap.h"
+#include "X11Colours.h"
+
+#include <string.h>
+#include <assert.h>
+
+const Type lucColourMap_Type = "lucColourMap";
+
+
+lucColourMap* lucColourMap_New( 
+		Name                                               name,
+		char*                                              colourMapString, 
+		double                                             minimum,
+		double                                             maximum,
+		Bool                                               logScale,
+		Bool                                               dynamicRange )
+{
+	lucColourMap* self = (lucColourMap*) _lucColourMap_DefaultNew( name );
+
+	lucColourMap_InitAll( self, colourMapString, minimum, maximum, logScale, dynamicRange );
+
+	return self;
+}
+
+lucColourMap* _lucColourMap_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name )
+{
+	lucColourMap*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucColourMap) );
+	self = (lucColourMap*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+	
+	return self;
+}
+
+void _lucColourMap_Init( 
+		lucColourMap*                                      self, 
+		char*                                              _colourMapString, 
+		double                                             minimum,
+		double                                             maximum,
+		Bool                                               logScale,
+		Bool                                               dynamicRange )
+{
+	char*        colourMapString = StG_Strdup( _colourMapString );
+	Colour_Index colourCount;
+	Colour_Index colour_I;
+	char*        charPointer;
+	lucColour*    colour;
+	char*        breakChars = " \t\n;,"; 
+
+	self->minimum      = minimum;
+	self->maximum      = maximum;
+	self->logScale     = logScale;
+	self->dynamicRange = dynamicRange;
+	
+	/* Find number of colours */
+	colourCount = 1;
+	charPointer = strpbrk( colourMapString, breakChars );
+	while ( charPointer != NULL ) {
+		charPointer = strpbrk( charPointer + 1 , breakChars );
+		colourCount++;
+	}
+	self->colourCount = colourCount;
+
+	/* Allocate space for colour map */
+	self->colourList = Memory_Alloc_Array( lucColour , colourCount, "Colour map");
+		
+	/* Read String to get colour map */
+	charPointer = strtok( colourMapString, breakChars );
+	for ( colour_I = 0 ; colour_I < colourCount ; colour_I++ ) {
+		colour = lucColourMap_GetColourFromList( self, colour_I );
+		lucColour_FromString( colour, charPointer );
+		charPointer = strtok( NULL, breakChars );
+	}
+
+	Memory_Free( colourMapString );
+}
+
+void lucColourMap_InitAll( 
+		void*                                              colourMap, 
+		char*                                              colourMapString, 
+		double                                             minimum,
+		double                                             maximum,
+		Bool                                               logScale,
+		Bool                                               dynamicRange )
+{
+	lucColourMap* self        = colourMap;
+
+	_lucColourMap_Init( self, colourMapString, minimum, maximum, logScale, dynamicRange );
+}
+		
+void _lucColourMap_Delete( void* colourMap ) {
+	lucColourMap* self        = colourMap;
+
+	Memory_Free( self->colourList );
+
+	_Stg_Component_Delete( self );
+}
+
+void _lucColourMap_Print( void* colourMap, Stream* stream ) {
+	lucColourMap* self        = colourMap;
+	Colour_Index  colour_I;
+	lucColour*    colour;
+	lucColour     black;
+	lucColour     white;
+	lucColour     colourFromValue;
+	Index         charCount = 100;
+	Index         char_I;
+	
+	black.red = black.green = black.blue = 0.0;
+	white.red = white.green = white.blue = 1.0;
+
+	Journal_Printf( stream, "lucColourMap: %s\n", self->name );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintValue( stream, self->colourCount );
+	for ( colour_I = 0 ; colour_I < self->colourCount ; colour_I++ ) {
+		colour = lucColourMap_GetColourFromList( self, colour_I );
+		Journal_Printf( stream, "\tColour %u: Red - %6.3g, Green - %6.3g, Blue - %6.3g, Opacity - %6.3g\n", 
+				colour_I, colour->red, colour->green, colour->blue, colour->opacity );
+	}
+	
+	Journal_PrintValue( stream, self->minimum );
+	Journal_PrintValue( stream, self->maximum );
+	Journal_PrintBool( stream, self->logScale );
+	Journal_PrintBool( stream, self->dynamicRange );
+
+	/* Print Colour Map using terminal colours */
+	for ( char_I = 0 ; char_I < charCount ; char_I++ ) {
+		double value = (double) char_I / (double) (charCount - 1);
+		lucColourMap_GetColourFromValue( self, value, &colourFromValue );
+		lucColour_SetTerminalColours( &black, &colourFromValue, stream );
+		Journal_Printf( stream, " " );
+	}
+	lucColour_SetTerminalColours( &black, &white, stream );
+	Journal_Printf( stream, "\n" );
+
+	/* Print Scale For Colour Map */
+	Journal_Printf( stream, "%.4g", self->minimum );
+	for ( char_I = 0 ; char_I < charCount ; char_I++ ) 
+		Journal_Printf( stream, " " );
+	Journal_Printf( stream, "%.4g\n", self->maximum );
+
+}
+
+void* _lucColourMap_Copy( void* colourMap, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucColourMap* self        = colourMap;
+	lucColourMap* newColourMap;
+
+	newColourMap = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newColourMap->colourCount  = self->colourCount;
+	newColourMap->minimum      = self->minimum;
+	newColourMap->maximum      = self->maximum;
+	newColourMap->logScale     = self->logScale;
+	newColourMap->dynamicRange = self->dynamicRange;
+
+	if (deep)
+		memcpy( newColourMap->colourList, self->colourList, self->colourCount * sizeof(lucColour) );
+	else 
+		newColourMap->colourList = self->colourList;
+
+	return (void*) newColourMap;
+}
+
+
+void* _lucColourMap_DefaultNew( Name name ) {
+	return _lucColourMap_New( 
+			sizeof( lucColourMap ),
+			lucColourMap_Type,
+			_lucColourMap_Delete,
+			_lucColourMap_Print,
+			_lucColourMap_Copy,
+			_lucColourMap_DefaultNew,
+			_lucColourMap_Construct,
+			_lucColourMap_Build,
+			_lucColourMap_Initialise,
+			_lucColourMap_Execute,
+			_lucColourMap_Destroy,
+			name );
+}
+
+void _lucColourMap_Construct( void* colourMap, Stg_ComponentFactory* cf, void* data ) {
+	lucColourMap* self             = (lucColourMap*) colourMap;
+
+	_lucColourMap_Init( 
+			self, 
+			Stg_ComponentFactory_GetString( cf, self->name, "colours", "Blue;White;Red"), 
+			Stg_ComponentFactory_GetDouble( cf, self->name, "minimum", 0.0 ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "maximum", 1.0 ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "logScale", False ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "dynamicRange", False ) );
+}
+
+void _lucColourMap_Build( void* colourMap, void* data ) { }
+void _lucColourMap_Initialise( void* colourMap, void* data ) { }
+void _lucColourMap_Execute( void* colourMap, void* data ) { }
+void _lucColourMap_Destroy( void* colourMap, void* data ) { }
+
+void lucColourMap_GetColourFromValue( void* colourMap, double value, lucColour* colour ) {
+	lucColourMap* self        = colourMap;
+	Colour_Index  colourBelow_I;
+	lucColour*    colourBelow;
+	lucColour*    colourAbove;
+	float         remainder;
+	float         scaledValue;
+	Colour_Index  colourCount = self->colourCount;
+
+	/* Scale value so that it is between 0 and 1 */
+	if (self->logScale == True) 
+		scaledValue = (log10(value) - log10(self->minimum))/(log10(self->maximum) - log10(self->minimum));
+	else
+		scaledValue = (value - self->minimum)/(self->maximum - self->minimum);
+
+	if (scaledValue <= 0.0 || colourCount == 1) {
+		memcpy( colour, lucColourMap_GetColourFromList( self, 0 ), sizeof(lucColour) );
+		return;
+	}
+	if (scaledValue >= 1.0) {
+		memcpy( colour, lucColourMap_GetColourFromList( self, colourCount - 1 ), sizeof(lucColour) );
+		return;
+	}
+	
+	colourBelow_I = (Colour_Index) ( ( colourCount - 1 ) * scaledValue );
+	colourBelow   = lucColourMap_GetColourFromList( self, colourBelow_I );
+	colourAbove   = lucColourMap_GetColourFromList( self, colourBelow_I + 1 );
+	
+	remainder = (float)( colourCount - 1 ) * scaledValue - (float) colourBelow_I;
+	
+	/* Do linear interpolation between colours */
+	colour->red     = ( colourAbove->red     - colourBelow->red     ) * remainder + colourBelow->red;
+	colour->green   = ( colourAbove->green   - colourBelow->green   ) * remainder + colourBelow->green;
+	colour->blue    = ( colourAbove->blue    - colourBelow->blue    ) * remainder + colourBelow->blue;
+	colour->opacity = ( colourAbove->opacity - colourBelow->opacity ) * remainder + colourBelow->opacity;
+}
+void lucColourMap_GetColourFromValue_ExplicitOpacity( void* colourMap, double value, lucColour* colour, float opacity ) {
+	lucColourMap* self        = colourMap;
+	Colour_Index  colourBelow_I;
+	lucColour*    colourBelow;
+	lucColour*    colourAbove;
+	float         remainder;
+	float         scaledValue;
+	Colour_Index  colourCount = self->colourCount;
+
+	/* Scale value so that it is between 0 and 1 */
+	if (self->logScale == True) 
+		scaledValue = (log10(value) - log10(self->minimum))/(log10(self->maximum) - log10(self->minimum));
+	else
+		scaledValue = (value - self->minimum)/(self->maximum - self->minimum);
+
+	if (scaledValue <= 0.0 || colourCount == 1) {
+		memcpy( colour, lucColourMap_GetColourFromList( self, 0 ), sizeof(lucColour) );
+		return;
+	}
+	if (scaledValue >= 1.0) {
+		memcpy( colour, lucColourMap_GetColourFromList( self, colourCount - 1 ), sizeof(lucColour) );
+		return;
+	}
+	
+	colourBelow_I = (Colour_Index) ( ( colourCount - 1 ) * scaledValue );
+	colourBelow   = lucColourMap_GetColourFromList( self, colourBelow_I );
+	colourAbove   = lucColourMap_GetColourFromList( self, colourBelow_I + 1 );
+	
+	remainder = (float)( colourCount - 1 ) * scaledValue - (float) colourBelow_I;
+	
+	/* Do linear interpolation between colours */
+	colour->red     = ( colourAbove->red     - colourBelow->red     ) * remainder + colourBelow->red;
+	colour->green   = ( colourAbove->green   - colourBelow->green   ) * remainder + colourBelow->green;
+	colour->blue    = ( colourAbove->blue    - colourBelow->blue    ) * remainder + colourBelow->blue;
+	colour->opacity =  opacity;
+}
+
+void lucColourMap_SetMinMax( void* colourMap, double min, double max ) {
+	lucColourMap* self        = colourMap;
+	double        tolerance;
+
+	/* Shift max and min if they are too close */
+	tolerance = 0.00005 * (fabs(max)+1);
+	if (fabs(min - max) < tolerance) {	
+		max += 0.5 * tolerance;
+		min -= 0.5 * tolerance;
+	}
+
+	/* Copy to colour map */
+	self->minimum = min;
+	self->maximum = max;
+}
+
+void lucColourMap_CalibrateFromVariable( void* colourMap, void* _variable ) {
+	lucColourMap* self        = colourMap;
+	Variable*     variable    = (Variable*)_variable;
+	Index         array_I;
+	Index         arrayCount  = *variable->arraySizePtr;
+	double        value;
+	double        localMin    = 1.0e99;
+	double        localMax    = -1.0e99;
+	double        globalMax;
+	double        globalMin;
+
+	if ( !self->dynamicRange ) return;
+
+	for ( array_I = 0 ; array_I < arrayCount ; array_I++ ){
+		/* Get scalar value from particle */
+		value = Variable_GetValueDouble( variable, array_I ) ;
+
+		if ( value < localMin ) 
+			localMin = value;
+		else if ( value > localMax ) 
+			localMax = value;
+	}
+	
+	MPI_Allreduce( &localMin, &globalMin, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD );
+	MPI_Allreduce( &localMax, &globalMax, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
+
+	lucColourMap_SetMinMax( self, globalMin, globalMax );
+}
+
+void lucColourMap_CalibrateFromFieldVariable( void* colourMap, void* _fieldVariable ) {
+	lucColourMap*   self          = colourMap;
+	FieldVariable*  fieldVariable = (FieldVariable*)_fieldVariable;
+
+	if ( !self->dynamicRange ) return;
+
+	lucColourMap_SetMinMax( 
+			self, 
+			FieldVariable_GetMinGlobalFieldMagnitude( fieldVariable ), 
+			FieldVariable_GetMaxGlobalFieldMagnitude( fieldVariable ) );
+}
+
+void lucColourMap_CalibrateFromSwarmVariable( void* colourMap, void* swarmVariable ) {
+	lucColourMap*   self          = colourMap;
+
+	if ( !self->dynamicRange ) return;
+
+	lucColourMap_SetMinMax( 
+			self, 
+			SwarmVariable_GetMinGlobalMagnitude( swarmVariable ), 
+			SwarmVariable_GetMaxGlobalMagnitude( swarmVariable ) );
+}
+
+void lucColour_FromHSV( lucColour* self, float hue, float saturation, float value, float opacity ) {
+	int   Hi     = (int) ( hue/60.0 );
+	float f      = hue/60.0 - (float) Hi;
+	float p      = value * ( 1.0 - saturation );
+	float q      = value * ( 1.0 - saturation * f );
+	float t      = value * ( 1.0 - saturation * ( 1.0 - f ));
+
+	switch ( Hi ){
+		case 0:
+			self->red = value;   self->green = t;       self->blue = p;     break;
+		case 1:
+			self->red = q;       self->green = value;   self->blue = p;     break;
+		case 2:
+			self->red = p;       self->green = value;   self->blue = t;     break;
+		case 3:
+			self->red = p;       self->green = q;       self->blue = value; break;
+		case 4:
+			self->red = t;       self->green = p;       self->blue = value; break;
+		case 5:
+			self->red = value;   self->green = p;       self->blue = q;     break;
+	}
+
+	self->opacity = opacity;
+}
+	
+	
+
+void lucColour_FromString( lucColour* self, char* string ) {
+	char* charPointer;
+	float opacity;
+
+	lucColour_FromX11ColourName( self, string );
+
+	/* Get Opacity From String */
+	/* Opacity must be read in after the ":" of the name of the colour */
+	charPointer = strchr( string, ':' );
+
+	if (charPointer != NULL) {
+		/* Return full opactity (non-transparent) if no opacity is set */
+		if (sscanf( charPointer + 1, "%f", &opacity )	!= 1) 
+			opacity = 1.0;
+	}
+	else 
+		opacity = 1.0;
+	self->opacity = opacity;
+}
+
+typedef enum {
+	Terminal_Black,
+	Terminal_Red,
+	Terminal_Green,
+	Terminal_Yellow,
+	Terminal_Blue,
+	Terminal_Magenta,
+	Terminal_Cyan,
+	Terminal_Grey,
+	Terminal_White 
+} Terminal_Colour;
+
+Terminal_Colour lucColour_GetClosestTerminalColour( lucColour* self ) {
+	Bool hasRed   = ( self->red   > 0.5 );
+	Bool hasGreen = ( self->green > 0.5 );
+	Bool hasBlue  = ( self->blue  > 0.5 );
+	
+	/* Shades */
+	if ( ! hasRed && ! hasGreen && ! hasBlue ) 
+		return Terminal_Black;
+
+	if ( hasRed && hasGreen && hasBlue ) 
+		return Terminal_White;
+	
+	/* Primary Colours */
+	if ( hasRed && ! hasGreen && ! hasBlue ) 
+		return Terminal_Red;
+
+	if ( ! hasRed && hasGreen && ! hasBlue ) 
+		return Terminal_Green;
+	
+	if ( ! hasRed && ! hasGreen && hasBlue ) 
+		return Terminal_Blue;
+
+	/* Secondary Colours */
+	if ( hasRed && ! hasGreen && hasBlue ) 
+		return Terminal_Magenta;
+
+	if ( ! hasRed && hasGreen && hasBlue ) 
+		return Terminal_Cyan;
+	
+	if ( hasRed && hasGreen && ! hasBlue ) 
+		return Terminal_Yellow;
+
+	abort();
+	return Terminal_Black;
+}
+
+void lucColour_SetTerminalColours( lucColour* textColour, lucColour* backgroundColour, Stream* stream ) {
+	int reset = 0;
+	
+	/* Command is the control command to the terminal */
+	Journal_Printf( stream, "%c[%d;%d;%dm", 
+			0x1B, 
+			reset, 
+			lucColour_GetClosestTerminalColour( textColour ) + 30, 
+			lucColour_GetClosestTerminalColour( backgroundColour ) + 40 );
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/ColourMap.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/ColourMap.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,131 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ColourMap.h 639 2006-11-15 05:29:51Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+
+#ifndef __lucColour_ColourMap_h__
+#define __lucColour_ColourMap_h__
+
+	extern const Type lucColourMap_Type;
+
+	struct lucColour {
+		float red;
+		float green;
+		float blue;
+		float opacity;
+	};
+
+	#define __lucColourMap                \
+		__Stg_Component			\
+		Colour_Index                                       colourCount;  \
+		lucColour*                                         colourList;   \
+		double                                             minimum;      \
+		double                                             maximum;      \
+		Bool                                               logScale;     \
+		Bool                                               dynamicRange; \
+
+	struct lucColourMap {__lucColourMap};
+
+	/** Constructors */
+	lucColourMap* lucColourMap_New( 
+		Name                                               name,
+		char*                                              _colourMapString, 
+		double                                             minimum,
+		double                                             maximum,
+		Bool                                               logScale,
+		Bool                                               dynamicRange );
+
+	lucColourMap* _lucColourMap_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name );
+
+	void lucColourMap_InitAll( 
+		void*                                              colourMap, 
+		char*                                              _colourMapString, 
+		double                                             minimum,
+		double                                             maximum,
+		Bool                                               logScale,
+		Bool                                               dynamicRange );
+
+	/** Virtual Functions */
+	void _lucColourMap_Delete( void* colourMap ) ;
+	void _lucColourMap_Print( void* colourMap, Stream* stream ) ;
+	void* _lucColourMap_Copy( void* colourMap, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+	void* _lucColourMap_DefaultNew( Name name ) ;
+void _lucColourMap_Construct( void* colourMap, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucColourMap_Build( void* colourMap, void* data ) ;
+	void _lucColourMap_Initialise( void* colourMap, void* data ) ;
+	void _lucColourMap_Execute( void* colourMap, void* data ) ;
+	void _lucColourMap_Destroy( void* colourMap, void* data ) ;
+
+	/** Public Functions */
+	void lucColourMap_GetColourFromValue( void* colourMap, double value, lucColour* colour ) ;
+	void lucColourMap_GetColourFromValue_ExplicitOpacity( void* colourMap, double value, lucColour* colour, float opacity ) ;
+
+	#define lucColourMap_GetColourFromList( self, colour_I ) \
+		(&(self)->colourList[ (colour_I) ])
+
+	void lucColourMap_SetMinMax( void* colourMap, double min, double max ) ;
+	void lucColourMap_CalibrateFromVariable( void* colourMap, void* _variable ) ;
+	void lucColourMap_CalibrateFromFieldVariable( void* colourMap, void* _fieldVariable ) ;
+	void lucColourMap_CalibrateFromSwarmVariable( void* colourMap, void* swarmVariable ) ;
+
+	void lucColour_FromHSV( lucColour* self, float hue, float saturation, float value, float opacity ) ;
+	void lucColour_FromString( lucColour* self, char* string ) ;
+
+	void lucColour_SetTerminalColours( lucColour* textColour, lucColour* backgroundColour, Stream* stream ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/ColourMap.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/ColourMap.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucColourMap</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Provides a way for lucDrawingObjects to map between scalar values and colours.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">colours</param>
+		<param name="Type">String</param>
+		<param name="Default">"Blue;White;Red"</param>
+		<param name="Description">Creates a list of colours to be used to draw objects. The first colour mentioned corresponds to the minimum value being plotting and the last colour corresponds to the maximum value being plotting. The other colours are distributed evenly between these values. The Colour Map smoothly interpolates these colours together. These colour names must correspond to the X11 Colour map names (see http://en.wikipedia.org/wiki/X11_Color_Names) or be a hex colour triplet with a '#' at the start (see http://en.wikipedia.org/wiki/Hex_triplet).</param>
+	</struct>
+	<struct>
+		<param name="Name">minimum</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">Sets the value for the colour at the first colour in the colour map to correspond to.</param>
+	</struct>
+	<struct>
+		<param name="Name">maximum</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">Sets the value for the colour at the last colour in the colour map to correspond to.</param>
+	</struct>
+	<struct>
+		<param name="Name">logScale</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If True, then the variation in colour happens to a logarithmic scale rather than a linear scale.</param>
+	</struct>
+	<struct>
+		<param name="Name">dynamicRange</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If True, then this colour map can reset the minimum and maximum values to be appropriate to the FieldVariable or SwarmVariable that is is being used to draw, if False, then the original minimum and maximum values are used and never changed.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/DrawingObject.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/DrawingObject.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,244 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: DrawingObject.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ColourMap.h"
+#include "ViewportInfo.h"
+#include "Window.h"
+#include "DrawingObject.h"
+#include "Init.h"
+
+#include <assert.h>
+#include <string.h>
+
+const Type lucDrawingObject_Type = "lucDrawingObject";
+
+lucDrawingObject* _lucDrawingObject_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		Name                                               name )
+{
+	lucDrawingObject*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucDrawingObject) );
+	self = (lucDrawingObject*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	self->_setup   = _setup;
+	self->_draw    = _draw;
+	self->_cleanUp = _cleanUp;
+	
+	return self;
+}
+
+void _lucDrawingObject_Init( lucDrawingObject* self ) {
+	self->isConstructed = True;
+
+	self->infoStream  = Journal_MyStream( Info_Type,  self );
+	self->errorStream = Journal_MyStream( Error_Type, self );
+	self->debugStream = Journal_MyStream( Debug_Type, self );
+}
+
+void lucDrawingObject_InitAll( void* drawingObject ) {
+	lucDrawingObject* self        = drawingObject;
+
+	_lucDrawingObject_Init( self );
+}
+
+void _lucDrawingObject_Delete( void* drawingObject ) {
+	lucDrawingObject* self        = drawingObject;
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucDrawingObject_Print( void* drawingObject, Stream* stream ) {
+	lucDrawingObject* self        = drawingObject;
+	
+	Journal_Printf( stream, "lucDrawingObject: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintPointer( stream, self->_setup );
+	Journal_PrintPointer( stream, self->_draw );
+	
+	Stream_UnIndent( stream );
+}
+
+void* _lucDrawingObject_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucDrawingObject* self        = drawingObject;
+	lucDrawingObject* newDrawingObject;
+
+	newDrawingObject = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return (void*) newDrawingObject;
+}
+
+void _lucDrawingObject_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ) {
+	lucDrawingObject*        self            = (lucDrawingObject*) drawingObject ;
+
+	_lucDrawingObject_Init( self );
+}
+
+void _lucDrawingObject_Build( void* camera, void* data ) { }
+void _lucDrawingObject_Initialise( void* camera, void* data ) { }
+void _lucDrawingObject_Execute( void* camera, void* data ) { }
+void _lucDrawingObject_Destroy( void* camera, void* data ) { }
+
+void lucDrawingObject_Setup( void* drawingObject, void* context ) {
+	lucDrawingObject*   self       = (lucDrawingObject*) drawingObject ;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	if ( self->needsToSetup ) 
+		self->_setup( self, context );
+	else {
+		Journal_DPrintfL( lucDebug, 2, "Already setup\n" );
+	}
+
+	self->needsToSetup   = False;
+	self->needsToCleanUp = True;
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucDrawingObject_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* context ) {
+	lucDrawingObject*   self       = (lucDrawingObject*) drawingObject ;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	lucDrawingObject_Setup( self, context );
+
+	self->_draw( self, window, viewportInfo, context );
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+
+void lucDrawingObject_CleanUp( void* drawingObject, void* context ) {
+	lucDrawingObject*   self       = (lucDrawingObject*) drawingObject ;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	if ( self->needsToCleanUp ) {
+		self->_cleanUp( self, context );
+
+		self->needsToCleanUp = False;
+	}
+	else {
+		Journal_DPrintfL( lucDebug, 2, "%s '%s' has already cleaned up.\n", self->type, self->name );
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucDrawingObjectMask_Construct( lucDrawingObjectMask* self, Name drawingObjectName, Stg_ComponentFactory* cf, void* mask ) {
+	Name                   maskTypeName;
+
+	self->value     = Stg_ComponentFactory_GetDouble( cf, drawingObjectName, "maskValue", 0.0 );
+	self->tolerance = Stg_ComponentFactory_GetDouble( cf, drawingObjectName, "maskTolerance", 0.001 );
+
+	maskTypeName = Stg_ComponentFactory_GetString( cf, drawingObjectName, "maskType", "GreaterThan" );
+	if ( strcasecmp( maskTypeName, "GreaterThan" ) == 0 ) 
+		self->type = GreaterThan;
+	else if ( strcasecmp( maskTypeName, "LesserThan" ) == 0 )
+		self->type = LesserThan;
+	else if ( strcasecmp( maskTypeName, "EqualTo" ) == 0 )
+		self->type = EqualTo;
+	else {
+		Journal_Printf( lucError, "In func %s: Cannot understand 'maskType' '%s'.\n", __func__, maskTypeName );
+		abort();
+	}
+}
+
+Bool lucDrawingObjectMask_Test( lucDrawingObjectMask* self, double value ) {
+	double maskValue = self->value;
+
+	switch (self->type) {
+		case GreaterThan:
+			if (value > maskValue) 
+				return True;
+			return False;
+		case LesserThan:
+			if (value < maskValue) 
+				return True;
+			return False;
+		case EqualTo:
+			if (fabs( maskValue - value ) < self->tolerance )
+				return True;
+			return False;
+	}
+	return True;
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/DrawingObject.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/DrawingObject.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,117 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: DrawingObject.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucDrawingObject_h__
+#define __lucDrawingObject_h__
+
+	extern const Type lucDrawingObject_Type;
+
+	typedef void (lucDrawingObject_SetupFunction) ( void* object, void* context );
+	typedef void (lucDrawingObject_DrawFunction)  ( void* object, lucWindow* window, lucViewportInfo* viewportInfo, void* context );
+	typedef void (lucDrawingObject_CleanUpFunction)  ( void* object, void* context );
+
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucDrawingObject                           \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__Stg_Component                                   \
+		/* Virtual Functions */ \
+		lucDrawingObject_SetupFunction*                    _setup;                     \
+		lucDrawingObject_DrawFunction*                     _draw;                      \
+		lucDrawingObject_CleanUpFunction*                  _cleanUp;                   \
+		/* Other Info */ \
+		Bool                                               needsToSetup;               \
+		Bool                                               needsToCleanUp;             \
+		/* Journal Information */ \
+		Stream*                                            infoStream;                 \
+		Stream*                                            errorStream;                \
+		Stream*                                            debugStream;                \
+		
+
+	struct lucDrawingObject {__lucDrawingObject};
+
+	lucDrawingObject* _lucDrawingObject_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		Name                                               name );
+
+
+	void _lucDrawingObject_Delete( void* drawingObject ) ;
+	void _lucDrawingObject_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucDrawingObject_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+void _lucDrawingObject_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucDrawingObject_Build( void* camera, void* data );
+	void _lucDrawingObject_Initialise( void* camera, void* data );
+	void _lucDrawingObject_Execute( void* camera, void* data );
+	void _lucDrawingObject_Destroy( void* camera, void* data );
+
+	/* +++ Public Functions +++ */
+	void lucDrawingObject_Setup( void* drawingObject, void* context ) ;
+	void lucDrawingObject_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* context ) ;
+	void lucDrawingObject_CleanUp( void* drawingObject, void* context ) ;
+
+	typedef enum { GreaterThan, LesserThan, EqualTo } lucDrawingObjectMask_Type;
+	typedef struct { 
+		lucDrawingObjectMask_Type type;
+		double                    value;
+		double                    tolerance;
+	} lucDrawingObjectMask;
+
+	void lucDrawingObjectMask_Construct( lucDrawingObjectMask* self, Name drawingObjectName, Stg_ComponentFactory* cf, void* data ) ;
+	Bool lucDrawingObjectMask_Test( lucDrawingObjectMask* self, double value ) ;
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/DrawingObject.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/DrawingObject.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucDrawingObject</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">An abstract class which sets up an interface for objects to be drawn inside viewports</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/DrawingObject_Register.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/DrawingObject_Register.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,121 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: DrawingObject_Register.c 658 2007-02-05 00:58:07Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ViewportInfo.h"
+#include "Viewport.h"
+#include "ColourMap.h"
+#include "Window.h"
+#include "RenderingEngine.h"
+#include "DrawingObject_Register.h"
+#include "DrawingObject.h"
+#include "Light_Register.h"
+
+
+const Type lucDrawingObject_Register_Type = "lucDrawingObject_Register";
+
+
+lucDrawingObject_Register*	lucDrawingObject_Register_New( void ) {
+	lucDrawingObject_Register* self;
+	
+	self = (lucDrawingObject_Register*) _NamedObject_Register_New(
+		sizeof(lucDrawingObject_Register),
+		lucDrawingObject_Register_Type,
+		_NamedObject_Register_Delete,
+		_NamedObject_Register_Print,
+		_NamedObject_Register_Copy );
+
+	return self;
+}
+
+void lucDrawingObject_Register_SetNeedsToSetupFlag( void* drawingObject_Register, Bool flag ) {
+	lucDrawingObject_Register* self           = (lucDrawingObject_Register*) drawingObject_Register;
+	DrawingObject_Index        object_I;
+	DrawingObject_Index        objectCount    = lucDrawingObject_Register_GetCount( self );
+	lucDrawingObject*          object;
+
+	for ( object_I = 0 ; object_I < objectCount ; object_I++ ) {
+		object = lucDrawingObject_Register_GetByIndex( self, object_I );
+
+		object->needsToSetup = flag;
+	}
+}
+
+void lucDrawingObject_Register_DrawAll( void* drawingObject_Register, lucWindow* window, lucViewportInfo* viewportInfo, void* context, Bool compositeEachDraw ) {
+	lucDrawingObject_Register* self          = (lucDrawingObject_Register*) drawingObject_Register;
+	DrawingObject_Index        object_I;
+	DrawingObject_Index        objectCount   = lucDrawingObject_Register_GetCount( self );
+	lucDrawingObject*          object;
+	lucViewport*               viewport      =  (lucViewport*) viewportInfo->viewport;
+	lucLight_Register*         lightRegister =  (lucLight_Register*) (viewport->light_Register);
+
+	for ( object_I = 0 ; object_I < objectCount ; object_I++ ) {
+		object = lucDrawingObject_Register_GetByIndex( self, object_I );
+		lucLight_Register_EnableAll( lightRegister );
+		lucDrawingObject_Draw( object, window, viewportInfo, context );
+
+		if ( compositeEachDraw )
+			lucRenderingEngine_CompositeViewport( window->renderingEngine, viewportInfo, context, True );
+	}
+
+	if ( !compositeEachDraw )
+		lucRenderingEngine_CompositeViewport( window->renderingEngine, viewportInfo, context, False );
+}
+
+void lucDrawingObject_Register_CleanUpAll( void* drawingObject_Register, void* context ) {
+	lucDrawingObject_Register* self          = (lucDrawingObject_Register*) drawingObject_Register;
+	DrawingObject_Index        object_I;
+	DrawingObject_Index        objectCount   = lucDrawingObject_Register_GetCount( self );
+	lucDrawingObject*          object;
+
+	for ( object_I = 0 ; object_I < objectCount ; object_I++ ) {
+		object = lucDrawingObject_Register_GetByIndex( self, object_I );
+		lucDrawingObject_CleanUp( object, context );
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/DrawingObject_Register.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/DrawingObject_Register.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,131 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: DrawingObject_Register.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Allows users to access lucDrawingObjects based on their textual name,
+**	or index.
+**
+** Assumptions:
+**
+** Comments:
+**
+**
+** $Id: DrawingObject_Register.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucDrawingObject_Register_h__
+#define __lucDrawingObject_Register_h__
+	
+	extern const Type lucDrawingObject_Register_Type;
+	
+	#define __lucDrawingObject_Register \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__NamedObject_Register \
+		\
+		/* Virtual functions go here */ \
+		\
+		/* Class info */ \
+
+	struct lucDrawingObject_Register { __lucDrawingObject_Register };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructor
+	*/
+	
+	lucDrawingObject_Register*	lucDrawingObject_Register_New( void );
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** General virtual functions
+	*/
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	#define lucDrawingObject_Register_Add NamedObject_Register_Add
+
+	#define lucDrawingObject_Register_GetIndex NamedObject_Register_GetIndex 
+
+	#define lucDrawingObject_Register_GetByName( self, materialName ) \
+		( (lucDrawingObject*) NamedObject_Register_GetByName( self, materialName ) ) 
+
+	#define lucDrawingObject_Register_GetByIndex( self, materialIndex ) \
+		( (lucDrawingObject*) NamedObject_Register_GetByIndex( self, materialIndex ) )
+
+	#define lucDrawingObject_Register_GetCount( self ) \
+		(self)->objects->count
+	
+	#define lucDrawingObject_Register_DeleteAllObjects( self ) \
+		Stg_ObjectList_DeleteAllObjects( (self)->objects )
+	#define lucDrawingObject_Register_PrintAllObjects( self, stream ) \
+		Stg_ObjectList_PrintAllObjects( (self)->objects, stream )
+
+	/* +++ Public Functions +++ */
+	void lucDrawingObject_Register_SetNeedsToSetupFlag( void* drawingObject_Register, Bool flag ) ;
+	void lucDrawingObject_Register_DrawAll( void* drawingObject_Register, lucWindow* window, lucViewportInfo* viewportInfo, void* context, Bool compositeWindowEachDraw ) ;
+	void lucDrawingObject_Register_CleanUpAll( void* drawingObject_Register, void* context ) ;
+
+
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Finalise.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,57 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Finalise.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool lucBase_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Finalise.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,84 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Finalise.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Finalises this library
+**
+** Assumptions:
+**	No functions from this library used after this one.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucBase_Finalise_h__
+#define __lucBase_Finalise_h__
+	
+	Bool lucBase_Finalise( void );
+	
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Init.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Init.c 658 2007-02-05 00:58:07Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "Base.h"
+
+Stream* lucInfo  = NULL;
+Stream* lucDebug = NULL;
+Stream* lucError = NULL;
+lucInputFormat_Register* lucInputFormat_Register_Singleton = NULL;
+
+Bool lucBase_Init() {
+	Stg_ComponentRegister* componentRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	/* Set up streams */
+	lucInfo  = Journal_Register( InfoStream_Type, "lucInfo" );
+	lucDebug = Journal_Register( DebugStream_Type, "lucDebug" );
+	lucError = Journal_Register( ErrorStream_Type, "lucError" );	
+	lucInputFormat_Register_Singleton = lucInputFormat_Register_New();
+	
+	Stg_ComponentRegister_Add( componentRegister, lucCamera_Type,     "0", _lucCamera_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucColourMap_Type,  "0", _lucColourMap_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucViewport_Type,   "0", _lucViewport_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucWindow_Type,     "0", _lucWindow_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucLight_Type,     "0", _lucLight_DefaultNew );
+
+	/* Register Parents for type checking */
+	RegisterParent( lucCamera_Type,            Stg_Component_Type );
+	RegisterParent( lucColourMap_Type,         Stg_Component_Type );
+	RegisterParent( lucDrawingObject_Type,     Stg_Component_Type );
+	RegisterParent( lucViewport_Type,          Stg_Component_Type );
+	RegisterParent( lucOutputFormat_Type,      Stg_Component_Type );
+	RegisterParent( lucInputFormat_Type,       Stg_Component_Type );
+	RegisterParent( lucWindow_Type,            Stg_Component_Type );
+	RegisterParent( lucRenderingEngine_Type,   Stg_Component_Type );
+	RegisterParent( lucWindowInteraction_Type, Stg_Component_Type );
+	RegisterParent( lucLight_Type,             Stg_Component_Type );
+
+	
+	
+	RegisterParent( lucDrawingObject_Register_Type, NamedObject_Register_Type );
+	RegisterParent( lucOutputFormat_Register_Type,  NamedObject_Register_Type );
+	RegisterParent( lucWindowInteraction_Register_Type,  NamedObject_Register_Type );
+	RegisterParent( lucLight_Register_Type,  NamedObject_Register_Type );
+
+	/* Create MPI Datatypes */
+	lucCamera_Create_MPI_Datatype();
+	lucViewport_Create_MPI_Datatype();
+	lucViewportInfo_Create_MPI_Datatype();
+	lucWindow_Create_MPI_Datatype();
+
+	return True;
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Init.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,103 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Init.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Initialises this library ready for use.
+**
+** Assumptions:
+**	The Init() function will be run before any other function in the library.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucUtils_Init_h__
+#define __lucUtils_Init_h__
+
+	extern Stream* lucInfo;
+	extern Stream* lucDebug;
+	extern Stream* lucError;
+
+	extern lucInputFormat_Register* lucInputFormat_Register_Singleton;
+	
+	Bool lucBase_Init() ;
+
+	#define lucDebug_PrintFunctionBegin( classPtr, level ) \
+		do { \
+			Journal_DPrintfL( lucDebug, level, "In func: '%s' for %s '%s'.\n", __func__, classPtr->type, classPtr->name ); \
+			Stream_Indent( lucDebug ); \
+		} while(0) 
+
+	#define lucDebug_PrintFunctionEnd( classPtr, level ) \
+		do { \
+			Stream_UnIndent( lucDebug ); \
+			Journal_DPrintfL( lucDebug, level, "Leaving: '%s' for %s '%s'.\n", __func__, classPtr->type, classPtr->name );\
+		} while (0)
+
+	
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/InputFormat.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/InputFormat.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,166 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "InputFormat.h"
+#include "ColourMap.h"
+#include "Window.h"
+#include "DrawingObject_Register.h"
+#include "DrawingObject.h"
+#include "Camera.h"
+#include "Init.h"
+#include "Window.h"
+
+#include <assert.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+const Type lucInputFormat_Type = "lucInputFormat";
+
+lucInputFormat* _lucInputFormat_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucInputFormat_InputFunction*                      _input,
+		Name                                               name )
+{
+	lucInputFormat*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucInputFormat) );
+	self = (lucInputFormat*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	self->_input = _input;
+
+	return self;
+}
+
+
+void _lucInputFormat_Init( 
+		lucInputFormat*                                   self, 
+		Name                                               imageName)
+{
+	self->imageName     = StG_Strdup( imageName );
+}
+
+void lucInputFormat_InitAll( 
+		void*                                              inputFormat,
+		Name                                               imageName )
+{
+	lucInputFormat* self        = inputFormat;
+
+	_lucInputFormat_Init( self, imageName );
+}
+
+	
+void _lucInputFormat_Delete( void* inputFormat ) {
+	lucInputFormat* self        = inputFormat;
+
+	Memory_Free( self->imageName );
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucInputFormat_Print( void* inputFormat, Stream* stream ) {
+	lucInputFormat*          self        = inputFormat;
+	
+	Journal_Printf( stream, "lucInputFormat: %s\n", self->name );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintString( stream, self->imageName );
+}
+
+void* _lucInputFormat_Copy( void* inputFormat, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucInputFormat* self        = inputFormat;
+	lucInputFormat* newInputFormat;
+
+	newInputFormat = (lucInputFormat*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return (void*) newInputFormat;
+}
+
+void _lucInputFormat_Construct( void* inputFormat, Stg_ComponentFactory* cf, void* data ) {}
+void _lucInputFormat_Build( void* inputFormat, void* data ) { }
+void _lucInputFormat_Initialise( void* inputFormat, void* data ) { }
+void _lucInputFormat_Execute( void* inputFormat, void* data ) { }
+void _lucInputFormat_Destroy( void* inputFormat, void* data ) { }
+
+
+lucPixel* lucInputFormat_Input( void* inputFormat, Name imageName, Pixel_Index *imageWidth, Pixel_Index* imageHeight  ) {
+	lucInputFormat*        self               = (lucInputFormat*) inputFormat; 
+	lucPixel* pixelData = self->_input(self, imageName, imageWidth, imageHeight );
+
+	return pixelData;
+}
+
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/InputFormat.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/InputFormat.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucInputFormat_h__
+#define __lucInputFormat_h__
+
+	extern const Type lucInputFormat_Type;
+
+	typedef lucPixel* (lucInputFormat_InputFunction) (void* inputFormat,  Name imageName, Pixel_Index* width, Pixel_Index* height);
+
+	#define __lucInputFormat                                         \
+		__Stg_Component                                           \
+		/* Virtual Functions */ \
+		lucInputFormat_InputFunction*                    _input;   \
+		/* Other Info */   \
+		Name                                             imageName;\
+		
+		
+
+	struct lucInputFormat {__lucInputFormat};
+
+	lucInputFormat* _lucInputFormat_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucInputFormat_InputFunction*                      _input,
+		Name                                               name );
+
+	void lucInputFormat_InitAll( 
+		void*                                              inputFormat,
+		Name                                               extension );
+
+	void _lucInputFormat_Delete( void* inputFormat ) ;
+	void _lucInputFormat_Print( void* inputFormat, Stream* stream ) ;
+	void* _lucInputFormat_Copy( void* inputFormat, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+	void* _lucInputFormat_DefaultNew( Name name ) ;
+void _lucInputFormat_Construct( void* inputFormat, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucInputFormat_Build( void* inputFormat, void* data );
+	void _lucInputFormat_Initialise( void* inputFormat, void* data );
+	void _lucInputFormat_Execute( void* inputFormat, void* data );
+	void _lucInputFormat_Destroy( void* inputFormat, void* data );
+
+	/* +++ Public Functions +++ */
+	lucPixel* lucInputFormat_Input(  void* inputFormat, Name imageName, Pixel_Index* imageWidth, Pixel_Index* imageHeight ) ;
+
+	FILE* lucInputFormat_OpenFile( void* inputFormat, lucWindow* window, void* _context, const char *mode ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/InputFormat.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/InputFormat.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucInputFormat</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">An abstract class to setup an interface to read in images to be used in lucDrawingObjects.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/InputFormat_Register.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/InputFormat_Register.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,146 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "types.h"
+#include "InputFormat_Register.h"
+#include "Init.h"
+
+#include <string.h>
+#include <assert.h>
+
+const Type lucInputFormat_Register_Type = "lucInputFormat_Register";
+
+lucInputFormat_Register* lucInputFormat_Register_New() {
+	lucInputFormat_Register* self;
+
+	self = _lucInputFormat_Register_New(
+			sizeof( lucInputFormat_Register ),
+			lucInputFormat_Register_Type,
+			_lucInputFormat_Register_Delete,
+			_lucInputFormat_Register_Print,
+			_lucInputFormat_Register_Copy );
+
+	lucInputFormat_Register_InitAll( self );
+
+	return self;
+}
+
+lucInputFormat_Register* _lucInputFormat_Register_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy )
+{
+	lucInputFormat_Register*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucInputFormat_Register) );
+	self = (lucInputFormat_Register*) _Stg_ComponentRegister_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy );
+	
+	return self;
+}
+
+void _lucInputFormat_Register_Init( void* inputFormat_Register ) {
+}
+
+void lucInputFormat_Register_InitAll( 
+		void*                                              inputFormat_Register ) 
+{
+	lucInputFormat_Register* self        = inputFormat_Register;
+
+	Stg_ComponentRegister_Init( ( Stg_ComponentRegister*)self );	
+	_lucInputFormat_Register_Init( self );
+}
+
+void _lucInputFormat_Register_Delete( void* inputFormat_Register ) {
+	lucInputFormat_Register* self        = inputFormat_Register;
+	
+	_Stg_ComponentRegister_Delete( self );
+}
+
+void _lucInputFormat_Register_Print( void* inputFormat_Register, Stream* stream ) {
+	lucInputFormat_Register* self        = (lucInputFormat_Register*) inputFormat_Register;
+	
+	_Stg_ComponentRegister_Print( self, stream );
+}
+
+void* _lucInputFormat_Register_Copy( void* inputFormat_Register, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucInputFormat_Register* self        = inputFormat_Register;
+	lucInputFormat_Register* newInputFormat_Register;
+
+	newInputFormat_Register = (lucInputFormat_Register*) _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return (void*) newInputFormat_Register;
+}
+
+/* This goes through each input format and finds the which one works with the extension for the filename passed in */
+lucInputFormat* lucInputFormat_Register_CreateFromFileName( void* inputFormat_Register, Name imageName ) {
+	lucInputFormat_Register*                  self        = (lucInputFormat_Register*) inputFormat_Register;
+	Stg_Component_DefaultConstructorFunction* defaultNewFunctionPtr;
+	Name                                      extension;
+	Stream* errorStream = Journal_Register( Error_Type, lucInputFormat_Register_Type );
+
+	Journal_Firewall( imageName != NULL, errorStream, "In func '%s for %s Image file name %s cannot be found \n", 
+			__func__, self->type, imageName );
+
+	/* Find extension of image name */ 
+	extension = strrchr( imageName, '.' );
+	Journal_Firewall( extension != (char*) 1, errorStream, 
+			"In func %s for %s - Cannot find extension for filename '%s'.\n", 
+			__func__, self->type, imageName );
+
+	defaultNewFunctionPtr = Stg_ComponentRegister_AssertGet( (Stg_ComponentRegister*)self, extension, "0" );
+
+	return (lucInputFormat*) defaultNewFunctionPtr( imageName );
+}
+	
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/InputFormat_Register.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/InputFormat_Register.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,84 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+
+#ifndef __lucInputFormat_Register_h__
+#define __lucInputFormat_Register_h__
+
+	extern const Type lucInputFormat_Register_Type;
+
+	#define __lucInputFormat_Register                                  \
+		__Stg_ComponentRegister                                 \
+
+	struct lucInputFormat_Register {__lucInputFormat_Register};
+
+	/** Constructors */
+	lucInputFormat_Register* lucInputFormat_Register_New(  );
+
+	lucInputFormat_Register* _lucInputFormat_Register_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy );
+
+	void lucInputFormat_Register_InitAll(  ) ;
+	
+	/** Virtual Functions */
+	void _lucInputFormat_Register_Delete( void* inputFormat_Register ) ;
+	void _lucInputFormat_Register_Print( void* inputFormat_Register, Stream* stream ) ;
+	void* _lucInputFormat_Register_Copy( void* inputFormat_Register, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+	#define lucInputFormat_Register_Copy( self ) \
+		(lucInputFormat_Register*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+
+	#define lucInputFormat_Register_Add( self, extension, componentType, version, func ) \
+		Stg_ComponentRegister_AddFunc( (Stg_ComponentRegister*)(self), (extension), (version), (func), NULL ); \
+		Stg_ComponentRegister_Add( (Stg_ComponentRegister*)(self), componentType, (version), (func) );
+
+	/* This goes through each input format and finds the which one works with the extension for the filename passed in */
+	lucInputFormat* lucInputFormat_Register_CreateFromFileName( void* inputFormat_Register, Name filename );
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Light.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Light.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,357 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Light.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "types.h"
+#include "Light.h"
+#include "ViewportInfo.h"
+#include "Init.h"
+
+#include <string.h>
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+
+const Type lucLight_Type = "lucLight";
+
+/* The position defaults have been chosen for a directional light source (hence posW=0)
+   shining onto the left,top,front corner of a 1x1x1 box, currently the most commonly
+   used geometry. -- PatrickSunter, 8 Jun 2006 */
+const double LUC_LIGHT_DEFAULT_POS_X = 1.0;
+const double LUC_LIGHT_DEFAULT_POS_Y = -2.0;
+const double LUC_LIGHT_DEFAULT_POS_Z = -2.0;
+const double LUC_LIGHT_DEFAULT_POS_W = 0.0;
+
+lucLight* lucLight_New( 
+		Name                                               name,
+		Light_Index 				index,
+		int                                   model,
+		int                                   material,
+		float                                 position[4],
+		float                                 lmodel_ambient[4],
+		float                                 spotCutOff,
+		float                                 spotDirection[3]
+)
+{
+	lucLight* self = (lucLight*) _lucLight_DefaultNew( name );
+
+	lucLight_InitAll( self, index, model, material, position, lmodel_ambient, spotCutOff, spotDirection);
+
+	return self;
+}
+
+lucLight* _lucLight_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name )
+{
+	lucLight*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucLight) );
+	self = (lucLight*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+	
+	
+	return self;
+}
+
+void lucLight_Init(		
+		lucLight*                                         self,
+		Light_Index index,
+		int model,
+		int material,
+		float position[4],
+		float lmodel_ambient[4],
+		float spotCutOff,
+		float spotDirection[3])
+{
+	self->index= index;
+	self->model         = model;
+	self->material          = material;
+	self->position[0] = position[0];
+	self->position[1] = position[1];
+	self->position[2] = position[2];
+	self->position[3] = position[3];
+	self->lmodel_ambient[0] = lmodel_ambient[0];
+	self->lmodel_ambient[1] = lmodel_ambient[1];
+	self->lmodel_ambient[2] = lmodel_ambient[2];
+	self->lmodel_ambient[3] = lmodel_ambient[3];
+	self->spotCutOff = spotCutOff;
+	self->spotDirection[0] = spotDirection[0];
+	self->spotDirection[1] = spotDirection[1];
+	self->spotDirection[2] = spotDirection[2];
+	
+
+	
+}
+
+void lucLight_InitAll( 
+		void*                         light,
+		Light_Index                   index,
+		int                           model,
+		int                           material,
+		float                         position[4],
+		float                         lmodel_ambient[4],
+		float                         spotCutOff,
+		float                         spotDirection[3])
+{
+	
+	lucLight* self        = light;
+
+	/* TODO Init parent */
+	lucLight_Init( self, index, model, material, position, lmodel_ambient, spotCutOff, spotDirection);
+}
+
+void _lucLight_Delete( void* light ) {
+	lucLight* self        = light;
+	
+	/*if ( self->originalLight != NULL );
+		Stg_Class_Delete( self->originalLight );*/
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucLight_Print( void* light, Stream* stream ) {
+	lucLight* self        = light;
+	
+	Journal_Printf( stream, "lucLight: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Stream_UnIndent( stream );
+}
+
+void* _lucLight_Copy( void* light, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucLight* self        = light;
+	lucLight* newLight;
+
+	newLight = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newLight->index    = self->index;
+	newLight->model    = self->model;
+	newLight->material =  self->material;	
+	
+
+	/*TODO*/
+       	newLight->position[0] = self->position[0];
+	newLight->position[1] =self-> position[1];
+	newLight->position[2] = self->position[2];
+	newLight->position[3] = self->position[3];
+	newLight->lmodel_ambient[0] = self->lmodel_ambient[0];
+	newLight->lmodel_ambient[1] = self->lmodel_ambient[1];
+	newLight->lmodel_ambient[2] = self->lmodel_ambient[2];
+	newLight->lmodel_ambient[3] = self->lmodel_ambient[3];
+	newLight->spotCutOff = self->spotCutOff;
+	newLight->spotDirection[0] = self->spotDirection[0];
+	newLight->spotDirection[1] = self->spotDirection[1];
+	newLight->spotDirection[2] = self->spotDirection[2];
+
+	
+	return (void*) newLight;
+}
+
+void* _lucLight_DefaultNew( Name name ) {
+	return _lucLight_New( 
+			sizeof( lucLight ),
+			lucLight_Type,
+			_lucLight_Delete,
+			_lucLight_Print,
+			_lucLight_Copy,
+			_lucLight_DefaultNew,
+			_lucLight_Construct,
+			_lucLight_Build,
+			_lucLight_Initialise,
+			_lucLight_Execute,
+			_lucLight_Destroy,
+			name );
+}
+
+void _lucLight_Construct( void* light, Stg_ComponentFactory* cf, void* data ) {
+	lucLight*             	self               = (lucLight*) light;
+	Light_Index             index;
+	int 			model;
+	int 			material;
+	float 	        	position[4];
+	float                   spotCutOff;
+	float                   spotDirection[3];
+	Name                    modelName;
+	Name                    materialName;
+	float                   lmodel_ambient[4]; 
+	
+	glEnable(GL_LIGHTING);
+
+	/* Spot values */
+	spotCutOff = Stg_ComponentFactory_GetDouble( cf, self->name, "spotCutOff", 180.0 );
+	spotDirection[1] = Stg_ComponentFactory_GetDouble( cf, self->name, "spotDirectionX", 0.0 );
+	spotDirection[2] = Stg_ComponentFactory_GetDouble( cf, self->name, "spotDirectionY", 0.0 );
+	spotDirection[3] = Stg_ComponentFactory_GetDouble( cf, self->name, "spotDirectionZ", -1.0 );
+
+        
+	/* Ambient values*/
+	lmodel_ambient[0] = Stg_ComponentFactory_GetDouble( cf, self->name, "ambX", 0.2 );
+	lmodel_ambient[1] = Stg_ComponentFactory_GetDouble( cf, self->name, "ambY", 0.2 );
+	lmodel_ambient[2] = Stg_ComponentFactory_GetDouble( cf, self->name, "ambZ", 0.2 );
+	lmodel_ambient[3] = Stg_ComponentFactory_GetDouble( cf, self->name, "ambW", 1.0 );
+
+
+	modelName = Stg_ComponentFactory_GetString( cf, self->name, "model", "TwoSide" );
+	if ( strcasecmp( modelName, "Ambient" ) == 0 ) {
+		model = GL_LIGHT_MODEL_AMBIENT;
+		glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+	}
+	else if ( strcasecmp( modelName, "Local" ) == 0 ) {
+		model = GL_LIGHT_MODEL_LOCAL_VIEWER;
+		glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
+	}
+	else if ( strcasecmp( modelName, "TwoSide" ) == 0 ){
+		model =  GL_LIGHT_MODEL_TWO_SIDE;
+		glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);	
+	}
+
+	position[0]  = Stg_ComponentFactory_GetDouble( cf, self->name, "posX", LUC_LIGHT_DEFAULT_POS_X );
+	position[1]  = Stg_ComponentFactory_GetDouble( cf, self->name, "posY", LUC_LIGHT_DEFAULT_POS_Y );
+	position[2]  = Stg_ComponentFactory_GetDouble( cf, self->name, "posZ", LUC_LIGHT_DEFAULT_POS_Z );
+        position[3]  = Stg_ComponentFactory_GetDouble( cf, self->name, "posW", LUC_LIGHT_DEFAULT_POS_W );
+
+	/*HACK - Got to retrieve */
+	materialName = Stg_ComponentFactory_GetString( cf, self->name, "material", "lucMono" );
+
+
+	lucLight_Init( self, index, model, material, position, lmodel_ambient, spotCutOff, spotDirection);
+	
+}
+
+void _lucLight_Build( void* light, void* data ) { }
+void _lucLight_Initialise( void* light, void* data ) { }
+void _lucLight_Execute( void* light, void* data ) { }
+void _lucLight_Destroy( void* light, void* data ) { }
+
+
+
+void lucLight_Pickle( void* light, Stream* stream ) {
+	lucLight* self                = light;
+	       
+	Journal_Printf( stream, "<struct name=\"%s\">\n", self->name);
+	Stream_Indent( stream );
+
+	Journal_Printf( stream, "<param name=\"Type\">%s</param>\n", self->type );
+	Journal_Printf( stream, "<param name=\"posX\">%.5g</param>\n", self->position[ 0 ] );
+	Journal_Printf( stream, "<param name=\"posY\">%.5g</param>\n", self->position[ 1 ] );
+	Journal_Printf( stream, "<param name=\"posZ\">%.5g</param>\n", self->position[ 2 ] );	
+	Journal_Printf( stream, "<param name=\"posZ\">%.5g</param>\n", self->position[ 3 ] );
+
+	Journal_Printf( stream, "<param name=\"ambX\">%.5g</param>\n", self->lmodel_ambient[ 0 ] );
+	Journal_Printf( stream, "<param name=\"ambY\">%.5g</param>\n", self->lmodel_ambient[ 1 ]  );
+	Journal_Printf( stream, "<param name=\"ambZ\">%.5g</param>\n", self->lmodel_ambient[ 2 ]  );
+	Journal_Printf( stream, "<param name=\"ambZ\">%.5g</param>\n", self->lmodel_ambient[ 3 ]  );
+
+	Journal_Printf( stream, "<param name=\"model\">%s</param>\n", 
+			self->model == GL_LIGHT_MODEL_LOCAL_VIEWER ? "Local" :
+			self->model == GL_LIGHT_MODEL_AMBIENT ? "Ambient" : 
+	                self->model == GL_LIGHT_MODEL_TWO_SIDE ? "TwoSide" : "" );
+
+	Journal_Printf( stream, "<param name=\"spotCutOff\">%.5g</param>\n", self->spotCutOff );
+	Journal_Printf( stream, "<param name=\"spotDirectionX\">%.5g</param>\n", self->spotDirection[ 0 ]  );
+	Journal_Printf( stream, "<param name=\"spotDirectionY\">%.5g</param>\n", self->spotDirection[ 1 ]  );
+	Journal_Printf( stream, "<param name=\"spotDirectionZ\">%.5g</param>\n", self->spotDirection[ 2 ]  );
+
+
+
+       	Stream_UnIndent( stream );
+	Journal_Printf( stream, "</struct>\n");
+}
+
+/* functions to change the lights paramters */
+void lucLight_Position( void * light, int lightIndex, float posX, float posY, float posZ, float posW) {
+	lucLight*             	self               = (lucLight*) light;
+	Light_Index             index              = (Light_Index) lightIndex;
+
+	/* Sets the potiotion of the light index = index */	
+	glEnable(GL_LIGHTING);
+        
+	self->position[0]  += posX;
+	self->position[1]  += posY;
+	self->position[2]  += posZ;
+        self->position[3]  += posW;
+
+	glLightfv(GL_LIGHT0 + lightIndex, GL_POSITION, self->position);
+
+	self->needsToDraw = True;
+	
+}
+void lucLight_Material( int material) {
+	
+	
+}
+void lucLight_SetNeedsToDraw( void * light ){
+	lucLight* self = (lucLight*) light;
+	self->needsToDraw = True;
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Light.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Light.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,126 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Light.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucLight_h__
+#define __lucLight_h__
+
+	extern const Type lucLight_Type;
+
+	extern const double LUC_LIGHT_DEFAULT_POS_X;
+	extern const double LUC_LIGHT_DEFAULT_POS_Y;
+	extern const double LUC_LIGHT_DEFAULT_POS_Z;
+	extern const double LUC_LIGHT_DEFAULT_POS_W;
+
+	#define __lucLight                                  \
+		__Stg_Component                                 \
+		Light_Index 		         index;\
+		int                              model; \
+		int                              material;\
+		float	                         position[4];\
+		float                            lmodel_ambient[4];\
+		float                            spotCutOff;\
+		float                            spotDirection[3];\
+		Bool                             needsToDraw;          \
+
+		
+	struct lucLight {__lucLight};
+
+	/** Constructors */
+	lucLight* lucLight_New( 
+		Name                                               name,
+		Light_Index            				   index,
+		int                                                model,
+		int                                                material,
+		float						   position[4],
+		float                                              lmodel_ambient[4],
+		float                                              spotCutOff,
+		float                                              spotDirection[3]
+	 );
+
+	lucLight* _lucLight_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name );
+
+	void lucLight_InitAll( 
+		void*                                              light,
+		Light_Index                                        index,
+		int                                              model,
+		int                                              material,
+		float                                            position[4],
+		float                                            lmodel_ambient[4],
+		float                                            spotCutOff,
+		float                                            spotDirection[3]
+	 );
+	
+	/** Virtual Functions */
+	void _lucLight_Delete( void* light ) ;
+	void _lucLight_Print( void* light, Stream* stream ) ;
+	void* _lucLight_Copy( void* light, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+	#define lucLight_Copy( self ) \
+		(lucLight*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	void* _lucLight_DefaultNew( Name name ) ;
+void _lucLight_Construct( void* light, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucLight_Build( void* light, void* data );
+	void _lucLight_Initialise( void* light, void* data );
+	void _lucLight_Execute( void* light, void* data );
+	void _lucLight_Destroy( void* light, void* data );
+
+	/** Public Functions */
+void lucLight_Position( void * light, int index, float posX, float posY, float posZ, float posW);
+void lucLight_Material( int material);
+
+
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Light.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Light.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucLight</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">ambX</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.2</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">ambY</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.2</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">ambZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.2</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">ambW</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">model</param>
+		<param name="Type">String</param>
+		<param name="Default">"TwoSide"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">posX</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">posY</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">posZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">posW</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">material</param>
+		<param name="Type">String</param>
+		<param name="Default">"lucMono"</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Light_Register.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Light_Register.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,113 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+
+#include "Light_Register.h"
+#include "Light.h"
+#include <gl.h>
+#include <glu.h>
+
+const Type lucLight_Register_Type = "lucLight_Register";
+
+lucLight_Register*	lucLight_Register_New( void ) {
+	lucLight_Register* self;
+	
+	self = (lucLight_Register*) _NamedObject_Register_New(
+		sizeof(lucLight_Register),
+		lucLight_Register_Type,
+		_NamedObject_Register_Delete,
+		_NamedObject_Register_Print,
+		_NamedObject_Register_Copy );
+	self->currentLightIndex = 0;
+
+	return self;
+}
+
+void    lucLight_Register_EnableAll( void * lightRegister ) {
+	lucLight_Register* self = (lucLight_Register*) lightRegister;
+	
+	lucLight* light;
+	Light_Index lightCount = 0;
+	Light_Index light_I = 0;
+	
+	/* Enabling the lights */
+	glEnable(GL_LIGHTING);
+	lightCount = lucLight_Register_GetCount( self );
+	
+	for (light_I = 0; light_I < lightCount; light_I++){
+            light = lucLight_Register_GetByIndex(self, light_I);	    
+	    glLightfv(GL_LIGHT0 + light_I, GL_POSITION, light->position);
+	    glLightf(GL_LIGHT0 + light_I, GL_SPOT_CUTOFF, light->spotCutOff);
+	    glLightfv(GL_LIGHT0 + light_I, GL_SPOT_DIRECTION, light->spotDirection);	
+
+            glEnable(GL_LIGHT0 + light_I);	    
+	}
+	
+	if(lightCount == 0) 	/* No light is listed in the xml file, but we still need to enable the default light */
+	   glEnable(GL_LIGHT0);
+
+}
+
+Light_Index   lucLight_Register_GetCurrentLightIndex( void * lightRegister ) {
+	lucLight_Register* self = (lucLight_Register*) lightRegister;
+	return self->currentLightIndex;
+}
+
+void lucLight_Register_SetCurrentLightIndex( void * lightRegister, Light_Index index ) {
+	lucLight_Register* self = (lucLight_Register*) lightRegister;
+	self->currentLightIndex = index;
+}
+void lucLight_Register_ChangeCurrentLightIndex( void * lightRegister ) {
+	lucLight_Register* self = (lucLight_Register*) lightRegister;
+	Light_Index lightCount   = lucLight_Register_GetCount( self );
+	self->currentLightIndex ++;
+	if (self->currentLightIndex == lightCount)  self->currentLightIndex = 0;
+
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Light_Register.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Light_Register.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,134 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Allows users to access lucLights based on their textual name,
+**	or index.
+**
+** Assumptions:
+**
+** Comments:
+**
+**
+** $Id: Light_Register.h 419 2005-11-29 12:04:20Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucLight_Register_h__
+#define __lucLight_Register_h__
+	
+	extern const Type lucLight_Register_Type;
+	
+	#define __lucLight_Register \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__NamedObject_Register \
+		\
+		/* Virtual functions go here */ \
+		\
+		/* Class info */ \
+		Light_Index currentLightIndex;
+
+	struct lucLight_Register { __lucLight_Register };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructor
+	*/
+	
+	lucLight_Register*	lucLight_Register_New( void );
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** General virtual functions
+	*/
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	#define lucLight_Register_Add NamedObject_Register_Add
+
+	#define lucLight_Register_GetIndex NamedObject_Register_GetIndex 
+
+	#define lucLight_Register_GetByName( self, materialName ) \
+		( (lucLight*) NamedObject_Register_GetByName( self, materialName ) ) 
+
+	#define lucLight_Register_GetByIndex( self, materialIndex ) \
+		( (lucLight*) NamedObject_Register_GetByIndex( self, materialIndex ) )
+
+	#define lucLight_Register_GetCount( self ) \
+		(self)->objects->count
+	
+	#define lucLight_Register_DeleteAllObjects( self ) \
+		Stg_ObjectList_DeleteAllObjects( (self)->objects )
+	#define lucLight_Register_PrintAllObjects( self, stream ) \
+		Stg_ObjectList_PrintAllObjects( (self)->objects, stream )
+
+	/* +++ Public Functions +++ */
+        void  lucLight_Register_EnableAll( void * lightRegister );
+	Light_Index   lucLight_Register_GetCurrentLightIndex( void * lightRegister );
+	void lucLight_Register_SetCurrentLightIndex( void * lightRegister, Light_Index index );
+	void lucLight_Register_ChangeCurrentLightIndex( void * lightRegister );
+
+
+        
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Light_Register.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Light_Register.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucLight_Register</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">NamedObject_Register</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/OutputFormat.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/OutputFormat.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,226 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: OutputFormat.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "OutputFormat.h"
+#include "ColourMap.h"
+#include "Window.h"
+#include "DrawingObject_Register.h"
+#include "DrawingObject.h"
+#include "Camera.h"
+#include "Init.h"
+#include "Window.h"
+
+#include <assert.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+const Type lucOutputFormat_Type = "lucOutputFormat";
+
+lucOutputFormat* _lucOutputFormat_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucOutputFormat_OutputFunction*                    _output,
+		Name                                               name )
+{
+	lucOutputFormat*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucOutputFormat) );
+	self = (lucOutputFormat*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	self->_output = _output;
+
+	return self;
+}
+
+void _lucOutputFormat_Init( 
+		lucOutputFormat*                                   self, 
+		Name                                               extension )
+{
+	self->extension     = StG_Strdup( extension );
+}
+
+void lucOutputFormat_InitAll( 
+		void*                                              outputFormat,
+		Name                                               extension )
+{
+	lucOutputFormat* self        = outputFormat;
+
+	_lucOutputFormat_Init( self, extension );
+}
+
+	
+void _lucOutputFormat_Delete( void* outputFormat ) {
+	lucOutputFormat* self        = outputFormat;
+
+	Memory_Free( self->extension );
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucOutputFormat_Print( void* outputFormat, Stream* stream ) {
+	lucOutputFormat*          self        = outputFormat;
+	
+	Journal_Printf( stream, "lucOutputFormat: %s\n", self->name );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintString( stream, self->extension );
+}
+
+void* _lucOutputFormat_Copy( void* outputFormat, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucOutputFormat* self        = outputFormat;
+	lucOutputFormat* newOutputFormat;
+
+	newOutputFormat = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newOutputFormat->extension = StG_Strdup( self->extension );
+
+	return (void*) newOutputFormat;
+}
+
+void _lucOutputFormat_Construct( void* outputFormat, Stg_ComponentFactory* cf, void* data ) {}
+void _lucOutputFormat_Build( void* outputFormat, void* data ) { }
+void _lucOutputFormat_Initialise( void* outputFormat, void* data ) { }
+void _lucOutputFormat_Execute( void* outputFormat, void* data ) { }
+void _lucOutputFormat_Destroy( void* outputFormat, void* data ) { }
+
+
+void lucOutputFormat_Output( void* outputFormat, lucWindow* window, AbstractContext* context, lucPixel* pixelData ) {
+	lucOutputFormat*        self               = (lucOutputFormat*) outputFormat;
+
+	if ( context->rank != MASTER )
+		return;
+
+	self->_output( self, window, context, pixelData );
+}
+
+
+Name lucOutputFormat_GetImageFilename( void* outputFormat, lucWindow* window, void* _context ) {
+	lucOutputFormat* self       = (lucOutputFormat*) outputFormat;
+	AbstractContext* context    = (AbstractContext*) _context;
+	Stream*          infoStream = Journal_MyStream( Info_Type, self );
+	Name             filename;
+
+	if ( lucWindow_HasStereoCamera( window ) ) 
+		Stg_asprintf( &filename, "%s/%s.%05d.%s.%s", 
+				context->outputPath, 
+				window->name, 
+				context->timeStep, 
+				window->currStereoBuffer == lucLeft ? "left" : "right", 
+				self->extension );
+	else 
+		Stg_asprintf( &filename, "%s/%s.%05d.%s", context->outputPath, window->name, context->timeStep, self->extension );
+	
+	Journal_Printf( infoStream, "Creating %s file: %s\n", self->extension, filename );
+
+	return filename;
+}
+
+FILE* lucOutputFormat_OpenFile( void* outputFormat, lucWindow* window, void* _context, const char *mode ) {
+	lucOutputFormat* self       = (lucOutputFormat*) outputFormat;
+	AbstractContext* context    = (AbstractContext*) _context;
+	Stream*          error      = Journal_MyStream( Error_Type, self );
+	Name             filename;
+	FILE*            file;
+
+	filename = lucOutputFormat_GetImageFilename( self, window, context );
+	file = fopen( filename, mode );
+
+	Journal_Firewall( file != NULL, error, "In func %s: Cannot open file %s.\n", __func__, filename );
+
+	Memory_Free( filename );
+	return file;
+}
+
+Stream* lucOutputFormat_OpenStream( void* outputFormat, lucWindow* window, void* context ) {
+	lucOutputFormat* self       = (lucOutputFormat*) outputFormat;
+	Stream*          stream     = Journal_MyStream( Dump_Type, self );
+	Stream*          error      = Journal_MyStream( Error_Type, self );
+	Name             filename;
+	Bool             result;
+
+	filename = lucOutputFormat_GetImageFilename( self, window, context );
+	result = Stream_RedirectFile( stream, filename );
+
+	Journal_Firewall( result, error, "In func %s: Cannot open file %s.\n", __func__, filename );
+
+	Memory_Free( filename );
+	
+	/* Setup stream */
+	Stream_Enable( stream, True );
+	Stream_SetAutoFlush( stream, True );
+
+	return stream;
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/OutputFormat.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/OutputFormat.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: OutputFormat.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucOutputFormat_h__
+#define __lucOutputFormat_h__
+
+	extern const Type lucOutputFormat_Type;
+
+	typedef void (lucOutputFormat_OutputFunction) ( void* outputFormat, lucWindow* window, AbstractContext* context, lucPixel* pixelData );
+
+	#define __lucOutputFormat                                         \
+		__Stg_Component                                           \
+		/* Virtual Functions */ \
+		lucOutputFormat_OutputFunction*                    _output;                  \
+		/* Other Info */   \
+		Name                                               extension;
+
+	struct lucOutputFormat {__lucOutputFormat};
+
+	lucOutputFormat* _lucOutputFormat_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucOutputFormat_OutputFunction*                    _output,
+		Name                                               name );
+
+	void lucOutputFormat_InitAll( 
+		void*                                              outputFormat,
+		Name                                               extension );
+
+	void _lucOutputFormat_Delete( void* outputFormat ) ;
+	void _lucOutputFormat_Print( void* outputFormat, Stream* stream ) ;
+	void* _lucOutputFormat_Copy( void* outputFormat, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+	void* _lucOutputFormat_DefaultNew( Name name ) ;
+void _lucOutputFormat_Construct( void* outputFormat, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucOutputFormat_Build( void* outputFormat, void* data );
+	void _lucOutputFormat_Initialise( void* outputFormat, void* data );
+	void _lucOutputFormat_Execute( void* outputFormat, void* data );
+	void _lucOutputFormat_Destroy( void* outputFormat, void* data );
+
+	/* +++ Public Functions +++ */
+	void lucOutputFormat_Output( void* outputFormat, lucWindow* window, AbstractContext* context, lucPixel* pixelData ) ;
+
+	Name lucOutputFormat_GetImageFilename( void* outputFormat, lucWindow* window, void* _context ) ;
+	FILE* lucOutputFormat_OpenFile( void* outputFormat, lucWindow* window, void* _context, const char *mode ) ;
+	Stream* lucOutputFormat_OpenStream( void* outputFormat, lucWindow* window, void* context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/OutputFormat.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/OutputFormat.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucOutputFormat</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">An abstract class to setup an interface to output lucWindows in different formats.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/OutputFormat_Register.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/OutputFormat_Register.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,81 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: OutputFormat_Register.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "OutputFormat_Register.h"
+#include "OutputFormat.h"
+
+const Type lucOutputFormat_Register_Type = "lucOutputFormat_Register";
+
+lucOutputFormat_Register*	lucOutputFormat_Register_New( void ) {
+	lucOutputFormat_Register* self;
+	
+	self = (lucOutputFormat_Register*) _NamedObject_Register_New(
+		sizeof(lucOutputFormat_Register),
+		lucOutputFormat_Register_Type,
+		_NamedObject_Register_Delete,
+		_NamedObject_Register_Print,
+		_NamedObject_Register_Copy );
+
+	return self;
+}
+
+void lucOutputFormat_Register_OutputAll( void* outputFormat_Register, lucWindow* window, AbstractContext* context, lucPixel* pixelData ) {
+	lucOutputFormat_Register* self          = (lucOutputFormat_Register*) outputFormat_Register;
+	OutputFormat_Index        object_I;
+	OutputFormat_Index        objectCount   = lucOutputFormat_Register_GetCount( self );
+	lucOutputFormat*          object;
+
+	for ( object_I = 0 ; object_I < objectCount ; object_I++ ) {
+		object = lucOutputFormat_Register_GetByIndex( self, object_I );
+		lucOutputFormat_Output( object, window, context, pixelData );
+	}
+}
+
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/OutputFormat_Register.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/OutputFormat_Register.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,129 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: OutputFormat_Register.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Allows users to access lucOutputFormats based on their textual name,
+**	or index.
+**
+** Assumptions:
+**
+** Comments:
+**
+**
+** $Id: OutputFormat_Register.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucOutputFormat_Register_h__
+#define __lucOutputFormat_Register_h__
+	
+	extern const Type lucOutputFormat_Register_Type;
+	
+	#define __lucOutputFormat_Register \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__NamedObject_Register \
+		\
+		/* Virtual functions go here */ \
+		\
+		/* Class info */ \
+
+	struct lucOutputFormat_Register { __lucOutputFormat_Register };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructor
+	*/
+	
+	lucOutputFormat_Register*	lucOutputFormat_Register_New( void );
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** General virtual functions
+	*/
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	#define lucOutputFormat_Register_Add NamedObject_Register_Add
+
+	#define lucOutputFormat_Register_GetIndex NamedObject_Register_GetIndex 
+
+	#define lucOutputFormat_Register_GetByName( self, materialName ) \
+		( (lucOutputFormat*) NamedObject_Register_GetByName( self, materialName ) ) 
+
+	#define lucOutputFormat_Register_GetByIndex( self, materialIndex ) \
+		( (lucOutputFormat*) NamedObject_Register_GetByIndex( self, materialIndex ) )
+
+	#define lucOutputFormat_Register_GetCount( self ) \
+		(self)->objects->count
+	
+	#define lucOutputFormat_Register_DeleteAllObjects( self ) \
+		Stg_ObjectList_DeleteAllObjects( (self)->objects )
+	#define lucOutputFormat_Register_PrintAllObjects( self, stream ) \
+		Stg_ObjectList_PrintAllObjects( (self)->objects, stream )
+
+	/* +++ Public Functions +++ */
+	void lucOutputFormat_Register_OutputAll( void* outputFormat_Register, lucWindow* window, AbstractContext* context, lucPixel* pixelData ) ;
+
+
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/RenderingEngine.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/RenderingEngine.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,192 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: RenderingEngine.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ColourMap.h"
+#include "X11Colours.h"
+#include "Window.h"
+#include "RenderingEngine.h"
+#include "Init.h"
+
+#include <assert.h>
+
+const Type lucRenderingEngine_Type = "lucRenderingEngine";
+
+lucRenderingEngine* _lucRenderingEngine_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucRenderingEngine_RenderFunction*                 _render,
+		lucRenderingEngine_GetPixelDataFunction*           _getPixelData,
+		lucRenderingEngine_CompositeViewportFunction*      _compositeViewport,
+		Name                                               name )
+{
+	lucRenderingEngine*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucRenderingEngine) );
+	self = (lucRenderingEngine*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	self->_render            = _render;
+	self->_getPixelData      = _getPixelData;
+	self->_compositeViewport = _compositeViewport;
+	
+	return self;
+}
+
+void _lucRenderingEngine_Init( lucRenderingEngine* self ) {
+	self->isConstructed = True;
+}
+
+void lucRenderingEngine_InitAll( void* renderingEngine ) {
+	lucRenderingEngine* self        = renderingEngine;
+
+	_lucRenderingEngine_Init( self );
+}
+
+void _lucRenderingEngine_Delete( void* renderingEngine ) {
+	lucRenderingEngine* self        = renderingEngine;
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucRenderingEngine_Print( void* renderingEngine, Stream* stream ) {
+	lucRenderingEngine* self        = renderingEngine;
+	
+	Journal_Printf( stream, "lucRenderingEngine: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintPointer( stream, self->_getPixelData );
+	
+	Stream_UnIndent( stream );
+}
+
+void* _lucRenderingEngine_Copy( void* renderingEngine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucRenderingEngine* self        = renderingEngine;
+	lucRenderingEngine* newRenderingEngine;
+
+	newRenderingEngine = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return (void*) newRenderingEngine;
+}
+
+void _lucRenderingEngine_Construct( void* renderingEngine, Stg_ComponentFactory* cf, void* data ) {
+	lucRenderingEngine*        self            = (lucRenderingEngine*) renderingEngine ;
+
+	_lucRenderingEngine_Init( self );
+}
+
+void _lucRenderingEngine_Build( void* camera, void* data ) { }
+void _lucRenderingEngine_Initialise( void* camera, void* data ) { }
+void _lucRenderingEngine_Execute( void* camera, void* data ) { }
+void _lucRenderingEngine_Destroy( void* camera, void* data ) { }
+
+void lucRenderingEngine_Render( void* renderingEngine, lucWindow* window, AbstractContext* context ) {
+	lucRenderingEngine*   self       = (lucRenderingEngine*) renderingEngine ;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	self->_render( self, window, context );
+	
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucRenderingEngine_GetPixelData( void* renderingEngine, lucWindow* window, lucPixel* pixelData ) {
+	lucRenderingEngine*   self       = (lucRenderingEngine*) renderingEngine ;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	self->_getPixelData( self, window, pixelData );
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucRenderingEngine_CompositeViewport( 
+		void*                                              renderingEngine, 
+		lucViewportInfo*                                   viewportInfo, 
+		AbstractContext*                                   context, 
+		Bool                                               broadcast )
+{
+	lucRenderingEngine*   self       = (lucRenderingEngine*) renderingEngine ;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	if ( context->nproc ==1 ) {
+		Journal_DPrintfL( lucDebug, 2, "Running in serial - No need to composite.\n" );
+	}
+	else {
+		self->_compositeViewport( self, viewportInfo, context, broadcast );
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/RenderingEngine.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/RenderingEngine.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,107 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: RenderingEngine.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucRenderingEngine_h__
+#define __lucRenderingEngine_h__
+
+	extern const Type lucRenderingEngine_Type;
+
+	typedef void (lucRenderingEngine_RenderFunction) ( void* renderingEngine, lucWindow* window, AbstractContext* context);
+	typedef void (lucRenderingEngine_GetPixelDataFunction) ( void* renderingEngine, lucWindow* window, lucPixel* pixelData);
+	typedef void (lucRenderingEngine_CompositeViewportFunction) (  
+		void*                                              renderingEngine, 
+		lucViewportInfo*                                   viewportInfo, 
+		AbstractContext*                                   context, 
+		Bool                                               broadcast );
+
+
+	#define __lucRenderingEngine                           \
+		__Stg_Component                                   \
+		/* Virtual Functions */ \
+		lucRenderingEngine_RenderFunction*                 _render;                  \
+		lucRenderingEngine_GetPixelDataFunction*           _getPixelData;            \
+		lucRenderingEngine_CompositeViewportFunction*      _compositeViewport;
+
+	struct lucRenderingEngine {__lucRenderingEngine};
+
+	lucRenderingEngine* _lucRenderingEngine_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucRenderingEngine_RenderFunction*                 _render,
+		lucRenderingEngine_GetPixelDataFunction*           _getPixelData,
+		lucRenderingEngine_CompositeViewportFunction*      _compositeViewport,
+		Name                                               name );
+
+
+	void _lucRenderingEngine_Delete( void* renderingEngine ) ;
+	void _lucRenderingEngine_Print( void* renderingEngine, Stream* stream ) ;
+	void* _lucRenderingEngine_Copy( void* renderingEngine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+void _lucRenderingEngine_Construct( void* renderingEngine, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucRenderingEngine_Build( void* renderingEngine, void* data );
+	void _lucRenderingEngine_Initialise( void* renderingEngine, void* data );
+	void _lucRenderingEngine_Execute( void* renderingEngine, void* data );
+	void _lucRenderingEngine_Destroy( void* renderingEngine, void* data );
+
+	/* +++ Public Functions +++ */
+	void lucRenderingEngine_Render( void* renderingEngine, lucWindow* window, AbstractContext* context ) ;
+	void lucRenderingEngine_GetPixelData( void* renderingEngine, lucWindow* window, lucPixel* pixelData ) ;
+	void lucRenderingEngine_CompositeViewport( 
+		void*                                              renderingEngine, 
+		lucViewportInfo*                                   viewportInfo, 
+		AbstractContext*                                   context, 
+		Bool                                               broadcast );
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/RenderingEngine.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/RenderingEngine.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucRenderingEngine</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">An abstract class which sets up an interface to render lucViewports in a lucWindow, get the pixel information from the lucWindow and to composite parallel versions of lucViewport.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Viewport.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Viewport.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,391 @@
+ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Viewport.c 658 2007-02-05 00:58:07Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ColourMap.h"
+#include "Window.h"
+#include "DrawingObject_Register.h"
+#include "Light_Register.h"
+#include "Light.h"
+
+
+#include "Viewport.h"
+
+#include "DrawingObject.h"
+#include "Camera.h"
+#include "Init.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+
+
+const Type lucViewport_Type = "lucViewport";
+
+MPI_Datatype lucViewport_MPI_Datatype;
+
+lucViewport* lucViewport_New(
+		Name                                               name,
+		lucCamera*                                         camera,
+		lucDrawingObject**                                 drawingObjectList,
+		DrawingObject_Index                                drawingObjectCount,
+		lucLight**          				   lightList,
+	  	Light_Index                                        lightCount,
+		Bool                                               drawTitle,
+		Bool                                               drawTime,
+		Bool                                               compositeEachObject,
+		double                                             nearClipPlane,
+		double                                             farClipPlane )
+{
+	lucViewport* self = _lucViewport_DefaultNew( name );
+
+	lucViewport_InitAll( self, camera, drawingObjectList, drawingObjectCount, lightList, lightCount, drawTitle, drawTime, compositeEachObject, nearClipPlane, farClipPlane );
+
+	return self;
+}
+
+lucViewport* _lucViewport_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name )
+{
+	lucViewport*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucViewport) );
+	self = (lucViewport*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	return self;
+}
+
+void _lucViewport_Init( 
+		lucViewport*                                       self, 
+		lucCamera*                                         camera, 
+		lucDrawingObject**                                 drawingObjectList, 
+		DrawingObject_Index                                drawingObjectCount,
+		lucLight**          				   lightList,
+	        Light_Index                                        lightCount,
+		Bool                                               drawTitle,
+		Bool                                               drawTime,
+		Bool                                               compositeEachObject,
+		double                                             nearClipPlane,
+		double                                             farClipPlane )
+{
+	DrawingObject_Index object_I;
+	Light_Index light_I;
+	GLfloat lightPosition[4];
+	GLfloat lmodel_ambient[4] = {0.2, 0.2, 0.2, 1.0};
+	GLfloat spotCutOff = 180.0;
+	GLfloat spotDirection[3] = {0.0, 0.0, -1.0};
+	
+	lightPosition[0]= LUC_LIGHT_DEFAULT_POS_X;
+	lightPosition[1]= LUC_LIGHT_DEFAULT_POS_Y;
+	lightPosition[2]= LUC_LIGHT_DEFAULT_POS_Z;
+	lightPosition[3]= LUC_LIGHT_DEFAULT_POS_W;
+	
+	self->camera                   = camera;
+	self->drawTitle                = drawTitle;
+	self->drawTime                 = drawTime;
+	self->nearClipPlane            = nearClipPlane;
+	self->farClipPlane             = farClipPlane;
+	self->compositeEachObject      = compositeEachObject;
+
+	self->drawingObject_Register = lucDrawingObject_Register_New();
+
+	for ( object_I = 0 ; object_I < drawingObjectCount ; object_I++ )
+		lucDrawingObject_Register_Add( self->drawingObject_Register, drawingObjectList[ object_I ] );
+		
+	/* Setup light register stuff*/	
+	self->light_Register = lucLight_Register_New();
+
+	for ( light_I = 0 ; light_I < lightCount ; light_I++ )
+		lucLight_Register_Add( self->light_Register, lightList[ light_I ] );
+
+       	if(lightCount == 0){
+       		self->defaultLight = lucLight_New( "defaultLight", 0, GL_LIGHT_MODEL_TWO_SIDE,  GL_AMBIENT_AND_DIFFUSE, lightPosition, lmodel_ambient, spotCutOff, spotDirection);
+		lucLight_Register_Add( self->light_Register, self->defaultLight );
+	}
+
+
+}
+
+void lucViewport_InitAll( 
+		void*                                              viewport,
+		lucCamera*                                         camera, 
+		lucDrawingObject**                                 drawingObjectList, 
+		DrawingObject_Index                                drawingObjectCount,
+	        lucLight**          			           lightList,
+	 	Light_Index                                        lightCount,
+		Bool                                               drawTitle,
+		Bool                                               drawTime,
+		Bool                                               compositeEachObject,
+		double                                             nearClipPlane,
+		double                                             farClipPlane )
+{
+	lucViewport* self        = viewport;
+
+	_lucViewport_Init( self, camera, drawingObjectList, drawingObjectCount, lightList, lightCount, drawTitle, drawTime, compositeEachObject, nearClipPlane, farClipPlane );
+}
+
+	
+void _lucViewport_Delete( void* viewport ) {
+	lucViewport* self        = viewport;
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucViewport_Print( void* viewport, Stream* stream ) {
+	lucViewport*          self        = viewport;
+	
+	Journal_Printf( stream, "lucViewport: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	lucDrawingObject_Register_PrintAllObjects( self->drawingObject_Register, stream );
+
+	Stg_Class_Print( self->camera, stream );
+
+	Journal_PrintValue( stream, self->nearClipPlane );
+	Journal_PrintValue( stream, self->farClipPlane );
+	
+	Journal_PrintBool( stream, self->drawTitle );
+	Journal_PrintBool( stream, self->drawTime );
+	Journal_PrintBool( stream, self->compositeEachObject );
+	
+	Stream_UnIndent( stream );
+}
+
+void* _lucViewport_Copy( void* viewport, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucViewport* self        = viewport;
+	lucViewport* newViewport;
+
+	newViewport = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	if ( deep ) {
+		newViewport->camera     = (lucCamera*)  Stg_Class_Copy( self->camera,     dest, deep, nameExt, ptrMap );
+	}
+	else {
+		newViewport->camera        = self->camera;
+	}
+
+	newViewport->nearClipPlane       = self->nearClipPlane;
+	newViewport->farClipPlane        = self->farClipPlane;
+	newViewport->drawTitle           = self->drawTitle;
+	newViewport->drawTime            = self->drawTime;
+	newViewport->compositeEachObject = self->compositeEachObject;
+
+	return (void*) newViewport;
+}
+
+void* _lucViewport_DefaultNew( Name name ) {
+	return _lucViewport_New( 
+			sizeof( lucViewport ),
+			lucViewport_Type,
+			_lucViewport_Delete,
+			_lucViewport_Print,
+			_lucViewport_Copy,
+			_lucViewport_DefaultNew,
+			_lucViewport_Construct,
+			_lucViewport_Build,
+			_lucViewport_Initialise,
+			_lucViewport_Execute,
+			_lucViewport_Destroy,
+			name );
+}
+
+void _lucViewport_Construct( void* viewport, Stg_ComponentFactory* cf, void* data ) {
+	lucViewport*        self               = (lucViewport*) viewport;
+	DrawingObject_Index drawingObjectCount;
+	lucDrawingObject**  drawingObjectList;
+	lucLight**          lightList;
+	Light_Index         lightCount;
+	lucCamera*          camera;
+
+	/* TODO Construct Parent */
+
+	camera =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "Camera", lucCamera, True, data ) ;
+
+	drawingObjectList = Stg_ComponentFactory_ConstructByList( 
+		cf, 
+		self->name, 
+		"DrawingObject", 
+		Stg_ComponentFactory_Unlimited, 
+		lucDrawingObject, 
+		True, 
+		&drawingObjectCount,
+		data );
+	
+	/* Grab a list of lights for this viewport */
+	lightList = Stg_ComponentFactory_ConstructByList( 
+		cf, 
+		self->name, 
+		"Light", 
+		Stg_ComponentFactory_Unlimited, 
+		lucLight, 
+		False, 
+		&lightCount,
+		data );
+
+	_lucViewport_Init(
+			self,
+			camera,
+			drawingObjectList,
+			drawingObjectCount,
+			lightList,
+			lightCount,
+			Stg_ComponentFactory_GetBool( cf, self->name, "drawTitle", True ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "drawTime", False ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "compositeEachObject", False ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "nearClipPlane", 0.1 ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "farClipPlane", 40.0 ) );
+
+	Memory_Free( drawingObjectList );
+        if(lightList)
+		Memory_Free( lightList );
+}
+
+void _lucViewport_Build( void* camera, void* data ) { }
+void _lucViewport_Initialise( void* camera, void* data ) { }
+void _lucViewport_Execute( void* camera, void* data ) { }
+void _lucViewport_Destroy( void* camera, void* data ) { }
+
+void lucViewport_Draw( void* viewport, lucWindow* window, lucViewportInfo* viewportInfo, void* context ) {
+	lucViewport*          self = (lucViewport*) viewport ;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	/*Enables the lights */
+	lucLight_Register_EnableAll( self->light_Register );
+
+	lucDrawingObject_Register_DrawAll( self->drawingObject_Register, window, viewportInfo, context, self->compositeEachObject );
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucViewport_CleanUp( void* viewport, void* context ) {
+	lucViewport*          self = (lucViewport*) viewport ;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	lucDrawingObject_Register_CleanUpAll( self->drawingObject_Register, context );
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucViewport_SetNeedsToSetupFlag( void* viewport, Bool flag ) {
+	lucViewport*       self = (lucViewport*) viewport ;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	lucDrawingObject_Register_SetNeedsToSetupFlag( self->drawingObject_Register, flag );
+	
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucViewport_Reset( void* viewport ) {
+	lucViewport*       self = (lucViewport*) viewport ;
+
+	if (self == NULL) 
+		return;
+	
+	lucCamera_Reset( self->camera );
+}
+
+void lucViewport_Broadcast( void* viewport, int rootRank, MPI_Comm comm ) {
+	lucViewport*       self      = (lucViewport*) viewport ;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	lucCamera_Broadcast( self->camera, rootRank, comm );
+
+	MPI_Bcast( self, 1, lucViewport_MPI_Datatype, rootRank, comm );
+	
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+
+#define lucViewport_TypesCount 5
+void lucViewport_Create_MPI_Datatype() {
+	MPI_Datatype        typeList[lucViewport_TypesCount]     = { MPI_DOUBLE, MPI_DOUBLE, MPI_INT, MPI_INT, MPI_INT };
+	int                 blocklen[lucViewport_TypesCount]     = {1, 1, 1, 1, 1};
+	MPI_Aint            displacement[lucViewport_TypesCount];
+	lucViewport         viewport;
+
+	displacement[0] = GetOffsetOfMember( viewport, nearClipPlane );
+	displacement[1] = GetOffsetOfMember( viewport, farClipPlane );
+	displacement[2] = GetOffsetOfMember( viewport, drawTitle );
+	displacement[3] = GetOffsetOfMember( viewport, drawTime );
+	displacement[4] = GetOffsetOfMember( viewport, compositeEachObject );
+	
+	MPI_Type_struct( lucViewport_TypesCount, blocklen, displacement, typeList, &lucViewport_MPI_Datatype );
+	MPI_Type_commit( & lucViewport_MPI_Datatype );
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Viewport.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Viewport.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,126 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Viewport.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucViewport_h__
+#define __lucViewport_h__
+
+	extern const Type lucViewport_Type;
+	extern MPI_Datatype lucViewport_MPI_Datatype;
+
+	#define __lucViewport                                         \
+		__Stg_Component                                           \
+		lucCamera*                                         camera;                   \
+		lucDrawingObject_Register*                         drawingObject_Register;   \
+		lucLight_Register*                         	   light_Register;           \
+		lucLight*                                          defaultLight;             \
+		double                                             nearClipPlane;            \
+		double                                             farClipPlane;             \
+		Bool                                               drawTitle;                \
+		Bool                                               drawTime;                 \
+		Bool                                               compositeEachObject;
+
+	struct lucViewport {__lucViewport};
+
+	lucViewport* lucViewport_New(
+		Name                                               name,
+		lucCamera*                                         camera,
+		lucDrawingObject**                                 drawingObjectList,
+		DrawingObject_Index                                drawingObjectCount,
+		lucLight**                                         lightList,
+	        Light_Index                                        lightCount,
+        	Bool                                               drawTitle,
+		Bool                                               drawTime,
+		Bool                                               compositeEachObject,
+		double                                             nearClipPlane,
+		double                                             farClipPlane );
+
+	lucViewport* _lucViewport_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name );
+
+	void lucViewport_InitAll( 
+		void*                                              viewport,
+		lucCamera*                                         camera, 
+		lucDrawingObject**                                 drawingObjectList,
+		DrawingObject_Index                                drawingObjectCount,
+		lucLight**                                         lightList,
+	        Light_Index                                        lightCount,
+		Bool                                               drawTitle,
+		Bool                                               drawTime,
+		Bool                                               compositeEachObject,
+		double                                             nearClipPlane,
+		double                                             farClipPlane );
+
+	void _lucViewport_Delete( void* viewport ) ;
+	void _lucViewport_Print( void* viewport, Stream* stream ) ;
+	void* _lucViewport_Copy( void* viewport, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+	void* _lucViewport_DefaultNew( Name name ) ;
+void _lucViewport_Construct( void* viewport, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucViewport_Build( void* viewport, void* data );
+	void _lucViewport_Initialise( void* viewport, void* data );
+	void _lucViewport_Execute( void* viewport, void* data );
+	void _lucViewport_Destroy( void* viewport, void* data );
+
+	/* +++ Public Functions +++ */
+	void lucViewport_SetNeedsToSetupFlag( void* viewport, Bool flag ) ;
+	void lucViewport_Draw( void* viewport, lucWindow* window, lucViewportInfo* viewportInfo, void* context ) ;
+	void lucViewport_CleanUp( void* viewport, void* context ) ;
+	void lucViewport_Reset( void* viewport ) ;
+	void lucViewport_Broadcast( void* viewport, int rootRank, MPI_Comm comm ) ;
+	void lucViewport_Create_MPI_Datatype() ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Viewport.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Viewport.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucViewport</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Describes a scene of several lucDrawingObjects which is drawn in a subset of a lucWindow</param>
+
+<!--Now the interesting stuff-->
+<list name="Params">
+	<struct>
+		<param name="Name">drawTitle</param>
+		<param name="Type">Bool</param>
+		<param name="Default">True</param>
+		<param name="Description">If True, then the textual name of this viewport will be drawn at the top of the viewport.</param>
+	</struct>
+	<struct>
+		<param name="Name">compositeEachObject</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If True, then when this viewport will be compositied between each object being drawn. This means the rendering will be slower but the order of the drawing of the objects will be conserved. If False, then the compositing will happen after all the objects have been drawn.</param>
+	</struct>
+	<struct>
+		<param name="Name">nearClipPlane</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.1</param>
+		<param name="Description">Specifies the distance from the camera to the near clipping plane, in front of which nothing will be drawn.</param>
+	</struct>
+	<struct>
+		<param name="Name">farClipPlane</param>
+		<param name="Type">Double</param>
+		<param name="Default">40.0</param>
+		<param name="Description">Specifies the distance from the camera to the far clipping plane, behind which nothing will be drawn.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Camera</param>
+		<param name="Type">lucCamera</param>
+		<param name="Description">The camera from which every drawing object in the viewport will be viewed from.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">DrawingObject</param>
+		<param name="Type">lucDrawingObject</param>
+		<param name="Description">A list of drawing objects that will be drawn in this viewport.</param>
+	</struct>	
+</list>
+
+<!-- Add an exmaple XML if possible -->
+<param name="Example">
+	<struct name="StressInvariantVP">
+		<param name="Type">lucViewport</param>
+		<param name="Camera">camera</param>
+		<list name="DrawingObject">
+			<param>stressInvMap</param>
+			<param>border</param>
+			<param>stressInvColourBar</param>
+		</list>
+		<param name="drawTitle">True</param>
+		<param name="compositeEachObject">False</param>
+		<param name="farClipPlane">0.1</param>
+		<param name="farClipPlane">40.0</param>
+	</struct>
+</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/ViewportInfo.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/ViewportInfo.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,59 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucViewportInfo_h__
+#define __lucViewportInfo_h__
+
+	struct lucViewportInfo {
+		lucViewport* viewport;
+		Pixel_Index  startx;
+		Pixel_Index  starty;
+		Pixel_Index  width;
+		Pixel_Index  height;
+		Bool         needsToDraw;
+	};
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Window.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Window.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,887 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Window.c 658 2007-02-05 00:58:07Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ColourMap.h"
+#include "X11Colours.h"
+#include "Window.h"
+#include "Viewport.h"
+#include "Camera.h"
+#include "OutputFormat.h"
+#include "OutputFormat_Register.h"
+#include "Init.h"
+#include "RenderingEngine.h"
+#include "Light.h"
+#include "Light_Register.h"
+
+#include "WindowInteraction.h"
+#include "WindowInteraction_Register.h"
+
+#include "ViewportInfo.h"
+
+#include <ctype.h>
+#include <assert.h>
+#include <string.h>
+
+/* ASCII Characters */
+#define ESCAPE 27
+
+const Type lucWindow_Type = "lucWindow";
+
+MPI_Datatype lucWindow_MPI_Datatype;
+MPI_Datatype lucViewportInfo_MPI_Datatype;
+
+lucWindow* _lucWindow_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name )
+{
+	lucWindow*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucWindow) );
+	self = (lucWindow*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	return self;
+}
+
+void _lucWindow_Init( 
+		lucWindow*                                         self,
+		lucRenderingEngine*                                renderingEngine,
+		lucViewportInfo*                                   viewportInfoList,
+		Viewport_Index                                     viewportCount,
+		lucOutputFormat**                                  outputFormatList,
+		OutputFormat_Index                                 outputFormatCount,
+		lucWindowInteraction**                             windowInteractionList, 
+		WindowInteraction_Index                            windowInteractionCount,
+		AbstractContext*                                   context,
+		Pixel_Index                                        width,
+		Pixel_Index                                        height,
+		Name                                               backgroundColourName,
+		Bool                                               interactive )
+{
+	OutputFormat_Index   outputFormat_I;
+	WindowInteraction_Index windowInteraction_I;
+
+	self->renderingEngine = renderingEngine;
+	self->width = width;
+	self->height = height;
+	self->interactive = interactive;
+
+	self->viewportInfoList = Memory_Alloc_Array( lucViewportInfo, viewportCount, "viewport info Array" );
+	memcpy( self->viewportInfoList, viewportInfoList, viewportCount * sizeof( lucViewportInfo ) );
+	self->viewportCount = viewportCount;
+	
+	/* Setup output format stuff */
+	self->outputFormat_Register = lucOutputFormat_Register_New();
+	for ( outputFormat_I = 0 ; outputFormat_I < outputFormatCount ; outputFormat_I++ )
+		lucOutputFormat_Register_Add( self->outputFormat_Register, outputFormatList[ outputFormat_I ] );
+		
+	/* Setup window interaction stuff */
+	self->windowInteraction_Register = lucWindowInteraction_Register_New();
+	self->defaultWindowInteraction = lucWindowInteraction_New( "defaultWindowInteraction" );
+	lucWindowInteraction_Register_Add( self->windowInteraction_Register, self->defaultWindowInteraction );
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount ; windowInteraction_I++ )
+		lucWindowInteraction_Register_Add( self->windowInteraction_Register, windowInteractionList[ windowInteraction_I ] );
+	
+
+	lucColour_FromString( &self->backgroundColour, backgroundColourName );
+
+	self->currStereoBuffer = lucLeft;
+
+	/* Get window to 'execute' at each 'Dump' entry point, and force the context not to re-execute itself. */
+	//context->hasExecuted = True;
+	EP_AppendClassHook( Context_GetEntryPoint( context, AbstractContext_EP_DumpClass ), self->_execute, self );
+}
+		
+void _lucWindow_Delete( void* window ) {
+	lucWindow* self        = window;
+
+	Stg_Class_Delete( self->outputFormat_Register );
+	Stg_Class_Delete( self->defaultWindowInteraction );
+	Stg_Class_Delete( self->windowInteraction_Register );
+		
+	_Stg_Component_Delete( self );
+}
+
+void _lucWindow_Print( void* window, Stream* stream ) {
+	lucWindow*          self        = window;
+	
+	Journal_Printf( stream, "lucWindow: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+
+	Journal_PrintValue( stream, self->width );
+	Journal_PrintValue( stream, self->height );
+	Journal_PrintValue( stream, self->interactive );
+	Journal_Printf( stream, "self->currStereoBuffer = ");
+	switch ( self->currStereoBuffer ) {
+		case lucLeft:
+			Journal_Printf( stream, "lucLeft\n" ); break;
+		case lucRight:
+			Journal_Printf( stream, "lucRight\n" ); break;
+	}
+	Stream_UnIndent( stream );
+}
+
+void* _lucWindow_Copy( void* window, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucWindow* self        = window;
+	lucWindow* newWindow;
+
+	newWindow = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newWindow;
+}
+
+void* _lucWindow_DefaultNew( Name name ) {
+	return _lucWindow_New( 
+			sizeof( lucWindow ),
+			lucWindow_Type,
+			_lucWindow_Delete,
+			_lucWindow_Print,
+			_lucWindow_Copy,
+			_lucWindow_DefaultNew,
+			_lucWindow_Construct,
+			_lucWindow_Build,
+			_lucWindow_Initialise,
+			_lucWindow_Execute,
+			_lucWindow_Destroy,
+			name );
+}
+
+void _lucWindow_Construct( void* window, Stg_ComponentFactory* cf, void* data ) {
+	lucWindow*               self        = window;
+	lucViewportInfo*         viewportInfoList;
+	Viewport_Index           viewportCount;
+	lucOutputFormat**        outputFormatList;
+	OutputFormat_Index       outputFormatCount;
+	AbstractContext*         context;
+	lucRenderingEngine*      renderingEngine;
+	Pixel_Index              width;
+	Pixel_Index              height;
+	lucWindowInteraction**   windowInteractionList;
+	WindowInteraction_Index  windowInteractionCount;
+	Bool                     interactiveDefault;
+	Bool                     interactive;
+	
+	width = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "width", 400 );
+	height = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "height", 400 );
+
+	/* Get information about whether this window is interactive or not
+	 * All lucWindow objects will check in the root dictionary first to see if interactivity in general is turned on
+	 * Specific lucWindow objects can override this parameter in their own component structs */
+	interactiveDefault = Stg_ComponentFactory_GetRootDictBool( cf, "interactive", False );
+	interactive = Stg_ComponentFactory_GetBool( cf, self->name, "interactive", interactiveDefault );
+
+	/* Grab information about what viewports are going to be plotting in this window */
+	viewportInfoList = lucWindow_ConstructViewportInfoList( self, cf, width, height, &viewportCount, data );
+
+	/* Grab a list of different output formats for this window to be dumped in */
+	outputFormatList = Stg_ComponentFactory_ConstructByList( 
+		cf, 
+		self->name, 
+		"OutputFormat", 
+		Stg_ComponentFactory_Unlimited, 
+		lucOutputFormat, 
+		False, 
+		&outputFormatCount, 
+		data );
+			
+	/* Grab a list of interactions for the user to interact with this window */
+	windowInteractionList = Stg_ComponentFactory_ConstructByList( 
+		cf, 
+		self->name, 
+		"WindowInteraction", 
+		Stg_ComponentFactory_Unlimited, 
+		lucWindowInteraction, 
+		False, 
+		&windowInteractionCount,
+		data );
+		
+	/* The window needs information about the context so that it can attach itself onto the AbstractContext_EP_DumpClass entry 
+	 * point. */
+	context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
+
+	renderingEngine = Stg_ComponentFactory_ConstructByKey( cf, self->name, "RenderingEngine", lucRenderingEngine, True, data );
+
+	_lucWindow_Init( 
+			self,
+			renderingEngine,
+			viewportInfoList,
+			viewportCount,
+			outputFormatList,
+			outputFormatCount,
+			windowInteractionList,
+			windowInteractionCount,
+			context,
+			width,
+			height,
+			Stg_ComponentFactory_GetString( cf, self->name, "backgroundColour", "white" ),
+			interactive );
+		
+	/* Free Memory */
+	Memory_Free(viewportInfoList); 
+	if ( windowInteractionList )
+		Memory_Free(windowInteractionList); 
+	if ( outputFormatList )
+		Memory_Free(outputFormatList); 
+
+}
+
+void _lucWindow_Build( void* window, void* data ) { }
+void _lucWindow_Initialise( void* window, void* data ) { }
+void _lucWindow_Execute( void* window, void* data ) { 
+	lucWindow*     self         = (lucWindow*) window ;
+
+	lucWindow_SetViewportNeedsToSetupFlag( self, True );
+	lucWindow_SetViewportNeedsToDrawFlag( self, True );
+
+	lucWindow_Draw( self, data );
+	lucWindow_Dump( self, data );
+	lucWindow_CleanUp( self, data );
+}
+void _lucWindow_Destroy( void* window, void* data ) { }
+
+void lucWindow_Draw( void* window, AbstractContext* context ) {
+	lucWindow*     self         = (lucWindow*) window ;
+
+	lucRenderingEngine_Render( self->renderingEngine, self, context );
+}
+
+void lucWindow_Dump( void* window, AbstractContext* context ) {
+	lucWindow*     self         = (lucWindow*) window ;
+	Pixel_Index    width        = self->width;
+	Pixel_Index    height       = self->height;
+	lucPixel*      imageBuffer  = NULL;
+	Stream*        errorStream  = Journal_MyStream( Error_Type, self );
+	
+	lucDebug_PrintFunctionBegin( self, 1 );
+
+	/* Allocate Memory */
+	imageBuffer = Memory_Alloc_Array( lucPixel, width * height, "Pixels" );
+	Journal_Firewall( imageBuffer != NULL, errorStream, "In func %s: Cannot allocate array.", __func__ );
+
+	/* Grab Pixels from window */
+	lucRenderingEngine_GetPixelData( self->renderingEngine, self, imageBuffer );
+
+	/* Output in different formats that the user gives */
+	lucOutputFormat_Register_OutputAll( self->outputFormat_Register, self, context, imageBuffer );
+	
+	/* Free memory */
+	Memory_Free( imageBuffer );
+	lucDebug_PrintFunctionEnd( self, 1 );
+}
+
+void lucWindow_CleanUp( void* window, void* context ) {
+	lucWindow*     self      = (lucWindow*) window;
+	Viewport_Index viewport_I;
+	Viewport_Index viewportCount = self->viewportCount;
+	lucViewport*   viewport;
+
+	for ( viewport_I = 0 ; viewport_I < viewportCount ; viewport_I++ ) {
+		viewport = self->viewportInfoList[ viewport_I ].viewport;
+		
+		lucViewport_CleanUp( viewport, context );
+	}
+}
+
+void lucWindow_MouseMotion( void* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty) {
+	lucWindow*            self      = (lucWindow*) window;
+	Index                 windowInteraction_I;
+	Index                 windowInteractionCount = lucWindowInteraction_Register_GetCount( self->windowInteraction_Register ); 
+	lucWindowInteraction* windowInteraction;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount ; windowInteraction_I++ ) {
+		windowInteraction = lucWindowInteraction_Register_GetByIndex( self->windowInteraction_Register, windowInteraction_I );
+		lucWindowInteraction_MouseMotion( windowInteraction, window, button, xpos, ypos, startx, starty );
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucWindow_MouseClick( void* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) {
+	lucWindow*            self      = (lucWindow*) window;
+	Index                 windowInteraction_I;
+	Index                 windowInteractionCount = lucWindowInteraction_Register_GetCount( self->windowInteraction_Register ); 
+	lucWindowInteraction* windowInteraction;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount ; windowInteraction_I++ ) {
+		windowInteraction = lucWindowInteraction_Register_GetByIndex( self->windowInteraction_Register, windowInteraction_I );
+		lucWindowInteraction_MouseClick( windowInteraction, window, button, state, xpos, ypos );
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucWindow_KeyboardEvent( void* window, char key, Pixel_Index xpos, Pixel_Index ypos ) {
+	lucWindow*              self      = (lucWindow*) window;
+	WindowInteraction_Index windowInteraction_I;
+	WindowInteraction_Index windowInteractionCount = lucWindowInteraction_Register_GetCount( self->windowInteraction_Register ); 
+	lucWindowInteraction*   windowInteraction;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount; windowInteraction_I++ ) {
+		windowInteraction = lucWindowInteraction_Register_GetByIndex( self->windowInteraction_Register, windowInteraction_I );
+		lucWindowInteraction_KeyboardEvent( windowInteraction, window, key, xpos, ypos );
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+Bool lucWindow_HasStereoCamera( lucWindow* self ) {
+	Viewport_Index viewport_I;
+	Viewport_Index viewportCount = self->viewportCount;
+	lucViewport*   viewport;
+
+	for ( viewport_I = 0 ; viewport_I < viewportCount ; viewport_I++ ) {
+		viewport = self->viewportInfoList[ viewport_I ].viewport;
+		
+		if (viewport->camera->stereoType != lucMono )
+			return True;
+	}
+	return False;
+}
+
+void lucWindow_CheckCameraFlag( void* window ) {
+	lucWindow*            self          = (lucWindow*) window;
+	Viewport_Index        viewport_I;
+	Viewport_Index        viewportCount = self->viewportCount;
+	lucViewport*          viewport;
+	lucViewportInfo*      viewportInfo;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	for ( viewport_I = 0 ; viewport_I < viewportCount ; viewport_I++ ) {
+		viewportInfo = &self->viewportInfoList[ viewport_I ];
+		viewport = viewportInfo->viewport;
+
+		if ( viewport->camera->needsToDraw )
+			viewportInfo->needsToDraw = True;
+
+	}
+
+	/* Now that camera has passed message to viewport - the camera's flag is no longer nessesary */
+	for ( viewport_I = 0 ; viewport_I < viewportCount ; viewport_I++ ) {
+		viewport = self->viewportInfoList[ viewport_I ].viewport;
+
+		viewport->camera->needsToDraw = False;
+	}
+	
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+
+void lucWindow_CheckLightFlag( void* window ) {
+	lucWindow*            self          = (lucWindow*) window;
+	Viewport_Index        viewport_I;
+	Viewport_Index        viewportCount = self->viewportCount;
+	lucViewport*          viewport;
+	lucViewportInfo*      viewportInfo;
+	
+	lucLight*                   light;
+	Light_Index                 light_I = 0;
+	Light_Index                 lightCount = 0;
+
+	lucDebug_PrintFunctionBegin( self, 2 );
+	
+	/* Loop through lights that are registered on the window */
+	
+	for ( viewport_I = 0 ; viewport_I < viewportCount ; viewport_I++ ) {
+	
+		viewportInfo = &self->viewportInfoList[ viewport_I ];
+		viewport = viewportInfo->viewport;
+
+		/* Finds the number of lights, and if one has been modified, then redraw */
+		lightCount   = lucLight_Register_GetCount( viewport->light_Register );
+		for ( light_I = 0 ; light_I < lightCount ; light_I++ ) {
+			light = lucLight_Register_GetByIndex( viewport->light_Register, light_I );
+
+			if ( light->needsToDraw )
+				viewportInfo->needsToDraw = True;
+
+		}
+	}
+
+	/* Now that lights has passed message to viewport - the lights' flag is no longer nessesary */
+	for ( viewport_I = 0 ; viewport_I < viewportCount ; viewport_I++ ) {
+		viewport = self->viewportInfoList[ viewport_I ].viewport;
+
+		lightCount   = lucLight_Register_GetCount( viewport->light_Register );
+		for ( light_I = 0 ; light_I < lightCount ; light_I++ ) {
+			light = lucLight_Register_GetByIndex( viewport->light_Register, light_I );						 light->needsToDraw = False;
+		}
+	}
+	
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+
+
+
+
+void lucWindow_SetViewportNeedsToSetupFlag( void* window, Bool flag ) {
+	lucWindow*              self         = (lucWindow*) window ;
+	Viewport_Index          viewport_I;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+	
+	for ( viewport_I = 0 ; viewport_I < self->viewportCount ; viewport_I++ ) {
+		lucViewport_SetNeedsToSetupFlag( self->viewportInfoList[ viewport_I ].viewport, flag );
+	}
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucWindow_SetViewportNeedsToDrawFlag( void* window, Bool flag ) {
+	lucWindow*              self         = (lucWindow*) window ;
+	Viewport_Index          viewport_I;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+	
+	for ( viewport_I = 0 ; viewport_I < self->viewportCount ; viewport_I++ ) {
+		self->viewportInfoList[ viewport_I ].needsToDraw = flag;
+	}
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+lucViewportInfo* lucWindow_GetViewportInfoByPixel( void* window, Pixel_Index xPixel, Pixel_Index yPixel ) {
+	lucWindow*              self         = (lucWindow*) window ;
+	Viewport_Index          viewport_I;
+	
+	for ( viewport_I = 0 ; viewport_I < self->viewportCount ; viewport_I++ ) {
+		if ( lucViewportInfo_IsPixelInside( &self->viewportInfoList[ viewport_I ], xPixel, yPixel ) )
+			return &self->viewportInfoList[ viewport_I ];
+	}
+
+	return NULL;	
+}
+
+lucViewport* lucWindow_GetViewportByPixel( void* window, Pixel_Index xPixel, Pixel_Index yPixel ) {
+	lucWindow*              self         = (lucWindow*) window ;
+	lucViewportInfo*        viewportInfo;
+
+	viewportInfo = lucWindow_GetViewportInfoByPixel( self, xPixel, yPixel );
+	
+	if ( viewportInfo )
+		return viewportInfo->viewport;
+	else 
+		return NULL;
+}
+
+
+void lucWindow_Broadcast( void* window, int rootRank, MPI_Comm comm ) {
+	lucWindow*         self      = (lucWindow*) window;
+	Viewport_Index     viewport_I;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	MPI_Bcast( self, 1, lucWindow_MPI_Datatype, rootRank, comm );
+
+	/* Broadcast Viewport Infos */
+	for ( viewport_I = 0 ; viewport_I < self->viewportCount ; viewport_I++ ) {
+		lucViewportInfo_Broadcast( &self->viewportInfoList[ viewport_I ], rootRank, comm );
+	}
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void lucViewportInfo_Broadcast( lucViewportInfo* self, int rootRank, MPI_Comm comm ) {
+	Journal_DPrintfL( lucDebug, 2, "In %s.\n", __func__ );
+
+	lucViewport_Broadcast( self->viewport, rootRank, comm );
+
+	MPI_Bcast( self, 1, lucViewportInfo_MPI_Datatype, rootRank, comm );
+}
+
+Bool lucViewportInfo_IsPixelInside( lucViewportInfo* viewportInfo, Pixel_Index xPixel, Pixel_Index yPixel ) {
+	if ( xPixel < viewportInfo->startx ) 
+		return False;
+	if ( yPixel < viewportInfo->starty ) 
+		return False;
+	
+	if ( xPixel >= viewportInfo->startx + viewportInfo->width ) 
+		return False;
+	if ( yPixel >= viewportInfo->starty + viewportInfo->height ) 
+		return False;
+
+	return True;
+}	
+
+lucViewportInfo* lucWindow_ConstructViewportInfoList( 
+		lucWindow* self, 
+		Stg_ComponentFactory* cf, 
+		Pixel_Index width, 
+		Pixel_Index height, 
+		Viewport_Index* viewportCount,
+		void* data ) 
+{
+	Viewport_Index          verticalCount;
+	Viewport_Index          horizontalCount;
+	Viewport_Index          vertical_I;
+	Viewport_Index          horizontal_I;
+	Viewport_Index          total_I                 = 0;
+	Pixel_Index             viewportHeight;
+	Pixel_Index             viewportWidth;
+	Dictionary_Entry_Value* list;
+	char*                   charPtr;
+	char*                   horizontalVP_String;
+	const char*             breakChars              = "\n\t ,;";
+	lucViewportInfo*        viewportInfoList        = Memory_Alloc_Array( lucViewportInfo, 1, "viewportInfoArray" );
+	lucViewportInfo*        currViewportInfo;
+	Dictionary*             dictionary              = Dictionary_GetDictionary( cf->componentDict, self->name );
+	Name                    viewportName;
+	char*                   bufferPtr;
+
+	*viewportCount = 0;
+	
+	list = Dictionary_Get( dictionary, "Viewport" );
+	Journal_Firewall( list != NULL, lucError, "Cannot Find 'Viewport' for %s '%s'.\n", self->type, self->name );
+		
+	verticalCount = Dictionary_Entry_Value_GetCount( list );
+
+	/* Calculate viewport height */
+	viewportHeight = div( height, verticalCount ).quot;
+
+	for ( vertical_I = 0 ; vertical_I < verticalCount ; vertical_I++ ) {
+		horizontalVP_String = StG_Strdup( Dictionary_Entry_Value_AsString( Dictionary_Entry_Value_GetElement( list, vertical_I ) ) );
+	
+		/* Find number of horizontal layers */
+		horizontalCount = 1;
+		charPtr = strpbrk( horizontalVP_String, breakChars );
+		while ( charPtr != NULL ) {
+			charPtr = strpbrk( charPtr + 1 , breakChars );
+			horizontalCount++;
+		}
+		
+		/* Sum up total number of viewports */
+		*viewportCount += horizontalCount;
+
+		/* Reallocate */
+		viewportInfoList = Memory_Realloc_Array( viewportInfoList, lucViewportInfo, *viewportCount );
+		
+		/* Calculate viewport width */
+		viewportWidth = div( width, horizontalCount ).quot;
+
+		/* Read String to get colour map */
+		charPtr = strtok_r( horizontalVP_String, breakChars, &bufferPtr );
+		for ( horizontal_I = 0 ; horizontal_I < horizontalCount ; horizontal_I++ ) {
+			currViewportInfo = &viewportInfoList[ total_I ];
+
+			/* Find viewport */
+			viewportName = StG_Strdup( charPtr );
+			currViewportInfo->viewport = Stg_ComponentFactory_ConstructByName( cf, viewportName, lucViewport, True, data ) ;
+			Memory_Free( viewportName );
+
+			/* Setup viewport dimensions */
+			currViewportInfo->startx = horizontal_I * viewportWidth;
+			currViewportInfo->starty = (verticalCount - 1 - vertical_I) * viewportHeight;
+			currViewportInfo->width  = viewportWidth;
+			currViewportInfo->height = viewportHeight;
+
+			charPtr = strtok_r( NULL, breakChars, &bufferPtr );
+
+			total_I++;
+		}
+
+		Memory_Free( horizontalVP_String );
+	}	
+
+	Journal_Firewall( total_I == *viewportCount, lucError, 
+			"Something went wrong in %s for %s '%s' - Incorrectly counted number of viewports.\n", 
+			__func__, self->type, self->name );
+
+	return viewportInfoList;
+}
+
+void lucWindow_InteractionHelpMessage( void* window, Stream* stream ) {
+	lucWindow*              self      = (lucWindow*) window;
+	WindowInteraction_Index windowInteraction_I;
+	WindowInteraction_Index windowInteractionCount = lucWindowInteraction_Register_GetCount( self->windowInteraction_Register ); 
+	lucWindowInteraction*   windowInteraction;
+
+	Journal_Printf( stream, "--------------------------------------------------------------------\n" );
+	Journal_Printf( stream, "Help for %s '%s':\n", self->type, self->name );
+
+	Journal_Printf( stream, "Window Interactions registered on this window are:\n" );
+	Stream_Indent( stream );
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount ; windowInteraction_I++ ) {
+		windowInteraction = lucWindowInteraction_Register_GetByIndex( self->windowInteraction_Register, windowInteraction_I );
+		Journal_Printf( stream, "'%s' (type %s)\n", windowInteraction->name, windowInteraction->type );
+	}
+	Stream_UnIndent( stream );
+	
+	Journal_Printf( stream, "Mouse Interaction:\n" );
+	Stream_Indent( stream );
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount ; windowInteraction_I++ ) {
+		windowInteraction = lucWindowInteraction_Register_GetByIndex( self->windowInteraction_Register, windowInteraction_I );
+		lucWindowInteraction_MouseMessage( windowInteraction, stream );
+	}
+	Stream_UnIndent( stream );	
+
+	Journal_Printf( stream, "Keyboard Interaction:\n" );
+	Stream_Indent( stream );
+	for ( windowInteraction_I = 0 ; windowInteraction_I < windowInteractionCount ; windowInteraction_I++ ) {
+		windowInteraction = lucWindowInteraction_Register_GetByIndex( self->windowInteraction_Register, windowInteraction_I );
+		lucWindowInteraction_KeyboardMessage( windowInteraction, stream );
+	}
+	Stream_UnIndent( stream );	
+	Journal_Printf( stream, "--------------------------------------------------------------------\n" );
+}
+	
+
+#define lucWindow_TypesCount 5
+void lucWindow_Create_MPI_Datatype() {
+	MPI_Datatype        typeList[lucWindow_TypesCount]     = { MPI_INT, MPI_INT, MPI_INT, MPI_FLOAT, MPI_INT };
+	int                 blocklen[lucWindow_TypesCount]     = {1, 1, 1, 4, 1};
+	MPI_Aint            displacement[lucWindow_TypesCount];
+	lucWindow           window;
+
+	displacement[0] = GetOffsetOfMember( window, width );
+	displacement[1] = GetOffsetOfMember( window, height );
+	displacement[2] = GetOffsetOfMember( window, interactive );
+	displacement[3] = GetOffsetOfMember( window, backgroundColour );
+	displacement[4] = GetOffsetOfMember( window, currStereoBuffer );
+	
+	MPI_Type_struct( lucWindow_TypesCount, blocklen, displacement, typeList, &lucWindow_MPI_Datatype );
+	MPI_Type_commit( & lucWindow_MPI_Datatype );
+}
+
+
+
+#define lucViewportInfo_TypesCount 5
+void lucViewportInfo_Create_MPI_Datatype() {
+	MPI_Datatype        typeList[lucViewportInfo_TypesCount]     = { MPI_INT, MPI_INT, MPI_INT, MPI_INT, MPI_INT };
+	int                 blocklen[lucViewportInfo_TypesCount]     = {1, 1, 1, 1, 1};
+	MPI_Aint            displacement[lucViewportInfo_TypesCount];
+	lucViewportInfo     viewportInfo;
+
+	displacement[0] = GetOffsetOfMember( viewportInfo, startx );
+	displacement[1] = GetOffsetOfMember( viewportInfo, starty );
+	displacement[2] = GetOffsetOfMember( viewportInfo, width );
+	displacement[3] = GetOffsetOfMember( viewportInfo, height );
+	displacement[4] = GetOffsetOfMember( viewportInfo, needsToDraw );
+	
+	MPI_Type_struct( lucViewportInfo_TypesCount, blocklen, displacement, typeList, &lucViewportInfo_MPI_Datatype );
+	MPI_Type_commit( & lucViewportInfo_MPI_Datatype );
+}
+
+#ifdef HAVE_GL
+
+#include <gl.h>
+
+void _lucWindow_SetupGLRasterFont( void* window ) {
+	GLuint i, j;
+
+	GLubyte rasters[][13] = {
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, 
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36}, 
+	{0x00, 0x00, 0x00, 0x66, 0x66, 0xff, 0x66, 0x66, 0xff, 0x66, 0x66, 0x00, 0x00}, 
+	{0x00, 0x00, 0x18, 0x7e, 0xff, 0x1b, 0x1f, 0x7e, 0xf8, 0xd8, 0xff, 0x7e, 0x18}, 
+	{0x00, 0x00, 0x0e, 0x1b, 0xdb, 0x6e, 0x30, 0x18, 0x0c, 0x76, 0xdb, 0xd8, 0x70}, 
+	{0x00, 0x00, 0x7f, 0xc6, 0xcf, 0xd8, 0x70, 0x70, 0xd8, 0xcc, 0xcc, 0x6c, 0x38}, 
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1c, 0x0c, 0x0e}, 
+	{0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c}, 
+	{0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30}, 
+	{0x00, 0x00, 0x00, 0x00, 0x99, 0x5a, 0x3c, 0xff, 0x3c, 0x5a, 0x99, 0x00, 0x00}, 
+	{0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00}, 
+	{0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03}, 
+	{0x00, 0x00, 0x3c, 0x66, 0xc3, 0xe3, 0xf3, 0xdb, 0xcf, 0xc7, 0xc3, 0x66, 0x3c}, 
+	{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x38, 0x18}, 
+	{0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0x07, 0x03, 0x03, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xcc, 0x6c, 0x3c, 0x1c, 0x0c}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xff}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x03, 0x03, 0xff}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x03, 0x7f, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06}, 
+	{0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60}, 
+	{0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x0c, 0x06, 0x03, 0xc3, 0xc3, 0x7e}, 
+	{0x00, 0x00, 0x3f, 0x60, 0xcf, 0xdb, 0xd3, 0xdd, 0xc3, 0x7e, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18}, 
+	{0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc}, 
+	{0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff}, 
+	{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, 
+	{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e}, 
+	{0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06}, 
+	{0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3}, 
+	{0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, 
+	{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3}, 
+	{0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, 
+	{0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c}, 
+	{0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e}, 
+	{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff}, 
+	{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, 
+	{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, 
+	{0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, 
+	{0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3}, 
+	{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3}, 
+	{0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff}, 
+	{0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c}, 
+	{0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60}, 
+	{0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c}, 
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18}, 
+	{0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x30, 0x70}, 
+	{0x00, 0x00, 0x7f, 0xc3, 0xc3, 0x7f, 0x03, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, 
+	{0x00, 0x00, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x03, 0x03, 0x03, 0x03, 0x03}, 
+	{0x00, 0x00, 0x7f, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x33, 0x1e}, 
+	{0x7e, 0xc3, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0}, 
+	{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00}, 
+	{0x38, 0x6c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x00}, 
+	{0x00, 0x00, 0xc6, 0xcc, 0xf8, 0xf0, 0xd8, 0xcc, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0}, 
+	{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78}, 
+	{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xfe, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfc, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, 
+	{0xc0, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00}, 
+	{0x03, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xfe, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xfe, 0x03, 0x03, 0x7e, 0xc0, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x1c, 0x36, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x00}, 
+	{0x00, 0x00, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xc3, 0xe7, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00}, 
+	{0xc0, 0x60, 0x60, 0x30, 0x18, 0x3c, 0x66, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0xff, 0x60, 0x30, 0x18, 0x0c, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00}, 
+	{0x00, 0x00, 0x0f, 0x18, 0x18, 0x18, 0x38, 0xf0, 0x38, 0x18, 0x18, 0x18, 0x0f}, 
+	{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, 
+	{0x00, 0x00, 0xf0, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x1c, 0x18, 0x18, 0x18, 0xf0}, 
+	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00} 
+	};
+
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+	for (i = 0,j = ' ' ; j < '~' ; i++,j++) {
+		glNewList( 2000 + j, GL_COMPILE);
+		glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, rasters[i]);
+		glEndList();
+	}
+	glListBase(2000);
+
+}	
+
+void lucWindow_ChangeInteractiveMode( void* window ) {
+	lucWindow*              self         = (lucWindow*) window ;
+	self->interactive = !self->interactive;
+}
+
+
+void lucWindow_BeginEventLoop( void* window ) {
+	lucWindow*              self         = (lucWindow*) window ;
+
+	self->quitEventLoop = False;
+	self->toggleApplicationQuit = False;
+}
+
+void lucWindow_QuitEventLoop( void* window ) {
+	lucWindow*              self         = (lucWindow*) window ;
+
+	self->quitEventLoop = True;
+}
+
+void lucWindow_ToggleApplicationQuit( void* window ) {
+	lucWindow*              self         = (lucWindow*) window ;
+
+	lucWindow_QuitEventLoop( self );
+	self->toggleApplicationQuit = True;
+}
+
+#endif /* HAVE_GL */
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Window.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Window.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,151 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Window.h 658 2007-02-05 00:58:07Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucWindow_h__
+#define __lucWindow_h__
+
+	extern const Type lucWindow_Type;
+
+	extern MPI_Datatype lucWindow_MPI_Datatype;
+	extern MPI_Datatype lucViewportInfo_MPI_Datatype;
+
+	#define __lucWindow                                     \
+		__Stg_Component                                                              \
+		/* Virtual Functions */ \
+		\
+		/* Other Info */ \
+		lucRenderingEngine*                            renderingEngine;            \
+		lucViewportInfo*                               viewportInfoList;           \
+		Viewport_Index                                 viewportCount;              \
+		lucOutputFormat_Register*                      outputFormat_Register;      \
+		lucWindowInteraction_Register*                 windowInteraction_Register; \
+		lucWindowInteraction*                          defaultWindowInteraction;   \
+		Pixel_Index                                    width;                      \
+		Pixel_Index                                    height;                     \
+		Bool                                           interactive;                \
+		lucColour                                      backgroundColour;           \
+		lucStereoBuffer                                currStereoBuffer;           \
+		Bool                                           quitEventLoop;              \
+		Bool                                           toggleApplicationQuit;      \
+			
+	struct lucWindow {__lucWindow};
+
+	lucWindow* _lucWindow_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		Name                                               name );
+
+	void _lucWindow_Delete( void* window ) ;
+	void _lucWindow_Print( void* window, Stream* stream ) ;
+	void* _lucWindow_Copy( void* window, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+	/* Stg_Component Virtual Functions */
+	void* _lucWindow_DefaultNew( Name name ) ;
+	void _lucWindow_Construct( void* window, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucWindow_Build( void* window, void* data ) ;
+	void _lucWindow_Initialise( void* window, void* data ) ;
+	void _lucWindow_Execute( void* window, void* data ) ;
+	void _lucWindow_Destroy( void* window, void* data ) ;
+
+	/* +++ Public Functions +++ */
+	void lucWindow_Draw( void* window, AbstractContext* context ) ;
+	void lucWindow_Dump( void* window, AbstractContext* context ) ;
+	void lucWindow_CleanUp( void* window, void* context ) ;
+
+	/** Functions for interactivity */
+	void lucWindow_MouseMotion( void* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty) ;
+	void lucWindow_MouseClick( void* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) ;
+/*	void lucWindow_MouseClickPosition( void* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) ;*/
+
+	void lucWindow_KeyboardEvent( void* window, char key, Pixel_Index xpos, Pixel_Index ypos) ;
+
+	Bool lucWindow_HasStereoCamera( lucWindow* self ) ;
+	void lucWindow_CheckCameraFlag( void* window ) ;
+	void lucWindow_CheckLightFlag( void* window ) ;
+
+
+	void lucWindow_SetViewportNeedsToSetupFlag( void* window, Bool flag ) ;
+	void lucWindow_SetViewportNeedsToDrawFlag( void* window, Bool flag ) ;
+
+	lucViewportInfo* lucWindow_GetViewportInfoByPixel( void* window, Pixel_Index xPixel, Pixel_Index yPixel ) ;
+	lucViewport* lucWindow_GetViewportByPixel( void* window, Pixel_Index xPixel, Pixel_Index yPixel ) ;
+	void lucWindow_Broadcast( void* window, int rootRank, MPI_Comm comm ) ;
+
+	void lucViewportInfo_Broadcast( lucViewportInfo* self, int rootRank, MPI_Comm comm ) ;
+	Bool lucViewportInfo_IsPixelInside( lucViewportInfo* viewportInfo, Pixel_Index xPixel, Pixel_Index yPixel ) ;
+
+	#define lucViewportInfo_AspectRatio( viewportInfo ) \
+		( (double) (viewportInfo)->width / (double) (viewportInfo)->height )
+
+	lucViewportInfo* lucWindow_ConstructViewportInfoList( 
+		lucWindow* self, 
+		Stg_ComponentFactory* cf, 
+		Pixel_Index width, 
+		Pixel_Index height, 
+		Viewport_Index* viewportCount,
+		void* data ) ;
+
+	void lucWindow_InteractionHelpMessage( void* window, Stream* stream ) ;
+
+	void lucWindow_Create_MPI_Datatype() ;
+	void lucViewportInfo_Create_MPI_Datatype() ;
+
+	void _lucWindow_SetupGLRasterFont( void* window );
+	void lucWindow_ChangeInteractiveMode( void* window );
+
+	void lucWindow_BeginEventLoop( void* window ) ;
+	void lucWindow_QuitEventLoop( void* window ) ;
+	void lucWindow_ToggleApplicationQuit( void* window ) ;
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/Window.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/Window.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucWindow</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">A collection of viewports that will be drawn in one window and written as one image at every dump output step.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">width</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">400</param>
+		<param name="Description">The horizontal length of the window.</param>
+	</struct>
+	<struct>
+		<param name="Name">height</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">400</param>
+		<param name="Description">The vertical length of the window.</param>
+	</struct>
+	<struct>
+		<param name="Name">backgroundColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"white"</param>
+		<param name="Description">The colour that will fill the window before the viewports are drawn.</param>
+	</struct>
+	<struct>
+		<param name="Name">interactive</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If True, then the window will pop up and the user can interact with it before the image is saved and the calculation continues. If False, then the window will render, the image will save and the calculation will continue without hesitation. Some implementations of lucWindow may pop up a window even for non-interactive windows and others may not have an interactive mode at all.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Viewport</param>
+		<param name="Type">lucViewport</param>
+		<param name="Description">A list of viewports to be drawn in this window. These must be given in order of them laid out in the window. For each line entered in the list, each viewport mentioned in that line will be laid out in a horizontal row (See wiki page for example).</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">context</param>
+		<param name="Type">AbstractContext</param>
+		<param name="Description">The window needs information about the context so that it can attach itself onto the AbstractContext_EP_DumpClass entry point.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">RenderingEngine</param>
+		<param name="Type">lucRenderingEngine</param>
+		<param name="Description">The rendering engine that you want to render the viewports in this window.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">OutputFormat</param>
+		<param name="Type">lucOutputFormat</param>
+		<param name="Description">A list of formats that you want the final images to be saved in. For each output format registered on a window, an image will be created with the name ./OUTPUT_PATH/WINDOW_NAME.TIMESTEP.EXTENSION (e.g. ./output/window.00050.png).</param>
+	</struct>	
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">WindowInteraction</param>
+		<param name="Type">lucWindowInteraction</param>
+		<param name="Description">A list of window interaction objects that you want to use with this window. The default lucWindowInteraction will be created with each lucWindow and registered automatically.</param>
+	</struct>	
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/WindowInteraction.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/WindowInteraction.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,379 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ColourMap.h"
+#include "X11Colours.h"
+#include "ViewportInfo.h"
+#include "WindowInteraction.h"
+#include "WindowInteraction_Register.h"
+#include "Viewport.h"
+#include "Camera.h"
+#include "OutputFormat.h"
+#include "OutputFormat_Register.h"
+#include "Init.h"
+#include "RenderingEngine.h"
+#include "Window.h"
+
+
+#include <ctype.h>
+#include <assert.h>
+#include <string.h>
+
+/* ASCII Characters */
+#define ESCAPE 27
+
+const Type lucWindowInteraction_Type = "lucWindowInteraction";
+
+lucWindowInteraction* lucWindowInteraction_New( Name name ) {
+	lucWindowInteraction* self = (lucWindowInteraction*) _lucWindowInteraction_DefaultNew( name );
+
+	lucWindowInteraction_InitAll( self );
+
+	return self;
+}
+
+lucWindowInteraction* _lucWindowInteraction_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucWindowInteraction_MouseMotionFunction*          _mouseMotion,
+		lucWindowInteraction_MouseClickFunction*           _mouseClick,
+		lucWindowInteraction_MouseMessageFunction*         _mouseMessage,
+		lucWindowInteraction_KeyboardEventFunction*        _keyboardEvent,
+		lucWindowInteraction_KeyboardMessageFunction*      _keyboardMessage,
+		Name                                               name )
+{
+	lucWindowInteraction*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucWindowInteraction) );
+	self = (lucWindowInteraction*) _Stg_Component_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name, 
+			NON_GLOBAL );
+
+	/* Set virtual functions specific to this sub-class here: */
+	self->_mouseMotion     = _mouseMotion;
+	self->_mouseClick      = _mouseClick;
+	self->_mouseMessage    = _mouseMessage;
+	self->_keyboardEvent   = _keyboardEvent;
+	self->_keyboardMessage = _keyboardMessage;
+
+	return self;
+}
+
+void _lucWindowInteraction_Init( lucWindowInteraction*                              self ) {
+}
+
+void lucWindowInteraction_InitAll( void* windowInteractor ) {
+	lucWindowInteraction* self        = windowInteractor;
+
+	_lucWindowInteraction_Init( self );
+}
+		
+void _lucWindowInteraction_Delete( void* windowInteractor ) {
+	lucWindowInteraction* self        = windowInteractor;
+	
+	_Stg_Component_Delete( self );
+}
+
+void _lucWindowInteraction_Print( void* windowInteractor, Stream* stream ) {
+	lucWindowInteraction*          self        = windowInteractor;
+	
+	Journal_Printf( stream, "lucWindowInteraction: %s\n", self->name );
+
+	Stream_Indent( stream );
+
+	/* Print Parent */
+	_Stg_Component_Print( self, stream );
+
+	Stream_UnIndent( stream );
+}
+
+void* _lucWindowInteraction_Copy( void* windowInteractor, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucWindowInteraction* self        = windowInteractor;
+	lucWindowInteraction* newWindowInteraction;
+
+	newWindowInteraction = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newWindowInteraction;
+}
+
+void* _lucWindowInteraction_DefaultNew( Name name ) {
+	return _lucWindowInteraction_New( 
+			sizeof( lucWindowInteraction ),
+			lucWindowInteraction_Type,
+			_lucWindowInteraction_Delete,
+			_lucWindowInteraction_Print,
+			_lucWindowInteraction_Copy,
+			_lucWindowInteraction_DefaultNew,
+			_lucWindowInteraction_Construct,
+			_lucWindowInteraction_Build,
+			_lucWindowInteraction_Initialise,
+			_lucWindowInteraction_Execute,
+			_lucWindowInteraction_Destroy,
+			_lucWindowInteraction_MouseMotion,
+			_lucWindowInteraction_MouseClick,
+			_lucWindowInteraction_MouseMessage,
+			_lucWindowInteraction_KeyboardEvent,
+			_lucWindowInteraction_KeyboardMessage,
+			name );
+}
+
+void _lucWindowInteraction_Construct( void* windowInteractor, Stg_ComponentFactory* cf, void* data ) {
+	lucWindowInteraction*          self        = windowInteractor;
+	
+	_lucWindowInteraction_Init( self );
+}
+
+void _lucWindowInteraction_Build( void* windowInteractor, void* data ) { }
+void _lucWindowInteraction_Initialise( void* windowInteractor, void* data ) { }
+void _lucWindowInteraction_Execute( void* windowInteractor, void* data ) { }
+void _lucWindowInteraction_Destroy( void* windowInteractor, void* data ) { }
+
+/* Wrappers to virtual functions */
+void lucWindowInteraction_MouseMotion( void* windowInteraction, lucWindow* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteraction;
+
+	self->_mouseMotion( self, window, button, xpos, ypos, startx, starty );
+}
+
+void lucWindowInteraction_MouseClick( void* windowInteraction, lucWindow* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteraction;
+
+	self->_mouseClick( self, window, button, state, xpos, ypos );
+}
+
+void lucWindowInteraction_MouseMessage( void* windowInteraction, Stream* stream ) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteraction;
+
+	self->_mouseMessage( self, stream );
+}
+
+void lucWindowInteraction_KeyboardEvent( void* windowInteraction, lucWindow* window, char key, Pixel_Index xpos, Pixel_Index ypos) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteraction;
+
+	self->_keyboardEvent( self, window, key, xpos, ypos );
+}
+
+void lucWindowInteraction_KeyboardMessage( void* windowInteraction, Stream* stream ) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteraction;
+
+	self->_keyboardMessage( self, stream );
+}
+
+/* Default Virtual Function Implementations */
+void _lucWindowInteraction_MouseMotion( void* windowInteractor, lucWindow* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteractor;
+	lucViewport*   viewport;
+	lucCamera*     camera;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	viewport = lucWindow_GetViewportByPixel( window, xpos, ypos );
+	if (viewport == NULL) {
+		lucDebug_PrintFunctionEnd( self, 2 );
+		return;
+	}
+	camera = viewport->camera;
+	
+	switch (button) {
+		case lucLeftButton:
+			lucCamera_RotateAroundUpDirection(  camera, ((double)startx - (double)xpos) * M_PI/180.0 );
+			lucCamera_RotateTowardsUpDirection( camera, ((double)starty - (double)ypos) * M_PI/180.0 );
+			break;
+		case lucRightButton: 
+		        lucCamera_ChangeFocalPoint( camera, startx, starty, xpos, ypos);
+			/*{
+			XYZ             leftDirection;
+			Dimension_Index dim_I;
+
+			lucCamera_GetLeftDirection( camera, leftDirection );
+			for ( dim_I = 0 ; dim_I < 3 ; dim_I++ ) {
+				camera->focalPoint[ dim_I ] -= 0.01 * ((double)xpos - (double)startx) * leftDirection[ dim_I ];
+				camera->focalPoint[ dim_I ] -= 0.01 * ((double)ypos - (double)starty) * camera->upDirection[ dim_I ];
+			}
+			lucCamera_SetNeedsToDraw( camera );*/
+			break;
+		//}
+		case lucMiddleButton:
+			lucCamera_Zoom( camera, 1.0 + ((double)starty - (double)ypos)/10.0 );
+			break;
+		default:
+			break;
+	}
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void _lucWindowInteraction_MouseClick( void* windowInteractor, lucWindow* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) {
+	lucWindowInteraction*     self      = (lucWindowInteraction*) windowInteractor;
+	lucViewport*   viewport;
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	viewport = lucWindow_GetViewportByPixel( window, xpos, ypos );
+	if (viewport == NULL) 
+		return;
+
+	switch (state) {
+		case lucButtonPress:
+			break;
+		case lucButtonRelease:
+			break;
+		default:
+			break;
+	}
+
+	switch (button) {
+		case lucLeftButton:
+			break;
+		case lucRightButton:
+			break;
+		case lucMiddleButton:
+			break;
+		case lucWheelUp:
+			lucCamera_Zoom( viewport->camera, 0.9 );
+			break;
+		case lucWheelDown:
+			lucCamera_Zoom( viewport->camera, 1.1 );
+			break;
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}	
+
+void _lucWindowInteraction_MouseMessage( void* windowInteractor, Stream* stream ) {
+	Journal_Printf( stream, "Left Button:                  Rotate camera around model.\n" );
+	Journal_Printf( stream, "Middle Button:                Zoom camera in or out of the model.\n" );
+	Journal_Printf( stream, "Right Button:                 Move camera's focal point (currently unavailable).\n" );
+}
+
+void _lucWindowInteraction_KeyboardEvent( void* windowInteractor, lucWindow* window, char key, Pixel_Index xpos, Pixel_Index ypos) {
+	lucWindowInteraction* self      = (lucWindowInteraction*) windowInteractor;
+	lucViewport*          viewport = lucWindow_GetViewportByPixel( window, xpos, ypos );
+	
+	lucDebug_PrintFunctionBegin( self, 2 );
+
+	/* Make Case Insensitive */
+	/*key = tolower( key )*/;
+
+	Journal_DPrintfL( lucDebug, 0, "Key pressed '%c' (%d)\n", key, key );
+
+	switch (key) {
+		case ESCAPE:
+			Journal_Printf( Journal_MyStream( Info_Type, self ), "Escape key pressed - Exiting program.\n" );
+			lucDebug_PrintFunctionEnd( self, 2 );
+			lucWindow_ToggleApplicationQuit( window );
+			break;
+		case 'q': case ' ':
+			lucDebug_PrintFunctionEnd( self, 2 );
+			lucWindow_QuitEventLoop( window );
+		case 'h': 
+			lucWindow_InteractionHelpMessage( window, Journal_MyStream( Info_Type, window ) );     
+			break;
+		case 'i': 
+			lucWindow_ChangeInteractiveMode( window );     
+			Journal_Printf( Journal_MyStream( Info_Type, self ), "Interactivity for %s '%s' is %s.\n",
+					window->type, window->name, window->interactive ? "True" : "False" );
+			break;
+		case 'r': 
+			if (viewport)
+				lucViewport_Reset( viewport );
+			break;
+		case 's': 
+			if (viewport)
+				lucCamera_Pickle( viewport->camera, Journal_MyStream( Info_Type, viewport->camera ) );
+			break;
+		case '[':
+			if (viewport)
+				lucCamera_Zoom( viewport->camera, 1.1 );
+			break;
+		case ']':
+			if (viewport)
+				lucCamera_Zoom( viewport->camera, 0.9 );
+			break;
+			
+		default:
+			break;
+	}
+
+	lucDebug_PrintFunctionEnd( self, 2 );
+}
+
+void _lucWindowInteraction_KeyboardMessage( void* windowInteractor, Stream* stream ) {
+	Journal_Printf( stream, "escape:                       Exit out of program.\n" );
+	Journal_Printf( stream, "q, space:                     Close window and continue running program.\n" );
+	Journal_Printf( stream, "h:                            Print this help message.\n" );
+	Journal_Printf( stream, "i:                            Toggle Window Interactivity.\n" );
+	Journal_Printf( stream, "r:                            Reset camera for viewport under cursor.\n" );
+	Journal_Printf( stream, "s:                            Output information for camera associated with viewport under cursor.\n" );
+	Journal_Printf( stream, "[:                            Zoom out with camera associated with viewport under cursor.\n" );
+	Journal_Printf( stream, "]:                            Zoom in with camera associated with viewport under cursor.\n" );
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/WindowInteraction.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/WindowInteraction.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,123 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucWindowInteraction_h__
+#define __lucWindowInteraction_h__
+	
+	typedef void (lucWindowInteraction_MouseMotionFunction) ( void* windowInteractor, lucWindow* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty );
+	typedef void (lucWindowInteraction_MouseClickFunction) ( void* windowInteractor, lucWindow* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos );
+	typedef void (lucWindowInteraction_MouseMessageFunction)  ( void* windowInteractor, Stream* stream );
+	typedef void (lucWindowInteraction_KeyboardEventFunction) ( void* windowInteractor, lucWindow* window, char key, Pixel_Index xpos, Pixel_Index ypos );
+	typedef void (lucWindowInteraction_KeyboardMessageFunction) ( void* windowInteractor, Stream* stream );
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucWindowInteraction_Type;
+
+	#define __lucWindowInteraction                                      \
+		/* Parent macro */ \
+		__Stg_Component                                                      \
+		/* Virtual functions go here */ \
+		lucWindowInteraction_MouseMotionFunction*          _mouseMotion;     \
+		lucWindowInteraction_MouseClickFunction*           _mouseClick;      \
+		lucWindowInteraction_MouseMessageFunction*         _mouseMessage;    \
+		lucWindowInteraction_KeyboardEventFunction*        _keyboardEvent;   \
+		lucWindowInteraction_KeyboardMessageFunction*      _keyboardMessage; \
+		\
+		/* Other Info */ \
+			
+	struct lucWindowInteraction {__lucWindowInteraction};
+
+	lucWindowInteraction* lucWindowInteraction_New( Name name ) ;
+	lucWindowInteraction* _lucWindowInteraction_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucWindowInteraction_MouseMotionFunction*          _mouseMotion,
+		lucWindowInteraction_MouseClickFunction*           _mouseClick,
+		lucWindowInteraction_MouseMessageFunction*         _mouseMessage,
+		lucWindowInteraction_KeyboardEventFunction*        _keyboardEvent,
+		lucWindowInteraction_KeyboardMessageFunction*      _keyboardMessage,
+		Name                                               name );
+
+	void lucWindowInteraction_InitAll( void* windowInteractor ) ;
+
+	void _lucWindowInteraction_Delete( void* windowInteraction ) ;
+	void _lucWindowInteraction_Print( void* windowInteraction, Stream* stream ) ;
+	void* _lucWindowInteraction_Copy( void* windowInteraction, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+
+	/* Stg_Component Virtual Function Implementations */
+	void* _lucWindowInteraction_DefaultNew( Name name ) ;
+	void _lucWindowInteraction_Construct( void* windowInteraction, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucWindowInteraction_Build( void* windowInteraction, void* data ) ;
+	void _lucWindowInteraction_Initialise( void* windowInteraction, void* data ) ;
+	void _lucWindowInteraction_Execute( void* windowInteraction, void* data ) ;
+	void _lucWindowInteraction_Destroy( void* windowInteraction, void* data ) ;
+
+	/* +++ Public Functions +++ */
+
+	/* Wrappers to virtual functions */
+	void lucWindowInteraction_MouseMotion( void* windowInteractor, lucWindow* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty) ;
+	void lucWindowInteraction_MouseClick( void* windowInteractor, lucWindow* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) ;
+	void lucWindowInteraction_MouseMessage( void* windowInteractor, Stream* stream ) ;
+	void lucWindowInteraction_KeyboardEvent( void* windowInteractor, lucWindow* window, char key, Pixel_Index xpos, Pixel_Index ypos) ;
+	void lucWindowInteraction_KeyboardMessage( void* windowInteraction, Stream* stream ) ;
+
+	/** Default interactivity implementations */
+	void _lucWindowInteraction_MouseMotion( void* windowInteraction, lucWindow* window, lucMouseButton button, Pixel_Index xpos, Pixel_Index ypos, Pixel_Index startx, Pixel_Index starty) ;
+	void _lucWindowInteraction_MouseClick( void* windowInteraction, lucWindow* window, lucMouseButton button, lucMouseState state, Pixel_Index xpos, Pixel_Index ypos) ;
+	void _lucWindowInteraction_MouseMessage( void* windowInteractor, Stream* stream ) ;
+	void _lucWindowInteraction_KeyboardEvent( void* windowInteraction, lucWindow* window, char key, Pixel_Index xpos, Pixel_Index ypos) ;
+	void _lucWindowInteraction_KeyboardMessage( void* windowInteractor, Stream* stream ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/WindowInteraction.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/WindowInteraction.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucWindowInteraction</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/Base/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">A class setting up an interface through which the user can interact with the window through mouse and keyboard input. A default implementation is given with this class.</param>
+
+<!--Now the interesting stuff-->
+<list name="Params">
+</list>
+
+<list name="Dependencies">
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/WindowInteraction_Register.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/WindowInteraction_Register.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,68 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "WindowInteraction_Register.h"
+#include "WindowInteraction.h"
+
+const Type lucWindowInteraction_Register_Type = "lucWindowInteraction_Register";
+
+lucWindowInteraction_Register*	lucWindowInteraction_Register_New( void ) {
+	lucWindowInteraction_Register* self;
+	
+	self = (lucWindowInteraction_Register*) _NamedObject_Register_New(
+		sizeof(lucWindowInteraction_Register),
+		lucWindowInteraction_Register_Type,
+		_NamedObject_Register_Delete,
+		_NamedObject_Register_Print,
+		_NamedObject_Register_Copy );
+
+	return self;
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/WindowInteraction_Register.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/WindowInteraction_Register.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,127 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Allows users to access lucWindowInteractions based on their textual name,
+**	or index.
+**
+** Assumptions:
+**
+** Comments:
+**
+**
+** $Id: WindowInteraction_Register.h 419 2005-11-29 12:04:20Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucWindowInteraction_Register_h__
+#define __lucWindowInteraction_Register_h__
+	
+	extern const Type lucWindowInteraction_Register_Type;
+	
+	#define __lucWindowInteraction_Register \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__NamedObject_Register \
+		\
+		/* Virtual functions go here */ \
+		\
+		/* Class info */ \
+
+	struct lucWindowInteraction_Register { __lucWindowInteraction_Register };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructor
+	*/
+	
+	lucWindowInteraction_Register*	lucWindowInteraction_Register_New( void );
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** General virtual functions
+	*/
+	
+	/*-----------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	#define lucWindowInteraction_Register_Add NamedObject_Register_Add
+
+	#define lucWindowInteraction_Register_GetIndex NamedObject_Register_GetIndex 
+
+	#define lucWindowInteraction_Register_GetByName( self, materialName ) \
+		( (lucWindowInteraction*) NamedObject_Register_GetByName( self, materialName ) ) 
+
+	#define lucWindowInteraction_Register_GetByIndex( self, materialIndex ) \
+		( (lucWindowInteraction*) NamedObject_Register_GetByIndex( self, materialIndex ) )
+
+	#define lucWindowInteraction_Register_GetCount( self ) \
+		(self)->objects->count
+	
+	#define lucWindowInteraction_Register_DeleteAllObjects( self ) \
+		Stg_ObjectList_DeleteAllObjects( (self)->objects )
+	#define lucWindowInteraction_Register_PrintAllObjects( self, stream ) \
+		Stg_ObjectList_PrintAllObjects( (self)->objects, stream )
+
+	/* +++ Public Functions +++ */
+
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/X11Colours.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/X11Colours.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,2087 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: X11Colours.c 616 2006-08-31 07:08:25Z KathleenHumble $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "ColourMap.h"
+#include "X11Colours.h"
+#include <ctype.h>
+#include <string.h>
+
+/* Reads hex or colour from X11 Colour Chart */
+/* Defaults to black if anything else */
+void lucColour_FromX11ColourName( lucColour* self, Name x11ColourName ) {
+	int rgb[3];
+
+	if (strncmp(x11ColourName,"#",1) == 0) {
+		lucColour_FromHexName( self, x11ColourName );
+		return;
+	}
+	else if (strncasecmp(x11ColourName,"snow",4) == 0) {
+		rgb[0] = 255;	rgb[1] = 250;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"GhostWhite",10) == 0) {
+		rgb[0] = 248;	rgb[1] = 248;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"WhiteSmoke",10) == 0) {
+		rgb[0] = 245;	rgb[1] = 245;	rgb[2] = 245;
+	}
+	else if (strncasecmp(x11ColourName,"gainsboro",9) == 0) {
+		rgb[0] = 220;	rgb[1] = 220;	rgb[2] = 220;
+	}
+	else if (strncasecmp(x11ColourName,"FloralWhite",11) == 0) {
+		rgb[0] = 255;	rgb[1] = 250;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"OldLace",7) == 0) {
+		rgb[0] = 253;	rgb[1] = 245;	rgb[2] = 230;
+	}
+	else if (strncasecmp(x11ColourName,"linen",5) == 0) {
+		rgb[0] = 250;	rgb[1] = 240;	rgb[2] = 230;
+	}
+	else if (strncasecmp(x11ColourName,"AntiqueWhite",12) == 0) {
+		rgb[0] = 250;	rgb[1] = 235;	rgb[2] = 215;
+	}
+	else if (strncasecmp(x11ColourName,"PapayaWhip",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 239;	rgb[2] = 213;
+	}
+	else if (strncasecmp(x11ColourName,"BlanchedAlmond",14) == 0) {
+		rgb[0] = 255;	rgb[1] = 235;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"bisque",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 228;	rgb[2] = 196;
+	}
+	else if (strncasecmp(x11ColourName,"PeachPuff",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 218;	rgb[2] = 185;
+	}
+	else if (strncasecmp(x11ColourName,"NavajoWhite",11) == 0) {
+		rgb[0] = 255;	rgb[1] = 222;	rgb[2] = 173;
+	}
+	else if (strncasecmp(x11ColourName,"moccasin",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 228;	rgb[2] = 181;
+	}
+	else if (strncasecmp(x11ColourName,"cornsilk",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 248;	rgb[2] = 220;
+	}
+	else if (strncasecmp(x11ColourName,"ivory",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"LemonChiffon",12) == 0) {
+		rgb[0] = 255;	rgb[1] = 250;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"seashell",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 245;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"honeydew",8) == 0) {
+		rgb[0] = 240;	rgb[1] = 255;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"MintCream",9) == 0) {
+		rgb[0] = 245;	rgb[1] = 255;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"azure",5) == 0) {
+		rgb[0] = 240;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"AliceBlue",9) == 0) {
+		rgb[0] = 240;	rgb[1] = 248;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"lavender",8) == 0) {
+		rgb[0] = 230;	rgb[1] = 230;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"LavenderBlush",13) == 0) {
+		rgb[0] = 255;	rgb[1] = 240;	rgb[2] = 245;
+	}
+	else if (strncasecmp(x11ColourName,"MistyRose",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 228;	rgb[2] = 225;
+	}
+	else if (strncasecmp(x11ColourName,"white",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"black",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateGray",13) == 0) {
+		rgb[0] = 47;	rgb[1] = 79;	rgb[2] = 79;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateGrey",13) == 0) {
+		rgb[0] = 47;	rgb[1] = 79;	rgb[2] = 79;
+	}
+	else if (strncasecmp(x11ColourName,"DimGray",7) == 0) {
+		rgb[0] = 105;	rgb[1] = 105;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"DimGrey",7) == 0) {
+		rgb[0] = 105;	rgb[1] = 105;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"SlateGray",9) == 0) {
+		rgb[0] = 112;	rgb[1] = 128;	rgb[2] = 144;
+	}
+	else if (strncasecmp(x11ColourName,"SlateGrey",9) == 0) {
+		rgb[0] = 112;	rgb[1] = 128;	rgb[2] = 144;
+	}
+	else if (strncasecmp(x11ColourName,"LightSlateGray",14) == 0) {
+		rgb[0] = 119;	rgb[1] = 136;	rgb[2] = 153;
+	}
+	else if (strncasecmp(x11ColourName,"LightSlateGrey",14) == 0) {
+		rgb[0] = 119;	rgb[1] = 136;	rgb[2] = 153;
+	}
+	else if (strncasecmp(x11ColourName,"gray",4) == 0) {
+		rgb[0] = 190;	rgb[1] = 190;	rgb[2] = 190;
+	}
+	else if (strncasecmp(x11ColourName,"grey",4) == 0) {
+		rgb[0] = 190;	rgb[1] = 190;	rgb[2] = 190;
+	}
+	else if (strncasecmp(x11ColourName,"LightGrey",9) == 0) {
+		rgb[0] = 211;	rgb[1] = 211;	rgb[2] = 211;
+	}
+	else if (strncasecmp(x11ColourName,"LightGray",9) == 0) {
+		rgb[0] = 211;	rgb[1] = 211;	rgb[2] = 211;
+	}
+	else if (strncasecmp(x11ColourName,"MidnightBlue",12) == 0) {
+		rgb[0] = 25;	rgb[1] = 25;	rgb[2] = 112;
+	}
+	else if (strncasecmp(x11ColourName,"navy",4) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 128;
+	}
+	else if (strncasecmp(x11ColourName,"NavyBlue",8) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 128;
+	}
+	else if (strncasecmp(x11ColourName,"CornflowerBlue",14) == 0) {
+		rgb[0] = 100;	rgb[1] = 149;	rgb[2] = 237;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateBlue",13) == 0) {
+		rgb[0] = 72;	rgb[1] = 61;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"SlateBlue",9) == 0) {
+		rgb[0] = 106;	rgb[1] = 90;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"MediumSlateBlue",15) == 0) {
+		rgb[0] = 123;	rgb[1] = 104;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"LightSlateBlue",14) == 0) {
+		rgb[0] = 132;	rgb[1] = 112;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"MediumBlue",10) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"RoyalBlue",9) == 0) {
+		rgb[0] = 65;	rgb[1] = 105;	rgb[2] = 225;
+	}
+	else if (strncasecmp(x11ColourName,"blue",4) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DodgerBlue",10) == 0) {
+		rgb[0] = 30;	rgb[1] = 144;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DeepSkyBlue",11) == 0) {
+		rgb[0] = 0;	rgb[1] = 191;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"SkyBlue",7) == 0) {
+		rgb[0] = 135;	rgb[1] = 206;	rgb[2] = 235;
+	}
+	else if (strncasecmp(x11ColourName,"LightSkyBlue",12) == 0) {
+		rgb[0] = 135;	rgb[1] = 206;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"SteelBlue",9) == 0) {
+		rgb[0] = 70;	rgb[1] = 130;	rgb[2] = 180;
+	}
+	else if (strncasecmp(x11ColourName,"LightSteelBlue",14) == 0) {
+		rgb[0] = 176;	rgb[1] = 196;	rgb[2] = 222;
+	}
+	else if (strncasecmp(x11ColourName,"LightBlue",9) == 0) {
+		rgb[0] = 173;	rgb[1] = 216;	rgb[2] = 230;
+	}
+	else if (strncasecmp(x11ColourName,"PowderBlue",10) == 0) {
+		rgb[0] = 176;	rgb[1] = 224;	rgb[2] = 230;
+	}
+	else if (strncasecmp(x11ColourName,"PaleTurquoise",13) == 0) {
+		rgb[0] = 175;	rgb[1] = 238;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"DarkTurquoise",13) == 0) {
+		rgb[0] = 0;	rgb[1] = 206;	rgb[2] = 209;
+	}
+	else if (strncasecmp(x11ColourName,"MediumTurquoise",15) == 0) {
+		rgb[0] = 72;	rgb[1] = 209;	rgb[2] = 204;
+	}
+	else if (strncasecmp(x11ColourName,"turquoise",9) == 0) {
+		rgb[0] = 64;	rgb[1] = 224;	rgb[2] = 208;
+	}
+	else if (strncasecmp(x11ColourName,"cyan",4) == 0) {
+		rgb[0] = 0;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"LightCyan",9) == 0) {
+		rgb[0] = 224;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"CadetBlue",9) == 0) {
+		rgb[0] = 95;	rgb[1] = 158;	rgb[2] = 160;
+	}
+	else if (strncasecmp(x11ColourName,"MediumAquamarine",16) == 0) {
+		rgb[0] = 102;	rgb[1] = 205;	rgb[2] = 170;
+	}
+	else if (strncasecmp(x11ColourName,"aquamarine",10) == 0) {
+		rgb[0] = 127;	rgb[1] = 255;	rgb[2] = 212;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGreen",9) == 0) {
+		rgb[0] = 0;	rgb[1] = 100;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOliveGreen",14) == 0) {
+		rgb[0] = 85;	rgb[1] = 107;	rgb[2] = 47;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSeaGreen",12) == 0) {
+		rgb[0] = 143;	rgb[1] = 188;	rgb[2] = 143;
+	}
+	else if (strncasecmp(x11ColourName,"SeaGreen",8) == 0) {
+		rgb[0] = 46;	rgb[1] = 139;	rgb[2] = 87;
+	}
+	else if (strncasecmp(x11ColourName,"MediumSeaGreen",14) == 0) {
+		rgb[0] = 60;	rgb[1] = 179;	rgb[2] = 113;
+	}
+	else if (strncasecmp(x11ColourName,"LightSeaGreen",13) == 0) {
+		rgb[0] = 32;	rgb[1] = 178;	rgb[2] = 170;
+	}
+	else if (strncasecmp(x11ColourName,"PaleGreen",9) == 0) {
+		rgb[0] = 152;	rgb[1] = 251;	rgb[2] = 152;
+	}
+	else if (strncasecmp(x11ColourName,"SpringGreen",11) == 0) {
+		rgb[0] = 0;	rgb[1] = 255;	rgb[2] = 127;
+	}
+	else if (strncasecmp(x11ColourName,"LawnGreen",9) == 0) {
+		rgb[0] = 124;	rgb[1] = 252;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"green",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 255;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"chartreuse",10) == 0) {
+		rgb[0] = 127;	rgb[1] = 255;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"MediumSpringGreen",17) == 0) {
+		rgb[0] = 0;	rgb[1] = 250;	rgb[2] = 154;
+	}
+	else if (strncasecmp(x11ColourName,"GreenYellow",11) == 0) {
+		rgb[0] = 173;	rgb[1] = 255;	rgb[2] = 47;
+	}
+	else if (strncasecmp(x11ColourName,"LimeGreen",9) == 0) {
+		rgb[0] = 50;	rgb[1] = 205;	rgb[2] = 50;
+	}
+	else if (strncasecmp(x11ColourName,"YellowGreen",11) == 0) {
+		rgb[0] = 154;	rgb[1] = 205;	rgb[2] = 50;
+	}
+	else if (strncasecmp(x11ColourName,"ForestGreen",11) == 0) {
+		rgb[0] = 34;	rgb[1] = 139;	rgb[2] = 34;
+	}
+	else if (strncasecmp(x11ColourName,"OliveDrab",9) == 0) {
+		rgb[0] = 107;	rgb[1] = 142;	rgb[2] = 35;
+	}
+	else if (strncasecmp(x11ColourName,"DarkKhaki",9) == 0) {
+		rgb[0] = 189;	rgb[1] = 183;	rgb[2] = 107;
+	}
+	else if (strncasecmp(x11ColourName,"khaki",5) == 0) {
+		rgb[0] = 240;	rgb[1] = 230;	rgb[2] = 140;
+	}
+	else if (strncasecmp(x11ColourName,"PaleGoldenrod",13) == 0) {
+		rgb[0] = 238;	rgb[1] = 232;	rgb[2] = 170;
+	}
+	else if (strncasecmp(x11ColourName,"LightGoldenrodYellow",20) == 0) {
+		rgb[0] = 250;	rgb[1] = 250;	rgb[2] = 210;
+	}
+	else if (strncasecmp(x11ColourName,"LightYellow",11) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 224;
+	}
+	else if (strncasecmp(x11ColourName,"yellow",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"gold",4) == 0) {
+		rgb[0] = 255;	rgb[1] = 215;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"LightGoldenrod",14) == 0) {
+		rgb[0] = 238;	rgb[1] = 221;	rgb[2] = 130;
+	}
+	else if (strncasecmp(x11ColourName,"goldenrod",9) == 0) {
+		rgb[0] = 218;	rgb[1] = 165;	rgb[2] = 32;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGoldenrod",13) == 0) {
+		rgb[0] = 184;	rgb[1] = 134;	rgb[2] = 11;
+	}
+	else if (strncasecmp(x11ColourName,"RosyBrown",9) == 0) {
+		rgb[0] = 188;	rgb[1] = 143;	rgb[2] = 143;
+	}
+	else if (strncasecmp(x11ColourName,"IndianRed",9) == 0) {
+		rgb[0] = 205;	rgb[1] = 92;	rgb[2] = 92;
+	}
+	else if (strncasecmp(x11ColourName,"SaddleBrown",11) == 0) {
+		rgb[0] = 139;	rgb[1] = 69;	rgb[2] = 19;
+	}
+	else if (strncasecmp(x11ColourName,"sienna",6) == 0) {
+		rgb[0] = 160;	rgb[1] = 82;	rgb[2] = 45;
+	}
+	else if (strncasecmp(x11ColourName,"peru",4) == 0) {
+		rgb[0] = 205;	rgb[1] = 133;	rgb[2] = 63;
+	}
+	else if (strncasecmp(x11ColourName,"burlywood",9) == 0) {
+		rgb[0] = 222;	rgb[1] = 184;	rgb[2] = 135;
+	}
+	else if (strncasecmp(x11ColourName,"beige",5) == 0) {
+		rgb[0] = 245;	rgb[1] = 245;	rgb[2] = 220;
+	}
+	else if (strncasecmp(x11ColourName,"wheat",5) == 0) {
+		rgb[0] = 245;	rgb[1] = 222;	rgb[2] = 179;
+	}
+	else if (strncasecmp(x11ColourName,"SandyBrown",10) == 0) {
+		rgb[0] = 244;	rgb[1] = 164;	rgb[2] = 96;
+	}
+	else if (strncasecmp(x11ColourName,"tan",3) == 0) {
+		rgb[0] = 210;	rgb[1] = 180;	rgb[2] = 140;
+	}
+	else if (strncasecmp(x11ColourName,"chocolate",9) == 0) {
+		rgb[0] = 210;	rgb[1] = 105;	rgb[2] = 30;
+	}
+	else if (strncasecmp(x11ColourName,"firebrick",9) == 0) {
+		rgb[0] = 178;	rgb[1] = 34;	rgb[2] = 34;
+	}
+	else if (strncasecmp(x11ColourName,"brown",5) == 0) {
+		rgb[0] = 165;	rgb[1] = 42;	rgb[2] = 42;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSalmon",10) == 0) {
+		rgb[0] = 233;	rgb[1] = 150;	rgb[2] = 122;
+	}
+	else if (strncasecmp(x11ColourName,"salmon",6) == 0) {
+		rgb[0] = 250;	rgb[1] = 128;	rgb[2] = 114;
+	}
+	else if (strncasecmp(x11ColourName,"LightSalmon",11) == 0) {
+		rgb[0] = 255;	rgb[1] = 160;	rgb[2] = 122;
+	}
+	else if (strncasecmp(x11ColourName,"orange",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 165;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrange",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 140;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"coral",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 127;	rgb[2] = 80;
+	}
+	else if (strncasecmp(x11ColourName,"LightCoral",10) == 0) {
+		rgb[0] = 240;	rgb[1] = 128;	rgb[2] = 128;
+	}
+	else if (strncasecmp(x11ColourName,"tomato",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 99;	rgb[2] = 71;
+	}
+	else if (strncasecmp(x11ColourName,"OrangeRed",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 69;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"red",3) == 0) {
+		rgb[0] = 255;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"HotPink",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 105;	rgb[2] = 180;
+	}
+	else if (strncasecmp(x11ColourName,"DeepPink",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 20;	rgb[2] = 147;
+	}
+	else if (strncasecmp(x11ColourName,"pink",4) == 0) {
+		rgb[0] = 255;	rgb[1] = 192;	rgb[2] = 203;
+	}
+	else if (strncasecmp(x11ColourName,"LightPink",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 182;	rgb[2] = 193;
+	}
+	else if (strncasecmp(x11ColourName,"PaleVioletRed",13) == 0) {
+		rgb[0] = 219;	rgb[1] = 112;	rgb[2] = 147;
+	}
+	else if (strncasecmp(x11ColourName,"maroon",6) == 0) {
+		rgb[0] = 176;	rgb[1] = 48;	rgb[2] = 96;
+	}
+	else if (strncasecmp(x11ColourName,"MediumVioletRed",15) == 0) {
+		rgb[0] = 199;	rgb[1] = 21;	rgb[2] = 133;
+	}
+	else if (strncasecmp(x11ColourName,"VioletRed",9) == 0) {
+		rgb[0] = 208;	rgb[1] = 32;	rgb[2] = 144;
+	}
+	else if (strncasecmp(x11ColourName,"magenta",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 0;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"violet",6) == 0) {
+		rgb[0] = 238;	rgb[1] = 130;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"plum",4) == 0) {
+		rgb[0] = 221;	rgb[1] = 160;	rgb[2] = 221;
+	}
+	else if (strncasecmp(x11ColourName,"orchid",6) == 0) {
+		rgb[0] = 218;	rgb[1] = 112;	rgb[2] = 214;
+	}
+	else if (strncasecmp(x11ColourName,"MediumOrchid",12) == 0) {
+		rgb[0] = 186;	rgb[1] = 85;	rgb[2] = 211;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrchid",10) == 0) {
+		rgb[0] = 153;	rgb[1] = 50;	rgb[2] = 204;
+	}
+	else if (strncasecmp(x11ColourName,"DarkViolet",10) == 0) {
+		rgb[0] = 148;	rgb[1] = 0;	rgb[2] = 211;
+	}
+	else if (strncasecmp(x11ColourName,"BlueViolet",10) == 0) {
+		rgb[0] = 138;	rgb[1] = 43;	rgb[2] = 226;
+	}
+	else if (strncasecmp(x11ColourName,"purple",6) == 0) {
+		rgb[0] = 160;	rgb[1] = 32;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"MediumPurple",12) == 0) {
+		rgb[0] = 147;	rgb[1] = 112;	rgb[2] = 219;
+	}
+	else if (strncasecmp(x11ColourName,"thistle",7) == 0) {
+		rgb[0] = 216;	rgb[1] = 191;	rgb[2] = 216;
+	}
+	else if (strncasecmp(x11ColourName,"snow1",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 250;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"snow2",5) == 0) {
+		rgb[0] = 238;	rgb[1] = 233;	rgb[2] = 233;
+	}
+	else if (strncasecmp(x11ColourName,"snow3",5) == 0) {
+		rgb[0] = 205;	rgb[1] = 201;	rgb[2] = 201;
+	}
+	else if (strncasecmp(x11ColourName,"snow4",5) == 0) {
+		rgb[0] = 139;	rgb[1] = 137;	rgb[2] = 137;
+	}
+	else if (strncasecmp(x11ColourName,"seashell1",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 245;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"seashell2",9) == 0) {
+		rgb[0] = 238;	rgb[1] = 229;	rgb[2] = 222;
+	}
+	else if (strncasecmp(x11ColourName,"seashell3",9) == 0) {
+		rgb[0] = 205;	rgb[1] = 197;	rgb[2] = 191;
+	}
+	else if (strncasecmp(x11ColourName,"seashell4",9) == 0) {
+		rgb[0] = 139;	rgb[1] = 134;	rgb[2] = 130;
+	}
+	else if (strncasecmp(x11ColourName,"AntiqueWhite1",13) == 0) {
+		rgb[0] = 255;	rgb[1] = 239;	rgb[2] = 219;
+	}
+	else if (strncasecmp(x11ColourName,"AntiqueWhite2",13) == 0) {
+		rgb[0] = 238;	rgb[1] = 223;	rgb[2] = 204;
+	}
+	else if (strncasecmp(x11ColourName,"AntiqueWhite3",13) == 0) {
+		rgb[0] = 205;	rgb[1] = 192;	rgb[2] = 176;
+	}
+	else if (strncasecmp(x11ColourName,"AntiqueWhite4",13) == 0) {
+		rgb[0] = 139;	rgb[1] = 131;	rgb[2] = 120;
+	}
+	else if (strncasecmp(x11ColourName,"bisque1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 228;	rgb[2] = 196;
+	}
+	else if (strncasecmp(x11ColourName,"bisque2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 213;	rgb[2] = 183;
+	}
+	else if (strncasecmp(x11ColourName,"bisque3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 183;	rgb[2] = 158;
+	}
+	else if (strncasecmp(x11ColourName,"bisque4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 125;	rgb[2] = 107;
+	}
+	else if (strncasecmp(x11ColourName,"PeachPuff1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 218;	rgb[2] = 185;
+	}
+	else if (strncasecmp(x11ColourName,"PeachPuff2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 203;	rgb[2] = 173;
+	}
+	else if (strncasecmp(x11ColourName,"PeachPuff3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 175;	rgb[2] = 149;
+	}
+	else if (strncasecmp(x11ColourName,"PeachPuff4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 119;	rgb[2] = 101;
+	}
+	else if (strncasecmp(x11ColourName,"NavajoWhite1",12) == 0) {
+		rgb[0] = 255;	rgb[1] = 222;	rgb[2] = 173;
+	}
+	else if (strncasecmp(x11ColourName,"NavajoWhite2",12) == 0) {
+		rgb[0] = 238;	rgb[1] = 207;	rgb[2] = 161;
+	}
+	else if (strncasecmp(x11ColourName,"NavajoWhite3",12) == 0) {
+		rgb[0] = 205;	rgb[1] = 179;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"NavajoWhite4",12) == 0) {
+		rgb[0] = 139;	rgb[1] = 121;	rgb[2] = 94;
+	}
+	else if (strncasecmp(x11ColourName,"LemonChiffon1",13) == 0) {
+		rgb[0] = 255;	rgb[1] = 250;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"LemonChiffon2",13) == 0) {
+		rgb[0] = 238;	rgb[1] = 233;	rgb[2] = 191;
+	}
+	else if (strncasecmp(x11ColourName,"LemonChiffon3",13) == 0) {
+		rgb[0] = 205;	rgb[1] = 201;	rgb[2] = 165;
+	}
+	else if (strncasecmp(x11ColourName,"LemonChiffon4",13) == 0) {
+		rgb[0] = 139;	rgb[1] = 137;	rgb[2] = 112;
+	}
+	else if (strncasecmp(x11ColourName,"cornsilk1",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 248;	rgb[2] = 220;
+	}
+	else if (strncasecmp(x11ColourName,"cornsilk2",9) == 0) {
+		rgb[0] = 238;	rgb[1] = 232;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"cornsilk3",9) == 0) {
+		rgb[0] = 205;	rgb[1] = 200;	rgb[2] = 177;
+	}
+	else if (strncasecmp(x11ColourName,"cornsilk4",9) == 0) {
+		rgb[0] = 139;	rgb[1] = 136;	rgb[2] = 120;
+	}
+	else if (strncasecmp(x11ColourName,"ivory1",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"ivory2",6) == 0) {
+		rgb[0] = 238;	rgb[1] = 238;	rgb[2] = 224;
+	}
+	else if (strncasecmp(x11ColourName,"ivory3",6) == 0) {
+		rgb[0] = 205;	rgb[1] = 205;	rgb[2] = 193;
+	}
+	else if (strncasecmp(x11ColourName,"ivory4",6) == 0) {
+		rgb[0] = 139;	rgb[1] = 139;	rgb[2] = 131;
+	}
+	else if (strncasecmp(x11ColourName,"honeydew1",9) == 0) {
+		rgb[0] = 240;	rgb[1] = 255;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"honeydew2",9) == 0) {
+		rgb[0] = 224;	rgb[1] = 238;	rgb[2] = 224;
+	}
+	else if (strncasecmp(x11ColourName,"honeydew3",9) == 0) {
+		rgb[0] = 193;	rgb[1] = 205;	rgb[2] = 193;
+	}
+	else if (strncasecmp(x11ColourName,"honeydew4",9) == 0) {
+		rgb[0] = 131;	rgb[1] = 139;	rgb[2] = 131;
+	}
+	else if (strncasecmp(x11ColourName,"LavenderBlush1",14) == 0) {
+		rgb[0] = 255;	rgb[1] = 240;	rgb[2] = 245;
+	}
+	else if (strncasecmp(x11ColourName,"LavenderBlush2",14) == 0) {
+		rgb[0] = 238;	rgb[1] = 224;	rgb[2] = 229;
+	}
+	else if (strncasecmp(x11ColourName,"LavenderBlush3",14) == 0) {
+		rgb[0] = 205;	rgb[1] = 193;	rgb[2] = 197;
+	}
+	else if (strncasecmp(x11ColourName,"LavenderBlush4",14) == 0) {
+		rgb[0] = 139;	rgb[1] = 131;	rgb[2] = 134;
+	}
+	else if (strncasecmp(x11ColourName,"MistyRose1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 228;	rgb[2] = 225;
+	}
+	else if (strncasecmp(x11ColourName,"MistyRose2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 213;	rgb[2] = 210;
+	}
+	else if (strncasecmp(x11ColourName,"MistyRose3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 183;	rgb[2] = 181;
+	}
+	else if (strncasecmp(x11ColourName,"MistyRose4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 125;	rgb[2] = 123;
+	}
+	else if (strncasecmp(x11ColourName,"azure1",6) == 0) {
+		rgb[0] = 240;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"azure2",6) == 0) {
+		rgb[0] = 224;	rgb[1] = 238;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"azure3",6) == 0) {
+		rgb[0] = 193;	rgb[1] = 205;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"azure4",6) == 0) {
+		rgb[0] = 131;	rgb[1] = 139;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"SlateBlue1",10) == 0) {
+		rgb[0] = 131;	rgb[1] = 111;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"SlateBlue2",10) == 0) {
+		rgb[0] = 122;	rgb[1] = 103;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"SlateBlue3",10) == 0) {
+		rgb[0] = 105;	rgb[1] = 89;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"SlateBlue4",10) == 0) {
+		rgb[0] = 71;	rgb[1] = 60;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"RoyalBlue1",10) == 0) {
+		rgb[0] = 72;	rgb[1] = 118;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"RoyalBlue2",10) == 0) {
+		rgb[0] = 67;	rgb[1] = 110;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"RoyalBlue3",10) == 0) {
+		rgb[0] = 58;	rgb[1] = 95;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"RoyalBlue4",10) == 0) {
+		rgb[0] = 39;	rgb[1] = 64;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"blue1",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"blue2",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"blue3",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"blue4",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DodgerBlue1",11) == 0) {
+		rgb[0] = 30;	rgb[1] = 144;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DodgerBlue2",11) == 0) {
+		rgb[0] = 28;	rgb[1] = 134;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"DodgerBlue3",11) == 0) {
+		rgb[0] = 24;	rgb[1] = 116;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"DodgerBlue4",11) == 0) {
+		rgb[0] = 16;	rgb[1] = 78;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"SteelBlue1",10) == 0) {
+		rgb[0] = 99;	rgb[1] = 184;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"SteelBlue2",10) == 0) {
+		rgb[0] = 92;	rgb[1] = 172;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"SteelBlue3",10) == 0) {
+		rgb[0] = 79;	rgb[1] = 148;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"SteelBlue4",10) == 0) {
+		rgb[0] = 54;	rgb[1] = 100;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DeepSkyBlue1",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 191;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DeepSkyBlue2",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 178;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"DeepSkyBlue3",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 154;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"DeepSkyBlue4",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 104;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"SkyBlue1",8) == 0) {
+		rgb[0] = 135;	rgb[1] = 206;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"SkyBlue2",8) == 0) {
+		rgb[0] = 126;	rgb[1] = 192;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"SkyBlue3",8) == 0) {
+		rgb[0] = 108;	rgb[1] = 166;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"SkyBlue4",8) == 0) {
+		rgb[0] = 74;	rgb[1] = 112;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"LightSkyBlue1",13) == 0) {
+		rgb[0] = 176;	rgb[1] = 226;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"LightSkyBlue2",13) == 0) {
+		rgb[0] = 164;	rgb[1] = 211;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"LightSkyBlue3",13) == 0) {
+		rgb[0] = 141;	rgb[1] = 182;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"LightSkyBlue4",13) == 0) {
+		rgb[0] = 96;	rgb[1] = 123;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"SlateGray1",10) == 0) {
+		rgb[0] = 198;	rgb[1] = 226;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"SlateGray2",10) == 0) {
+		rgb[0] = 185;	rgb[1] = 211;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"SlateGray3",10) == 0) {
+		rgb[0] = 159;	rgb[1] = 182;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"SlateGray4",10) == 0) {
+		rgb[0] = 108;	rgb[1] = 123;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"LightSteelBlue1",15) == 0) {
+		rgb[0] = 202;	rgb[1] = 225;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"LightSteelBlue2",15) == 0) {
+		rgb[0] = 188;	rgb[1] = 210;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"LightSteelBlue3",15) == 0) {
+		rgb[0] = 162;	rgb[1] = 181;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"LightSteelBlue4",15) == 0) {
+		rgb[0] = 110;	rgb[1] = 123;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"LightBlue1",10) == 0) {
+		rgb[0] = 191;	rgb[1] = 239;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"LightBlue2",10) == 0) {
+		rgb[0] = 178;	rgb[1] = 223;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"LightBlue3",10) == 0) {
+		rgb[0] = 154;	rgb[1] = 192;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"LightBlue4",10) == 0) {
+		rgb[0] = 104;	rgb[1] = 131;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"LightCyan1",10) == 0) {
+		rgb[0] = 224;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"LightCyan2",10) == 0) {
+		rgb[0] = 209;	rgb[1] = 238;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"LightCyan3",10) == 0) {
+		rgb[0] = 180;	rgb[1] = 205;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"LightCyan4",10) == 0) {
+		rgb[0] = 122;	rgb[1] = 139;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"PaleTurquoise1",14) == 0) {
+		rgb[0] = 187;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"PaleTurquoise2",14) == 0) {
+		rgb[0] = 174;	rgb[1] = 238;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"PaleTurquoise3",14) == 0) {
+		rgb[0] = 150;	rgb[1] = 205;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"PaleTurquoise4",14) == 0) {
+		rgb[0] = 102;	rgb[1] = 139;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"CadetBlue1",10) == 0) {
+		rgb[0] = 152;	rgb[1] = 245;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"CadetBlue2",10) == 0) {
+		rgb[0] = 142;	rgb[1] = 229;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"CadetBlue3",10) == 0) {
+		rgb[0] = 122;	rgb[1] = 197;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"CadetBlue4",10) == 0) {
+		rgb[0] = 83;	rgb[1] = 134;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"turquoise1",10) == 0) {
+		rgb[0] = 0;	rgb[1] = 245;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"turquoise2",10) == 0) {
+		rgb[0] = 0;	rgb[1] = 229;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"turquoise3",10) == 0) {
+		rgb[0] = 0;	rgb[1] = 197;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"turquoise4",10) == 0) {
+		rgb[0] = 0;	rgb[1] = 134;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"cyan1",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"cyan2",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 238;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"cyan3",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 205;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"cyan4",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 139;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateGray1",14) == 0) {
+		rgb[0] = 151;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateGray2",14) == 0) {
+		rgb[0] = 141;	rgb[1] = 238;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateGray3",14) == 0) {
+		rgb[0] = 121;	rgb[1] = 205;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSlateGray4",14) == 0) {
+		rgb[0] = 82;	rgb[1] = 139;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"aquamarine1",11) == 0) {
+		rgb[0] = 127;	rgb[1] = 255;	rgb[2] = 212;
+	}
+	else if (strncasecmp(x11ColourName,"aquamarine2",11) == 0) {
+		rgb[0] = 118;	rgb[1] = 238;	rgb[2] = 198;
+	}
+	else if (strncasecmp(x11ColourName,"aquamarine3",11) == 0) {
+		rgb[0] = 102;	rgb[1] = 205;	rgb[2] = 170;
+	}
+	else if (strncasecmp(x11ColourName,"aquamarine4",11) == 0) {
+		rgb[0] = 69;	rgb[1] = 139;	rgb[2] = 116;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSeaGreen1",13) == 0) {
+		rgb[0] = 193;	rgb[1] = 255;	rgb[2] = 193;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSeaGreen2",13) == 0) {
+		rgb[0] = 180;	rgb[1] = 238;	rgb[2] = 180;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSeaGreen3",13) == 0) {
+		rgb[0] = 155;	rgb[1] = 205;	rgb[2] = 155;
+	}
+	else if (strncasecmp(x11ColourName,"DarkSeaGreen4",13) == 0) {
+		rgb[0] = 105;	rgb[1] = 139;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"SeaGreen1",9) == 0) {
+		rgb[0] = 84;	rgb[1] = 255;	rgb[2] = 159;
+	}
+	else if (strncasecmp(x11ColourName,"SeaGreen2",9) == 0) {
+		rgb[0] = 78;	rgb[1] = 238;	rgb[2] = 148;
+	}
+	else if (strncasecmp(x11ColourName,"SeaGreen3",9) == 0) {
+		rgb[0] = 67;	rgb[1] = 205;	rgb[2] = 128;
+	}
+	else if (strncasecmp(x11ColourName,"SeaGreen4",9) == 0) {
+		rgb[0] = 46;	rgb[1] = 139;	rgb[2] = 87;
+	}
+	else if (strncasecmp(x11ColourName,"PaleGreen1",10) == 0) {
+		rgb[0] = 154;	rgb[1] = 255;	rgb[2] = 154;
+	}
+	else if (strncasecmp(x11ColourName,"PaleGreen2",10) == 0) {
+		rgb[0] = 144;	rgb[1] = 238;	rgb[2] = 144;
+	}
+	else if (strncasecmp(x11ColourName,"PaleGreen3",10) == 0) {
+		rgb[0] = 124;	rgb[1] = 205;	rgb[2] = 124;
+	}
+	else if (strncasecmp(x11ColourName,"PaleGreen4",10) == 0) {
+		rgb[0] = 84;	rgb[1] = 139;	rgb[2] = 84;
+	}
+	else if (strncasecmp(x11ColourName,"SpringGreen1",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 255;	rgb[2] = 127;
+	}
+	else if (strncasecmp(x11ColourName,"SpringGreen2",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 238;	rgb[2] = 118;
+	}
+	else if (strncasecmp(x11ColourName,"SpringGreen3",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 205;	rgb[2] = 102;
+	}
+	else if (strncasecmp(x11ColourName,"SpringGreen4",12) == 0) {
+		rgb[0] = 0;	rgb[1] = 139;	rgb[2] = 69;
+	}
+	else if (strncasecmp(x11ColourName,"green1",6) == 0) {
+		rgb[0] = 0;	rgb[1] = 255;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"green2",6) == 0) {
+		rgb[0] = 0;	rgb[1] = 238;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"green3",6) == 0) {
+		rgb[0] = 0;	rgb[1] = 205;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"green4",6) == 0) {
+		rgb[0] = 0;	rgb[1] = 139;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"chartreuse1",11) == 0) {
+		rgb[0] = 127;	rgb[1] = 255;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"chartreuse2",11) == 0) {
+		rgb[0] = 118;	rgb[1] = 238;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"chartreuse3",11) == 0) {
+		rgb[0] = 102;	rgb[1] = 205;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"chartreuse4",11) == 0) {
+		rgb[0] = 69;	rgb[1] = 139;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"OliveDrab1",10) == 0) {
+		rgb[0] = 192;	rgb[1] = 255;	rgb[2] = 62;
+	}
+	else if (strncasecmp(x11ColourName,"OliveDrab2",10) == 0) {
+		rgb[0] = 179;	rgb[1] = 238;	rgb[2] = 58;
+	}
+	else if (strncasecmp(x11ColourName,"OliveDrab3",10) == 0) {
+		rgb[0] = 154;	rgb[1] = 205;	rgb[2] = 50;
+	}
+	else if (strncasecmp(x11ColourName,"OliveDrab4",10) == 0) {
+		rgb[0] = 105;	rgb[1] = 139;	rgb[2] = 34;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOliveGreen1",15) == 0) {
+		rgb[0] = 202;	rgb[1] = 255;	rgb[2] = 112;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOliveGreen2",15) == 0) {
+		rgb[0] = 188;	rgb[1] = 238;	rgb[2] = 104;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOliveGreen3",15) == 0) {
+		rgb[0] = 162;	rgb[1] = 205;	rgb[2] = 90;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOliveGreen4",15) == 0) {
+		rgb[0] = 110;	rgb[1] = 139;	rgb[2] = 61;
+	}
+	else if (strncasecmp(x11ColourName,"khaki1",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 246;	rgb[2] = 143;
+	}
+	else if (strncasecmp(x11ColourName,"khaki2",6) == 0) {
+		rgb[0] = 238;	rgb[1] = 230;	rgb[2] = 133;
+	}
+	else if (strncasecmp(x11ColourName,"khaki3",6) == 0) {
+		rgb[0] = 205;	rgb[1] = 198;	rgb[2] = 115;
+	}
+	else if (strncasecmp(x11ColourName,"khaki4",6) == 0) {
+		rgb[0] = 139;	rgb[1] = 134;	rgb[2] = 78;
+	}
+	else if (strncasecmp(x11ColourName,"LightGoldenrod1",15) == 0) {
+		rgb[0] = 255;	rgb[1] = 236;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"LightGoldenrod2",15) == 0) {
+		rgb[0] = 238;	rgb[1] = 220;	rgb[2] = 130;
+	}
+	else if (strncasecmp(x11ColourName,"LightGoldenrod3",15) == 0) {
+		rgb[0] = 205;	rgb[1] = 190;	rgb[2] = 112;
+	}
+	else if (strncasecmp(x11ColourName,"LightGoldenrod4",15) == 0) {
+		rgb[0] = 139;	rgb[1] = 129;	rgb[2] = 76;
+	}
+	else if (strncasecmp(x11ColourName,"LightYellow1",12) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 224;
+	}
+	else if (strncasecmp(x11ColourName,"LightYellow2",12) == 0) {
+		rgb[0] = 238;	rgb[1] = 238;	rgb[2] = 209;
+	}
+	else if (strncasecmp(x11ColourName,"LightYellow3",12) == 0) {
+		rgb[0] = 205;	rgb[1] = 205;	rgb[2] = 180;
+	}
+	else if (strncasecmp(x11ColourName,"LightYellow4",12) == 0) {
+		rgb[0] = 139;	rgb[1] = 139;	rgb[2] = 122;
+	}
+	else if (strncasecmp(x11ColourName,"yellow1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"yellow2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 238;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"yellow3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 205;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"yellow4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 139;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"gold1",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 215;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"gold2",5) == 0) {
+		rgb[0] = 238;	rgb[1] = 201;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"gold3",5) == 0) {
+		rgb[0] = 205;	rgb[1] = 173;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"gold4",5) == 0) {
+		rgb[0] = 139;	rgb[1] = 117;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"goldenrod1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 193;	rgb[2] = 37;
+	}
+	else if (strncasecmp(x11ColourName,"goldenrod2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 180;	rgb[2] = 34;
+	}
+	else if (strncasecmp(x11ColourName,"goldenrod3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 155;	rgb[2] = 29;
+	}
+	else if (strncasecmp(x11ColourName,"goldenrod4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 105;	rgb[2] = 20;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGoldenrod1",14) == 0) {
+		rgb[0] = 255;	rgb[1] = 185;	rgb[2] = 15;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGoldenrod2",14) == 0) {
+		rgb[0] = 238;	rgb[1] = 173;	rgb[2] = 14;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGoldenrod3",14) == 0) {
+		rgb[0] = 205;	rgb[1] = 149;	rgb[2] = 12;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGoldenrod4",14) == 0) {
+		rgb[0] = 139;	rgb[1] = 101;	rgb[2] = 8;
+	}
+	else if (strncasecmp(x11ColourName,"RosyBrown1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 193;	rgb[2] = 193;
+	}
+	else if (strncasecmp(x11ColourName,"RosyBrown2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 180;	rgb[2] = 180;
+	}
+	else if (strncasecmp(x11ColourName,"RosyBrown3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 155;	rgb[2] = 155;
+	}
+	else if (strncasecmp(x11ColourName,"RosyBrown4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 105;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"IndianRed1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 106;	rgb[2] = 106;
+	}
+	else if (strncasecmp(x11ColourName,"IndianRed2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 99;	rgb[2] = 99;
+	}
+	else if (strncasecmp(x11ColourName,"IndianRed3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 85;	rgb[2] = 85;
+	}
+	else if (strncasecmp(x11ColourName,"IndianRed4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 58;	rgb[2] = 58;
+	}
+	else if (strncasecmp(x11ColourName,"sienna1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 130;	rgb[2] = 71;
+	}
+	else if (strncasecmp(x11ColourName,"sienna2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 121;	rgb[2] = 66;
+	}
+	else if (strncasecmp(x11ColourName,"sienna3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 104;	rgb[2] = 57;
+	}
+	else if (strncasecmp(x11ColourName,"sienna4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 71;	rgb[2] = 38;
+	}
+	else if (strncasecmp(x11ColourName,"burlywood1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 211;	rgb[2] = 155;
+	}
+	else if (strncasecmp(x11ColourName,"burlywood2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 197;	rgb[2] = 145;
+	}
+	else if (strncasecmp(x11ColourName,"burlywood3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 170;	rgb[2] = 125;
+	}
+	else if (strncasecmp(x11ColourName,"burlywood4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 115;	rgb[2] = 85;
+	}
+	else if (strncasecmp(x11ColourName,"wheat1",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 231;	rgb[2] = 186;
+	}
+	else if (strncasecmp(x11ColourName,"wheat2",6) == 0) {
+		rgb[0] = 238;	rgb[1] = 216;	rgb[2] = 174;
+	}
+	else if (strncasecmp(x11ColourName,"wheat3",6) == 0) {
+		rgb[0] = 205;	rgb[1] = 186;	rgb[2] = 150;
+	}
+	else if (strncasecmp(x11ColourName,"wheat4",6) == 0) {
+		rgb[0] = 139;	rgb[1] = 126;	rgb[2] = 102;
+	}
+	else if (strncasecmp(x11ColourName,"tan1",4) == 0) {
+		rgb[0] = 255;	rgb[1] = 165;	rgb[2] = 79;
+	}
+	else if (strncasecmp(x11ColourName,"tan2",4) == 0) {
+		rgb[0] = 238;	rgb[1] = 154;	rgb[2] = 73;
+	}
+	else if (strncasecmp(x11ColourName,"tan3",4) == 0) {
+		rgb[0] = 205;	rgb[1] = 133;	rgb[2] = 63;
+	}
+	else if (strncasecmp(x11ColourName,"tan4",4) == 0) {
+		rgb[0] = 139;	rgb[1] = 90;	rgb[2] = 43;
+	}
+	else if (strncasecmp(x11ColourName,"chocolate1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 127;	rgb[2] = 36;
+	}
+	else if (strncasecmp(x11ColourName,"chocolate2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 118;	rgb[2] = 33;
+	}
+	else if (strncasecmp(x11ColourName,"chocolate3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 102;	rgb[2] = 29;
+	}
+	else if (strncasecmp(x11ColourName,"chocolate4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 69;	rgb[2] = 19;
+	}
+	else if (strncasecmp(x11ColourName,"firebrick1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 48;	rgb[2] = 48;
+	}
+	else if (strncasecmp(x11ColourName,"firebrick2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 44;	rgb[2] = 44;
+	}
+	else if (strncasecmp(x11ColourName,"firebrick3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 38;	rgb[2] = 38;
+	}
+	else if (strncasecmp(x11ColourName,"firebrick4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 26;	rgb[2] = 26;
+	}
+	else if (strncasecmp(x11ColourName,"brown1",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 64;	rgb[2] = 64;
+	}
+	else if (strncasecmp(x11ColourName,"brown2",6) == 0) {
+		rgb[0] = 238;	rgb[1] = 59;	rgb[2] = 59;
+	}
+	else if (strncasecmp(x11ColourName,"brown3",6) == 0) {
+		rgb[0] = 205;	rgb[1] = 51;	rgb[2] = 51;
+	}
+	else if (strncasecmp(x11ColourName,"brown4",6) == 0) {
+		rgb[0] = 139;	rgb[1] = 35;	rgb[2] = 35;
+	}
+	else if (strncasecmp(x11ColourName,"salmon1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 140;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"salmon2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 130;	rgb[2] = 98;
+	}
+	else if (strncasecmp(x11ColourName,"salmon3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 112;	rgb[2] = 84;
+	}
+	else if (strncasecmp(x11ColourName,"salmon4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 76;	rgb[2] = 57;
+	}
+	else if (strncasecmp(x11ColourName,"LightSalmon1",12) == 0) {
+		rgb[0] = 255;	rgb[1] = 160;	rgb[2] = 122;
+	}
+	else if (strncasecmp(x11ColourName,"LightSalmon2",12) == 0) {
+		rgb[0] = 238;	rgb[1] = 149;	rgb[2] = 114;
+	}
+	else if (strncasecmp(x11ColourName,"LightSalmon3",12) == 0) {
+		rgb[0] = 205;	rgb[1] = 129;	rgb[2] = 98;
+	}
+	else if (strncasecmp(x11ColourName,"LightSalmon4",12) == 0) {
+		rgb[0] = 139;	rgb[1] = 87;	rgb[2] = 66;
+	}
+	else if (strncasecmp(x11ColourName,"orange1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 165;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"orange2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 154;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"orange3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 133;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"orange4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 90;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrange1",11) == 0) {
+		rgb[0] = 255;	rgb[1] = 127;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrange2",11) == 0) {
+		rgb[0] = 238;	rgb[1] = 118;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrange3",11) == 0) {
+		rgb[0] = 205;	rgb[1] = 102;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrange4",11) == 0) {
+		rgb[0] = 139;	rgb[1] = 69;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"coral1",6) == 0) {
+		rgb[0] = 255;	rgb[1] = 114;	rgb[2] = 86;
+	}
+	else if (strncasecmp(x11ColourName,"coral2",6) == 0) {
+		rgb[0] = 238;	rgb[1] = 106;	rgb[2] = 80;
+	}
+	else if (strncasecmp(x11ColourName,"coral3",6) == 0) {
+		rgb[0] = 205;	rgb[1] = 91;	rgb[2] = 69;
+	}
+	else if (strncasecmp(x11ColourName,"coral4",6) == 0) {
+		rgb[0] = 139;	rgb[1] = 62;	rgb[2] = 47;
+	}
+	else if (strncasecmp(x11ColourName,"tomato1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 99;	rgb[2] = 71;
+	}
+	else if (strncasecmp(x11ColourName,"tomato2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 92;	rgb[2] = 66;
+	}
+	else if (strncasecmp(x11ColourName,"tomato3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 79;	rgb[2] = 57;
+	}
+	else if (strncasecmp(x11ColourName,"tomato4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 54;	rgb[2] = 38;
+	}
+	else if (strncasecmp(x11ColourName,"OrangeRed1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 69;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"OrangeRed2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 64;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"OrangeRed3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 55;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"OrangeRed4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 37;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"red1",4) == 0) {
+		rgb[0] = 255;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"red2",4) == 0) {
+		rgb[0] = 238;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"red3",4) == 0) {
+		rgb[0] = 205;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"red4",4) == 0) {
+		rgb[0] = 139;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"DeepPink1",9) == 0) {
+		rgb[0] = 255;	rgb[1] = 20;	rgb[2] = 147;
+	}
+	else if (strncasecmp(x11ColourName,"DeepPink2",9) == 0) {
+		rgb[0] = 238;	rgb[1] = 18;	rgb[2] = 137;
+	}
+	else if (strncasecmp(x11ColourName,"DeepPink3",9) == 0) {
+		rgb[0] = 205;	rgb[1] = 16;	rgb[2] = 118;
+	}
+	else if (strncasecmp(x11ColourName,"DeepPink4",9) == 0) {
+		rgb[0] = 139;	rgb[1] = 10;	rgb[2] = 80;
+	}
+	else if (strncasecmp(x11ColourName,"HotPink1",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 110;	rgb[2] = 180;
+	}
+	else if (strncasecmp(x11ColourName,"HotPink2",8) == 0) {
+		rgb[0] = 238;	rgb[1] = 106;	rgb[2] = 167;
+	}
+	else if (strncasecmp(x11ColourName,"HotPink3",8) == 0) {
+		rgb[0] = 205;	rgb[1] = 96;	rgb[2] = 144;
+	}
+	else if (strncasecmp(x11ColourName,"HotPink4",8) == 0) {
+		rgb[0] = 139;	rgb[1] = 58;	rgb[2] = 98;
+	}
+	else if (strncasecmp(x11ColourName,"pink1",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 181;	rgb[2] = 197;
+	}
+	else if (strncasecmp(x11ColourName,"pink2",5) == 0) {
+		rgb[0] = 238;	rgb[1] = 169;	rgb[2] = 184;
+	}
+	else if (strncasecmp(x11ColourName,"pink3",5) == 0) {
+		rgb[0] = 205;	rgb[1] = 145;	rgb[2] = 158;
+	}
+	else if (strncasecmp(x11ColourName,"pink4",5) == 0) {
+		rgb[0] = 139;	rgb[1] = 99;	rgb[2] = 108;
+	}
+	else if (strncasecmp(x11ColourName,"LightPink1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 174;	rgb[2] = 185;
+	}
+	else if (strncasecmp(x11ColourName,"LightPink2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 162;	rgb[2] = 173;
+	}
+	else if (strncasecmp(x11ColourName,"LightPink3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 140;	rgb[2] = 149;
+	}
+	else if (strncasecmp(x11ColourName,"LightPink4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 95;	rgb[2] = 101;
+	}
+	else if (strncasecmp(x11ColourName,"PaleVioletRed1",14) == 0) {
+		rgb[0] = 255;	rgb[1] = 130;	rgb[2] = 171;
+	}
+	else if (strncasecmp(x11ColourName,"PaleVioletRed2",14) == 0) {
+		rgb[0] = 238;	rgb[1] = 121;	rgb[2] = 159;
+	}
+	else if (strncasecmp(x11ColourName,"PaleVioletRed3",14) == 0) {
+		rgb[0] = 205;	rgb[1] = 104;	rgb[2] = 137;
+	}
+	else if (strncasecmp(x11ColourName,"PaleVioletRed4",14) == 0) {
+		rgb[0] = 139;	rgb[1] = 71;	rgb[2] = 93;
+	}
+	else if (strncasecmp(x11ColourName,"maroon1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 52;	rgb[2] = 179;
+	}
+	else if (strncasecmp(x11ColourName,"maroon2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 48;	rgb[2] = 167;
+	}
+	else if (strncasecmp(x11ColourName,"maroon3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 41;	rgb[2] = 144;
+	}
+	else if (strncasecmp(x11ColourName,"maroon4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 28;	rgb[2] = 98;
+	}
+	else if (strncasecmp(x11ColourName,"VioletRed1",10) == 0) {
+		rgb[0] = 255;	rgb[1] = 62;	rgb[2] = 150;
+	}
+	else if (strncasecmp(x11ColourName,"VioletRed2",10) == 0) {
+		rgb[0] = 238;	rgb[1] = 58;	rgb[2] = 140;
+	}
+	else if (strncasecmp(x11ColourName,"VioletRed3",10) == 0) {
+		rgb[0] = 205;	rgb[1] = 50;	rgb[2] = 120;
+	}
+	else if (strncasecmp(x11ColourName,"VioletRed4",10) == 0) {
+		rgb[0] = 139;	rgb[1] = 34;	rgb[2] = 82;
+	}
+	else if (strncasecmp(x11ColourName,"magenta1",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 0;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"magenta2",8) == 0) {
+		rgb[0] = 238;	rgb[1] = 0;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"magenta3",8) == 0) {
+		rgb[0] = 205;	rgb[1] = 0;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"magenta4",8) == 0) {
+		rgb[0] = 139;	rgb[1] = 0;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"orchid1",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 131;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"orchid2",7) == 0) {
+		rgb[0] = 238;	rgb[1] = 122;	rgb[2] = 233;
+	}
+	else if (strncasecmp(x11ColourName,"orchid3",7) == 0) {
+		rgb[0] = 205;	rgb[1] = 105;	rgb[2] = 201;
+	}
+	else if (strncasecmp(x11ColourName,"orchid4",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 71;	rgb[2] = 137;
+	}
+	else if (strncasecmp(x11ColourName,"plum1",5) == 0) {
+		rgb[0] = 255;	rgb[1] = 187;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"plum2",5) == 0) {
+		rgb[0] = 238;	rgb[1] = 174;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"plum3",5) == 0) {
+		rgb[0] = 205;	rgb[1] = 150;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"plum4",5) == 0) {
+		rgb[0] = 139;	rgb[1] = 102;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"MediumOrchid1",13) == 0) {
+		rgb[0] = 224;	rgb[1] = 102;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"MediumOrchid2",13) == 0) {
+		rgb[0] = 209;	rgb[1] = 95;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"MediumOrchid3",13) == 0) {
+		rgb[0] = 180;	rgb[1] = 82;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"MediumOrchid4",13) == 0) {
+		rgb[0] = 122;	rgb[1] = 55;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrchid1",11) == 0) {
+		rgb[0] = 191;	rgb[1] = 62;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrchid2",11) == 0) {
+		rgb[0] = 178;	rgb[1] = 58;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrchid3",11) == 0) {
+		rgb[0] = 154;	rgb[1] = 50;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"DarkOrchid4",11) == 0) {
+		rgb[0] = 104;	rgb[1] = 34;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"purple1",7) == 0) {
+		rgb[0] = 155;	rgb[1] = 48;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"purple2",7) == 0) {
+		rgb[0] = 145;	rgb[1] = 44;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"purple3",7) == 0) {
+		rgb[0] = 125;	rgb[1] = 38;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"purple4",7) == 0) {
+		rgb[0] = 85;	rgb[1] = 26;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"MediumPurple1",13) == 0) {
+		rgb[0] = 171;	rgb[1] = 130;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"MediumPurple2",13) == 0) {
+		rgb[0] = 159;	rgb[1] = 121;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"MediumPurple3",13) == 0) {
+		rgb[0] = 137;	rgb[1] = 104;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"MediumPurple4",13) == 0) {
+		rgb[0] = 93;	rgb[1] = 71;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"thistle1",8) == 0) {
+		rgb[0] = 255;	rgb[1] = 225;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"thistle2",8) == 0) {
+		rgb[0] = 238;	rgb[1] = 210;	rgb[2] = 238;
+	}
+	else if (strncasecmp(x11ColourName,"thistle3",8) == 0) {
+		rgb[0] = 205;	rgb[1] = 181;	rgb[2] = 205;
+	}
+	else if (strncasecmp(x11ColourName,"thistle4",8) == 0) {
+		rgb[0] = 139;	rgb[1] = 123;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"gray0",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"grey0",5) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"gray1",5) == 0) {
+		rgb[0] = 3;	rgb[1] = 3;	rgb[2] = 3;
+	}
+	else if (strncasecmp(x11ColourName,"grey1",5) == 0) {
+		rgb[0] = 3;	rgb[1] = 3;	rgb[2] = 3;
+	}
+	else if (strncasecmp(x11ColourName,"gray2",5) == 0) {
+		rgb[0] = 5;	rgb[1] = 5;	rgb[2] = 5;
+	}
+	else if (strncasecmp(x11ColourName,"grey2",5) == 0) {
+		rgb[0] = 5;	rgb[1] = 5;	rgb[2] = 5;
+	}
+	else if (strncasecmp(x11ColourName,"gray3",5) == 0) {
+		rgb[0] = 8;	rgb[1] = 8;	rgb[2] = 8;
+	}
+	else if (strncasecmp(x11ColourName,"grey3",5) == 0) {
+		rgb[0] = 8;	rgb[1] = 8;	rgb[2] = 8;
+	}
+	else if (strncasecmp(x11ColourName,"gray4",5) == 0) {
+		rgb[0] = 10;	rgb[1] = 10;	rgb[2] = 10;
+	}
+	else if (strncasecmp(x11ColourName,"grey4",5) == 0) {
+		rgb[0] = 10;	rgb[1] = 10;	rgb[2] = 10;
+	}
+	else if (strncasecmp(x11ColourName,"gray5",5) == 0) {
+		rgb[0] = 13;	rgb[1] = 13;	rgb[2] = 13;
+	}
+	else if (strncasecmp(x11ColourName,"grey5",5) == 0) {
+		rgb[0] = 13;	rgb[1] = 13;	rgb[2] = 13;
+	}
+	else if (strncasecmp(x11ColourName,"gray6",5) == 0) {
+		rgb[0] = 15;	rgb[1] = 15;	rgb[2] = 15;
+	}
+	else if (strncasecmp(x11ColourName,"grey6",5) == 0) {
+		rgb[0] = 15;	rgb[1] = 15;	rgb[2] = 15;
+	}
+	else if (strncasecmp(x11ColourName,"gray7",5) == 0) {
+		rgb[0] = 18;	rgb[1] = 18;	rgb[2] = 18;
+	}
+	else if (strncasecmp(x11ColourName,"grey7",5) == 0) {
+		rgb[0] = 18;	rgb[1] = 18;	rgb[2] = 18;
+	}
+	else if (strncasecmp(x11ColourName,"gray8",5) == 0) {
+		rgb[0] = 20;	rgb[1] = 20;	rgb[2] = 20;
+	}
+	else if (strncasecmp(x11ColourName,"grey8",5) == 0) {
+		rgb[0] = 20;	rgb[1] = 20;	rgb[2] = 20;
+	}
+	else if (strncasecmp(x11ColourName,"gray9",5) == 0) {
+		rgb[0] = 23;	rgb[1] = 23;	rgb[2] = 23;
+	}
+	else if (strncasecmp(x11ColourName,"grey9",5) == 0) {
+		rgb[0] = 23;	rgb[1] = 23;	rgb[2] = 23;
+	}
+	else if (strncasecmp(x11ColourName,"gray10",6) == 0) {
+		rgb[0] = 26;	rgb[1] = 26;	rgb[2] = 26;
+	}
+	else if (strncasecmp(x11ColourName,"grey10",6) == 0) {
+		rgb[0] = 26;	rgb[1] = 26;	rgb[2] = 26;
+	}
+	else if (strncasecmp(x11ColourName,"gray11",6) == 0) {
+		rgb[0] = 28;	rgb[1] = 28;	rgb[2] = 28;
+	}
+	else if (strncasecmp(x11ColourName,"grey11",6) == 0) {
+		rgb[0] = 28;	rgb[1] = 28;	rgb[2] = 28;
+	}
+	else if (strncasecmp(x11ColourName,"gray12",6) == 0) {
+		rgb[0] = 31;	rgb[1] = 31;	rgb[2] = 31;
+	}
+	else if (strncasecmp(x11ColourName,"grey12",6) == 0) {
+		rgb[0] = 31;	rgb[1] = 31;	rgb[2] = 31;
+	}
+	else if (strncasecmp(x11ColourName,"gray13",6) == 0) {
+		rgb[0] = 33;	rgb[1] = 33;	rgb[2] = 33;
+	}
+	else if (strncasecmp(x11ColourName,"grey13",6) == 0) {
+		rgb[0] = 33;	rgb[1] = 33;	rgb[2] = 33;
+	}
+	else if (strncasecmp(x11ColourName,"gray14",6) == 0) {
+		rgb[0] = 36;	rgb[1] = 36;	rgb[2] = 36;
+	}
+	else if (strncasecmp(x11ColourName,"grey14",6) == 0) {
+		rgb[0] = 36;	rgb[1] = 36;	rgb[2] = 36;
+	}
+	else if (strncasecmp(x11ColourName,"gray15",6) == 0) {
+		rgb[0] = 38;	rgb[1] = 38;	rgb[2] = 38;
+	}
+	else if (strncasecmp(x11ColourName,"grey15",6) == 0) {
+		rgb[0] = 38;	rgb[1] = 38;	rgb[2] = 38;
+	}
+	else if (strncasecmp(x11ColourName,"gray16",6) == 0) {
+		rgb[0] = 41;	rgb[1] = 41;	rgb[2] = 41;
+	}
+	else if (strncasecmp(x11ColourName,"grey16",6) == 0) {
+		rgb[0] = 41;	rgb[1] = 41;	rgb[2] = 41;
+	}
+	else if (strncasecmp(x11ColourName,"gray17",6) == 0) {
+		rgb[0] = 43;	rgb[1] = 43;	rgb[2] = 43;
+	}
+	else if (strncasecmp(x11ColourName,"grey17",6) == 0) {
+		rgb[0] = 43;	rgb[1] = 43;	rgb[2] = 43;
+	}
+	else if (strncasecmp(x11ColourName,"gray18",6) == 0) {
+		rgb[0] = 46;	rgb[1] = 46;	rgb[2] = 46;
+	}
+	else if (strncasecmp(x11ColourName,"grey18",6) == 0) {
+		rgb[0] = 46;	rgb[1] = 46;	rgb[2] = 46;
+	}
+	else if (strncasecmp(x11ColourName,"gray19",6) == 0) {
+		rgb[0] = 48;	rgb[1] = 48;	rgb[2] = 48;
+	}
+	else if (strncasecmp(x11ColourName,"grey19",6) == 0) {
+		rgb[0] = 48;	rgb[1] = 48;	rgb[2] = 48;
+	}
+	else if (strncasecmp(x11ColourName,"gray20",6) == 0) {
+		rgb[0] = 51;	rgb[1] = 51;	rgb[2] = 51;
+	}
+	else if (strncasecmp(x11ColourName,"grey20",6) == 0) {
+		rgb[0] = 51;	rgb[1] = 51;	rgb[2] = 51;
+	}
+	else if (strncasecmp(x11ColourName,"gray21",6) == 0) {
+		rgb[0] = 54;	rgb[1] = 54;	rgb[2] = 54;
+	}
+	else if (strncasecmp(x11ColourName,"grey21",6) == 0) {
+		rgb[0] = 54;	rgb[1] = 54;	rgb[2] = 54;
+	}
+	else if (strncasecmp(x11ColourName,"gray22",6) == 0) {
+		rgb[0] = 56;	rgb[1] = 56;	rgb[2] = 56;
+	}
+	else if (strncasecmp(x11ColourName,"grey22",6) == 0) {
+		rgb[0] = 56;	rgb[1] = 56;	rgb[2] = 56;
+	}
+	else if (strncasecmp(x11ColourName,"gray23",6) == 0) {
+		rgb[0] = 59;	rgb[1] = 59;	rgb[2] = 59;
+	}
+	else if (strncasecmp(x11ColourName,"grey23",6) == 0) {
+		rgb[0] = 59;	rgb[1] = 59;	rgb[2] = 59;
+	}
+	else if (strncasecmp(x11ColourName,"gray24",6) == 0) {
+		rgb[0] = 61;	rgb[1] = 61;	rgb[2] = 61;
+	}
+	else if (strncasecmp(x11ColourName,"grey24",6) == 0) {
+		rgb[0] = 61;	rgb[1] = 61;	rgb[2] = 61;
+	}
+	else if (strncasecmp(x11ColourName,"gray25",6) == 0) {
+		rgb[0] = 64;	rgb[1] = 64;	rgb[2] = 64;
+	}
+	else if (strncasecmp(x11ColourName,"grey25",6) == 0) {
+		rgb[0] = 64;	rgb[1] = 64;	rgb[2] = 64;
+	}
+	else if (strncasecmp(x11ColourName,"gray26",6) == 0) {
+		rgb[0] = 66;	rgb[1] = 66;	rgb[2] = 66;
+	}
+	else if (strncasecmp(x11ColourName,"grey26",6) == 0) {
+		rgb[0] = 66;	rgb[1] = 66;	rgb[2] = 66;
+	}
+	else if (strncasecmp(x11ColourName,"gray27",6) == 0) {
+		rgb[0] = 69;	rgb[1] = 69;	rgb[2] = 69;
+	}
+	else if (strncasecmp(x11ColourName,"grey27",6) == 0) {
+		rgb[0] = 69;	rgb[1] = 69;	rgb[2] = 69;
+	}
+	else if (strncasecmp(x11ColourName,"gray28",6) == 0) {
+		rgb[0] = 71;	rgb[1] = 71;	rgb[2] = 71;
+	}
+	else if (strncasecmp(x11ColourName,"grey28",6) == 0) {
+		rgb[0] = 71;	rgb[1] = 71;	rgb[2] = 71;
+	}
+	else if (strncasecmp(x11ColourName,"gray29",6) == 0) {
+		rgb[0] = 74;	rgb[1] = 74;	rgb[2] = 74;
+	}
+	else if (strncasecmp(x11ColourName,"grey29",6) == 0) {
+		rgb[0] = 74;	rgb[1] = 74;	rgb[2] = 74;
+	}
+	else if (strncasecmp(x11ColourName,"gray30",6) == 0) {
+		rgb[0] = 77;	rgb[1] = 77;	rgb[2] = 77;
+	}
+	else if (strncasecmp(x11ColourName,"grey30",6) == 0) {
+		rgb[0] = 77;	rgb[1] = 77;	rgb[2] = 77;
+	}
+	else if (strncasecmp(x11ColourName,"gray31",6) == 0) {
+		rgb[0] = 79;	rgb[1] = 79;	rgb[2] = 79;
+	}
+	else if (strncasecmp(x11ColourName,"grey31",6) == 0) {
+		rgb[0] = 79;	rgb[1] = 79;	rgb[2] = 79;
+	}
+	else if (strncasecmp(x11ColourName,"gray32",6) == 0) {
+		rgb[0] = 82;	rgb[1] = 82;	rgb[2] = 82;
+	}
+	else if (strncasecmp(x11ColourName,"grey32",6) == 0) {
+		rgb[0] = 82;	rgb[1] = 82;	rgb[2] = 82;
+	}
+	else if (strncasecmp(x11ColourName,"gray33",6) == 0) {
+		rgb[0] = 84;	rgb[1] = 84;	rgb[2] = 84;
+	}
+	else if (strncasecmp(x11ColourName,"grey33",6) == 0) {
+		rgb[0] = 84;	rgb[1] = 84;	rgb[2] = 84;
+	}
+	else if (strncasecmp(x11ColourName,"gray34",6) == 0) {
+		rgb[0] = 87;	rgb[1] = 87;	rgb[2] = 87;
+	}
+	else if (strncasecmp(x11ColourName,"grey34",6) == 0) {
+		rgb[0] = 87;	rgb[1] = 87;	rgb[2] = 87;
+	}
+	else if (strncasecmp(x11ColourName,"gray35",6) == 0) {
+		rgb[0] = 89;	rgb[1] = 89;	rgb[2] = 89;
+	}
+	else if (strncasecmp(x11ColourName,"grey35",6) == 0) {
+		rgb[0] = 89;	rgb[1] = 89;	rgb[2] = 89;
+	}
+	else if (strncasecmp(x11ColourName,"gray36",6) == 0) {
+		rgb[0] = 92;	rgb[1] = 92;	rgb[2] = 92;
+	}
+	else if (strncasecmp(x11ColourName,"grey36",6) == 0) {
+		rgb[0] = 92;	rgb[1] = 92;	rgb[2] = 92;
+	}
+	else if (strncasecmp(x11ColourName,"gray37",6) == 0) {
+		rgb[0] = 94;	rgb[1] = 94;	rgb[2] = 94;
+	}
+	else if (strncasecmp(x11ColourName,"grey37",6) == 0) {
+		rgb[0] = 94;	rgb[1] = 94;	rgb[2] = 94;
+	}
+	else if (strncasecmp(x11ColourName,"gray38",6) == 0) {
+		rgb[0] = 97;	rgb[1] = 97;	rgb[2] = 97;
+	}
+	else if (strncasecmp(x11ColourName,"grey38",6) == 0) {
+		rgb[0] = 97;	rgb[1] = 97;	rgb[2] = 97;
+	}
+	else if (strncasecmp(x11ColourName,"gray39",6) == 0) {
+		rgb[0] = 99;	rgb[1] = 99;	rgb[2] = 99;
+	}
+	else if (strncasecmp(x11ColourName,"grey39",6) == 0) {
+		rgb[0] = 99;	rgb[1] = 99;	rgb[2] = 99;
+	}
+	else if (strncasecmp(x11ColourName,"gray40",6) == 0) {
+		rgb[0] = 102;	rgb[1] = 102;	rgb[2] = 102;
+	}
+	else if (strncasecmp(x11ColourName,"grey40",6) == 0) {
+		rgb[0] = 102;	rgb[1] = 102;	rgb[2] = 102;
+	}
+	else if (strncasecmp(x11ColourName,"gray41",6) == 0) {
+		rgb[0] = 105;	rgb[1] = 105;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"grey41",6) == 0) {
+		rgb[0] = 105;	rgb[1] = 105;	rgb[2] = 105;
+	}
+	else if (strncasecmp(x11ColourName,"gray42",6) == 0) {
+		rgb[0] = 107;	rgb[1] = 107;	rgb[2] = 107;
+	}
+	else if (strncasecmp(x11ColourName,"grey42",6) == 0) {
+		rgb[0] = 107;	rgb[1] = 107;	rgb[2] = 107;
+	}
+	else if (strncasecmp(x11ColourName,"gray43",6) == 0) {
+		rgb[0] = 110;	rgb[1] = 110;	rgb[2] = 110;
+	}
+	else if (strncasecmp(x11ColourName,"grey43",6) == 0) {
+		rgb[0] = 110;	rgb[1] = 110;	rgb[2] = 110;
+	}
+	else if (strncasecmp(x11ColourName,"gray44",6) == 0) {
+		rgb[0] = 112;	rgb[1] = 112;	rgb[2] = 112;
+	}
+	else if (strncasecmp(x11ColourName,"grey44",6) == 0) {
+		rgb[0] = 112;	rgb[1] = 112;	rgb[2] = 112;
+	}
+	else if (strncasecmp(x11ColourName,"gray45",6) == 0) {
+		rgb[0] = 115;	rgb[1] = 115;	rgb[2] = 115;
+	}
+	else if (strncasecmp(x11ColourName,"grey45",6) == 0) {
+		rgb[0] = 115;	rgb[1] = 115;	rgb[2] = 115;
+	}
+	else if (strncasecmp(x11ColourName,"gray46",6) == 0) {
+		rgb[0] = 117;	rgb[1] = 117;	rgb[2] = 117;
+	}
+	else if (strncasecmp(x11ColourName,"grey46",6) == 0) {
+		rgb[0] = 117;	rgb[1] = 117;	rgb[2] = 117;
+	}
+	else if (strncasecmp(x11ColourName,"gray47",6) == 0) {
+		rgb[0] = 120;	rgb[1] = 120;	rgb[2] = 120;
+	}
+	else if (strncasecmp(x11ColourName,"grey47",6) == 0) {
+		rgb[0] = 120;	rgb[1] = 120;	rgb[2] = 120;
+	}
+	else if (strncasecmp(x11ColourName,"gray48",6) == 0) {
+		rgb[0] = 122;	rgb[1] = 122;	rgb[2] = 122;
+	}
+	else if (strncasecmp(x11ColourName,"grey48",6) == 0) {
+		rgb[0] = 122;	rgb[1] = 122;	rgb[2] = 122;
+	}
+	else if (strncasecmp(x11ColourName,"gray49",6) == 0) {
+		rgb[0] = 125;	rgb[1] = 125;	rgb[2] = 125;
+	}
+	else if (strncasecmp(x11ColourName,"grey49",6) == 0) {
+		rgb[0] = 125;	rgb[1] = 125;	rgb[2] = 125;
+	}
+	else if (strncasecmp(x11ColourName,"gray50",6) == 0) {
+		rgb[0] = 127;	rgb[1] = 127;	rgb[2] = 127;
+	}
+	else if (strncasecmp(x11ColourName,"grey50",6) == 0) {
+		rgb[0] = 127;	rgb[1] = 127;	rgb[2] = 127;
+	}
+	else if (strncasecmp(x11ColourName,"gray51",6) == 0) {
+		rgb[0] = 130;	rgb[1] = 130;	rgb[2] = 130;
+	}
+	else if (strncasecmp(x11ColourName,"grey51",6) == 0) {
+		rgb[0] = 130;	rgb[1] = 130;	rgb[2] = 130;
+	}
+	else if (strncasecmp(x11ColourName,"gray52",6) == 0) {
+		rgb[0] = 133;	rgb[1] = 133;	rgb[2] = 133;
+	}
+	else if (strncasecmp(x11ColourName,"grey52",6) == 0) {
+		rgb[0] = 133;	rgb[1] = 133;	rgb[2] = 133;
+	}
+	else if (strncasecmp(x11ColourName,"gray53",6) == 0) {
+		rgb[0] = 135;	rgb[1] = 135;	rgb[2] = 135;
+	}
+	else if (strncasecmp(x11ColourName,"grey53",6) == 0) {
+		rgb[0] = 135;	rgb[1] = 135;	rgb[2] = 135;
+	}
+	else if (strncasecmp(x11ColourName,"gray54",6) == 0) {
+		rgb[0] = 138;	rgb[1] = 138;	rgb[2] = 138;
+	}
+	else if (strncasecmp(x11ColourName,"grey54",6) == 0) {
+		rgb[0] = 138;	rgb[1] = 138;	rgb[2] = 138;
+	}
+	else if (strncasecmp(x11ColourName,"gray55",6) == 0) {
+		rgb[0] = 140;	rgb[1] = 140;	rgb[2] = 140;
+	}
+	else if (strncasecmp(x11ColourName,"grey55",6) == 0) {
+		rgb[0] = 140;	rgb[1] = 140;	rgb[2] = 140;
+	}
+	else if (strncasecmp(x11ColourName,"gray56",6) == 0) {
+		rgb[0] = 143;	rgb[1] = 143;	rgb[2] = 143;
+	}
+	else if (strncasecmp(x11ColourName,"grey56",6) == 0) {
+		rgb[0] = 143;	rgb[1] = 143;	rgb[2] = 143;
+	}
+	else if (strncasecmp(x11ColourName,"gray57",6) == 0) {
+		rgb[0] = 145;	rgb[1] = 145;	rgb[2] = 145;
+	}
+	else if (strncasecmp(x11ColourName,"grey57",6) == 0) {
+		rgb[0] = 145;	rgb[1] = 145;	rgb[2] = 145;
+	}
+	else if (strncasecmp(x11ColourName,"gray58",6) == 0) {
+		rgb[0] = 148;	rgb[1] = 148;	rgb[2] = 148;
+	}
+	else if (strncasecmp(x11ColourName,"grey58",6) == 0) {
+		rgb[0] = 148;	rgb[1] = 148;	rgb[2] = 148;
+	}
+	else if (strncasecmp(x11ColourName,"gray59",6) == 0) {
+		rgb[0] = 150;	rgb[1] = 150;	rgb[2] = 150;
+	}
+	else if (strncasecmp(x11ColourName,"grey59",6) == 0) {
+		rgb[0] = 150;	rgb[1] = 150;	rgb[2] = 150;
+	}
+	else if (strncasecmp(x11ColourName,"gray60",6) == 0) {
+		rgb[0] = 153;	rgb[1] = 153;	rgb[2] = 153;
+	}
+	else if (strncasecmp(x11ColourName,"grey60",6) == 0) {
+		rgb[0] = 153;	rgb[1] = 153;	rgb[2] = 153;
+	}
+	else if (strncasecmp(x11ColourName,"gray61",6) == 0) {
+		rgb[0] = 156;	rgb[1] = 156;	rgb[2] = 156;
+	}
+	else if (strncasecmp(x11ColourName,"grey61",6) == 0) {
+		rgb[0] = 156;	rgb[1] = 156;	rgb[2] = 156;
+	}
+	else if (strncasecmp(x11ColourName,"gray62",6) == 0) {
+		rgb[0] = 158;	rgb[1] = 158;	rgb[2] = 158;
+	}
+	else if (strncasecmp(x11ColourName,"grey62",6) == 0) {
+		rgb[0] = 158;	rgb[1] = 158;	rgb[2] = 158;
+	}
+	else if (strncasecmp(x11ColourName,"gray63",6) == 0) {
+		rgb[0] = 161;	rgb[1] = 161;	rgb[2] = 161;
+	}
+	else if (strncasecmp(x11ColourName,"grey63",6) == 0) {
+		rgb[0] = 161;	rgb[1] = 161;	rgb[2] = 161;
+	}
+	else if (strncasecmp(x11ColourName,"gray64",6) == 0) {
+		rgb[0] = 163;	rgb[1] = 163;	rgb[2] = 163;
+	}
+	else if (strncasecmp(x11ColourName,"grey64",6) == 0) {
+		rgb[0] = 163;	rgb[1] = 163;	rgb[2] = 163;
+	}
+	else if (strncasecmp(x11ColourName,"gray65",6) == 0) {
+		rgb[0] = 166;	rgb[1] = 166;	rgb[2] = 166;
+	}
+	else if (strncasecmp(x11ColourName,"grey65",6) == 0) {
+		rgb[0] = 166;	rgb[1] = 166;	rgb[2] = 166;
+	}
+	else if (strncasecmp(x11ColourName,"gray66",6) == 0) {
+		rgb[0] = 168;	rgb[1] = 168;	rgb[2] = 168;
+	}
+	else if (strncasecmp(x11ColourName,"grey66",6) == 0) {
+		rgb[0] = 168;	rgb[1] = 168;	rgb[2] = 168;
+	}
+	else if (strncasecmp(x11ColourName,"gray67",6) == 0) {
+		rgb[0] = 171;	rgb[1] = 171;	rgb[2] = 171;
+	}
+	else if (strncasecmp(x11ColourName,"grey67",6) == 0) {
+		rgb[0] = 171;	rgb[1] = 171;	rgb[2] = 171;
+	}
+	else if (strncasecmp(x11ColourName,"gray68",6) == 0) {
+		rgb[0] = 173;	rgb[1] = 173;	rgb[2] = 173;
+	}
+	else if (strncasecmp(x11ColourName,"grey68",6) == 0) {
+		rgb[0] = 173;	rgb[1] = 173;	rgb[2] = 173;
+	}
+	else if (strncasecmp(x11ColourName,"gray69",6) == 0) {
+		rgb[0] = 176;	rgb[1] = 176;	rgb[2] = 176;
+	}
+	else if (strncasecmp(x11ColourName,"grey69",6) == 0) {
+		rgb[0] = 176;	rgb[1] = 176;	rgb[2] = 176;
+	}
+	else if (strncasecmp(x11ColourName,"gray70",6) == 0) {
+		rgb[0] = 179;	rgb[1] = 179;	rgb[2] = 179;
+	}
+	else if (strncasecmp(x11ColourName,"grey70",6) == 0) {
+		rgb[0] = 179;	rgb[1] = 179;	rgb[2] = 179;
+	}
+	else if (strncasecmp(x11ColourName,"gray71",6) == 0) {
+		rgb[0] = 181;	rgb[1] = 181;	rgb[2] = 181;
+	}
+	else if (strncasecmp(x11ColourName,"grey71",6) == 0) {
+		rgb[0] = 181;	rgb[1] = 181;	rgb[2] = 181;
+	}
+	else if (strncasecmp(x11ColourName,"gray72",6) == 0) {
+		rgb[0] = 184;	rgb[1] = 184;	rgb[2] = 184;
+	}
+	else if (strncasecmp(x11ColourName,"grey72",6) == 0) {
+		rgb[0] = 184;	rgb[1] = 184;	rgb[2] = 184;
+	}
+	else if (strncasecmp(x11ColourName,"gray73",6) == 0) {
+		rgb[0] = 186;	rgb[1] = 186;	rgb[2] = 186;
+	}
+	else if (strncasecmp(x11ColourName,"grey73",6) == 0) {
+		rgb[0] = 186;	rgb[1] = 186;	rgb[2] = 186;
+	}
+	else if (strncasecmp(x11ColourName,"gray74",6) == 0) {
+		rgb[0] = 189;	rgb[1] = 189;	rgb[2] = 189;
+	}
+	else if (strncasecmp(x11ColourName,"grey74",6) == 0) {
+		rgb[0] = 189;	rgb[1] = 189;	rgb[2] = 189;
+	}
+	else if (strncasecmp(x11ColourName,"gray75",6) == 0) {
+		rgb[0] = 191;	rgb[1] = 191;	rgb[2] = 191;
+	}
+	else if (strncasecmp(x11ColourName,"grey75",6) == 0) {
+		rgb[0] = 191;	rgb[1] = 191;	rgb[2] = 191;
+	}
+	else if (strncasecmp(x11ColourName,"gray76",6) == 0) {
+		rgb[0] = 194;	rgb[1] = 194;	rgb[2] = 194;
+	}
+	else if (strncasecmp(x11ColourName,"grey76",6) == 0) {
+		rgb[0] = 194;	rgb[1] = 194;	rgb[2] = 194;
+	}
+	else if (strncasecmp(x11ColourName,"gray77",6) == 0) {
+		rgb[0] = 196;	rgb[1] = 196;	rgb[2] = 196;
+	}
+	else if (strncasecmp(x11ColourName,"grey77",6) == 0) {
+		rgb[0] = 196;	rgb[1] = 196;	rgb[2] = 196;
+	}
+	else if (strncasecmp(x11ColourName,"gray78",6) == 0) {
+		rgb[0] = 199;	rgb[1] = 199;	rgb[2] = 199;
+	}
+	else if (strncasecmp(x11ColourName,"grey78",6) == 0) {
+		rgb[0] = 199;	rgb[1] = 199;	rgb[2] = 199;
+	}
+	else if (strncasecmp(x11ColourName,"gray79",6) == 0) {
+		rgb[0] = 201;	rgb[1] = 201;	rgb[2] = 201;
+	}
+	else if (strncasecmp(x11ColourName,"grey79",6) == 0) {
+		rgb[0] = 201;	rgb[1] = 201;	rgb[2] = 201;
+	}
+	else if (strncasecmp(x11ColourName,"gray80",6) == 0) {
+		rgb[0] = 204;	rgb[1] = 204;	rgb[2] = 204;
+	}
+	else if (strncasecmp(x11ColourName,"grey80",6) == 0) {
+		rgb[0] = 204;	rgb[1] = 204;	rgb[2] = 204;
+	}
+	else if (strncasecmp(x11ColourName,"gray81",6) == 0) {
+		rgb[0] = 207;	rgb[1] = 207;	rgb[2] = 207;
+	}
+	else if (strncasecmp(x11ColourName,"grey81",6) == 0) {
+		rgb[0] = 207;	rgb[1] = 207;	rgb[2] = 207;
+	}
+	else if (strncasecmp(x11ColourName,"gray82",6) == 0) {
+		rgb[0] = 209;	rgb[1] = 209;	rgb[2] = 209;
+	}
+	else if (strncasecmp(x11ColourName,"grey82",6) == 0) {
+		rgb[0] = 209;	rgb[1] = 209;	rgb[2] = 209;
+	}
+	else if (strncasecmp(x11ColourName,"gray83",6) == 0) {
+		rgb[0] = 212;	rgb[1] = 212;	rgb[2] = 212;
+	}
+	else if (strncasecmp(x11ColourName,"grey83",6) == 0) {
+		rgb[0] = 212;	rgb[1] = 212;	rgb[2] = 212;
+	}
+	else if (strncasecmp(x11ColourName,"gray84",6) == 0) {
+		rgb[0] = 214;	rgb[1] = 214;	rgb[2] = 214;
+	}
+	else if (strncasecmp(x11ColourName,"grey84",6) == 0) {
+		rgb[0] = 214;	rgb[1] = 214;	rgb[2] = 214;
+	}
+	else if (strncasecmp(x11ColourName,"gray85",6) == 0) {
+		rgb[0] = 217;	rgb[1] = 217;	rgb[2] = 217;
+	}
+	else if (strncasecmp(x11ColourName,"grey85",6) == 0) {
+		rgb[0] = 217;	rgb[1] = 217;	rgb[2] = 217;
+	}
+	else if (strncasecmp(x11ColourName,"gray86",6) == 0) {
+		rgb[0] = 219;	rgb[1] = 219;	rgb[2] = 219;
+	}
+	else if (strncasecmp(x11ColourName,"grey86",6) == 0) {
+		rgb[0] = 219;	rgb[1] = 219;	rgb[2] = 219;
+	}
+	else if (strncasecmp(x11ColourName,"gray87",6) == 0) {
+		rgb[0] = 222;	rgb[1] = 222;	rgb[2] = 222;
+	}
+	else if (strncasecmp(x11ColourName,"grey87",6) == 0) {
+		rgb[0] = 222;	rgb[1] = 222;	rgb[2] = 222;
+	}
+	else if (strncasecmp(x11ColourName,"gray88",6) == 0) {
+		rgb[0] = 224;	rgb[1] = 224;	rgb[2] = 224;
+	}
+	else if (strncasecmp(x11ColourName,"grey88",6) == 0) {
+		rgb[0] = 224;	rgb[1] = 224;	rgb[2] = 224;
+	}
+	else if (strncasecmp(x11ColourName,"gray89",6) == 0) {
+		rgb[0] = 227;	rgb[1] = 227;	rgb[2] = 227;
+	}
+	else if (strncasecmp(x11ColourName,"grey89",6) == 0) {
+		rgb[0] = 227;	rgb[1] = 227;	rgb[2] = 227;
+	}
+	else if (strncasecmp(x11ColourName,"gray90",6) == 0) {
+		rgb[0] = 229;	rgb[1] = 229;	rgb[2] = 229;
+	}
+	else if (strncasecmp(x11ColourName,"grey90",6) == 0) {
+		rgb[0] = 229;	rgb[1] = 229;	rgb[2] = 229;
+	}
+	else if (strncasecmp(x11ColourName,"gray91",6) == 0) {
+		rgb[0] = 232;	rgb[1] = 232;	rgb[2] = 232;
+	}
+	else if (strncasecmp(x11ColourName,"grey91",6) == 0) {
+		rgb[0] = 232;	rgb[1] = 232;	rgb[2] = 232;
+	}
+	else if (strncasecmp(x11ColourName,"gray92",6) == 0) {
+		rgb[0] = 235;	rgb[1] = 235;	rgb[2] = 235;
+	}
+	else if (strncasecmp(x11ColourName,"grey92",6) == 0) {
+		rgb[0] = 235;	rgb[1] = 235;	rgb[2] = 235;
+	}
+	else if (strncasecmp(x11ColourName,"gray93",6) == 0) {
+		rgb[0] = 237;	rgb[1] = 237;	rgb[2] = 237;
+	}
+	else if (strncasecmp(x11ColourName,"grey93",6) == 0) {
+		rgb[0] = 237;	rgb[1] = 237;	rgb[2] = 237;
+	}
+	else if (strncasecmp(x11ColourName,"gray94",6) == 0) {
+		rgb[0] = 240;	rgb[1] = 240;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"grey94",6) == 0) {
+		rgb[0] = 240;	rgb[1] = 240;	rgb[2] = 240;
+	}
+	else if (strncasecmp(x11ColourName,"gray95",6) == 0) {
+		rgb[0] = 242;	rgb[1] = 242;	rgb[2] = 242;
+	}
+	else if (strncasecmp(x11ColourName,"grey95",6) == 0) {
+		rgb[0] = 242;	rgb[1] = 242;	rgb[2] = 242;
+	}
+	else if (strncasecmp(x11ColourName,"gray96",6) == 0) {
+		rgb[0] = 245;	rgb[1] = 245;	rgb[2] = 245;
+	}
+	else if (strncasecmp(x11ColourName,"grey96",6) == 0) {
+		rgb[0] = 245;	rgb[1] = 245;	rgb[2] = 245;
+	}
+	else if (strncasecmp(x11ColourName,"gray97",6) == 0) {
+		rgb[0] = 247;	rgb[1] = 247;	rgb[2] = 247;
+	}
+	else if (strncasecmp(x11ColourName,"grey97",6) == 0) {
+		rgb[0] = 247;	rgb[1] = 247;	rgb[2] = 247;
+	}
+	else if (strncasecmp(x11ColourName,"gray98",6) == 0) {
+		rgb[0] = 250;	rgb[1] = 250;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"grey98",6) == 0) {
+		rgb[0] = 250;	rgb[1] = 250;	rgb[2] = 250;
+	}
+	else if (strncasecmp(x11ColourName,"gray99",6) == 0) {
+		rgb[0] = 252;	rgb[1] = 252;	rgb[2] = 252;
+	}
+	else if (strncasecmp(x11ColourName,"grey99",6) == 0) {
+		rgb[0] = 252;	rgb[1] = 252;	rgb[2] = 252;
+	}
+	else if (strncasecmp(x11ColourName,"gray100",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"grey100",7) == 0) {
+		rgb[0] = 255;	rgb[1] = 255;	rgb[2] = 255;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGrey",8) == 0) {
+		rgb[0] = 169;	rgb[1] = 169;	rgb[2] = 169;
+	}
+	else if (strncasecmp(x11ColourName,"DarkGray",8) == 0) {
+		rgb[0] = 169;	rgb[1] = 169;	rgb[2] = 169;
+	}
+	else if (strncasecmp(x11ColourName,"DarkBlue",8) == 0) {
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DarkCyan",8) == 0) {
+		rgb[0] = 0;	rgb[1] = 139;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DarkMagenta",11) == 0) {
+		rgb[0] = 139;	rgb[1] = 0;	rgb[2] = 139;
+	}
+	else if (strncasecmp(x11ColourName,"DarkRed",7) == 0) {
+		rgb[0] = 139;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	else if (strncasecmp(x11ColourName,"LightGreen",10) == 0) {
+		rgb[0] = 144;	rgb[1] = 238;	rgb[2] = 144;
+	}
+	else {		/* Default is Black */
+		rgb[0] = 0;	rgb[1] = 0;	rgb[2] = 0;
+	}
+	
+	/* Convert from int to float */
+	self->red   = (float) rgb[0]/255.0;
+	self->green = (float) rgb[1]/255.0;
+	self->blue  = (float) rgb[2]/255.0;
+	self->opacity = 1.0;
+}
+
+void lucColour_FromHexName( lucColour* self, Name hexName ) {
+	char* red;
+	char* green;
+	char* blue;
+	int i;
+	int rgb[3];
+	
+	/* Check to make sure colour is valid */
+	if (hexName[0] != '#') {
+		lucColour_FromX11ColourName( self, "black" );
+		printf( "Cannot recognise hex colour %s.\n", hexName);
+		return;
+	}
+	for (i = 1 ; i <= 6 ; i++) {
+		if (isxdigit(hexName[i]) == 0) {
+			lucColour_FromX11ColourName( self, "black" );
+			printf( "Cannot recognise hex colour %s.\n", hexName);
+			return;
+		}
+	}
+	
+	/* Seperate colours */
+	red = StG_Strdup(&hexName[1]);
+	red[2] = '\0';
+	green = StG_Strdup(&hexName[3]);
+	green[2] = '\0';
+	blue = StG_Strdup(&hexName[5]);
+	blue[2] = '\0';
+	
+	/* Read colours */
+	sscanf(red,   "%x", &rgb[0]);
+	sscanf(green, "%x", &rgb[1]);
+	sscanf(blue,  "%x", &rgb[2]);
+
+	Memory_Free( blue );
+	Memory_Free( green );
+	Memory_Free( red );
+	
+	self->red   = (float) rgb[0]/255.0;
+	self->green = (float) rgb[1]/255.0;
+	self->blue  = (float) rgb[2]/255.0;
+	self->opacity = 1.0;
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/X11Colours.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/X11Colours.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,52 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: X11Colours.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucColour_X11Colours_h__
+#define __lucColour_X11Colours_h__
+
+void lucColour_FromX11ColourName( lucColour* self, Name x11ColourName ) ;
+void lucColour_FromHexName( lucColour* self, Name hexName ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/makefile	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,30 @@
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+packages = STGERMAIN
+
+ifdef HAVE_OSMESA
+	packages += OSMESA
+endif
+
+ifdef HAVE_GL
+	packages += GL
+endif
+
+packages += MPI XML 
+
+# Work out name to call library
+lib = luc$(shell basename `pwd | sed s/src//g`)
+libdynamic = yes
+libstatic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r c3d217e50ce0 -r 28d655bec240 Base/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/src/types.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,118 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: types.h 540 2006-04-27 05:26:37Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucBase_types_h__
+#define __lucBase_types_h__
+
+	typedef struct lucColourMap                lucColourMap;
+	typedef struct lucColour                   lucColour;
+	
+	typedef struct lucCamera                   lucCamera;
+
+	typedef struct lucWindow                   lucWindow;
+	
+	typedef struct lucWindowInteraction_Register        lucWindowInteraction_Register;	
+	typedef struct lucWindowInteraction        lucWindowInteraction;	
+	
+	typedef struct lucRenderingEngine          lucRenderingEngine;
+
+	typedef struct lucViewport                 lucViewport;
+	typedef struct lucViewportInfo             lucViewportInfo;
+
+	typedef struct lucOutputFormat_Register    lucOutputFormat_Register;
+	typedef struct lucOutputFormat             lucOutputFormat;	
+	
+	typedef struct lucInputFormat_Register     lucInputFormat_Register;
+	typedef struct lucInputFormat             lucInputFormat;
+
+	typedef struct lucDrawingObject_Register   lucDrawingObject_Register;
+	typedef struct lucDrawingObject            lucDrawingObject;
+	
+	typedef struct lucLight_Register           lucLight_Register;
+  typedef struct lucLight                    lucLight;
+	
+	/* types for clarity */
+	typedef Index Colour_Index;
+	typedef Index Camera_Index;
+	typedef Index Viewport_Index;
+	typedef Index DrawingObject_Index;
+	typedef Index Pixel_Index;
+	typedef Index Window_Index;
+	typedef Index OutputFormat_Index;
+	typedef Index InputFormat_Index;
+	typedef Index WindowInteraction_Index;
+	typedef Index Light_Index;
+	
+	typedef unsigned char lucPixel[3];
+	typedef unsigned char lucAlphaPixel[4];
+
+	typedef enum {
+		lucMono,
+		lucStereoToeIn,
+		lucStereoAsymmetric
+	} lucStereoType;
+		
+	typedef enum {
+		lucLeft,
+		lucRight
+	} lucStereoBuffer;
+
+	typedef enum {
+		lucButtonPress = 4,
+		lucButtonRelease = 5
+	} lucMouseState;
+
+	typedef enum {
+		lucLeftButton   = 1,
+		lucMiddleButton = 2,
+		lucRightButton  = 3,
+		lucWheelUp      = 4,
+		lucWheelDown    = 5
+	} lucMouseButton;
+
+
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/expected/testCameras.0of1.camera.txt.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/expected/testCameras.0of1.camera.txt.expected	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,266 @@
+lucCamera: frontOn
+	Stg_Component (ptr): 0x806a390
+	Stg_Object (ptr): 0x806a390
+		Stg_Class (ptr): 0x806a390
+			sizeOfSelf: 212
+			_deleteSelf: Yes
+			type: lucCamera
+			_delete (func ptr): 0xb7f6bff5
+			_print (func ptr): 0xb7f6c02c
+			_copy (func ptr): 0xb7f6c301
+		name: frontOn
+		nameAllocationType: NON_GLOBAL
+		_defaultConstructor (func ptr): 0xb7f6c3f8
+		_construct (func ptr): 0xb7f6c489
+		_build (func ptr): 0xb7f6c7d7
+		_initialise (func ptr): 0xb7f6c7dc
+		_execute (func ptr): 0xb7f6c7e1
+		_destroy (func ptr): 0xb7f6c7e6
+		isConstructed: True
+		isBuilt: False
+		isInitialised: False
+		hasExecuted: False
+		isDestroyed: False
+		constructor function name: frontOn-Construct
+		build function name: frontOn-Build
+		initialise function name: frontOn-Initialise
+		execute function name: frontOn-Execute
+		destroy function name: frontOn-Destroy
+	self->coord = { 0, 0, 1 }
+	self->focalPoint = { 0, 0, 0 }
+	self->upDirection = { 0, 1, 0 }
+	self->aperture = 45
+	self->stereoType = lucMono
+	self->buffer = lucLeft
+	self->eyeSeparation = 0.2
+lucCamera: stereo
+	Stg_Component (ptr): 0x806b468
+	Stg_Object (ptr): 0x806b468
+		Stg_Class (ptr): 0x806b468
+			sizeOfSelf: 212
+			_deleteSelf: Yes
+			type: lucCamera
+			_delete (func ptr): 0xb7f6bff5
+			_print (func ptr): 0xb7f6c02c
+			_copy (func ptr): 0xb7f6c301
+		name: stereo
+		nameAllocationType: NON_GLOBAL
+		_defaultConstructor (func ptr): 0xb7f6c3f8
+		_construct (func ptr): 0xb7f6c489
+		_build (func ptr): 0xb7f6c7d7
+		_initialise (func ptr): 0xb7f6c7dc
+		_execute (func ptr): 0xb7f6c7e1
+		_destroy (func ptr): 0xb7f6c7e6
+		isConstructed: True
+		isBuilt: False
+		isInitialised: False
+		hasExecuted: False
+		isDestroyed: False
+		constructor function name: stereo-Construct
+		build function name: stereo-Build
+		initialise function name: stereo-Initialise
+		execute function name: stereo-Execute
+		destroy function name: stereo-Destroy
+	self->coord = { 1, 1, 0 }
+	self->focalPoint = { 1, 0, 0 }
+	self->upDirection = { 1, 0, 0 }
+	self->aperture = 70
+	self->stereoType = lucStereoToeIn
+	self->buffer = lucLeft
+	self->eyeSeparation = 0.3
+************** Checking Camera 'frontOn' **************
+	************** Testing lucCamera_Zoom **************
+	lucCamera: frontOn
+		Stg_Component (ptr): 0x806a390
+		Stg_Object (ptr): 0x806a390
+			Stg_Class (ptr): 0x806a390
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7f6bff5
+				_print (func ptr): 0xb7f6c02c
+				_copy (func ptr): 0xb7f6c301
+			name: frontOn
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7f6c3f8
+			_construct (func ptr): 0xb7f6c489
+			_build (func ptr): 0xb7f6c7d7
+			_initialise (func ptr): 0xb7f6c7dc
+			_execute (func ptr): 0xb7f6c7e1
+			_destroy (func ptr): 0xb7f6c7e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: frontOn-Construct
+			build function name: frontOn-Build
+			initialise function name: frontOn-Initialise
+			execute function name: frontOn-Execute
+			destroy function name: frontOn-Destroy
+		self->coord = { 0, 0, 2 }
+		self->focalPoint = { 0, 0, 0 }
+		self->upDirection = { 0, 1, 0 }
+		self->aperture = 45
+		self->stereoType = lucMono
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.2
+	lucCamera: frontOn
+		Stg_Component (ptr): 0x806a390
+		Stg_Object (ptr): 0x806a390
+			Stg_Class (ptr): 0x806a390
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7f6bff5
+				_print (func ptr): 0xb7f6c02c
+				_copy (func ptr): 0xb7f6c301
+			name: frontOn
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7f6c3f8
+			_construct (func ptr): 0xb7f6c489
+			_build (func ptr): 0xb7f6c7d7
+			_initialise (func ptr): 0xb7f6c7dc
+			_execute (func ptr): 0xb7f6c7e1
+			_destroy (func ptr): 0xb7f6c7e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: frontOn-Construct
+			build function name: frontOn-Build
+			initialise function name: frontOn-Initialise
+			execute function name: frontOn-Execute
+			destroy function name: frontOn-Destroy
+		self->coord = { 0, 0, 0.25 }
+		self->focalPoint = { 0, 0, 0 }
+		self->upDirection = { 0, 1, 0 }
+		self->aperture = 45
+		self->stereoType = lucMono
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.2
+	************** Testing lucCamera_RotateAroundUpDirection **************
+		Has rotated 45 degrees.
+		Has rotated 90 degrees.
+		Has rotated 135 degrees.
+		Has rotated 180 degrees.
+		Has rotated 135 degrees.
+		Has rotated 90 degrees.
+		Has rotated 45 degrees.
+		Has rotated 0 degrees.
+	************** Testing lucCamera_RotateTowardsUpDirection **************
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
+************** Checking Camera 'stereo' **************
+	************** Testing lucCamera_Zoom **************
+	lucCamera: stereo
+		Stg_Component (ptr): 0x806b468
+		Stg_Object (ptr): 0x806b468
+			Stg_Class (ptr): 0x806b468
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7f6bff5
+				_print (func ptr): 0xb7f6c02c
+				_copy (func ptr): 0xb7f6c301
+			name: stereo
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7f6c3f8
+			_construct (func ptr): 0xb7f6c489
+			_build (func ptr): 0xb7f6c7d7
+			_initialise (func ptr): 0xb7f6c7dc
+			_execute (func ptr): 0xb7f6c7e1
+			_destroy (func ptr): 0xb7f6c7e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: stereo-Construct
+			build function name: stereo-Build
+			initialise function name: stereo-Initialise
+			execute function name: stereo-Execute
+			destroy function name: stereo-Destroy
+		self->coord = { 1, 2, 0 }
+		self->focalPoint = { 1, 0, 0 }
+		self->upDirection = { 1, 0, 0 }
+		self->aperture = 70
+		self->stereoType = lucStereoToeIn
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.3
+	lucCamera: stereo
+		Stg_Component (ptr): 0x806b468
+		Stg_Object (ptr): 0x806b468
+			Stg_Class (ptr): 0x806b468
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7f6bff5
+				_print (func ptr): 0xb7f6c02c
+				_copy (func ptr): 0xb7f6c301
+			name: stereo
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7f6c3f8
+			_construct (func ptr): 0xb7f6c489
+			_build (func ptr): 0xb7f6c7d7
+			_initialise (func ptr): 0xb7f6c7dc
+			_execute (func ptr): 0xb7f6c7e1
+			_destroy (func ptr): 0xb7f6c7e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: stereo-Construct
+			build function name: stereo-Build
+			initialise function name: stereo-Initialise
+			execute function name: stereo-Execute
+			destroy function name: stereo-Destroy
+		self->coord = { 1, 0.25, 0 }
+		self->focalPoint = { 1, 0, 0 }
+		self->upDirection = { 1, 0, 0 }
+		self->aperture = 70
+		self->stereoType = lucStereoToeIn
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.3
+	************** Testing lucCamera_RotateAroundUpDirection **************
+		Has rotated 45 degrees.
+		Has rotated 90 degrees.
+		Has rotated 135 degrees.
+		Has rotated 180 degrees.
+		Has rotated 135 degrees.
+		Has rotated 90 degrees.
+		Has rotated 45 degrees.
+		Has rotated 0 degrees.
+	************** Testing lucCamera_RotateTowardsUpDirection **************
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/expected/testCameras.0of3.camera.txt.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/expected/testCameras.0of3.camera.txt.expected	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,266 @@
+lucCamera: frontOn
+	Stg_Component (ptr): 0x80686d8
+	Stg_Object (ptr): 0x80686d8
+		Stg_Class (ptr): 0x80686d8
+			sizeOfSelf: 212
+			_deleteSelf: Yes
+			type: lucCamera
+			_delete (func ptr): 0xb7fa8ff5
+			_print (func ptr): 0xb7fa902c
+			_copy (func ptr): 0xb7fa9301
+		name: frontOn
+		nameAllocationType: NON_GLOBAL
+		_defaultConstructor (func ptr): 0xb7fa93f8
+		_construct (func ptr): 0xb7fa9489
+		_build (func ptr): 0xb7fa97d7
+		_initialise (func ptr): 0xb7fa97dc
+		_execute (func ptr): 0xb7fa97e1
+		_destroy (func ptr): 0xb7fa97e6
+		isConstructed: True
+		isBuilt: False
+		isInitialised: False
+		hasExecuted: False
+		isDestroyed: False
+		constructor function name: frontOn-Construct
+		build function name: frontOn-Build
+		initialise function name: frontOn-Initialise
+		execute function name: frontOn-Execute
+		destroy function name: frontOn-Destroy
+	self->coord = { 0, 0, 1 }
+	self->focalPoint = { 0, 0, 0 }
+	self->upDirection = { 0, 1, 0 }
+	self->aperture = 45
+	self->stereoType = lucMono
+	self->buffer = lucLeft
+	self->eyeSeparation = 0.2
+lucCamera: stereo
+	Stg_Component (ptr): 0x806b598
+	Stg_Object (ptr): 0x806b598
+		Stg_Class (ptr): 0x806b598
+			sizeOfSelf: 212
+			_deleteSelf: Yes
+			type: lucCamera
+			_delete (func ptr): 0xb7fa8ff5
+			_print (func ptr): 0xb7fa902c
+			_copy (func ptr): 0xb7fa9301
+		name: stereo
+		nameAllocationType: NON_GLOBAL
+		_defaultConstructor (func ptr): 0xb7fa93f8
+		_construct (func ptr): 0xb7fa9489
+		_build (func ptr): 0xb7fa97d7
+		_initialise (func ptr): 0xb7fa97dc
+		_execute (func ptr): 0xb7fa97e1
+		_destroy (func ptr): 0xb7fa97e6
+		isConstructed: True
+		isBuilt: False
+		isInitialised: False
+		hasExecuted: False
+		isDestroyed: False
+		constructor function name: stereo-Construct
+		build function name: stereo-Build
+		initialise function name: stereo-Initialise
+		execute function name: stereo-Execute
+		destroy function name: stereo-Destroy
+	self->coord = { 1, 1, 0 }
+	self->focalPoint = { 1, 0, 0 }
+	self->upDirection = { 1, 0, 0 }
+	self->aperture = 70
+	self->stereoType = lucStereoToeIn
+	self->buffer = lucLeft
+	self->eyeSeparation = 0.3
+************** Checking Camera 'frontOn' **************
+	************** Testing lucCamera_Zoom **************
+	lucCamera: frontOn
+		Stg_Component (ptr): 0x80686d8
+		Stg_Object (ptr): 0x80686d8
+			Stg_Class (ptr): 0x80686d8
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7fa8ff5
+				_print (func ptr): 0xb7fa902c
+				_copy (func ptr): 0xb7fa9301
+			name: frontOn
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7fa93f8
+			_construct (func ptr): 0xb7fa9489
+			_build (func ptr): 0xb7fa97d7
+			_initialise (func ptr): 0xb7fa97dc
+			_execute (func ptr): 0xb7fa97e1
+			_destroy (func ptr): 0xb7fa97e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: frontOn-Construct
+			build function name: frontOn-Build
+			initialise function name: frontOn-Initialise
+			execute function name: frontOn-Execute
+			destroy function name: frontOn-Destroy
+		self->coord = { 0, 0, 2 }
+		self->focalPoint = { 0, 0, 0 }
+		self->upDirection = { 0, 1, 0 }
+		self->aperture = 45
+		self->stereoType = lucMono
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.2
+	lucCamera: frontOn
+		Stg_Component (ptr): 0x80686d8
+		Stg_Object (ptr): 0x80686d8
+			Stg_Class (ptr): 0x80686d8
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7fa8ff5
+				_print (func ptr): 0xb7fa902c
+				_copy (func ptr): 0xb7fa9301
+			name: frontOn
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7fa93f8
+			_construct (func ptr): 0xb7fa9489
+			_build (func ptr): 0xb7fa97d7
+			_initialise (func ptr): 0xb7fa97dc
+			_execute (func ptr): 0xb7fa97e1
+			_destroy (func ptr): 0xb7fa97e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: frontOn-Construct
+			build function name: frontOn-Build
+			initialise function name: frontOn-Initialise
+			execute function name: frontOn-Execute
+			destroy function name: frontOn-Destroy
+		self->coord = { 0, 0, 0.25 }
+		self->focalPoint = { 0, 0, 0 }
+		self->upDirection = { 0, 1, 0 }
+		self->aperture = 45
+		self->stereoType = lucMono
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.2
+	************** Testing lucCamera_RotateAroundUpDirection **************
+		Has rotated 45 degrees.
+		Has rotated 90 degrees.
+		Has rotated 135 degrees.
+		Has rotated 180 degrees.
+		Has rotated 135 degrees.
+		Has rotated 90 degrees.
+		Has rotated 45 degrees.
+		Has rotated 0 degrees.
+	************** Testing lucCamera_RotateTowardsUpDirection **************
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
+************** Checking Camera 'stereo' **************
+	************** Testing lucCamera_Zoom **************
+	lucCamera: stereo
+		Stg_Component (ptr): 0x806b598
+		Stg_Object (ptr): 0x806b598
+			Stg_Class (ptr): 0x806b598
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7fa8ff5
+				_print (func ptr): 0xb7fa902c
+				_copy (func ptr): 0xb7fa9301
+			name: stereo
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7fa93f8
+			_construct (func ptr): 0xb7fa9489
+			_build (func ptr): 0xb7fa97d7
+			_initialise (func ptr): 0xb7fa97dc
+			_execute (func ptr): 0xb7fa97e1
+			_destroy (func ptr): 0xb7fa97e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: stereo-Construct
+			build function name: stereo-Build
+			initialise function name: stereo-Initialise
+			execute function name: stereo-Execute
+			destroy function name: stereo-Destroy
+		self->coord = { 1, 2, 0 }
+		self->focalPoint = { 1, 0, 0 }
+		self->upDirection = { 1, 0, 0 }
+		self->aperture = 70
+		self->stereoType = lucStereoToeIn
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.3
+	lucCamera: stereo
+		Stg_Component (ptr): 0x806b598
+		Stg_Object (ptr): 0x806b598
+			Stg_Class (ptr): 0x806b598
+				sizeOfSelf: 212
+				_deleteSelf: Yes
+				type: lucCamera
+				_delete (func ptr): 0xb7fa8ff5
+				_print (func ptr): 0xb7fa902c
+				_copy (func ptr): 0xb7fa9301
+			name: stereo
+			nameAllocationType: NON_GLOBAL
+			_defaultConstructor (func ptr): 0xb7fa93f8
+			_construct (func ptr): 0xb7fa9489
+			_build (func ptr): 0xb7fa97d7
+			_initialise (func ptr): 0xb7fa97dc
+			_execute (func ptr): 0xb7fa97e1
+			_destroy (func ptr): 0xb7fa97e6
+			isConstructed: True
+			isBuilt: False
+			isInitialised: False
+			hasExecuted: False
+			isDestroyed: False
+			constructor function name: stereo-Construct
+			build function name: stereo-Build
+			initialise function name: stereo-Initialise
+			execute function name: stereo-Execute
+			destroy function name: stereo-Destroy
+		self->coord = { 1, 0.25, 0 }
+		self->focalPoint = { 1, 0, 0 }
+		self->upDirection = { 1, 0, 0 }
+		self->aperture = 70
+		self->stereoType = lucStereoToeIn
+		self->buffer = lucLeft
+		self->eyeSeparation = 0.3
+	************** Testing lucCamera_RotateAroundUpDirection **************
+		Has rotated 45 degrees.
+		Has rotated 90 degrees.
+		Has rotated 135 degrees.
+		Has rotated 180 degrees.
+		Has rotated 135 degrees.
+		Has rotated 90 degrees.
+		Has rotated 45 degrees.
+		Has rotated 0 degrees.
+	************** Testing lucCamera_RotateTowardsUpDirection **************
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
+		Has rotated 12.25 degrees.
+		Has rotated 24.5 degrees.
+		Has rotated 36.75 degrees.
+		Has rotated 49 degrees.
+		Has rotated 61.25 degrees.
+		Has rotated 73.5 degrees.
+		Has rotated 85.75 degrees.
+		Has rotated 89.9 degrees.
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/expected/testColourMaps.0of1.colourMap.txt.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/expected/testColourMaps.0of1.colourMap.txt.expected	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,159 @@
+lucColourMap: cIItcomColourMap
+Stg_Component (ptr): 0x806a750
+Stg_Object (ptr): 0x806a750
+	Stg_Class (ptr): 0x806a750
+		sizeOfSelf: 128
+		_deleteSelf: Yes
+		type: lucColourMap
+		_delete (func ptr): 0xb7f084ef
+		_print (func ptr): 0xb7f08526
+		_copy (func ptr): 0xb7f08804
+	name: cIItcomColourMap
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0xb7f088c4
+	_construct (func ptr): 0xb7f08955
+	_build (func ptr): 0xb7f08a6f
+	_initialise (func ptr): 0xb7f08a74
+	_execute (func ptr): 0xb7f08a79
+	_destroy (func ptr): 0xb7f08a7e
+	isConstructed: True
+	isBuilt: False
+	isInitialised: False
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: cIItcomColourMap-Construct
+	build function name: cIItcomColourMap-Build
+	initialise function name: cIItcomColourMap-Initialise
+	execute function name: cIItcomColourMap-Execute
+	destroy function name: cIItcomColourMap-Destroy
+self->colourCount = 3
+	Colour 0: Red -      0, Green -      0, Blue -      1, Opacity -      1
+	Colour 1: Red -      0, Green -      1, Blue -      0, Opacity -      1
+	Colour 2: Red -      1, Green -      0, Blue -      0, Opacity -      1
+self->minimum = 0
+self->maximum = 1
+self->logScale = False
+self->dynamicRange = True
+                                                                                                    
+0                                                                                                    1
+lucColourMap: French Girl
+Stg_Component (ptr): 0x8069190
+Stg_Object (ptr): 0x8069190
+	Stg_Class (ptr): 0x8069190
+		sizeOfSelf: 128
+		_deleteSelf: Yes
+		type: lucColourMap
+		_delete (func ptr): 0xb7f084ef
+		_print (func ptr): 0xb7f08526
+		_copy (func ptr): 0xb7f08804
+	name: French Girl
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0xb7f088c4
+	_construct (func ptr): 0xb7f08955
+	_build (func ptr): 0xb7f08a6f
+	_initialise (func ptr): 0xb7f08a74
+	_execute (func ptr): 0xb7f08a79
+	_destroy (func ptr): 0xb7f08a7e
+	isConstructed: True
+	isBuilt: False
+	isInitialised: False
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: French Girl-Construct
+	build function name: French Girl-Build
+	initialise function name: French Girl-Initialise
+	execute function name: French Girl-Execute
+	destroy function name: French Girl-Destroy
+self->colourCount = 3
+	Colour 0: Red -      1, Green -      0, Blue -      0, Opacity -      1
+	Colour 1: Red -      1, Green -      1, Blue -      0, Opacity -      1
+	Colour 2: Red -      0, Green -      0, Blue -      0, Opacity -      1
+self->minimum = 0
+self->maximum = 1
+self->logScale = False
+self->dynamicRange = True
+                                                                                                    
+0                                                                                                    1
+lucColourMap: Rainbow2
+Stg_Component (ptr): 0x806c090
+Stg_Object (ptr): 0x806c090
+	Stg_Class (ptr): 0x806c090
+		sizeOfSelf: 128
+		_deleteSelf: Yes
+		type: lucColourMap
+		_delete (func ptr): 0xb7f084ef
+		_print (func ptr): 0xb7f08526
+		_copy (func ptr): 0xb7f08804
+	name: Rainbow2
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0xb7f088c4
+	_construct (func ptr): 0xb7f08955
+	_build (func ptr): 0xb7f08a6f
+	_initialise (func ptr): 0xb7f08a74
+	_execute (func ptr): 0xb7f08a79
+	_destroy (func ptr): 0xb7f08a7e
+	isConstructed: True
+	isBuilt: False
+	isInitialised: False
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: Rainbow2-Construct
+	build function name: Rainbow2-Build
+	initialise function name: Rainbow2-Initialise
+	execute function name: Rainbow2-Execute
+	destroy function name: Rainbow2-Destroy
+self->colourCount = 7
+	Colour 0: Red -      1, Green -      1, Blue -      1, Opacity -      1
+	Colour 1: Red -  0.627, Green -  0.125, Blue -  0.941, Opacity -      1
+	Colour 2: Red -      0, Green -      0, Blue -      1, Opacity -      1
+	Colour 3: Red -      0, Green -      1, Blue -      0, Opacity -      1
+	Colour 4: Red -      1, Green -      1, Blue -      0, Opacity -      1
+	Colour 5: Red -      1, Green -  0.647, Blue -      0, Opacity -      1
+	Colour 6: Red -      1, Green -      0, Blue -      0, Opacity -      1
+self->minimum = 0
+self->maximum = 1
+self->logScale = False
+self->dynamicRange = True
+                                                                                                    
+0                                                                                                    1
+lucColourMap: Rainbow
+Stg_Component (ptr): 0x8068db8
+Stg_Object (ptr): 0x8068db8
+	Stg_Class (ptr): 0x8068db8
+		sizeOfSelf: 128
+		_deleteSelf: Yes
+		type: lucColourMap
+		_delete (func ptr): 0xb7f084ef
+		_print (func ptr): 0xb7f08526
+		_copy (func ptr): 0xb7f08804
+	name: Rainbow
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0xb7f088c4
+	_construct (func ptr): 0xb7f08955
+	_build (func ptr): 0xb7f08a6f
+	_initialise (func ptr): 0xb7f08a74
+	_execute (func ptr): 0xb7f08a79
+	_destroy (func ptr): 0xb7f08a7e
+	isConstructed: True
+	isBuilt: False
+	isInitialised: False
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: Rainbow-Construct
+	build function name: Rainbow-Build
+	initialise function name: Rainbow-Initialise
+	execute function name: Rainbow-Execute
+	destroy function name: Rainbow-Destroy
+self->colourCount = 6
+	Colour 0: Red -  0.627, Green -  0.125, Blue -  0.941, Opacity -      1
+	Colour 1: Red -      0, Green -      0, Blue -      1, Opacity -      1
+	Colour 2: Red -      0, Green -      1, Blue -      0, Opacity -      1
+	Colour 3: Red -      1, Green -      1, Blue -      0, Opacity -      1
+	Colour 4: Red -      1, Green -  0.647, Blue -      0, Opacity -      1
+	Colour 5: Red -      1, Green -      0, Blue -      0, Opacity -      1
+self->minimum = 0
+self->maximum = 1
+self->logScale = False
+self->dynamicRange = True
+                                                                                                    
+0                                                                                                    1
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/makefile	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,51 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##
+## This file may be distributed under the terms of the VPAC Public License
+## as defined by VPAC of Australia and appearing in the file
+## LICENSE.VPL included in the packaging of this file.
+##
+## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+##
+## $Id: Makefile.rules 2752 2005-03-07 06:45:55Z AlanLo $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+NAME = $(shell basename `pwd | sed s/tests//g`)
+
+tests = lib${PROJECT}_${NAME}
+CHECKS = $(wildcard *.sh)
+SRCS = $(wildcard *.c)
+
+subdirs = plugins
+
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} 
+EXTERNAL_LIBS= -L${LIB_DIR} -llucBase
+
+ifdef HAVE_OSMESA
+	packages += OSMESA
+endif
+
+ifdef HAVE_GL
+	packages += GL
+endif
+
+packages += STGERMAIN DL HYPRE PETSC MPI MATH XML 
+
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/Others/lucTestColourMaps.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/Others/lucTestColourMaps.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,63 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: lucTestColourMaps.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+
+void lucTestColourMaps( void* _context, void* _buffer ) {
+	AbstractContext* context = (AbstractContext*) _context;
+	lucBaseContextExtension* contextExt = ExtensionManager_Get( context->extensionMgr, context, lucBaseContextExtensionHandle );
+	Stream* stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "colourMap.txt" );
+
+	lucColourMap_Register_PrintAllObjects( contextExt->colourMap_Register, stream );
+}
+
+void lucTestColourMaps_Register( void* _context ) {
+	ContextEP_Append( _context, AbstractContext_EP_ConstructExtensions, lucTestColourMaps );
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/Others/lucTestOutputing.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/Others/lucTestOutputing.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,73 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: lucTestOutputing.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+
+void lucTestOutputing( lucWindow* window, unsigned char* buffer, AbstractContext* context ) {
+	Pixel_Index    width          = window->width;
+	Pixel_Index    height         = window->height;
+	Pixel_Index    vertical_I;
+	Pixel_Index    horizontal_I;
+	unsigned char* pixel;
+	
+	/* Draw Picture */
+	for ( vertical_I = 0 ; vertical_I < height ; vertical_I++ ) {
+		for ( horizontal_I = 0 ; horizontal_I < width ; horizontal_I++ ) {
+			pixel = &buffer[3 * ( horizontal_I + vertical_I * width )];
+
+			pixel[0] = (unsigned char) (255.0/(double)height * (double)vertical_I);
+			pixel[1] = (unsigned char) (255.0 - 255.0/(double)width * (double)horizontal_I);
+			pixel[2] = (unsigned char) (255.0/(double)width * (double)horizontal_I);
+		}
+	}
+}
+
+void lucTestOutputing_Register( void* context ) {
+	ContextEP_Append( context, luc_EP_ImageBuffer, lucTestOutputing );
+	ContextEP_Append( context, AbstractContext_EP_Dump, lucBase_DumpAllWindows );
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/Others/lucTestPlottingObjects.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/Others/lucTestPlottingObjects.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,91 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: lucTestPlottingObjects.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+
+
+void lucTestCalculate( AbstractContext* context, lucWindow* window, lucViewport* viewport, lucPlottingObject* object ) {
+	Stream* stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	Journal_Printf( stream, "In func '%s' for object %s\n", __func__, object->name );
+}
+
+void lucTestDraw( AbstractContext* context, lucWindow* window, lucViewport* viewport, lucPlottingObject* object ) {
+	Stream* stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	Journal_Printf( stream, "In func '%s' for object %s\n", __func__, object->name );
+}
+
+void lucTestPlottingObjects( AbstractContext* context ) {
+	lucBaseContextExtension* contextExt = ExtensionManager_Get( context->extensionMgr, context, lucBaseContextExtensionHandle );
+	lucPlottingObject*            plottingObject;
+	PlottingObject_Index          plottingObject_I;
+	Stream*                       stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "plottingObject.txt" );
+	lucPlottingObject_Register_PrintAllObjects( contextExt->plottingObject_Register, stream );
+
+	for ( plottingObject_I = 0 ; plottingObject_I < lucPlottingObject_Register_GetCount( contextExt->plottingObject_Register ) ; plottingObject_I++ ) {
+		plottingObject = lucPlottingObject_Register_GetByIndex( contextExt->plottingObject_Register, plottingObject_I );
+
+		EP_Append( plottingObject->CalculateEP, lucTestCalculate );
+		EP_Append( plottingObject->DrawEP, lucTestDraw );
+		
+	}
+	
+}
+
+void lucTestPlottingObjects_Draw( AbstractContext* context ) {
+	lucBaseContextExtension* contextExt = ExtensionManager_Get( context->extensionMgr, context, lucBaseContextExtensionHandle );
+	lucPlottingObject_Register_DrawAll( contextExt->plottingObject_Register, NULL, NULL, context );
+}
+
+void lucTestPlottingObjects_Register( void* context ) {
+	ContextEP_Append( context, AbstractContext_EP_ConstructExtensions, lucTestPlottingObjects );
+	ContextEP_Append( context, AbstractContext_EP_Dump, lucTestPlottingObjects_Draw );
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/RenderingEngineTest.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/RenderingEngineTest.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,215 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: RenderingEngineTest.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+
+#include <assert.h>
+#include <string.h>
+#include "RenderingEngineTest.h"
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucRenderingEngineTest_Type = "lucRenderingEngineTest";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucRenderingEngineTest* _lucRenderingEngineTest_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucRenderingEngine_RenderFunction*                 _render,
+		lucRenderingEngine_GetPixelDataFunction*           _getPixelData,
+		lucRenderingEngine_CompositeViewportFunction*      _compositeViewport,
+		Name                                               name ) 
+{
+	lucRenderingEngineTest*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucRenderingEngineTest) );
+	self = (lucRenderingEngineTest*) _lucRenderingEngine_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_render,
+			_getPixelData,
+			_compositeViewport,
+			name );
+	
+	return self;
+}
+
+void _lucRenderingEngineTest_Init( 
+		lucRenderingEngineTest*                                      self  ) 
+{
+	/* Initial malloc of memory */
+	self->buffer = Memory_Alloc_Array( lucPixel, 1, "buffer" );
+}
+
+void _lucRenderingEngineTest_Delete( void* renderingEngine ) {
+	lucRenderingEngineTest*  self = (lucRenderingEngineTest*)renderingEngine;
+
+	_lucRenderingEngine_Delete( self );
+}
+
+void _lucRenderingEngineTest_Print( void* renderingEngine, Stream* stream ) {
+	lucRenderingEngineTest*  self = (lucRenderingEngineTest*)renderingEngine;
+
+	_lucRenderingEngine_Print( self, stream );
+}
+
+void* _lucRenderingEngineTest_Copy( void* renderingEngine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucRenderingEngineTest*  self = (lucRenderingEngineTest*)renderingEngine;
+	lucRenderingEngineTest* newRenderingEngine;
+
+	newRenderingEngine = _lucRenderingEngine_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newRenderingEngine;
+}
+
+
+void* _lucRenderingEngineTest_DefaultNew( Name name ) {
+	return (void*) _lucRenderingEngineTest_New(
+		sizeof(lucRenderingEngineTest),
+		lucRenderingEngineTest_Type,
+		_lucRenderingEngineTest_Delete,
+		_lucRenderingEngineTest_Print,
+		NULL,
+		_lucRenderingEngineTest_DefaultNew,
+		_lucRenderingEngineTest_Construct,
+		_lucRenderingEngineTest_Build,
+		_lucRenderingEngineTest_Initialise,
+		_lucRenderingEngineTest_Execute,
+		_lucRenderingEngineTest_Destroy,
+		_lucRenderingEngineTest_Render,
+		_lucRenderingEngineTest_GetPixelData,
+		_lucRenderingEngineTest_CompositeViewport,
+		name );
+}
+
+void _lucRenderingEngineTest_Construct( void* renderingEngine, Stg_ComponentFactory* cf, void* data ){
+	lucRenderingEngineTest*  self = (lucRenderingEngineTest*)renderingEngine;
+
+	/* Construct Parent */
+	_lucRenderingEngine_Construct( self, cf, data );
+	
+	_lucRenderingEngineTest_Init( self );
+}
+
+void _lucRenderingEngineTest_Build( void* renderingEngine, void* data ) {}
+void _lucRenderingEngineTest_Initialise( void* renderingEngine, void* data ) {}
+void _lucRenderingEngineTest_Execute( void* renderingEngine, void* data ) {}
+void _lucRenderingEngineTest_Destroy( void* renderingEngine, void* data ) {}
+
+
+void _lucRenderingEngineTest_Render( void* renderingEngine, lucWindow* window, AbstractContext* context ) {
+	lucRenderingEngineTest* self              = (lucRenderingEngineTest*) renderingEngine;
+	Pixel_Index           width  = window->width;
+	Pixel_Index           height = window->height;
+	Pixel_Index           horizontal_I;
+	Pixel_Index           vertical_I;
+	unsigned char*        pixel;
+
+	Journal_DPrintfL( lucDebug, 2, "In func: %s for %s '%s'\n", __func__, self->type, self->name );
+	Stream_Indent( lucDebug );
+
+	self->buffer = Memory_Realloc_Array( self->buffer, lucPixel, width * height );
+	memset( self->buffer, 0, width * height * sizeof(lucPixel) );
+	
+	for ( vertical_I = 0 ; vertical_I < height ; vertical_I++ ) {
+		for ( horizontal_I = 0 ; horizontal_I < width ; horizontal_I++ ) {
+			pixel = (unsigned char*) &self->buffer[ horizontal_I + vertical_I * width ];
+
+			pixel[0] = (unsigned char) (255.0/(double)height * (double)vertical_I);
+			pixel[1] = (unsigned char) (255.0 - 255.0/(double)width * (double)horizontal_I);
+			pixel[2] = (unsigned char) (255.0/(double)width * (double)horizontal_I);
+		}
+	}
+	
+	Stream_UnIndent( lucDebug );
+	Journal_DPrintfL( lucDebug, 2, "Leaving func %s\n", __func__ );
+}
+
+void _lucRenderingEngineTest_GetPixelData( void* renderingEngine, lucWindow* window, lucPixel* buffer ) {
+	lucRenderingEngineTest* self              = (lucRenderingEngineTest*) renderingEngine;
+	Pixel_Index             width             = window->width;
+	Pixel_Index             height            = window->height;
+
+	memcpy( buffer, self->buffer, sizeof(lucPixel) * width * height );
+}
+
+void _lucRenderingEngineTest_CompositeViewport( 
+		void*                                              renderingEngine, 
+		lucViewportInfo*                                   viewportInfo, 
+		AbstractContext*                                   context, 
+		Bool                                               broadcast ) 
+{
+}
+
+void RenderingEngineTest_Register( AbstractContext* context ) {
+	Stg_ComponentRegister* componentRegister = Stg_ComponentRegister_Get_ComponentRegister();
+	Stg_ComponentRegister_Add( componentRegister, lucRenderingEngineTest_Type,     "0", _lucRenderingEngineTest_DefaultNew );
+	RegisterParent( lucRenderingEngineTest_Type, lucRenderingEngine_Type );
+}
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/RenderingEngineTest.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/RenderingEngineTest.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,104 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: RenderingEngineTest.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucRenderingEngineTest_h__
+#define __lucRenderingEngineTest_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucRenderingEngineTest_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucRenderingEngineTest \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucRenderingEngine \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		lucPixel* buffer;
+
+	typedef struct { __lucRenderingEngineTest } lucRenderingEngineTest;
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucRenderingEngineTest* _lucRenderingEngineTest_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucRenderingEngine_RenderFunction*                 _render,
+		lucRenderingEngine_GetPixelDataFunction*           _getPixelData,
+		lucRenderingEngine_CompositeViewportFunction*      _compositeViewport,
+		Name                                               name );
+
+	void _lucRenderingEngineTest_Delete( void* renderingEngine ) ;
+	void _lucRenderingEngineTest_Print( void* renderingEngine, Stream* stream ) ;
+	void* _lucRenderingEngineTest_Copy( void* renderingEngine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucRenderingEngineTest_DefaultNew( Name name ) ;
+	void _lucRenderingEngineTest_Construct( void* renderingEngine, Stg_ComponentFactory* cf, void* data );
+	void _lucRenderingEngineTest_Build( void* renderingEngine, void* data ) ;
+	void _lucRenderingEngineTest_Initialise( void* renderingEngine, void* data ) ;
+	void _lucRenderingEngineTest_Execute( void* renderingEngine, void* data );
+	void _lucRenderingEngineTest_Destroy( void* renderingEngine, void* data ) ;
+
+	void _lucRenderingEngineTest_Render( void* renderingEngine, lucWindow* window, AbstractContext* context ) ;
+	void _lucRenderingEngineTest_GetPixelData( void* renderingEngine, lucWindow* window, lucPixel* buffer ) ;
+
+	/** Compositing Functions */
+
+	void _lucRenderingEngineTest_CompositeViewport( 
+		void*                                              renderingEngine, 
+		lucViewportInfo*                                   viewportInfo, 
+		AbstractContext*                                   context, 
+		Bool                                               broadcast ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/RenderingEngineTest.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/RenderingEngineTest.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucRenderingEngineTest</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucRenderingEngine</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/lucTestCameras.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/lucTestCameras.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,226 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: lucTestCameras.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+
+void lucTestLeftDirection( lucCamera* camera, Stream* stream ) {
+	XYZ   leftDirection;
+	XYZ   focusDirection;
+
+	lucCamera_GetLeftDirection( camera, leftDirection );
+	lucCamera_GetFocusDirection( camera, focusDirection );
+
+	Journal_Firewall( fabs( StGermain_AngleBetweenVectors( leftDirection, camera->upDirection, 3 ) - M_PI/2.0 ) < 0.01 , 
+			stream, "Failed %s - left direction = %f %f %f, focusDirection = %f %f %f\n", __func__,
+			leftDirection[0], leftDirection[1], leftDirection[2], 
+			focusDirection[0], focusDirection[1], focusDirection[2] ); 
+	Journal_Firewall( fabs( StGermain_AngleBetweenVectors( leftDirection, focusDirection, 3 ) - M_PI/2.0 ) < 0.01 , 
+			stream, "Failed %s - left direction = %f %f %f, focusDirection = %f %f %f\n", __func__,
+			leftDirection[0], leftDirection[1], leftDirection[2], 
+			focusDirection[0], focusDirection[1], focusDirection[2] ); 
+
+}
+
+void lucTestBroadcast( lucCamera* camera, Stream* stream, AbstractContext* context ) {
+	int rootRank = 0;
+	double rank = (double) context->rank;
+
+	camera->coord[ J_AXIS ] = rank;
+
+	camera->eyeSeparation = rank;
+	
+	lucCamera_Broadcast( camera, rootRank, context->communicator );
+
+	Journal_Firewall( fabs( camera->coord[ J_AXIS ] - (double) rootRank ) < 0.01, 
+			stream, "Failed %s\n", __func__ );
+
+	Journal_Firewall( fabs( camera->eyeSeparation - (double) rootRank ) < 0.01, 
+			stream, "Failed %s\n", __func__ );
+}
+
+void lucTestEye( lucCamera* camera, Stream* stream ) {
+	Coord leftEye;
+	Coord rightEye;
+	XYZ   vector;
+	XYZ   leftDirection;
+
+	camera->buffer = lucRight;
+	lucCamera_SwapStereoBuffer( camera );
+	lucCamera_CurrentEyePosition( camera, leftEye );
+	lucCamera_SwapStereoBuffer( camera );
+	lucCamera_CurrentEyePosition( camera, rightEye );
+
+	StGermain_VectorSubtraction( vector, leftEye, rightEye, 3 );
+	if ( camera->stereoType == lucMono ) {
+		Journal_Firewall( fabs(StGermain_VectorMagnitude( vector, 3 ) ) < 0.01, 
+				stream, "Failed %s\n", __func__ );
+		StGermain_VectorSubtraction( vector, leftEye, camera->coord, 3 );
+		Journal_Firewall( fabs(StGermain_VectorMagnitude( vector, 3 ) ) < 0.01, 
+				stream, "Failed %s\n", __func__ );
+		return;
+	}
+
+	Journal_Firewall( fabs(StGermain_VectorMagnitude( vector, 3 ) - camera->eyeSeparation ) < 0.01*camera->eyeSeparation, 
+			stream, "Failed %s\n", __func__ );
+
+	lucCamera_GetLeftDirection( camera, leftDirection );
+	Journal_Firewall( fabs( StGermain_AngleBetweenVectors( vector, leftDirection, 3 ) ) < 0.01 , 
+			stream, "Failed %s\n", __func__ );
+}
+
+void testCamera( lucCamera* camera, Stream* stream, AbstractContext* context ) {
+	lucTestEye( camera, stream );
+	lucTestLeftDirection( camera, stream );
+}
+
+
+void lucTestThisCamera( AbstractContext* context, lucCamera* camera, Stream* stream ) {
+	Index                         angleCount = 8;                         
+	Index                         angle_I;                         
+	XYZ                           leftDirection;
+	XYZ                           focusDirection;
+	XYZ                           originalFocusDirection;
+	
+	Journal_Printf( stream, "************** Checking Camera '%s' **************\n", camera->name );
+	Stream_Indent( stream );
+	lucCamera_GetFocusDirection( camera, originalFocusDirection );
+
+	Journal_Printf( stream, "************** Testing lucCamera_Zoom **************\n");
+	lucCamera_Zoom( camera, 2.0 ) ;
+	Print( camera, stream );
+	testCamera( camera, stream, context );
+	lucCamera_Reset( camera );
+
+	lucCamera_Zoom( camera, 0.25 ) ;
+	Print( camera, stream );
+	testCamera( camera, stream, context );
+	lucCamera_Reset( camera );
+
+	lucTestBroadcast( camera, stream, context );
+	lucCamera_Reset( camera );
+
+	Journal_Printf( stream, "************** Testing lucCamera_RotateAroundUpDirection **************\n");
+	Stream_Indent( stream );
+	for ( angle_I = 0 ; angle_I < angleCount ; angle_I++ ) {
+		lucCamera_RotateAroundUpDirection( camera, 2.0 * M_PI / (double)angleCount ) ;
+		lucCamera_GetFocusDirection( camera, focusDirection );
+		Journal_Printf(stream, "Has rotated %.5g degrees.\n", 
+				StGermain_AngleBetweenVectors( focusDirection, originalFocusDirection, 3) * 180.0 / M_PI );
+		lucCamera_GetLeftDirection( camera, leftDirection );
+	}
+	Stream_UnIndent( stream );
+	lucCamera_Reset( camera );
+	
+	Journal_Printf( stream, "************** Testing lucCamera_RotateTowardsUpDirection **************\n");
+	Stream_Indent( stream );
+	for ( angle_I = 0 ; angle_I < angleCount ; angle_I++ ) {
+		lucCamera_RotateTowardsUpDirection( camera,  0.5 * M_PI / (double)angleCount + M_PI/180.0 ) ;
+		lucCamera_GetFocusDirection( camera, focusDirection );
+		Journal_Printf(stream, "Has rotated %.5g degrees.\n", 
+				StGermain_AngleBetweenVectors( focusDirection, originalFocusDirection, 3) * 180.0 / M_PI );
+		testCamera( camera, stream, context );
+	}
+	lucCamera_Reset( camera );
+	for ( angle_I = 0 ; angle_I < angleCount ; angle_I++ ) {
+		lucCamera_RotateTowardsUpDirection( camera,  -0.5 * M_PI / (double)angleCount - M_PI/180.0 ) ;
+		lucCamera_GetFocusDirection( camera, focusDirection );
+		Journal_Printf(stream, "Has rotated %.5g degrees.\n", 
+				StGermain_AngleBetweenVectors( focusDirection, originalFocusDirection, 3) * 180.0 / M_PI );
+
+		/* Print left direction */
+		testCamera( camera, stream, context );
+	}
+	Stream_UnIndent( stream );
+	lucCamera_Reset( camera );
+	Stream_UnIndent( stream );
+}
+
+void lucTestAllCameras( AbstractContext* context ) {
+	lucCamera*                    stereo;
+	lucCamera*                    frontOn;
+	Stream*                       stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	if ( context->rank == 0 )
+		Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "camera.txt" );
+	Stream_SetPrintingRank( stream, 0 );
+
+	/* Note: this func gets added to construct extensions... may it should be changed to take in the tummy too? */
+	frontOn = Stg_ComponentFactory_ConstructByName( context->CF, "frontOn", lucCamera, True, 0 /* dummy */ ); 
+	stereo = Stg_ComponentFactory_ConstructByName( context->CF, "stereo", lucCamera, True, 0 /* dummy */ ); 
+	Print( frontOn, stream );
+	Print( stereo, stream );
+	lucTestThisCamera( context, frontOn, stream );
+	lucTestThisCamera( context, stereo, stream );
+}
+
+const Type lucTestCameras_Type = "lucTestCameras";
+typedef struct {
+	__Codelet
+} lucTestCameras;
+
+void _lucTestCameras_Construct( void* components, Stg_ComponentFactory* cf, void* data ) {
+	AbstractContext* context;
+	context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
+	ContextEP_Append( context, AbstractContext_EP_ConstructExtensions, lucTestAllCameras );
+}
+
+void* _lucTestCameras_DefaultNew( Name name ) {
+	return Codelet_New(
+		lucTestCameras_Type,
+		_lucTestCameras_DefaultNew,
+		_lucTestCameras_Construct,
+		_Codelet_Build,
+		_Codelet_Initialise,
+		_Codelet_Execute,
+		_Codelet_Destroy,
+		name );
+}
+
+Index lucTestCameras_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, lucTestCameras_Type, "0", _lucTestCameras_DefaultNew );
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/lucTestColourMaps.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/lucTestColourMaps.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,93 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: lucTestColourMaps.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+
+void lucTestColourMaps_Function( AbstractContext* context ) {
+	Index            component_I;
+	Stg_ObjectList*  componentList = context->CF->LCRegister->componentList;
+	Stg_Component*   component;
+	Stream*          stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "colourMap.txt" );
+
+	/* Do Stg_Class_Print for all colour maps */
+	for ( component_I = 0 ; component_I < componentList->count ; component_I++ ) {
+		component = (Stg_Component*) Stg_ObjectList_At( componentList, component_I );
+
+		if ( Stg_Class_IsInstance( component, lucColourMap_Type ) )
+			Stg_Class_Print( component, stream );
+	}
+}
+
+const Type lucTestColourMaps_Type = "lucTestColourMaps";
+typedef struct {
+	__Codelet
+} lucTestColourMaps;
+
+void _lucTestColourMaps_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	AbstractContext* context;
+	context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
+	ContextEP_Append( context, AbstractContext_EP_ConstructExtensions, lucTestColourMaps_Function );
+}
+
+void* _lucTestColourMaps_DefaultNew( Name name ) {
+	return Codelet_New(
+		lucTestColourMaps_Type,
+		_lucTestColourMaps_DefaultNew,
+		_lucTestColourMaps_Construct,
+		_Codelet_Build,
+		_Codelet_Initialise,
+		_Codelet_Execute,
+		_Codelet_Destroy,
+		name );
+}
+
+Index lucTestColourMaps_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, lucTestColourMaps_Type, "0", _lucTestColourMaps_DefaultNew );
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/plugins/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/plugins/makefile	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,16 @@
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+#EXTERNAL_INCLUDES = ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+#EXTERNAL_LIBS = ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS} 
+
+packages = STGERMAIN MPI XML GL
+
+# Note don't put the .c extension. just the base name of the plugin
+plugins := $(wildcard *.c)
+
+include ${PROJ_ROOT}/Makefile.vmake
+
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/testCameras.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/testCameras.0of1.sh	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "glucifer testCameras.xml" "$0" "$@"
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/testCameras.0of3.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/testCameras.0of3.sh	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "glucifer testCameras.xml" "$0" "$@"
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/testCameras.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/testCameras.xml	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 
+	<!-- Construct the app by choosing which plugins to load -->
+	<list name="plugins">
+		<param>lucTestCameras</param>
+	</list>
+
+	<param name="dim">2</param>
+	<param name="outputPath">./output</param>
+	<param name="journal.debug.Plugin">true</param>
+
+	<struct name="components">
+		<struct name="frontOn">
+				<param name="Type">lucCamera</param>
+				<param name="coordX">0.0</param>
+				<param name="coordY">0.0</param>
+				<param name="coordZ">1.0</param>
+		</struct>
+		<struct name="stereo">
+				<param name="Type">lucCamera</param>
+				<param name="coordX">1.0</param>
+				<param name="coordY">1.0</param>
+				<param name="coordZ">0.0</param>
+				<param name="focalPointX">1.0</param>
+				<param name="focalPointY">0.0</param>
+				<param name="focalPointZ">0.0</param>
+				<param name="upDirectionX">1.0</param>
+				<param name="upDirectionY">0.0</param>
+				<param name="upDirectionZ">0.0</param>
+				<param name="aperture">70.0</param>
+				<param name="stereoType">ToeIn</param>
+				<param name="eyeSeparation">0.3</param>
+		</struct>		
+	</struct>	
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/testColourMaps.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/testColourMaps.0of1.sh	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "glucifer testColourMaps.xml" "$0" "$@"
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/testColourMaps.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/testColourMaps.xml	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 
+	<!-- Construct the app by choosing which plugins to load -->
+	<list name="plugins">
+		<param>lucTestColourMaps</param>
+	</list>
+
+	<param name="outputPath">./output</param>
+
+	<struct name="components">
+		<struct name="cIItcomColourMap">
+				<param name="Type">lucColourMap</param>
+				<param name="colours">Blue Green Red</param>
+				<param name="minimum">0.0</param>
+				<param name="maximum">1.0</param>
+				<param name="dynamicRange">true</param>
+		</struct>
+		<struct name="French Girl">
+				<param name="Type">lucColourMap</param>
+				<param name="colours">Red Yellow Black</param>
+				<param name="minimum">0.0</param>
+				<param name="maximum">1.0</param>
+				<param name="dynamicRange">true</param>
+		</struct>	
+		<struct name="Rainbow2">
+				<param name="Type">lucColourMap</param>
+				<param name="colours">white Purple Blue Green Yellow Orange Red</param>
+				<param name="minimum">0.0</param>
+				<param name="maximum">1.0</param>
+				<param name="logScale">f</param>
+				<param name="dynamicRange">t</param>
+		</struct>	
+		<struct name="Rainbow">
+				<param name="Type">lucColourMap</param>
+				<param name="colours">Purple Blue Green Yellow Orange Red</param>
+				<param name="minimum">0.0</param>
+				<param name="maximum">1.0</param>
+				<param name="logScale">f</param>
+				<param name="dynamicRange">t</param>
+		</struct>	
+	</struct>	
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 Base/tests/testlucBase.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Base/tests/testlucBase.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,138 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: testlucBase.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+
+#ifdef HAVE_PYTHON
+#include <Python.h>
+#endif
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <glucifer/Base/Base.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+int main( int argc, char* argv[] ) {
+	MPI_Comm           CommWorld;
+	int                rank;
+	int                numProcessors;
+	Dictionary*        dictionary;
+	XML_IO_Handler*    ioHandler;
+	DiscretisationContext* context         = NULL;
+	
+	/* Initialise PETSc, get world info */
+	MPI_Init( &argc, &argv );
+	MPI_Comm_dup( MPI_COMM_WORLD, &CommWorld );
+	MPI_Comm_size( CommWorld, &numProcessors );
+	MPI_Comm_rank( CommWorld, &rank );
+	
+	StGermain_Init( &argc, &argv );
+	lucBase_Init( &argc, &argv );
+	#ifdef HAVE_PYTHON
+	Py_Initialize();
+	#endif
+
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	/* Create the application's dictionary */
+	dictionary = Dictionary_New();
+
+	/* Read input */
+	ioHandler = XML_IO_Handler_New();
+	IO_Handler_ReadAllFromCommandLine( ioHandler, argc, argv, dictionary );
+	Journal_ReadFromDictionary( dictionary );
+
+	/* Construction phase -----------------------------------------------------------------------------------------------*/
+	context = DiscretisationContext_New( "context", 0, 0, CommWorld, dictionary );
+	#if 0
+	PluginsManager_Load( context->plugins, context, dictionary );
+
+	componentDict = Dictionary_GetDictionary( dictionary, "components" );
+	assert( componentDict );
+
+	context->CF = Stg_ComponentFactory_New( dictionary, componentDict, context->register_Register );
+
+	LiveComponentRegister_Add( context->CF->LCRegister, (Stg_Component*) context );
+	
+	Stg_ComponentFactory_CreateComponents( context->CF );
+	Stg_ComponentFactory_ConstructComponents( context->CF );
+	KeyCall( context, context->constructExtensionsK, EntryPoint_VoidPtr_CallCast* )( KeyHandle(context,context->constructExtensionsK), context );
+	#endif
+	Stg_Component_Construct( context, 0 /* dummy */, &context, False );
+	
+	if( rank == 0 ) 
+		Context_PrintConcise( context, context->verbose );
+
+	/* Building phase ---------------------------------------------------------------------------------------------------*/
+	Stg_Component_Build( context, 0 /* dummy */, False );
+	
+	/* Initialisaton phase ----------------------------------------------------------------------------------------------*/
+	Stg_Component_Initialise( context, 0 /* dummy */, False );
+	
+	/* Run (Solve) phase ------------------------------------------------------------------------------------------------*/
+	AbstractContext_Dump( context );
+	
+	/* Destruct phase ---------------------------------------------------------------------------------------------------*/
+	Stg_Component_Destroy( context, 0 /* dummy */, False );
+	Stg_Component_Destroy( context, 0 /* dummy */, False );
+	Stg_Class_Delete( context );
+	Stg_Class_Delete( dictionary );
+
+	#ifdef HAVE_PYTHON
+	Py_Finalize();
+	#endif
+
+	lucBase_Finalise();
+	StGermain_Finalise();
+		
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0; /* success */
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/makefile	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,9 @@
+
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Axis.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Axis.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,385 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Axis.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "Axis.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+const Type lucAxis_Type = "lucAxis";
+
+lucAxis* lucAxis_New( 
+		Name                                                  name,
+		Coord                                                 origin,
+    		float 				                      scale,
+		lucColour                                             colourX,
+		lucColour                                             colourY,
+		lucColour                                             colourZ)
+{
+	lucAxis* self = (lucAxis*) _lucAxis_DefaultNew( name );
+
+	lucAxis_InitAll( self, origin, scale, colourX, colourY, colourZ);
+
+	return self;
+}
+
+lucAxis* _lucAxis_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+	
+		Name                                               name )
+{
+	lucAxis*    self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucAxis) );
+	self = (lucAxis*)  _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	
+	return self;
+}
+
+void lucAxis_Init(		
+		lucAxis*                                         self,
+		Coord                                            origin,
+		float 				                 scale,
+		lucColour                                        colourX,
+		lucColour                                        colourY,
+		lucColour                                        colourZ) 
+{
+	
+	self->scale = scale;
+	memcpy( self->origin, origin, sizeof(Coord) );	
+	memcpy( &(self->colourX), &colourX, sizeof(lucColour) );	
+	memcpy( &(self->colourY), &colourY, sizeof(lucColour) );	
+	memcpy( &(self->colourZ), &colourZ, sizeof(lucColour) );	
+
+	
+}
+
+void lucAxis_InitAll( 
+		void*                                              axis,
+		Coord                                              origin,
+	        float 				                   scale,
+		lucColour                                          colourX,
+		lucColour                                          colourY,
+		lucColour                                          colourZ)
+{
+	lucAxis* self        = axis;
+
+	/* TODO Init parent */
+	lucAxis_Init( self, origin, scale, colourX, colourY, colourZ );
+}
+
+void _lucAxis_Delete( void* drawingObject ) {
+	lucAxis*  self = (lucAxis*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucAxis_Print( void* drawingObject, Stream* stream ) {
+	lucAxis*  self = (lucAxis*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucAxis_Copy( void* axis, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	lucAxis* self        = axis;
+	lucAxis* newAxis;
+
+	newAxis = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newAxis->scale = self->scale;
+	memcpy( &(newAxis->colourX),       &(self->colourX),       sizeof(lucColour) );
+	memcpy( &(newAxis->colourY),       &(self->colourY),       sizeof(lucColour) );
+	memcpy( &(newAxis->colourZ),       &(self->colourZ),       sizeof(lucColour) );
+	memcpy( newAxis->origin,       self->origin,       sizeof(Coord) );
+	
+	return (void*) newAxis;
+}
+
+void* _lucAxis_DefaultNew( Name name ) {
+	return _lucAxis_New( 
+			sizeof( lucAxis ),
+			lucAxis_Type,
+			_lucAxis_Delete,
+			_lucAxis_Print,
+			_lucAxis_Copy,
+			_lucAxis_DefaultNew,
+			_lucAxis_Construct,
+			_lucAxis_Build,
+			_lucAxis_Initialise,
+			_lucAxis_Execute,
+			_lucAxis_Destroy,		
+		        _lucAxis_Setup,
+			_lucAxis_Draw,
+	                _lucAxis_CleanUp,
+	 		_lucAxis_BuildDisplayList,
+			name );
+}
+
+void _lucAxis_Construct( void* axis, Stg_ComponentFactory* cf, void* data ) {
+	lucAxis*             self               = (lucAxis*) axis;
+        Name colourNameX;
+	Name colourNameY;	
+	Name colourNameZ;		
+	
+	Coord origin;
+	
+	/* Get Stereo Type */
+         /* Construct Parent */
+	_lucDrawingObject_Construct( self, cf, data );
+
+	colourNameX  = Stg_ComponentFactory_GetString( cf, self->name, "colourX", "Red") ;
+	colourNameY  = Stg_ComponentFactory_GetString( cf, self->name, "colourY", "Green") ;
+	colourNameZ  = Stg_ComponentFactory_GetString( cf, self->name, "colourZ", "Blue") ;
+	
+	lucColour_FromString( &self->colourX, colourNameX );	
+	lucColour_FromString( &self->colourY, colourNameY );
+	lucColour_FromString( &self->colourZ, colourNameZ );
+	
+	origin[I_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "originX", -0.25 );
+	origin[J_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "originY", 0.0 );
+	origin[K_AXIS]  = Stg_ComponentFactory_GetDouble( cf, self->name, "originZ", 0.0 );
+	
+       	lucAxis_InitAll( self, 
+	                origin,
+			Stg_ComponentFactory_GetDouble( cf, self->name, "scale", 1.0),
+		        self->colourX,
+			self->colourY,
+			self->colourZ);
+			
+}
+
+void _lucAxis_Build( void* Axis, void* data ) { }
+void _lucAxis_Initialise( void* Axis, void* data ) { }
+void _lucAxis_Execute( void* Axis, void* data ) { }
+void _lucAxis_Destroy( void* Axis, void* data ) { }
+
+void _lucAxis_Setup( void* drawingObject, void* _context ) {
+	lucAxis*       self            = (lucAxis*)drawingObject;
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+void _lucAxis_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucAxis*      self            = (lucAxis*)drawingObject;
+        lucViewport* viewport = viewportInfo->viewport;
+	DiscretisationContext*   context = (DiscretisationContext*) _context;
+	Dimension_Index          dim     = context->dim;
+
+        double rodLength = 0.0;
+	double arrowLength = 0.0;
+
+		
+	/* Initialise OpenGL stuff */
+	glShadeModel(GL_SMOOTH);
+	glDisable(GL_LIGHTING);
+
+	glEnable(GL_LINE_SMOOTH);
+	glEnable(GL_BLEND);	
+	
+	/* Disable lighting because we don't want a 3D effect */
+	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+	/* The rodlength is the total length of the arrow line.
+	   By default it is 0.25, but can be scaled */
+         rodLength =  self->scale*0.25;
+	 
+	 /* The tip of the arrow hea starts at rofLength. The size of the arrow
+	 is a fifth of the total length
+	 ---->
+	 */
+	 arrowLength = rodLength/5.0;
+	 
+	 if (dim == 2) {
+	        /* Drawing the X axis, default is the RED color */
+		glColor3f(self->colourX.red, self->colourX.green, self->colourX.blue);
+
+		glBegin( GL_LINES );
+			glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] ); 
+			glVertex2f( self->origin[I_AXIS] + self->scale*0.25 , self->origin[J_AXIS]  );
+		glEnd(); 
+		glBegin(GL_TRIANGLES);
+			glVertex2f( self->origin[I_AXIS] + self->scale*0.25, self->origin[J_AXIS] );
+			glVertex2f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength, self->origin[J_AXIS] -arrowLength/2.0);
+			glVertex2f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength, self->origin[J_AXIS] +arrowLength/2.0);
+		glEnd();
+		glRasterPos2f( self->origin[I_AXIS] + self->scale*0.25 + self->scale*0.05, self->origin[J_AXIS] );
+		lucPrintString( "X");
+		
+		/* Drawing the Y axis, default is the GREEN color */
+		glColor3f(self->colourY.red, self->colourY.green, self->colourY.blue);
+
+		glBegin( GL_LINES );
+			glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] ); 
+			glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25 );
+		glEnd();	
+		glBegin(GL_TRIANGLES);
+			glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25 );
+			glVertex2f( self->origin[I_AXIS] + arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength);
+			glVertex2f( self->origin[I_AXIS] - arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength);
+		glEnd();
+		glRasterPos2f( self->origin[I_AXIS], self->origin[J_AXIS]+ self->scale*0.25 + self->scale*0.05 );	
+		lucPrintString( "Y");
+	}
+	else if ( dim == 3 ) {
+		/* Drawing the X axis, by default using the RED color */
+		glColor3f(self->colourX.red, self->colourX.green, self->colourX.blue);
+
+		glBegin(GL_TRIANGLES);
+			glVertex3f( self->origin[I_AXIS] + self->scale*0.25, self->origin[J_AXIS], self->origin[K_AXIS] );
+			glVertex3f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength, 
+				    self->origin[J_AXIS] -arrowLength/2.0, self->origin[K_AXIS] );
+			glVertex3f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength,
+				    self->origin[J_AXIS] +arrowLength/2.0,
+				    self->origin[K_AXIS] );
+		glEnd();
+
+		glBegin( GL_LINES );
+			glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] ); 
+			glVertex3f( self->origin[I_AXIS] + self->scale*0.25, self->origin[J_AXIS] , self->origin[K_AXIS] );
+		glEnd(); 
+		
+		glRasterPos3f( self->origin[I_AXIS] + self->scale*0.25 + self->scale*0.05, self->origin[J_AXIS], self->origin[K_AXIS] );
+		lucPrintString( "X");
+		
+		/* Drawing the X axis, by default using the GREEN color */
+		glColor3f(self->colourY.red, self->colourY.green, self->colourY.blue);
+
+		glBegin(GL_TRIANGLES);
+			glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25, self->origin[K_AXIS]  );
+			glVertex3f( self->origin[I_AXIS] + arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength, 
+				    self->origin[K_AXIS] );
+			glVertex3f( self->origin[I_AXIS] - arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength, 
+				    self->origin[K_AXIS] );
+		glEnd();
+
+		glBegin( GL_LINES );
+			glVertex3f(  self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS]  ); 
+			glVertex3f(  self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25 , self->origin[K_AXIS]  );
+		glEnd();
+		
+		glRasterPos3f( self->origin[I_AXIS], self->origin[J_AXIS]+ self->scale*0.25 + self->scale*0.05, self->origin[K_AXIS] );
+		lucPrintString( "Y");
+		
+		
+		/* Drawing the X axis, by default using the BLUE color */
+		glColor3f(self->colourZ.red, self->colourZ.green, self->colourZ.blue);
+		glBegin(GL_TRIANGLES);
+			glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + self->scale*0.25  );
+			glVertex3f( self->origin[I_AXIS] + arrowLength/2.0, self->origin[J_AXIS] , 
+				    self->origin[K_AXIS] + self->scale*0.25 - arrowLength );
+			glVertex3f( self->origin[I_AXIS] - arrowLength/2.0, self->origin[J_AXIS], 
+				    self->origin[K_AXIS] + self->scale*0.25 -arrowLength );
+		glEnd();
+
+		glBegin( GL_LINES );
+			glVertex3f(  self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] ); 
+			glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + self->scale*0.25 );
+		glEnd(); 
+		glRasterPos3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + self->scale*0.25+ self->scale*0.05 );
+		lucPrintString("Z");
+	}
+	/* Put back settings */
+	glEnable(GL_LIGHTING);
+}
+
+void _lucAxis_CleanUp( void* drawingObject, void* _context ) {
+	lucAxis*      self            = (lucAxis*)drawingObject;
+	
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+
+}
+
+void _lucAxis_BuildDisplayList( void* drawingObject, void* _context ) {
+	}
+
+
+
+
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Axis.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Axis.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,125 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Axis.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+
+#ifndef __lucAxis_h__
+#define __lucAxis_h__
+
+	extern const Type lucAxis_Type;
+
+	#define __lucAxis                              \
+		__lucOpenGLDrawingObject \
+		Coord                               origin;\
+		float 				    scale;\
+		lucColour                           colourX;\
+		lucColour                           colourY;\
+		lucColour                           colourZ;
+		
+	struct lucAxis {__lucAxis};
+
+	/** Constructors */
+	lucAxis* lucAxis_New( 
+		Name                                               name,
+		Coord                                              origin,
+		float 						   scale,
+		lucColour                                          colourX,
+		lucColour                                          colourY,
+		lucColour                                          colourZ);
+
+	lucAxis* _lucAxis_New(
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,		
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void lucAxis_InitAll( 
+		void*                                              axis,
+		Coord                                              origin,
+		float                                              scale, 
+		lucColour                                          colourX,
+		lucColour                                          colourY,
+		lucColour                                          colourZ);
+
+	void _lucAxis_Init( 
+		void*                                              axis,
+		Coord                                              origin,
+		float 						   scale, 
+		lucColour                                          colourX,
+		lucColour                                          colourY,
+		lucColour                                          colourZ);
+
+
+	void _lucAxis_Setup( void* drawingObject, void* _context );
+		
+	/** Virtual Functions */
+	void _lucAxis_Delete( void* axis ) ;
+	void _lucAxis_Print( void* axis, Stream* stream ) ;
+	void* _lucAxis_Copy( void* axis, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
+	#define lucAxis_Copy( self ) \
+		(lucAxis*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	void* _lucAxis_DefaultNew( Name name ) ;
+void _lucAxis_Construct( void* axis, Stg_ComponentFactory* cf, void* data ) ;
+	void _lucAxis_Build( void* axis, void* data );
+	void _lucAxis_Initialise( void* axis, void* data );
+	void _lucAxis_Execute( void* axis, void* data );
+	void _lucAxis_Destroy( void* axis, void* data );
+	void _lucAxis_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context );
+	void _lucAxis_CleanUp( void* drawingObject, void* _context );
+	void _lucAxis_BuildDisplayList( void* drawingObject, void* _context );
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Axis.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Axis.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucAxis</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Draws a set of X,Y,Z axis </param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">colourX</param>
+		<param name="Type">String</param>
+		<param name="Default">"Red"</param>
+		<param name="Description">Sets the colour for the X axis</param>
+	</struct>
+	<struct>
+		<param name="Name">colourY</param>
+		<param name="Type">String</param>
+		<param name="Default">"Green"</param>
+		<param name="Description">Sets the colour for the Y axis</param>
+	</struct>
+	<struct>
+		<param name="Name">colourZ</param>
+		<param name="Type">String</param>
+		<param name="Default">"Blue"</param>
+		<param name="Description">Sets the colour for the Z axis</param>
+	</struct>
+	<struct>
+		<param name="Name">originX</param>
+		<param name="Type">Double</param>
+		<param name="Default">-0.5</param>
+		<param name="Description">Sets the X origin of the axis set</param>
+	</struct>
+	<struct>
+		<param name="Name">originY</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">Sets the Y origin of the axis set</param>
+	</struct>
+	<struct>
+		<param name="Name">originZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">Sets the Z origin of the axis set</param>
+	</struct>
+	<struct>
+		<param name="Name">scale</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">Scales the length of the x,y,z axis</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ColourBar.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ColourBar.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,390 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ColourBar.c 646 2006-12-05 02:54:33Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "ColourBar.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucColourBar_Type = "lucColourBar";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucColourBar* _lucColourBar_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		Name                                               name ) 
+{
+	lucColourBar*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucColourBar) );
+	self = (lucColourBar*) _lucDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			name );
+	
+	return self;
+}
+
+void _lucColourBar_Init( 
+		lucColourBar*                                                self,
+		lucColourMap*                                                colourMap,
+		double                                                       lengthFactor,    
+		Pixel_Index                                                  height,    
+		Pixel_Index                                                  margin,
+		float                                                        borderWidth,
+		int                                                          precision,
+		Bool                                                         scientific,
+		int                                                          ticks,
+		Bool                                                         printTickValue,
+		float                                                        scaleValue )
+{
+	self->colourMap = colourMap;
+	self->lengthFactor = lengthFactor;
+	self->height = height;
+	self->margin = margin;
+	self->borderWidth = borderWidth;
+	self->precision = precision;
+	self->scientific = scientific;
+	self->ticks = ticks;
+	self->printTickValue = printTickValue;
+	self->scaleValue = scaleValue;
+
+}
+
+void _lucColourBar_Delete( void* drawingObject ) {
+	lucColourBar*  self = (lucColourBar*)drawingObject;
+
+	_lucDrawingObject_Delete( self );
+}
+
+void _lucColourBar_Print( void* drawingObject, Stream* stream ) {
+	lucColourBar*  self = (lucColourBar*)drawingObject;
+
+	_lucDrawingObject_Print( self, stream );
+}
+
+void* _lucColourBar_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucColourBar*  self = (lucColourBar*)drawingObject;
+	lucColourBar* newDrawingObject;
+
+	newDrawingObject = _lucDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucColourBar_DefaultNew( Name name ) {
+	return (void*) _lucColourBar_New(
+		sizeof(lucColourBar),
+		lucColourBar_Type,
+		_lucColourBar_Delete,
+		_lucColourBar_Print,
+		NULL,
+		_lucColourBar_DefaultNew,
+		_lucColourBar_Construct,
+		_lucColourBar_Build,
+		_lucColourBar_Initialise,
+		_lucColourBar_Execute,
+		_lucColourBar_Destroy,
+		_lucColourBar_Setup,
+		_lucColourBar_Draw,
+		_lucColourBar_CleanUp,
+		name );
+}
+
+void _lucColourBar_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucColourBar*  self = (lucColourBar*)drawingObject;
+	lucColourMap*    colourMap;
+
+	/* Construct Parent */
+	_lucDrawingObject_Construct( self, cf, data );
+
+	colourMap     =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "ColourMap", lucColourMap, True, data ) ;
+	
+	_lucColourBar_Init( 
+			self, 
+			colourMap,
+			Stg_ComponentFactory_GetDouble( cf, self->name, "lengthFactor", 0.8 ),
+			Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "height",  10 ),
+			Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "margin",  16 ),
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "borderWidth", 1 ) ,
+			Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "precision", 2 ) ,
+			Stg_ComponentFactory_GetBool(cf, self->name, "scientific", False ),
+			Stg_ComponentFactory_GetUnsignedInt(cf, self->name, "ticks", 0 ) ,
+			Stg_ComponentFactory_GetBool(cf, self->name, "printTickValue", False ),
+			(float) Stg_ComponentFactory_GetDouble(cf, self->name, "scaleValue", 1.0 ) 
+			);
+}
+
+void _lucColourBar_Build( void* drawingObject, void* data ) {}
+void _lucColourBar_Initialise( void* drawingObject, void* data ) {}
+void _lucColourBar_Execute( void* drawingObject, void* data ) {}
+void _lucColourBar_Destroy( void* drawingObject, void* data ) {}
+
+void _lucColourBar_Setup( void* drawingObject, void* _context ) {
+}
+
+void _lucColourBar_WithPrecision(char *string, Bool scientific, int precision, float scaleValue, double value){
+
+if(precision > 5 ) precision = 2;
+
+/* For display purpose, scales the printed values if needed */
+value = scaleValue * value;
+
+	if(scientific){
+		if( precision == 1 ){
+			sprintf(string, "%.1E", value);
+			return;
+			}
+		if( precision == 2 ){
+			sprintf(string, "%.2E", value);
+			return;
+			}
+		if( precision == 3 ){
+			sprintf(string, "%.3E", value);
+			return;
+			}
+		if( precision == 4 ){
+			sprintf(string, "%.4E", value);
+			return;
+			}
+		if( precision == 5 ){
+			sprintf(string, "%.5E", value);
+			return;
+			}
+	}
+	else{
+		if( precision == 1 ){
+			sprintf(string, "%.1g", value);
+			return;
+			}
+		if( precision == 2 ){
+			sprintf(string, "%.2g", value);
+			return;
+			}
+		if( precision == 3 ){
+			sprintf(string, "%.3g", value);
+			return;
+			}
+		if( precision == 4 ){
+			sprintf(string, "%.4g", value);
+			return;
+			}
+		if( precision == 5 ){
+			sprintf(string, "%.5g", value);
+			return;
+			}
+	}
+
+}
+	
+void _lucColourBar_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucColourBar*            self          = (lucColourBar*)drawingObject;
+	lucColourMap*            colourMap     = self->colourMap;
+	Pixel_Index              length        = (Pixel_Index) ((double) viewportInfo->width * self->lengthFactor);
+	Pixel_Index              height         = self->height;
+	Pixel_Index              pixel_I;
+	double                   value;
+	double                   tickValue;
+	int                      startPos[2];
+	GLint                    rasterPos[2];
+	char                     string[20];
+	int                      stringWidth;
+	int i = 0;
+	AbstractContext*         context       = (AbstractContext*) _context;
+
+	
+	/* Only get master to draw colour bar */
+	if ( context->rank != MASTER )
+		return;
+
+	/* Set up 2D Viewer the size of the viewport */
+	
+	
+	//glPushMatrix();
+	glMatrixMode(GL_PROJECTION);
+	glPushMatrix();
+	glLoadIdentity();
+	gluOrtho2D((GLfloat) 0.0, (GLfloat) viewportInfo->width, (GLfloat) 0.0, (GLfloat) viewportInfo->height );
+	glMatrixMode(GL_MODELVIEW);
+	glLoadIdentity();
+
+	/* Disable lighting because we don't want a 3D effect */
+	glDisable(GL_LIGHTING);
+
+	startPos[0] = (viewportInfo->width - length)/2;
+	startPos[1] = self->margin;
+	
+	/* Draw Colour Bar */
+	for ( pixel_I = 0 ; pixel_I < length ; pixel_I++ ) {
+		value = colourMap->minimum + (double) pixel_I * (colourMap->maximum - colourMap->minimum) / (double) length;
+
+		lucColourMap_SetOpenGLColourFromValue( colourMap, value );
+	
+		glRecti( startPos[0] + pixel_I, startPos[1], startPos[0] + pixel_I + 1 , startPos[1] + height );
+	}
+
+	/* Draw Box around colour bar */
+	glLineWidth( self->borderWidth );
+	lucColour_SetComplimentaryOpenGLColour( &window->backgroundColour );
+	glBegin( GL_LINE_LOOP );
+		glVertex2i( startPos[0], startPos[1] );
+		glVertex2i( startPos[0] + length, startPos[1] );
+		glVertex2i( startPos[0] + length, startPos[1] + height );
+		glVertex2i( startPos[0] , startPos[1] + height );
+	glEnd();
+
+	/* Write scale */
+	if ( fabs(colourMap->minimum) < 1.0e-5 )
+		sprintf( string, "0" );
+	else{
+		 _lucColourBar_WithPrecision(string, self->scientific, self->precision,  self->scaleValue, colourMap->minimum);
+	}
+	stringWidth = lucStringWidth( string );
+
+	rasterPos[0] = startPos[0] - (int) (0.5 * (float)stringWidth);
+	rasterPos[1] = startPos[1] - 13;
+	if (rasterPos[0] < 0)
+		rasterPos[0] = 1;
+
+	glRasterPos2iv( rasterPos );
+	lucPrintString( string );
+	
+	if ( fabs(colourMap->maximum) < 1.0e-5 )
+		sprintf( string, "0" );
+	else{
+		_lucColourBar_WithPrecision( string, self->scientific, self->precision, self->scaleValue, colourMap->maximum);
+	}
+	stringWidth = lucStringWidth( string );
+
+	rasterPos[0] = startPos[0] + length - (int) (0.5 * (float)stringWidth);
+	glRasterPos2iv( rasterPos );
+	lucPrintString( string );
+
+	/* Write ticks */
+	for(i = 1; i< self->ticks; i++){
+		/* Computes the tick position */
+	       	rasterPos[0] = startPos[0]+ i*(length/ self->ticks);
+        	rasterPos[1] = startPos[1] - 13;
+
+                /* Draws the tick */
+		glLineWidth( self->borderWidth );
+		lucColour_SetComplimentaryOpenGLColour( &window->backgroundColour );
+		glBegin(GL_LINES);
+			glVertex2i( startPos[0]+ i*(length/ self->ticks), startPos[1]-5 );
+			glVertex2i( startPos[0] + i*(length/ self->ticks), startPos[1] );
+		glEnd();
+
+		
+		/* Computse the tick value */
+		tickValue = colourMap->minimum + ( i*(colourMap->maximum - colourMap->minimum)/self->ticks );
+		
+		if(self->printTickValue)  {
+			_lucColourBar_WithPrecision( string, self->scientific, self->precision, self->scaleValue, tickValue);
+			
+			stringWidth = lucStringWidth( string );
+			rasterPos[0] -= (int) (0.5 * (float)stringWidth);
+			glRasterPos2iv( rasterPos );
+			lucPrintString( string );
+		}
+
+	}
+
+	/* Put back settings */
+	glEnable(GL_LIGHTING);
+	glPopMatrix();
+	
+	
+	/*Set back the viewport to what it should be to render any other object */
+	/* If this is not done, than any object displayed after the colour bar will not appear,*/
+	/* because the projection matrix and lookAt point have been altered */
+	lucViewportInfo_SetOpenGLCamera( viewportInfo );
+}
+
+void _lucColourBar_CleanUp( void* drawingObject, void* _context ) {
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ColourBar.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ColourBar.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,107 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ColourBar.h 646 2006-12-05 02:54:33Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucColourBar_h__
+#define __lucColourBar_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucColourBar_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucColourBar \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		lucColourMap*                                      colourMap;              \
+		double                                             lengthFactor;           \
+		Pixel_Index                                        height;                 \
+		Pixel_Index                                        margin;                 \
+		float                                              borderWidth;            \
+		int                                                precision;              \
+		Bool                                               scientific;             \
+		int                                                ticks;                  \
+		Bool                                               printTickValue;	   \
+		float                                              scaleValue;             \
+
+	struct lucColourBar { __lucColourBar };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucColourBar* _lucColourBar_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		Name                                               name );
+
+	void _lucColourBar_Delete( void* drawingObject ) ;
+	void _lucColourBar_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucColourBar_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucColourBar_DefaultNew( Name name ) ;
+	void _lucColourBar_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucColourBar_Build( void* drawingObject, void* data ) ;
+	void _lucColourBar_Initialise( void* drawingObject, void* data ) ;
+	void _lucColourBar_Execute( void* drawingObject, void* data );
+	void _lucColourBar_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucColourBar_Setup( void* drawingObject, void* _context ) ;
+	void _lucColourBar_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucColourBar_CleanUp( void* drawingObject, void* _context ) ;
+
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ColourBar.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ColourBar.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,94 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucColourBar</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Draws a colour bar at the bottom of a viewport so that you can have a calibration scale of a particular lucColourMap.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">lengthFactor</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.8</param>
+		<param name="Description">The proportion of the width of the viewport that you want the colour bar to fill.</param>
+	</struct>
+	<struct>
+		<param name="Name">height</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">10</param>
+		<param name="Description">The height of the colour bar in pixels</param>
+	</struct>
+	<struct>
+		<param name="Name">margin</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">16</param>
+		<param name="Description">The number of pixels between the bar and the colour bar.</param>
+	</struct>
+	<struct>
+		<param name="Name">borderWidth</param>
+		<param name="Type">Double</param>
+		<param name="Default">1</param>
+		<param name="Description">The thickness of the border around the colour bar.</param>
+	</struct>
+	<struct>
+		<param name="Name">precision</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">2</param>
+		<param name="Description">The decimal precision</param>
+	</struct>
+	<struct>
+		<param name="Name">scientific</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If set to True, the annotation will be in scitnfic mode.</param>
+	</struct>
+	<struct>
+		<param name="Name">ticks</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">Number of ticks to be displayed on the colourbar. If the colourbar is divided in ten segments, it means 9 ticks.</param>
+	</struct>
+	<struct>
+		<param name="Name">printTickValue</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If set to True, display the tick values.</param>
+	</struct>
+	<struct>
+		<param name="Name">scaleValue</param>
+		<param name="Type">float</param>
+		<param name="Default">1.0</param>
+		<param name="Description">Scale the displayed value by multiplying by the scaleValue number.</param>
+	</struct>
+
+
+
+
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">The lucColourMap that you want to have a calibration scale for</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Contour.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Contour.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,475 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Contour.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "Contour.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucContour_Type = "lucContour";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucContour* _lucContour_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucContour*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucContour) );
+	self = (lucContour*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucContour_Init( 
+		lucContour*                                         self,
+		FieldVariable*                                      fieldVariable,
+		lucColourMap*                                       colourMap,
+		Name                                                colourName,
+		IJK                                                 resolution,
+		double                                              lineWidth,
+		Index                                               isovalueCount,
+		double*                                             isovalueList,
+		double                                              interval )
+{
+	self->fieldVariable = fieldVariable;
+	self->colourMap     = colourMap;
+	lucColour_FromString( &self->colour, colourName );
+	memcpy( self->resolution, resolution, sizeof(IJK) );
+	self->lineWidth = lineWidth;
+	self->isovalueCount = isovalueCount;
+
+	self->isovalueList = Memory_Alloc_Array( double, isovalueCount, "isovalue list" );
+	memcpy( self->isovalueList, isovalueList, isovalueCount * sizeof(double) );
+	self->interval = interval;
+}
+
+void _lucContour_Delete( void* drawingObject ) {
+	lucContour*  self = (lucContour*)drawingObject;
+
+	Memory_Free( self->isovalueList );
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucContour_Print( void* drawingObject, Stream* stream ) {
+	lucContour*  self = (lucContour*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucContour_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucContour*  self = (lucContour*)drawingObject;
+	lucContour* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucContour_DefaultNew( Name name ) {
+	return (void*) _lucContour_New(
+		sizeof(lucContour),
+		lucContour_Type,
+		_lucContour_Delete,
+		_lucContour_Print,
+		NULL,
+		_lucContour_DefaultNew,
+		_lucContour_Construct,
+		_lucContour_Build,
+		_lucContour_Initialise,
+		_lucContour_Execute,
+		_lucContour_Destroy,
+		_lucContour_Setup,
+		_lucContour_Draw,
+		_lucContour_CleanUp,
+		_lucContour_BuildDisplayList,
+		name );
+}
+
+void _lucContour_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucContour*      self = (lucContour*)drawingObject;
+	Index            defaultResolution;
+	FieldVariable*   fieldVariable;
+	lucColourMap*    colourMap;
+	IJK              resolution;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	fieldVariable =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "FieldVariable", FieldVariable, True,  data );
+	colourMap     =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap",     lucColourMap,  False, data );
+
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 8 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+			
+	_lucContour_Init( 
+			self, 
+			fieldVariable,
+			colourMap,
+			Stg_ComponentFactory_GetString( cf, self->name, "colour", "black" ),
+			resolution,
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "lineWidth", 1.0 ),
+			0,
+			NULL,
+			Stg_ComponentFactory_GetDouble( cf, self->name, "interval", -1.0 ) ) ;
+}
+
+void _lucContour_Build( void* drawingObject, void* data ) {}
+void _lucContour_Initialise( void* drawingObject, void* data ) {}
+void _lucContour_Execute( void* drawingObject, void* data ) {}
+void _lucContour_Destroy( void* drawingObject, void* data ) {}
+
+void _lucContour_Setup( void* drawingObject, void* _context ) {
+	lucContour*            self            = (lucContour*)drawingObject;
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+
+void _lucContour_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucContour*            self            = (lucContour*)drawingObject;
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+void _lucContour_CleanUp( void* drawingObject, void* _context ) {
+	lucContour*            self            = (lucContour*)drawingObject;
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}
+	
+void _lucContour_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucContour*            self            = (lucContour*)drawingObject;
+	FieldVariable*         fieldVariable   = self->fieldVariable;
+	double                 isovalue;
+	double                 interval        = self->interval;
+	double                 minIsovalue     = FieldVariable_GetMinGlobalFieldMagnitude( fieldVariable );
+	double                 maxIsovalue     = FieldVariable_GetMaxGlobalFieldMagnitude( fieldVariable );
+	lucColourMap*          colourMap       = self->colourMap;
+	Index                  isovalue_I;
+	Coord min, max;
+	
+	glLineWidth(self->lineWidth);
+
+	FieldVariable_GetMinAndMaxLocalCoords( fieldVariable, min, max );
+	
+	lucColour_SetOpenGLColour( &self->colour );
+
+	/* Draw static isovalues */
+	for ( isovalue_I = 0 ; isovalue_I < self->isovalueCount ; isovalue_I++ ) {
+		isovalue = self->isovalueList[isovalue_I];
+	
+		if ( colourMap )
+			lucColourMap_SetOpenGLColourFromValue( colourMap, isovalue );
+
+		lucContour_DrawContour( self, isovalue, 0.0, K_AXIS, min, max ); 
+	}
+	
+	/* Draw isovalues at interval */
+	if ( interval <= 0.0 ) 
+		return;
+
+	for ( isovalue = minIsovalue ; isovalue < maxIsovalue ; isovalue += interval ) {
+		if ( colourMap )
+			lucColourMap_SetOpenGLColourFromValue( colourMap, isovalue );
+		lucContour_DrawContour( self, isovalue, 0.0, K_AXIS, min, max ); 
+	}
+}
+
+
+#define LEFT   0
+#define RIGHT  1
+#define BOTTOM 2
+#define TOP    3
+
+void lucContour_DrawContour( 
+		void*                                             drawingObject,
+		double                                            isovalue,
+		double                                            planeHeight,
+		Axis                                              planeAxis,
+		Coord                                             min,
+		Coord                                             max )
+{
+	lucContour*            self            = (lucContour*)drawingObject;
+	FieldVariable*         fieldVariable   = self->fieldVariable;
+	Axis                   aAxis           = ( planeAxis == I_AXIS ? J_AXIS : I_AXIS );
+	Axis                   bAxis           = ( planeAxis == K_AXIS ? J_AXIS : K_AXIS );
+	unsigned int           elementType;
+	unsigned int           i, j;
+	Coord                  pos;
+	double **              array;
+	Index                  resolutionA     = self->resolution[ aAxis ];
+	Index                  resolutionB     = self->resolution[ bAxis ];
+	double                 dA, dB;
+	
+	/* Find position of cross - section */
+	pos[planeAxis] = planeHeight;
+	
+	/* Calculate number of points in direction A and B */
+	dA = (max[ aAxis ] - min[ aAxis ])/(double) (resolutionA - 1);
+	dB = (max[ bAxis ] - min[ bAxis ])/(double) (resolutionB - 1);
+
+	array = Memory_Alloc_2DArray( double , resolutionA, resolutionB, "Field Values");
+	for ( i = 0, pos[ aAxis ] = min[ aAxis ] ; i < resolutionA ; i++, pos[aAxis] += dA ) {
+		for ( j = 0, pos[bAxis] = min[ bAxis ] ; j < resolutionB ; j++, pos[bAxis] += dB ) {
+			if (pos[aAxis] > max[ aAxis ]) 
+				pos[aAxis] = max[ aAxis ];
+			if (pos[bAxis] > max[ bAxis ]) 
+				pos[bAxis] = max[ bAxis ];
+
+			/* Interpolate value to point */
+			FieldVariable_InterpolateValueAt( fieldVariable, pos, &array[i][j] );
+		}
+	}
+		
+	/* Initialise OpenGL stuff */
+	glDisable(GL_LIGHTING);
+	glEnable(GL_LINE_SMOOTH);
+	glEnable(GL_BLEND);
+	glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+	glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
+
+	glBegin(GL_LINES);
+
+	/* Start marching rectangles */
+	for ( i = 0, pos[ aAxis ] = min[ aAxis ] ; i < resolutionA - 1 ; i++, pos[ aAxis ] += dA ) {
+		for ( j = 0, pos[ bAxis ] = min[ bAxis ] ; j < resolutionB - 1 ; j++, pos[ bAxis ] += dB ) {
+			/* Assign a unique number to the square type from 0 to 15 */
+			elementType = 0;
+			if (array[i][j]     > isovalue) 	elementType += 1;
+			if (array[i+1][j]   > isovalue) 	elementType += 2;
+			if (array[i][j+1]   > isovalue) 	elementType += 4;
+			if (array[i+1][j+1] > isovalue) 	elementType += 8;
+
+			switch ( elementType ) {
+				case 0:
+					/*  @@  */
+					/*  @@  */
+					break;
+				case 1:		
+					/*  @@  */
+					/*  #@  */
+					lucContour_PlotPoint( LEFT,   isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 2:
+					/*  @@  */
+					/*  @#  */	
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 3:
+					/*  @@  */
+					/*  ##  */	
+					lucContour_PlotPoint( LEFT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 4:
+					/*  #@  */
+					/*  @@  */
+					lucContour_PlotPoint( LEFT  , isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( TOP   , isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 5:
+					/*  #@  */
+					/*  #@  */
+					lucContour_PlotPoint( TOP   , isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 6:
+					/*  #@  */
+					/*  @#  */
+					lucContour_PlotPoint( LEFT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( TOP , isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+
+					lucContour_PlotPoint( RIGHT , isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 7:
+					/*  #@  */
+					/*  ##  */
+					lucContour_PlotPoint( TOP, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 8:
+					/*  @#  */
+					/*  @@  */
+					lucContour_PlotPoint( TOP, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 9:
+					/*  @#  */
+					/*  #@  */
+					lucContour_PlotPoint( TOP, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( LEFT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 10:
+					/*  @#  */
+					/*  @#  */
+					lucContour_PlotPoint( TOP, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 11:
+					/*  @#  */
+					/*  ##  */
+					lucContour_PlotPoint( TOP, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( LEFT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 12:
+					/*  ##  */
+					/*  @@  */
+					lucContour_PlotPoint( LEFT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 13:
+					/*  ##  */
+					/*  #@  */
+					lucContour_PlotPoint( RIGHT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 14:
+					/*  ##  */
+					/*  @#  */
+					lucContour_PlotPoint( LEFT, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					lucContour_PlotPoint( BOTTOM, isovalue, array[i][j], array[i+1][j], array[i][j+1], array[i+1][j+1], pos, dA, dB, planeAxis );
+					break;
+				case 15:
+					/*  ##  */
+					/*  ##  */
+					break;
+				default:
+					fprintf(stderr, "In func %s: Cannot find element %d.\n", __func__, elementType );
+					abort();
+			}
+			
+		}
+	}
+	glEnd();
+	glEnable(GL_LIGHTING);
+
+	/* Clean up */
+	Memory_Free(array);
+}
+
+void lucContour_PlotPoint( char edge, double isovalue, double leftBtm, double rightBtm, double leftTop, double rightTop , Coord pos, double dA, double dB, Axis planeAxis ) {
+	Axis            aAxis           = ( planeAxis == I_AXIS ? J_AXIS : I_AXIS );
+	Axis            bAxis           = ( planeAxis == K_AXIS ? J_AXIS : K_AXIS );
+	Coord           vertex;
+	
+	vertex[planeAxis] = pos[planeAxis];
+
+	switch (edge) {
+		case BOTTOM:
+			vertex[aAxis] = pos[aAxis] + dA * (isovalue - leftBtm)/(rightBtm - leftBtm) ; 
+			vertex[bAxis] = pos[bAxis];
+			break;
+		case TOP:	
+			vertex[aAxis] = pos[aAxis] + dA * (isovalue - leftTop)/(rightTop - leftTop); 
+			vertex[bAxis] = pos[bAxis] + dB;
+			break;
+		case LEFT:	
+			vertex[aAxis] = pos[aAxis];
+			vertex[bAxis] = pos[bAxis] + dB * (isovalue - leftBtm)/(leftTop - leftBtm); 
+			break;
+		case RIGHT:	
+			vertex[aAxis] = pos[aAxis] + dA;
+			vertex[bAxis] = pos[bAxis] + dB * (isovalue - rightBtm)/(rightTop - rightBtm ); 
+			break;
+	}
+	glVertex3dv(vertex);
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Contour.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Contour.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,118 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Contour.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucContour_h__
+#define __lucContour_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucContour_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucContour \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     fieldVariable;          \
+		lucColourMap*                                      colourMap;              \
+		lucColour                                          colour;                 \
+		IJK                                                resolution;             \
+		float                                              lineWidth;              \
+		Index                                              isovalueCount;          \
+		double*                                            isovalueList;           \
+		/* Interval Stuff */ \
+		double                                             interval;               \
+
+	struct lucContour { __lucContour };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucContour* _lucContour_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucContour_Delete( void* drawingObject ) ;
+	void _lucContour_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucContour_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucContour_DefaultNew( Name name ) ;
+	void _lucContour_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucContour_Build( void* drawingObject, void* data ) ;
+	void _lucContour_Initialise( void* drawingObject, void* data ) ;
+	void _lucContour_Execute( void* drawingObject, void* data );
+	void _lucContour_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucContour_Setup( void* drawingObject, void* _context ) ;
+	void _lucContour_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucContour_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucContour_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+	void lucContour_DrawContour( 
+		void*                                             drawingObject,
+		double                                            isovalue,
+		double                                            planeHeight,
+		Axis                                              planeAxis,
+		Coord                                             min,
+		Coord                                             max );
+
+	void lucContour_PlotPoint( char edge, double isovalue, double leftBtm, double rightBtm, double leftTop, double rightTop , Coord pos, double dA, double dB, Axis planeAxis ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Contour.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Contour.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucContour</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Visualises a scalar field by the use of contour lines at specific intervals. It gets the value of the field on a grid and uses a 2D form of the Marching Cubes algorithm to draw the contours.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">resolution</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">8</param>
+		<param name="Description">The default value for the resolutionX, resolutionY and resolutionZ. If these values aren't set the sampling grid will be uniform with this number of verticies in each direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionX</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of grid points in the X direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionY</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of grid points in the Y direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionZ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of grid points in the Z direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">The colour of the contour lines. (If a lucColourMap is given - then this colour will not be used)</param>
+	</struct>
+	<struct>
+		<param name="Name">lineWidth</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">The width of each contour line.</param>
+	</struct>
+	<struct>
+		<param name="Name">interval</param>
+		<param name="Type">Double</param>
+		<param name="Default">-1.0</param>
+		<param name="Description">If this number if positive, contours will be drawn from the minimum value of the field to the maximum value of the field at this interval. If this number is negative, this feature will not be used.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FieldVariable</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">The field that you want to visualise with contour lines.</param>
+	</struct>
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">You may colour each of the contour lines with a colour map if you specify it here. This will override the 'colour' given as a parameter.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/DrawingObjects.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/DrawingObjects.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,80 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: DrawingObjects.h 598 2006-08-01 03:11:05Z CecileDuboz $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucDrawingObjects_h__
+#define __lucDrawingObjects_h__
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "ColourBar.h"
+#include "FieldVariableBorder.h"
+#include "Isosurface.h"
+#include "ScalarFieldCrossSection.h"
+#include "ScalarField.h"
+#include "VectorArrowCrossSection.h"
+#include "EigenvectorsCrossSection.h"
+#include "Eigenvectors.h"
+#include "VectorArrows.h"
+#include "TextureMap.h"
+#include "Contour.h"
+#include "FeVariableSurface.h"
+#include "SwarmViewerBase.h"
+#include "SwarmViewer.h"
+#include "SwarmVectors.h"
+#include "SwarmSquares.h"
+#include "HistoricalSwarmTrajectory.h"
+#include "SwarmRGBColourViewer.h"
+#include "MeshViewer.h"
+#include "Title.h"
+#include "Axis.h"
+#include "TimeStep.h"
+#include "ScalarFieldOnMeshCrossSection.h"
+#include "ScalarFieldOnMesh.h"
+
+#include "Init.h"
+#include "Finalise.h"
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Eigenvectors.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Eigenvectors.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,212 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Eigenvectors.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "EigenvectorsCrossSection.h"
+#include "Eigenvectors.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucEigenvectors_Type = "lucEigenvectors";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucEigenvectors* _lucEigenvectors_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucEigenvectors*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucEigenvectors) );
+	self = (lucEigenvectors*) _lucEigenvectorsCrossSection_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucEigenvectors_Init( lucEigenvectors*                                             self ) {
+}
+
+void _lucEigenvectors_Delete( void* drawingObject ) {
+	lucEigenvectors*  self = (lucEigenvectors*)drawingObject;
+
+	_lucEigenvectorsCrossSection_Delete( self );
+}
+
+void _lucEigenvectors_Print( void* drawingObject, Stream* stream ) {
+	lucEigenvectors*  self = (lucEigenvectors*)drawingObject;
+
+	_lucEigenvectorsCrossSection_Print( self, stream );
+}
+
+void* _lucEigenvectors_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucEigenvectors*  self = (lucEigenvectors*)drawingObject;
+	lucEigenvectors* newDrawingObject;
+
+	newDrawingObject = _lucEigenvectorsCrossSection_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucEigenvectors_DefaultNew( Name name ) {
+	return (void*) _lucEigenvectors_New(
+		sizeof(lucEigenvectors),
+		lucEigenvectors_Type,
+		_lucEigenvectors_Delete,
+		_lucEigenvectors_Print,
+		NULL,
+		_lucEigenvectors_DefaultNew,
+		_lucEigenvectors_Construct,
+		_lucEigenvectors_Build,
+		_lucEigenvectors_Initialise,
+		_lucEigenvectors_Execute,
+		_lucEigenvectors_Destroy,
+		_lucEigenvectors_Setup,
+		_lucEigenvectors_Draw,
+		_lucEigenvectors_CleanUp,
+		_lucEigenvectors_BuildDisplayList,
+		name );
+}
+
+void _lucEigenvectors_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucEigenvectors* self = (lucEigenvectors*)drawingObject;
+
+	/* Construct Parent */
+	_lucEigenvectorsCrossSection_Construct( self, cf, data );
+	
+	_lucEigenvectors_Init( self );
+}
+
+void _lucEigenvectors_Build( void* drawingObject, void* data ) {}
+void _lucEigenvectors_Initialise( void* drawingObject, void* data ) {}
+void _lucEigenvectors_Execute( void* drawingObject, void* data ) {}
+void _lucEigenvectors_Destroy( void* drawingObject, void* data ) {}
+
+void _lucEigenvectors_Setup( void* drawingObject, void* _context ) {
+	lucEigenvectors*       self            = (lucEigenvectors*)drawingObject;
+	
+	_lucEigenvectorsCrossSection_Setup( self, _context );
+}
+
+void _lucEigenvectors_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucEigenvectors*       self            = (lucEigenvectors*)drawingObject;
+
+	_lucEigenvectorsCrossSection_Draw( self, window, viewportInfo, _context );
+}
+
+void _lucEigenvectors_CleanUp( void* drawingObject, void* _context ) {
+	lucEigenvectors*       self            = (lucEigenvectors*)drawingObject;
+	
+	_lucEigenvectorsCrossSection_CleanUp( self, _context );
+}
+	
+void _lucEigenvectors_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucEigenvectors*       self            = (lucEigenvectors*)drawingObject;
+	DiscretisationContext* context         = (DiscretisationContext*) _context;
+	Dimension_Index        dim             = context->dim;
+
+	if ( dim == 2 ) {
+		_lucEigenvectorsCrossSection_DrawCrossSection( self, dim, 0.0, K_AXIS );
+	}
+	else {
+		Coord             globalMin;
+		Coord             globalMax;
+		double            dz;
+		double            depth;
+
+		FieldVariable_GetMinAndMaxGlobalCoords( self->tensorField, globalMin, globalMax );
+	
+		dz = (globalMax[K_AXIS] - globalMin[K_AXIS])/(double)self->resolution[ K_AXIS ];
+
+		for ( depth = globalMin[ K_AXIS ] + dz * 0.5 ; depth < globalMax[ K_AXIS ] ; depth += dz) {
+			_lucEigenvectorsCrossSection_DrawCrossSection( self, dim, depth, K_AXIS );
+		}
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Eigenvectors.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Eigenvectors.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,98 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Eigenvectors.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucEigenvectors_h__
+#define __lucEigenvectors_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucEigenvectors_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucEigenvectors \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucEigenvectorsCrossSection \
+		/* Virtual functions go here */ \
+		/* Other info */\
+
+	struct lucEigenvectors { __lucEigenvectors };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucEigenvectors* _lucEigenvectors_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucEigenvectors_Delete( void* drawingObject ) ;
+	void _lucEigenvectors_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucEigenvectors_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucEigenvectors_DefaultNew( Name name ) ;
+	void _lucEigenvectors_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucEigenvectors_Build( void* drawingObject, void* data ) ;
+	void _lucEigenvectors_Initialise( void* drawingObject, void* data ) ;
+	void _lucEigenvectors_Execute( void* drawingObject, void* data );
+	void _lucEigenvectors_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucEigenvectors_Setup( void* drawingObject, void* _context ) ;
+	void _lucEigenvectors_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucEigenvectors_CleanUp( void* drawingObject, void* _context ) ;
+	void _lucEigenvectors_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Eigenvectors.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Eigenvectors.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucEigenvectors</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucEigenvectorsCrossSection</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/EigenvectorsCrossSection.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/EigenvectorsCrossSection.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,380 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: EigenvectorsCrossSection.c 665 2007-02-27 07:10:48Z JulianGiordani $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "EigenvectorsCrossSection.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+#include <ctype.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucEigenvectorsCrossSection_Type = "lucEigenvectorsCrossSection";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucEigenvectorsCrossSection* _lucEigenvectorsCrossSection_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucEigenvectorsCrossSection*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucEigenvectorsCrossSection) );
+	self = (lucEigenvectorsCrossSection*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucEigenvectorsCrossSection_Init( 
+		lucEigenvectorsCrossSection*                                 self,
+		FieldVariable*                                               tensorField,
+		Dimension_Index                                              dim,
+		Name                                                         leastColourName,
+		Name                                                         middleColourName,
+		Name                                                         greatestColourName,
+		IJK                                                          resolution,
+		double                                                       arrowHeadSize,
+		double                                                       lengthScale,
+		float                                                        lineWidth,
+		Bool 				                             useEigenValue,
+		double                                                       notEigenValue,
+		Bool 							     plotEigenVector,
+		Bool 							     plotEigenValue,
+		double 							     scaleEigenValue,
+		Name                                                         leastColourForNegativeName,
+		Name                                                         middleColourForNegativeName,
+		Name                                                         greatestColourForNegativeName,
+		double                                                       crossSectionValue,
+		Axis                                                         crossSectionAxis ) 
+{
+	Stream* errorStream         = Journal_MyStream( Error_Type, self );
+	self->tensorField = tensorField;
+	if ( dim == 2 ) {
+		lucColour_FromString( &self->colour[0], leastColourName );
+		lucColour_FromString( &self->colour[1], greatestColourName );
+		lucColour_FromString( &self->colourForNegative[0], leastColourForNegativeName );
+		lucColour_FromString( &self->colourForNegative[1], greatestColourForNegativeName );
+
+	}
+	else {
+		lucColour_FromString( &self->colour[0], leastColourName );
+		lucColour_FromString( &self->colour[1], middleColourName );
+		lucColour_FromString( &self->colour[2], greatestColourName );
+
+	        lucColour_FromString( &self->colourForNegative[0], leastColourForNegativeName );
+		lucColour_FromString( &self->colourForNegative[1], middleColourForNegativeName );
+		lucColour_FromString( &self->colourForNegative[2], greatestColourForNegativeName );
+	}
+
+	memcpy( self->resolution, resolution, sizeof(IJK) );
+	self->arrowHeadSize = arrowHeadSize;
+	Journal_Firewall( ( arrowHeadSize <= 1 && arrowHeadSize >= 0 ), errorStream,
+			"Error in %s:\narrowHeadSize given for %s was not in the range [0, 1]. " 
+			"Please use an arrowHeadSize within this range\n", __func__, self->name );
+	self->lengthScale = lengthScale;
+	self->lineWidth = lineWidth;
+	
+	
+	self->useEigenValue = useEigenValue;
+	self->notEigenValue = notEigenValue;
+
+	self->plotEigenVector = plotEigenVector;
+	self->plotEigenValue = plotEigenValue;
+	self->scaleEigenValue = scaleEigenValue;
+
+	self->crossSectionValue = crossSectionValue;
+	self->crossSectionAxis = crossSectionAxis;
+}
+
+void _lucEigenvectorsCrossSection_Delete( void* drawingObject ) {
+	lucEigenvectorsCrossSection*  self = (lucEigenvectorsCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucEigenvectorsCrossSection_Print( void* drawingObject, Stream* stream ) {
+	lucEigenvectorsCrossSection*  self = (lucEigenvectorsCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucEigenvectorsCrossSection_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucEigenvectorsCrossSection*  self = (lucEigenvectorsCrossSection*)drawingObject;
+	lucEigenvectorsCrossSection* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucEigenvectorsCrossSection_DefaultNew( Name name ) {
+	return (void*) _lucEigenvectorsCrossSection_New(
+		sizeof(lucEigenvectorsCrossSection),
+		lucEigenvectorsCrossSection_Type,
+		_lucEigenvectorsCrossSection_Delete,
+		_lucEigenvectorsCrossSection_Print,
+		NULL,
+		_lucEigenvectorsCrossSection_DefaultNew,
+		_lucEigenvectorsCrossSection_Construct,
+		_lucEigenvectorsCrossSection_Build,
+		_lucEigenvectorsCrossSection_Initialise,
+		_lucEigenvectorsCrossSection_Execute,
+		_lucEigenvectorsCrossSection_Destroy,
+		_lucEigenvectorsCrossSection_Setup,
+		_lucEigenvectorsCrossSection_Draw,
+		_lucEigenvectorsCrossSection_CleanUp,
+		_lucEigenvectorsCrossSection_BuildDisplayList,
+		name );
+}
+
+void _lucEigenvectorsCrossSection_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucEigenvectorsCrossSection* self = (lucEigenvectorsCrossSection*)drawingObject;
+	FieldVariable*   tensorField;
+	Index            defaultResolution;
+	IJK              resolution;
+	double           value               = 0.0;
+	Axis             axis                = 0;
+	char             axisChar;
+	Name             crossSectionName;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	tensorField =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "TensorField", FieldVariable, True, data );
+
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 8 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+			
+	crossSectionName = Stg_ComponentFactory_GetString( cf, self->name, "crossSection", "" );
+	if ( sscanf( crossSectionName, "%c=%lf", &axisChar, &value ) == 2 ) {
+		if ( toupper( axisChar ) >= 'X' )
+			axis = toupper( axisChar ) - 'X';
+	}
+	
+	_lucEigenvectorsCrossSection_Init( 
+			self, 
+			tensorField,
+			Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 2 ),
+			Stg_ComponentFactory_GetString( cf, self->name, "leastColour", "black" ),
+			Stg_ComponentFactory_GetString( cf, self->name, "middleColour", "black" ),
+			Stg_ComponentFactory_GetString( cf, self->name, "greatestColour", "black" ),
+			resolution,
+			Stg_ComponentFactory_GetDouble( cf, self->name, "arrowHeadSize", 0.3 ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "lengthScale", 0.3 ),
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "lineWidth", 1.0 ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "useEigenValue", True ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "notEigenValue", 0.3 ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "plotEigenVector", True ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "plotEigenValue", False ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "scaleEigenValue", 1.0 ),
+			Stg_ComponentFactory_GetString( cf, self->name, "leastColourForNegative", "black" ),
+			Stg_ComponentFactory_GetString( cf, self->name, "middleColourForNegative", "black" ),
+			Stg_ComponentFactory_GetString( cf, self->name, "greatestColourForNegative", "black" ),
+			value, 
+			axis );
+}
+
+void _lucEigenvectorsCrossSection_Build( void* drawingObject, void* data ) {}
+void _lucEigenvectorsCrossSection_Initialise( void* drawingObject, void* data ) {}
+void _lucEigenvectorsCrossSection_Execute( void* drawingObject, void* data ) {}
+void _lucEigenvectorsCrossSection_Destroy( void* drawingObject, void* data ) {}
+
+void _lucEigenvectorsCrossSection_Setup( void* drawingObject, void* _context ) {
+	lucEigenvectorsCrossSection*       self            = (lucEigenvectorsCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+	
+void _lucEigenvectorsCrossSection_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucEigenvectorsCrossSection*       self            = (lucEigenvectorsCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucEigenvectorsCrossSection_CleanUp( void* drawingObject, void* _context ) {
+	lucEigenvectorsCrossSection*       self            = (lucEigenvectorsCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}
+
+void _lucEigenvectorsCrossSection_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucEigenvectorsCrossSection*       self            = (lucEigenvectorsCrossSection*)drawingObject;
+	DiscretisationContext*            context         = (DiscretisationContext*) _context;
+
+	_lucEigenvectorsCrossSection_DrawCrossSection( self, context->dim, self->crossSectionValue, self->crossSectionAxis );
+}
+
+void _lucEigenvectorsCrossSection_DrawCrossSection( void* drawingObject, Dimension_Index dim, double crossSectionValue, Axis axis ) {
+	lucEigenvectorsCrossSection*  self           = (lucEigenvectorsCrossSection*)drawingObject;
+	FieldVariable*    tensorField    = self->tensorField;
+	Axis              aAxis          = (axis == I_AXIS ? J_AXIS : I_AXIS);
+	Axis              bAxis          = (axis == K_AXIS ? J_AXIS : K_AXIS);
+	Coord             pos;
+	SymmetricTensor   tensor;
+	Coord             globalMin;
+	Coord             globalMax;
+	Coord             localMin;
+	Coord             localMax;
+	double            dA, dB;
+	Eigenvector       eigenvectorList[3];
+	Dimension_Index   dim_I;
+	
+	FieldVariable_GetMinAndMaxGlobalCoords( tensorField, globalMin, globalMax );
+	FieldVariable_GetMinAndMaxLocalCoords( tensorField, localMin, localMax );
+
+	glLineWidth(self->lineWidth);
+	
+	dA = (globalMax[ aAxis ] - globalMin[ aAxis ])/(double)self->resolution[ aAxis ];
+	dB = (globalMax[ bAxis ] - globalMin[ bAxis ])/(double)self->resolution[ bAxis ];
+	
+	pos[axis] = crossSectionValue;
+
+	for ( pos[ aAxis ] = globalMin[ aAxis ] + dA * 0.5 ; pos[ aAxis ] < globalMax[ aAxis ] ; pos[ aAxis ] += dA ) {
+		for ( pos[ bAxis ] = globalMin[ bAxis ] + dB * 0.5 ; pos[ bAxis ] < globalMax[ bAxis ] ; pos[ bAxis ] += dB ) {
+
+			if ( pos[ aAxis ] < localMin[ aAxis ] || pos[ aAxis ] >= localMax[ aAxis ] )
+				continue;
+			if ( pos[ bAxis ] < localMin[ bAxis ] || pos[ bAxis ] >= localMax[ bAxis ] )
+				continue;
+
+			/* Get Value of Tensor at this point in space */
+			if ( FieldVariable_InterpolateValueAt( tensorField, pos, tensor ) == LOCAL ) {
+				SymmetricTensor_CalcAllEigenvectors( tensor, dim, eigenvectorList );
+
+                                if(self->plotEigenVector){
+					for ( dim_I = 0 ; dim_I < dim ; dim_I++ ) {
+						
+						lucColour_SetOpenGLColour( &self->colour[ dim_I ] );
+						if(self->useEigenValue){
+						     luc_DrawVector( dim, pos, eigenvectorList[ dim_I ].vector, 
+								(eigenvectorList[ dim_I ].eigenvalue * self->scaleEigenValue), self->arrowHeadSize );
+						}
+						else{
+							luc_DrawVector( dim, pos, eigenvectorList[ dim_I ].vector,
+									 self->notEigenValue, self->arrowHeadSize );
+						}
+					}
+				}
+				if(self->plotEigenValue){
+					GLfloat pointSize = 0;
+
+					for ( dim_I = 0 ; dim_I < dim ; dim_I++ ) {
+					        /* The EigenValue can be negative.... Got to attribute a potential */
+						/* colour for negative values, one for each dim as well */
+						if ( eigenvectorList[ dim_I ].eigenvalue >= 0) {
+						        pointSize = eigenvectorList[ dim_I ].eigenvalue * self->scaleEigenValue;
+							lucColour_SetOpenGLColour( &self->colour[ dim_I ] );
+	                                        }
+						else {
+						        lucColour_SetOpenGLColour( &self->colourForNegative[ dim_I ] );
+							pointSize = - eigenvectorList[ dim_I ].eigenvalue * self->scaleEigenValue;
+	                                        }
+						glPointSize( pointSize );
+					
+						glBegin(GL_POINTS);
+							if (dim == 2)
+					      			glVertex3f( (GLfloat)pos[0], (GLfloat)pos[1], 0.001 );
+							else 
+						    		glVertex3dv( pos );
+						glEnd();
+					
+					}
+				}
+
+			}
+		}
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/EigenvectorsCrossSection.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/EigenvectorsCrossSection.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,121 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: EigenvectorsCrossSection.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucEigenvectorsCrossSection_h__
+#define __lucEigenvectorsCrossSection_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucEigenvectorsCrossSection_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucEigenvectorsCrossSection \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     tensorField;              \
+		lucColour                                          colour[3];                \
+		/* Colour used to display negative EigenValues */                            \
+		lucColour                                          colourForNegative[3];     \
+		IJK                                                resolution;               \
+		double                                             arrowHeadSize;            \
+		double                                             lengthScale;              \
+		float                                              lineWidth;                \
+		double                                             crossSectionValue;        \
+		Axis                                               crossSectionAxis;	     \
+		/* Specifies if the eigenvalue is used to draw the vector - default true */  \
+		Bool 						   useEigenValue;            \
+		/* Value used to draw the vector if the eigenvalue is not used */            \
+		double 				                   notEigenValue;            \
+		/* Specifies if the EigenVector and/or EigenValues are to be drawn */        \
+		/* Default is True for EigenVector, False for EigenValues */                 \
+                Bool                                               plotEigenVector;          \
+		Bool                                               plotEigenValue;           \
+		/* Used to scale the EigenValue if needed */                                 \
+		double 					           scaleEigenValue;
+
+
+	struct lucEigenvectorsCrossSection { __lucEigenvectorsCrossSection };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucEigenvectorsCrossSection* _lucEigenvectorsCrossSection_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucEigenvectorsCrossSection_Delete( void* drawingObject ) ;
+	void _lucEigenvectorsCrossSection_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucEigenvectorsCrossSection_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucEigenvectorsCrossSection_DefaultNew( Name name ) ;
+	void _lucEigenvectorsCrossSection_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucEigenvectorsCrossSection_Build( void* drawingObject, void* data ) ;
+	void _lucEigenvectorsCrossSection_Initialise( void* drawingObject, void* data ) ;
+	void _lucEigenvectorsCrossSection_Execute( void* drawingObject, void* data );
+	void _lucEigenvectorsCrossSection_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucEigenvectorsCrossSection_Setup( void* drawingObject, void* _context ) ;
+	void _lucEigenvectorsCrossSection_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucEigenvectorsCrossSection_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucEigenvectorsCrossSection_BuildDisplayList( void* drawingObject, void* _context ) ;
+	void _lucEigenvectorsCrossSection_DrawCrossSection( void* drawingObject, Dimension_Index dim, double crossSectionValue, Axis axis );
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/EigenvectorsCrossSection.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/EigenvectorsCrossSection.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucEigenvectorsCrossSection</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">resolution</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">8</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionX</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionY</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionZ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">crossSection</param>
+		<param name="Type">String</param>
+		<param name="Default">""</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">dim</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">2</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">leastColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">middleColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">greatestColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">arrowHeadSize</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.3</param>
+		<param name="Description">The size of the head of the arrow compared with the arrow length. Must be between [0, 1]</param>
+	</struct>
+	<struct>
+		<param name="Name">lengthScale</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.3</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">lineWidth</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">TensorField</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 162 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/FeVariableSurface.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/FeVariableSurface.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,274 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: FeVariableSurface.c 631 2006-10-18 06:20:15Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "FeVariableSurface.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucFeVariableSurface_Type = "lucFeVariableSurface";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucFeVariableSurface* _lucFeVariableSurface_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucFeVariableSurface*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucFeVariableSurface) );
+	self = (lucFeVariableSurface*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucFeVariableSurface_Init( 
+		lucFeVariableSurface*                                        self,
+		FieldVariable*                                               feVariable,
+		lucColourMap*                                                colourMap,
+		Name                                                         colourName,
+		Bool                                                         wireframe,
+		float                                                        lineWidth,
+		float                                                        scaleHeight )
+{
+	self->feVariable  = feVariable;
+	self->colourMap   = colourMap;
+	lucColour_FromString( &self->colour, colourName );
+	self->wireframe   = wireframe;
+	self->lineWidth   = lineWidth;
+	self->scaleHeight = scaleHeight;
+
+	assert( Stg_Class_IsInstance( feVariable, FeVariable_Type ) );
+}
+
+void _lucFeVariableSurface_Delete( void* drawingObject ) {
+	lucFeVariableSurface*  self = (lucFeVariableSurface*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucFeVariableSurface_Print( void* drawingObject, Stream* stream ) {
+	lucFeVariableSurface*  self = (lucFeVariableSurface*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucFeVariableSurface_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucFeVariableSurface*  self = (lucFeVariableSurface*)drawingObject;
+	lucFeVariableSurface* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucFeVariableSurface_DefaultNew( Name name ) {
+	return (void*) _lucFeVariableSurface_New(
+		sizeof(lucFeVariableSurface),
+		lucFeVariableSurface_Type,
+		_lucFeVariableSurface_Delete,
+		_lucFeVariableSurface_Print,
+		NULL,
+		_lucFeVariableSurface_DefaultNew,
+		_lucFeVariableSurface_Construct,
+		_lucFeVariableSurface_Build,
+		_lucFeVariableSurface_Initialise,
+		_lucFeVariableSurface_Execute,
+		_lucFeVariableSurface_Destroy,
+		_lucFeVariableSurface_Setup,
+		_lucFeVariableSurface_Draw,
+		_lucFeVariableSurface_CleanUp,
+		_lucFeVariableSurface_BuildDisplayList,
+		name );
+}
+
+void _lucFeVariableSurface_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucFeVariableSurface*  self = (lucFeVariableSurface*)drawingObject;
+	FieldVariable*         feVariable;
+	lucColourMap*          colourMap;
+
+	/* Construct Parent */
+	_lucDrawingObject_Construct( self, cf, data );
+
+	feVariable    =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "FeVariable", FieldVariable, True,  data );
+	colourMap     =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap",  lucColourMap,  False, data );
+	
+	_lucFeVariableSurface_Init( 
+			self, 
+			feVariable,
+			colourMap,
+			Stg_ComponentFactory_GetString( cf, self->name, "colour", "black" ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "wireframe", False ),
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "lineWidth", 1.0 ),
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "scaleHeight", 0.0 ) );
+}
+
+void _lucFeVariableSurface_Build( void* drawingObject, void* data ) {}
+void _lucFeVariableSurface_Initialise( void* drawingObject, void* data ) {}
+void _lucFeVariableSurface_Execute( void* drawingObject, void* data ) {}
+void _lucFeVariableSurface_Destroy( void* drawingObject, void* data ) {}
+
+void _lucFeVariableSurface_Setup( void* drawingObject, void* _context ) {
+	lucFeVariableSurface*       self            = (lucFeVariableSurface*)drawingObject;
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+	
+void _lucFeVariableSurface_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucFeVariableSurface*       self            = (lucFeVariableSurface*)drawingObject;
+	FeVariable*                    feVariable         = (FeVariable*) self->feVariable;
+	lucColourMap*                  colourMap          = self->colourMap;
+	if ( colourMap )
+		lucColourMap_CalibrateFromFieldVariable( colourMap, feVariable );
+	else
+		lucColour_SetOpenGLColour( &self->colour );
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucFeVariableSurface_CleanUp( void* drawingObject, void* _context ) {
+	lucFeVariableSurface*       self            = (lucFeVariableSurface*)drawingObject;
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}
+	
+void _lucFeVariableSurface_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucFeVariableSurface*          self               = (lucFeVariableSurface*)drawingObject;
+	FeVariable*                    feVariable         = (FeVariable*) self->feVariable;
+	FiniteElement_Mesh*            mesh               = feVariable->feMesh;
+	lucColourMap*                  colourMap          = self->colourMap;
+	Element_LocalIndex             lElement_I;
+	Element_LocalIndex             elementLocalCount  = mesh->elementLocalCount;
+	Element_NodeIndex              eNode_I;
+	Element_NodeIndex              elementNodeCount;
+	Node_LocalIndex                lNode_I;
+	double                         nodeValue;
+	double                         height;
+
+
+	/* Give option to draw surface as wireframe */
+	if (self->wireframe) 
+		glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+	else 
+		glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+
+	glNormal3f( 0.0, 0.0, 1.0 ); /* TODO - FIX */
+	glLineWidth( self->lineWidth );
+	glDisable( GL_LIGHTING );
+
+	if ( colourMap )
+		lucColourMap_CalibrateFromFieldVariable( colourMap, feVariable );
+	else
+		lucColour_SetOpenGLColour( &self->colour );
+
+	for ( lElement_I = 0 ; lElement_I < elementLocalCount ; lElement_I++ ) {
+		elementNodeCount = mesh->elementNodeCountTbl[ lElement_I ];
+
+		glBegin( GL_POLYGON );
+		for ( eNode_I = 0 ; eNode_I < elementNodeCount ; eNode_I++ ) {
+			lNode_I = mesh->elementNodeTbl[ lElement_I ][ eNode_I ];
+			/* Get Value at node */
+			nodeValue = FeVariable_GetScalarAtNode( feVariable, lNode_I );
+
+			/* Change Colour */
+			if ( colourMap )
+				lucColourMap_SetOpenGLColourFromValue( colourMap, nodeValue );
+
+			/* Set Height */
+			height = nodeValue * self->scaleHeight;
+
+			/* Plot Vertex */
+			glVertex3d( mesh->nodeCoord[ lNode_I ][ I_AXIS ], mesh->nodeCoord[ lNode_I ][ J_AXIS ], height );
+		}
+		glEnd();
+	}
+	glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+	glEnable( GL_LIGHTING );	
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/FeVariableSurface.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/FeVariableSurface.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,104 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: FeVariableSurface.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucFeVariableSurface_h__
+#define __lucFeVariableSurface_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucFeVariableSurface_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucFeVariableSurface \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     feVariable;          \
+		lucColourMap*                                      colourMap;           \
+		lucColour                                          colour;              \
+		Bool                                               wireframe;           \
+		float                                              lineWidth;           \
+		float                                              scaleHeight;
+
+	struct lucFeVariableSurface { __lucFeVariableSurface };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucFeVariableSurface* _lucFeVariableSurface_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucFeVariableSurface_Delete( void* drawingObject ) ;
+	void _lucFeVariableSurface_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucFeVariableSurface_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucFeVariableSurface_DefaultNew( Name name ) ;
+	void _lucFeVariableSurface_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucFeVariableSurface_Build( void* drawingObject, void* data ) ;
+	void _lucFeVariableSurface_Initialise( void* drawingObject, void* data ) ;
+	void _lucFeVariableSurface_Execute( void* drawingObject, void* data );
+	void _lucFeVariableSurface_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucFeVariableSurface_Setup( void* drawingObject, void* _context ) ;
+	void _lucFeVariableSurface_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucFeVariableSurface_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucFeVariableSurface_BuildDisplayList( void* drawingObject, void* _context ) ;
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/FeVariableSurface.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/FeVariableSurface.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucFeVariableSurface</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">wireframe</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">lineWidth</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">scaleHeight</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0 )</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FeVariable</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 138 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 139 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/FieldVariableBorder.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/FieldVariableBorder.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,257 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: FieldVariableBorder.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "FieldVariableBorder.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucFieldVariableBorder_Type = "lucFieldVariableBorder";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucFieldVariableBorder* _lucFieldVariableBorder_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucFieldVariableBorder*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucFieldVariableBorder) );
+	self = (lucFieldVariableBorder*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucFieldVariableBorder_Init( 
+		lucFieldVariableBorder*                                      self,
+		FieldVariable*                                               fieldVariable,
+		Name                                                         colourName,
+		float                                                        lineWidth ) 
+{
+	self->fieldVariable = fieldVariable;
+	
+	lucColour_FromString( &self->colour, colourName );
+	self->lineWidth = lineWidth;
+}
+
+void _lucFieldVariableBorder_Delete( void* drawingObject ) {
+	lucFieldVariableBorder*  self = (lucFieldVariableBorder*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucFieldVariableBorder_Print( void* drawingObject, Stream* stream ) {
+	lucFieldVariableBorder*  self = (lucFieldVariableBorder*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucFieldVariableBorder_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucFieldVariableBorder*  self = (lucFieldVariableBorder*)drawingObject;
+	lucFieldVariableBorder* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucFieldVariableBorder_DefaultNew( Name name ) {
+	return (void*) _lucFieldVariableBorder_New(
+		sizeof(lucFieldVariableBorder),
+		lucFieldVariableBorder_Type,
+		_lucFieldVariableBorder_Delete,
+		_lucFieldVariableBorder_Print,
+		NULL,
+		_lucFieldVariableBorder_DefaultNew,
+		_lucFieldVariableBorder_Construct,
+		_lucFieldVariableBorder_Build,
+		_lucFieldVariableBorder_Initialise,
+		_lucFieldVariableBorder_Execute,
+		_lucFieldVariableBorder_Destroy,
+		_lucFieldVariableBorder_Setup,
+		_lucFieldVariableBorder_Draw,
+		_lucFieldVariableBorder_CleanUp,
+		_lucFieldVariableBorder_BuildDisplayList,
+		name );
+}
+
+void _lucFieldVariableBorder_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucFieldVariableBorder*  self = (lucFieldVariableBorder*)drawingObject;
+	FieldVariable*           fieldVariable;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	fieldVariable =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "FieldVariable", FieldVariable, True, data );
+	
+	_lucFieldVariableBorder_Init( 
+			self, 
+			fieldVariable, 
+			Stg_ComponentFactory_GetString( cf, self->name, "colour", "Black" ),
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "lineWidth", 1.0 ) );
+
+}
+
+void _lucFieldVariableBorder_Build( void* drawingObject, void* data ) {}
+void _lucFieldVariableBorder_Initialise( void* drawingObject, void* data ) {}
+void _lucFieldVariableBorder_Execute( void* drawingObject, void* data ) {}
+void _lucFieldVariableBorder_Destroy( void* drawingObject, void* data ) {}
+
+void _lucFieldVariableBorder_Setup( void* drawingObject, void* _context ) {
+	lucFieldVariableBorder*       self            = (lucFieldVariableBorder*)drawingObject;
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+	
+void _lucFieldVariableBorder_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucFieldVariableBorder*       self            = (lucFieldVariableBorder*)drawingObject;
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucFieldVariableBorder_CleanUp( void* drawingObject, void* _context ) {
+	lucFieldVariableBorder*       self            = (lucFieldVariableBorder*)drawingObject;
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}	
+
+void _lucFieldVariableBorder_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucFieldVariableBorder*  self    = (lucFieldVariableBorder*)drawingObject;
+	DiscretisationContext*   context = (DiscretisationContext*) _context;
+	Dimension_Index          dim     = context->dim;
+	FieldVariable*           field   = self->fieldVariable;
+	Coord                    min;
+	Coord                    max;
+
+	if ( context->rank != MASTER )
+		return;
+
+	/* Initialise OpenGL stuff */
+	glShadeModel(GL_SMOOTH);
+	glDisable(GL_LIGHTING);
+
+	glEnable(GL_LINE_SMOOTH);
+	glEnable(GL_BLEND);
+	glPolygonMode ( GL_FRONT_AND_BACK, GL_LINE ) ;
+
+	lucColour_SetOpenGLColour( &self->colour );
+	glLineWidth( self->lineWidth );
+
+	/* Grab values from field variable */
+	FieldVariable_GetMinAndMaxGlobalCoords( field, min, max );
+	
+	if (dim == 2) 
+		glRectd( min[ I_AXIS ], min[ J_AXIS ], max[ I_AXIS ], max[ J_AXIS ] );
+	else if ( dim == 3 ) {
+		glBegin( GL_QUAD_STRIP );
+			glVertex3d( min[ I_AXIS ], min[ J_AXIS ], min[ K_AXIS ] );
+			glVertex3d( min[ I_AXIS ], max[ J_AXIS ], min[ K_AXIS ] );
+
+			glVertex3d( max[ I_AXIS ], min[ J_AXIS ], min[ K_AXIS ] );
+			glVertex3d( max[ I_AXIS ], max[ J_AXIS ], min[ K_AXIS ] );
+
+			glVertex3d( max[ I_AXIS ], min[ J_AXIS ], max[ K_AXIS ] );
+			glVertex3d( max[ I_AXIS ], max[ J_AXIS ], max[ K_AXIS ] );
+
+			glVertex3d( min[ I_AXIS ], min[ J_AXIS ], max[ K_AXIS ] );
+			glVertex3d( min[ I_AXIS ], max[ J_AXIS ], max[ K_AXIS ] );
+			
+			glVertex3d( min[ I_AXIS ], min[ J_AXIS ], min[ K_AXIS ] );
+			glVertex3d( min[ I_AXIS ], max[ J_AXIS ], min[ K_AXIS ] );
+		glEnd();
+	}
+	
+	/* Clean up OpenGL stuff */
+	glPolygonMode ( GL_FRONT_AND_BACK, GL_FILL ) ;
+	glEnable( GL_LIGHTING );
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/FieldVariableBorder.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/FieldVariableBorder.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,101 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: FieldVariableBorder.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucFieldVariableBorder_h__
+#define __lucFieldVariableBorder_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucFieldVariableBorder_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucFieldVariableBorder \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     fieldVariable;          \
+		lucColour                                          colour;                 \
+		float                                              lineWidth; 
+
+	struct lucFieldVariableBorder { __lucFieldVariableBorder };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucFieldVariableBorder* _lucFieldVariableBorder_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucFieldVariableBorder_Delete( void* drawingObject ) ;
+	void _lucFieldVariableBorder_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucFieldVariableBorder_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucFieldVariableBorder_DefaultNew( Name name ) ;
+	void _lucFieldVariableBorder_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucFieldVariableBorder_Build( void* drawingObject, void* data ) ;
+	void _lucFieldVariableBorder_Initialise( void* drawingObject, void* data ) ;
+	void _lucFieldVariableBorder_Execute( void* drawingObject, void* data );
+	void _lucFieldVariableBorder_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucFieldVariableBorder_Setup( void* drawingObject, void* _context ) ;
+	void _lucFieldVariableBorder_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucFieldVariableBorder_CleanUp( void* drawingObject, void* _context ) ;
+	void _lucFieldVariableBorder_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/FieldVariableBorder.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/FieldVariableBorder.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucFieldVariableBorder</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Draws a border around a FieldVariable so that it stands out against the background. - Currently this will only work for fields with a cartesian geometry.</param>
+
+<!--Now the interesting stuff-->
+<list name="Params">
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"Black"</param>
+		<param name="Description">The colour of the border.</param>
+	</struct>
+	<struct>
+		<param name="Name">lineWidth</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">The width of each line making up the border.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FieldVariable</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">The field variable used to get the size of the box of the model.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Finalise.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,57 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Finalise.c 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool lucDrawingObjects_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Finalise.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,84 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Finalise.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Finalises this library
+**
+** Assumptions:
+**	No functions from this library used after this one.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucDrawingObjects_Finalise_h__
+#define __lucDrawingObjects_Finalise_h__
+	
+	Bool lucDrawingObjects_Finalise( void );
+	
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/HistoricalSwarmTrajectory.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/HistoricalSwarmTrajectory.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,288 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: HistoricalSwarmTrajectory.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "HistoricalSwarmTrajectory.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucHistoricalSwarmTrajectory_Type = "lucHistoricalSwarmTrajectory";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucHistoricalSwarmTrajectory* _lucHistoricalSwarmTrajectory_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucHistoricalSwarmTrajectory*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucHistoricalSwarmTrajectory) );
+	self = (lucHistoricalSwarmTrajectory*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+
+	return self;
+}
+
+void _lucHistoricalSwarmTrajectory_Init( 
+		lucHistoricalSwarmTrajectory*                                self,
+		Swarm*                                                       swarm,
+		lucColourMap*                                                colourMap,
+		Name                                                         colourName,
+		float                                                        lineWidth )
+{
+	self->swarm               = swarm;
+	self->colourMap           = colourMap;
+	self->lineWidth           = lineWidth;
+
+	self->particleExtHandle = 
+		ExtensionManager_Add( swarm->particleExtensionMgr, self->type, sizeof(lucHistoricalSwarmTrajectory_ParticleExt) );
+
+	lucColour_FromString( &self->colour, colourName );
+}
+
+void _lucHistoricalSwarmTrajectory_Delete( void* drawingObject ) {
+	lucHistoricalSwarmTrajectory*  self = (lucHistoricalSwarmTrajectory*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucHistoricalSwarmTrajectory_Print( void* drawingObject, Stream* stream ) {
+	lucHistoricalSwarmTrajectory*  self = (lucHistoricalSwarmTrajectory*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucHistoricalSwarmTrajectory_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucHistoricalSwarmTrajectory*  self = (lucHistoricalSwarmTrajectory*)drawingObject;
+	lucHistoricalSwarmTrajectory* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucHistoricalSwarmTrajectory_DefaultNew( Name name ) {
+	return (void*) _lucHistoricalSwarmTrajectory_New(
+		sizeof(lucHistoricalSwarmTrajectory),
+		lucHistoricalSwarmTrajectory_Type,
+		_lucHistoricalSwarmTrajectory_Delete,
+		_lucHistoricalSwarmTrajectory_Print,
+		NULL,
+		_lucHistoricalSwarmTrajectory_DefaultNew,
+		_lucHistoricalSwarmTrajectory_Construct,
+		_lucHistoricalSwarmTrajectory_Build,
+		_lucHistoricalSwarmTrajectory_Initialise,
+		_lucHistoricalSwarmTrajectory_Execute,
+		_lucHistoricalSwarmTrajectory_Destroy,
+		_lucHistoricalSwarmTrajectory_Setup,
+		_lucHistoricalSwarmTrajectory_Draw,
+		_lucHistoricalSwarmTrajectory_CleanUp,
+		_lucHistoricalSwarmTrajectory_BuildDisplayList,
+		name );
+}
+
+void _lucHistoricalSwarmTrajectory_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucHistoricalSwarmTrajectory*         self = (lucHistoricalSwarmTrajectory*)drawingObject;
+	lucColourMap*           colourMap;
+	Swarm*                  swarm;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	swarm         =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "Swarm",     Swarm,        True,  data );
+	colourMap     =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap", lucColourMap, False, data );
+
+	Journal_Firewall(
+			swarm->particleLayout->coordSystem == GlobalCoordSystem,
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, unable to visualise swarm %s because it uses a local coord system layout %s of type %s.\n",
+			__func__,
+			swarm->name,
+			swarm->particleLayout->name,
+			swarm->particleLayout->type );
+
+	_lucHistoricalSwarmTrajectory_Init( 
+			self, 
+			swarm,
+			colourMap,
+			Stg_ComponentFactory_GetString( cf, self->name, "colour", "black" ),
+			(float) Stg_ComponentFactory_GetDouble( cf, self->name, "lineWidth", 1.0 ) );
+}
+
+void _lucHistoricalSwarmTrajectory_Build( void* drawingObject, void* data ) {}
+void _lucHistoricalSwarmTrajectory_Initialise( void* drawingObject, void* data ) { }
+
+void _lucHistoricalSwarmTrajectory_Execute( void* drawingObject, void* data ) {}
+void _lucHistoricalSwarmTrajectory_Destroy( void* drawingObject, void* data ) {}
+
+void _lucHistoricalSwarmTrajectory_Setup( void* drawingObject, void* _context ) {
+	lucHistoricalSwarmTrajectory*  self            = (lucHistoricalSwarmTrajectory*)drawingObject;
+	AbstractContext*               context         = (AbstractContext*)             _context;
+	Swarm*                         swarm           = self->swarm;
+	lucColourMap*                  colourMap       = self->colourMap;
+	Particle_Index                 lParticle_I;
+	GlobalParticle*                particle;
+	int                            currentTimestep = context->timeStep;
+	lucHistoricalSwarmTrajectory_ParticleExt* particleExt;
+
+	/* Adjust current timestep counter so that the list of stored coordinates loops over itself */
+	if ( currentTimestep >= HISTORY_STEPS ) {
+		self->startTimestepIndex++;
+		self->startTimestepIndex %= HISTORY_STEPS;
+		currentTimestep %= HISTORY_STEPS;
+	}
+	self->timeAtStep[ currentTimestep ] = context->currentTime;
+
+	/* Calibrate Colour Map */
+	lucColourMap_SetMinMax( colourMap, self->timeAtStep[ self->startTimestepIndex ], self->timeAtStep[ currentTimestep ] );
+
+	/* Store Current position for each time step */
+	for ( lParticle_I = 0 ; lParticle_I < swarm->particleLocalCount ; lParticle_I++ ) {
+		particle    = (GlobalParticle*)Swarm_ParticleAt( swarm, lParticle_I );
+		particleExt = ExtensionManager_Get( swarm->particleExtensionMgr, particle, self->particleExtHandle );
+
+		memcpy( particleExt->historyCoordList[ currentTimestep ], particle->coord, sizeof(Coord) );
+	}
+	
+	/* Call parent's 'Setup' function */
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+
+void _lucHistoricalSwarmTrajectory_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	_lucOpenGLDrawingObject_Draw( drawingObject, window, viewportInfo, _context );
+}
+
+void _lucHistoricalSwarmTrajectory_CleanUp( void* drawingObject, void* context ) {
+	_lucOpenGLDrawingObject_CleanUp( drawingObject, context );
+}
+
+void _lucHistoricalSwarmTrajectory_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucHistoricalSwarmTrajectory*  self            = (lucHistoricalSwarmTrajectory*)drawingObject;
+	DiscretisationContext*         context         = (DiscretisationContext*)       _context;
+	Swarm*                         swarm           = self->swarm;
+	lucColourMap*                  colourMap       = self->colourMap;
+	int                            timestep;
+	int                            currentTimestep = context->timeStep % HISTORY_STEPS;
+	Particle_Index                 lParticle_I;
+	StandardParticle*              particle;
+	lucHistoricalSwarmTrajectory_ParticleExt* particleExt;
+	float                          offset              = 0.001;
+	double*                        coord;
+	Dimension_Index                dim                 = context->dim;
+
+	lucColour_SetOpenGLColour( &self->colour );
+	glLineWidth( self->lineWidth );
+
+	/* Loop over all particles and draw lines according to where each one has been */
+	for ( lParticle_I = 0 ; lParticle_I < swarm->particleLocalCount ; lParticle_I++ ) {
+		particle    = Swarm_ParticleAt( swarm, lParticle_I );
+		particleExt = ExtensionManager_Get( swarm->particleExtensionMgr, particle, self->particleExtHandle );
+
+		glBegin( GL_LINE_STRIP );
+		for ( timestep = self->startTimestepIndex ; timestep != currentTimestep ; ) {
+			coord = particleExt->historyCoordList[ timestep ];
+
+			/* Set the colour from the colour map - if we've passed it in */
+			if ( colourMap ) {
+				lucColourMap_SetOpenGLColourFromValue( colourMap, self->timeAtStep[ timestep ] );
+			}
+
+			if (dim == 2)
+				glVertex3f( (float)coord[0], (float)coord[1], offset );
+			else 
+				glVertex3dv( coord );
+			
+			/* Adjust current timestep counter so that the list of stored coordinates loops over itself */
+			timestep++;
+			timestep %= HISTORY_STEPS;
+		}
+		glEnd();
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/HistoricalSwarmTrajectory.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/HistoricalSwarmTrajectory.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,114 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: HistoricalSwarmTrajectory.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucHistoricalSwarmTrajectory_h__
+#define __lucHistoricalSwarmTrajectory_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucHistoricalSwarmTrajectory_Type;
+
+	#define HISTORY_STEPS 50
+
+	typedef struct {
+		Coord  historyCoordList[ HISTORY_STEPS ];
+	} lucHistoricalSwarmTrajectory_ParticleExt;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucHistoricalSwarmTrajectory \
+		/* Parent info */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		Swarm*                                             swarm;                  \
+		ExtensionInfo_Index                                particleExtHandle;      \
+		/* Colour Stuff */ \
+		lucColourMap*                                      colourMap;              \
+		lucColour                                          colour;                 \
+		/* Other Stuff */ \
+		float                                              lineWidth;              \
+		double                                             timeAtStep[ HISTORY_STEPS ]; \
+		Index                                              startTimestepIndex;
+
+	struct lucHistoricalSwarmTrajectory { __lucHistoricalSwarmTrajectory };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucHistoricalSwarmTrajectory* _lucHistoricalSwarmTrajectory_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,		
+		Name                                               name );
+
+	void _lucHistoricalSwarmTrajectory_Delete( void* drawingObject ) ;
+	void _lucHistoricalSwarmTrajectory_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucHistoricalSwarmTrajectory_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucHistoricalSwarmTrajectory_DefaultNew( Name name ) ;
+	void _lucHistoricalSwarmTrajectory_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucHistoricalSwarmTrajectory_Build( void* drawingObject, void* data ) ;
+	void _lucHistoricalSwarmTrajectory_Initialise( void* drawingObject, void* data ) ;
+	void _lucHistoricalSwarmTrajectory_Execute( void* drawingObject, void* data );
+	void _lucHistoricalSwarmTrajectory_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucHistoricalSwarmTrajectory_Setup( void* drawingObject, void* _context ) ;
+	void _lucHistoricalSwarmTrajectory_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucHistoricalSwarmTrajectory_CleanUp( void* drawingObject, void* context ) ;
+
+	void _lucHistoricalSwarmTrajectory_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/HistoricalSwarmTrajectory.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/HistoricalSwarmTrajectory.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucHistoricalSwarmTrajectory</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">lineWidth</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0 )</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Swarm</param>
+		<param name="Type">Swarm</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 135 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 136 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Init.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,117 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Init.c 667 2007-03-01 06:43:11Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "DrawingObjects.h"
+
+Bool lucDrawingObjects_Init() {
+	Stg_ComponentRegister* componentRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+
+	Stg_ComponentRegister_Add( componentRegister, lucColourBar_Type,               "0", _lucColourBar_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucFieldVariableBorder_Type,     "0", _lucFieldVariableBorder_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucIsosurface_Type,              "0", _lucIsosurface_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucScalarFieldCrossSection_Type, "0", _lucScalarFieldCrossSection_DefaultNew);
+	Stg_ComponentRegister_Add( componentRegister, lucScalarField_Type,             "0", _lucScalarField_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucVectorArrowCrossSection_Type, "0", _lucVectorArrowCrossSection_DefaultNew);
+	Stg_ComponentRegister_Add( componentRegister, lucVectorArrows_Type,            "0", _lucVectorArrows_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucTextureMap_Type,              "0", _lucTextureMap_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucContour_Type,                 "0", _lucContour_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucFeVariableSurface_Type,       "0", _lucFeVariableSurface_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucSwarmViewer_Type,             "0", _lucSwarmViewer_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucSwarmVectors_Type,            "0", _lucSwarmVectors_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucSwarmSquares_Type,            "0", _lucSwarmSquares_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucHistoricalSwarmTrajectory_Type,"0", _lucHistoricalSwarmTrajectory_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucEigenvectorsCrossSection_Type, "0", _lucEigenvectorsCrossSection_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucEigenvectors_Type,             "0", _lucEigenvectors_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucSwarmRGBColourViewer_Type,     "0", _lucSwarmRGBColourViewer_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucMeshViewer_Type,               "0", _lucMeshViewer_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucTitle_Type,                    "0", _lucTitle_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucAxis_Type,                      "0", _lucAxis_DefaultNew );
+        Stg_ComponentRegister_Add( componentRegister, lucTimeStep_Type,                      "0", _lucTimeStep_DefaultNew );
+	Stg_ComponentRegister_Add( componentRegister, lucScalarFieldOnMeshCrossSection_Type, "0", _lucScalarFieldOnMeshCrossSection_DefaultNew);
+	Stg_ComponentRegister_Add( componentRegister, lucScalarFieldOnMesh_Type,             "0", _lucScalarFieldOnMesh_DefaultNew);
+	
+
+	/* Register Parents for type checking */
+	RegisterParent( lucOpenGLDrawingObject_Type,             lucDrawingObject_Type );
+	RegisterParent( lucScalarFieldCrossSection_Type,         lucOpenGLDrawingObject_Type );
+	RegisterParent( lucScalarField_Type,                     lucScalarFieldCrossSection_Type );	
+	RegisterParent( lucScalarFieldOnMeshCrossSection_Type,   lucOpenGLDrawingObject_Type );
+	RegisterParent( lucScalarFieldOnMesh_Type,  	 	 lucScalarFieldOnMeshCrossSection_Type );
+	RegisterParent( lucVectorArrowCrossSection_Type,         lucOpenGLDrawingObject_Type );
+	RegisterParent( lucVectorArrows_Type,                    lucVectorArrowCrossSection_Type );
+	RegisterParent( lucEigenvectorsCrossSection_Type,        lucOpenGLDrawingObject_Type );
+	RegisterParent( lucEigenvectors_Type,                    lucEigenvectorsCrossSection_Type );
+	
+	
+	RegisterParent( lucColourBar_Type,                       lucDrawingObject_Type );
+	RegisterParent( lucFieldVariableBorder_Type,             lucOpenGLDrawingObject_Type );
+	RegisterParent( lucIsosurface_Type,                      lucOpenGLDrawingObject_Type );
+	RegisterParent( lucTextureMap_Type,                      lucOpenGLDrawingObject_Type );
+	RegisterParent( lucContour_Type,                         lucOpenGLDrawingObject_Type );
+	RegisterParent( lucFeVariableSurface_Type,               lucOpenGLDrawingObject_Type );
+	RegisterParent( lucSwarmViewerBase_Type,           lucOpenGLDrawingObject_Type );
+	RegisterParent( lucSwarmViewer_Type,               lucSwarmViewerBase_Type );
+	RegisterParent( lucSwarmVectors_Type,              lucSwarmViewerBase_Type );
+	RegisterParent( lucSwarmSquares_Type,              lucSwarmViewerBase_Type );
+	RegisterParent( lucHistoricalSwarmTrajectory_Type, lucOpenGLDrawingObject_Type );
+	RegisterParent( lucSwarmRGBColourViewer_Type,      lucSwarmViewerBase_Type );
+	RegisterParent( lucMeshViewer_Type,                lucOpenGLDrawingObject_Type );
+	RegisterParent( lucTitle_Type,                     lucOpenGLDrawingObject_Type );
+	RegisterParent( lucAxis_Type,                      lucOpenGLDrawingObject_Type );
+	RegisterParent( lucTimeStep_Type,                  lucOpenGLDrawingObject_Type );
+
+
+
+
+	return True;
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Init.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,84 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Init.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+** This file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  Role:
+**	Initialises this library ready for use.
+**
+** Assumptions:
+**	The Init() function will be run before any other function in the library.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __lucDrawingObjects_Init_h__
+#define __lucDrawingObjects_Init_h__
+	
+	Bool lucDrawingObjects_Init() ;
+	
+#endif 
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Isosurface.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Isosurface.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,1229 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Isosurface.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "Isosurface.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucIsosurface_Type = "lucIsosurface";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucIsosurface* _lucIsosurface_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucIsosurface*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucIsosurface) );
+	self = (lucIsosurface*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucIsosurface_Init( 
+		lucIsosurface*                                     self,
+		FieldVariable*                                     isosurfaceField,
+		double                                             isovalue,
+		IJK                                                resolution,
+		Bool                                               drawWalls,
+		Bool                                               wireframe,
+		Bool                                               cullFrontFace,
+		Bool                                               cullBackFace,
+		Name                                               colourName,
+		lucColourMap*                                      colourMap,
+		FieldVariable*                                     colourField,
+		FieldVariable*                                     maskField,
+		lucDrawingObjectMask*                              mask )
+{
+	self->isosurfaceField = isosurfaceField;
+	self->isovalue        = isovalue;
+	lucColour_FromString( &self->colour, colourName );
+	memcpy( self->resolution, resolution, sizeof(IJK) );
+	self->drawWalls       = drawWalls;
+	self->wireframe       = wireframe;
+	self->cullFrontFace   = cullFrontFace;
+	self->cullBackFace    = cullBackFace;
+	self->colourMap       = colourMap;
+	self->colourField     = colourField;
+	self->maskField       = maskField;
+	memcpy( &self->mask, mask, sizeof(lucDrawingObjectMask) );
+
+	self->trianglesAlloced = 100;
+	self->triangleList = Memory_Alloc_Array( Surface_Triangle, self->trianglesAlloced, "triangleList" );
+}
+
+void _lucIsosurface_Delete( void* drawingObject ) {
+	lucIsosurface*  self = (lucIsosurface*)drawingObject;
+
+	Memory_Free( self->triangleList );
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucIsosurface_Print( void* drawingObject, Stream* stream ) {
+	lucIsosurface*  self = (lucIsosurface*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucIsosurface_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucIsosurface*  self = (lucIsosurface*)drawingObject;
+	lucIsosurface* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucIsosurface_DefaultNew( Name name ) {
+	return (void*) _lucIsosurface_New(
+		sizeof(lucIsosurface),
+		lucIsosurface_Type,
+		_lucIsosurface_Delete,
+		_lucIsosurface_Print,
+		NULL,
+		_lucIsosurface_DefaultNew,
+		_lucIsosurface_Construct,
+		_lucIsosurface_Build,
+		_lucIsosurface_Initialise,
+		_lucIsosurface_Execute,
+		_lucIsosurface_Destroy,
+		_lucIsosurface_Setup,
+		_lucIsosurface_Draw,
+		_lucIsosurface_CleanUp,
+		_lucIsosurface_BuildDisplayList,
+		name );
+}
+
+void _lucIsosurface_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucIsosurface*         self               = (lucIsosurface*)drawingObject;
+	FieldVariable*         isosurfaceField;
+	FieldVariable*         colourField;
+	FieldVariable*         maskField;
+	lucColourMap*          colourMap;
+	Index                  defaultResolution;
+	IJK                    resolution;
+	double                 isovalue;
+	lucDrawingObjectMask   mask;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	isosurfaceField = Stg_ComponentFactory_ConstructByKey( cf, self->name, "IsosurfaceField", FieldVariable, True,  data );
+	colourMap       = Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap",       lucColourMap,  False, data );
+	colourField     = Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourField",     FieldVariable, False, data );
+	maskField       = Stg_ComponentFactory_ConstructByKey( cf, self->name, "MaskField",       FieldVariable, False, data );
+
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 64 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+
+	lucDrawingObjectMask_Construct( &mask, self->name, cf, data );
+
+	isovalue = Stg_ComponentFactory_GetDouble( cf, self->name, "isovalue", 0.0 );
+	
+	_lucIsosurface_Init( 
+			self, 
+			isosurfaceField,
+			isovalue,
+			resolution,
+			Stg_ComponentFactory_GetBool( cf, self->name, "drawWalls", False ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "wireframe", False ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "cullFrontFace", False ),
+			Stg_ComponentFactory_GetBool( cf, self->name, "cullBackFace", False ),
+			Stg_ComponentFactory_GetString( cf, self->name, "colour", "White" ),
+			colourMap,
+			colourField,
+			maskField,
+			&mask );
+}
+
+void _lucIsosurface_Build( void* drawingObject, void* data ) {}
+void _lucIsosurface_Initialise( void* drawingObject, void* data ) {}
+void _lucIsosurface_Execute( void* drawingObject, void* data ) {}
+void _lucIsosurface_Destroy( void* drawingObject, void* data ) {}
+
+void _lucIsosurface_Setup( void* drawingObject, void* _context ) {
+	lucIsosurface*           self            = (lucIsosurface*)drawingObject;
+	DiscretisationContext*   context         = (DiscretisationContext*) _context;
+	FieldVariable*           isosurfaceField = self->isosurfaceField;
+	int                      i, j, k;
+	int                      nx, ny, nz;
+	double                   dx, dy, dz;
+	Vertex***                vertex;
+	Coord                    pos;
+	Coord                    min;
+	Coord                    max;
+	Dimension_Index          dim             = context->dim;
+
+	/* Initialise Variables */
+	self->triangleCount = 0;
+	nx = self->resolution[ I_AXIS ];
+	ny = self->resolution[ J_AXIS ];
+	nz = self->resolution[ K_AXIS ];
+	
+	FieldVariable_GetMinAndMaxLocalCoords( isosurfaceField, min, max );
+	dx = (max[0] - min[0])/((double) nx - 1);
+	dy = (max[1] - min[1])/((double) ny - 1);
+	dz = (max[2] - min[2])/((double) nz - 1);
+	if (dim == 2) {
+		dz = 0.0;
+		nz = 1;
+	}
+	
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	vertex = Memory_Alloc_3DArray( Vertex , nx, ny, nz , "Vertex array" );
+
+	/* Sample Field in in regular grid */
+	for ( i = 0 ; i < nx ; i++ ) {
+		for ( j = 0 ; j < ny ; j++ ) {
+			for ( k = 0 ; k < nz ; k++ ) {
+				pos[ I_AXIS ] = min[ I_AXIS ] + dx * (double) i;
+				pos[ J_AXIS ] = min[ J_AXIS ] + dy * (double) j;
+				pos[ K_AXIS ] = min[ K_AXIS ] + dz * (double) k;
+
+				memcpy( vertex[i][j][k].pos, pos, 3 * sizeof(double) );
+				
+				if ( i == 0 )
+					pos[ I_AXIS ] = min[ I_AXIS ] + 0.001 * dx; 
+				if ( j == 0 )
+					pos[ J_AXIS ] = min[ J_AXIS ] + 0.001 * dy; 
+				if ( k == 0 )
+					pos[ K_AXIS ] = min[ K_AXIS ] + 0.001 * dz; 
+				if ( i == nx - 1 )
+					pos[ I_AXIS ] = max[ I_AXIS ] - 0.001 * dx;
+				if ( j == ny - 1 )
+					pos[ J_AXIS ] = max[ J_AXIS ] - 0.001 * dy;
+				if ( k == nz - 1 )
+					pos[ K_AXIS ] = max[ K_AXIS ] - 0.001 * dz;
+				FieldVariable_InterpolateValueAt( isosurfaceField, pos, &vertex[i][j][k].value );
+			}
+		}
+	}
+	if (dim == 3) {
+		/* Find normals */
+		lucIsosurface_Normals( self, vertex );
+		
+		/* Find Surface with Marching Cubes */
+		lucIsosurface_MarchingCubes( self, vertex );
+	}
+	if (dim == 2 || self->drawWalls)
+		lucIsosurface_DrawWalls( self, vertex );
+
+	/* Free memory */
+	Memory_Free( vertex );
+
+	/* Call parents setup function */
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+
+
+
+	#define lucIsosurface_GetColourForPos( self, pos, min, max, fudgeFactor ) \
+		do { \
+			double          __value; \
+			Coord           __interpolationPos; \
+			if ( self->colourField && self->colourMap ) { \
+				memcpy( __interpolationPos, pos, sizeof(Coord) ); \
+				if ( __interpolationPos[ I_AXIS ] >= max[ I_AXIS ] ) \
+					__interpolationPos[ I_AXIS ] = max[ I_AXIS ] - fudgeFactor[ I_AXIS ]; \
+				if ( __interpolationPos[ J_AXIS ] >= max[ J_AXIS ] ) \
+					__interpolationPos[ J_AXIS ] = max[ J_AXIS ] - fudgeFactor[ J_AXIS ]; \
+				if ( __interpolationPos[ K_AXIS ] >= max[ K_AXIS ] ) \
+					__interpolationPos[ K_AXIS ] = max[ K_AXIS ] - fudgeFactor[ K_AXIS ]; \
+				FieldVariable_InterpolateValueAt( self->colourField, __interpolationPos, &__value ); \
+				lucColourMap_SetOpenGLColourFromValue( self->colourMap, __value ); \
+			} \
+		} while (0)
+	
+void _lucIsosurface_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucIsosurface*           self          = (lucIsosurface*)drawingObject;
+	FieldVariable*           colourField   = self->colourField;
+	lucColourMap*            colourMap     = self->colourMap;
+	Coord                    min;
+	Coord                    max;
+	XYZ                      fudgeFactor   = { 0.0, 0.0, 0.0 };
+	Index                    dof_I;
+
+
+	/* Calibrate Colour Map using Colour Variable */
+	if ( colourMap && colourField ) {
+		lucColourMap_CalibrateFromFieldVariable( colourMap, colourField );
+		FieldVariable_GetMinAndMaxGlobalCoords( colourField, min, max );
+		for ( dof_I = 0 ; dof_I < 3 ; dof_I++ )
+			fudgeFactor[ dof_I ] = 0.001 * (max[ dof_I ] - min[ dof_I ]);
+		FieldVariable_GetMinAndMaxLocalCoords( colourField, min, max );
+	}
+	else if ( colourMap ) 
+		lucColourMap_CalibrateFromFieldVariable( colourMap, self->isosurfaceField );	
+	glEnable(GL_LIGHTING);
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucIsosurface_CleanUp( void* drawingObject, void* _context ) {
+	lucIsosurface*            self            = (lucIsosurface*) drawingObject;
+	
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}
+
+void _lucIsosurface_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucIsosurface*           self          = (lucIsosurface*)drawingObject;
+	FieldVariable*           colourField   = self->colourField;
+	FieldVariable*           maskField     = self->maskField;
+	Surface_Triangle*        triangleList  = self->triangleList;
+	Surface_Triangle*        currentTriangle;
+	Index                    triangle_I;
+	Index                    triangleCount = self->triangleCount;
+	lucColourMap*            colourMap     = self->colourMap;
+	Coord                    min;
+	Coord                    max;
+	XYZ                      fudgeFactor   = { 0.0, 0.0, 0.0 };
+	Index                    dof_I;
+
+
+	/* Give option to draw surface as wireframe */
+	if (self->wireframe) 
+		glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+	else 
+		glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );	
+
+	/* Set up Face Culling */
+	if (self->cullBackFace) {
+		if (self->cullFrontFace) 
+			glCullFace( GL_FRONT_AND_BACK );
+		else 
+			glCullFace( GL_BACK );
+		glEnable( GL_CULL_FACE );
+	}
+	else if( self->cullFrontFace ) {
+		glCullFace( GL_FRONT );
+		glEnable( GL_CULL_FACE );
+	}
+
+	/* Calibrate Colour Map using Colour Variable */
+	if ( colourMap && colourField ) {
+		lucColourMap_CalibrateFromFieldVariable( colourMap, colourField );
+		FieldVariable_GetMinAndMaxGlobalCoords( colourField, min, max );
+		for ( dof_I = 0 ; dof_I < 3 ; dof_I++ )
+			fudgeFactor[ dof_I ] = 0.001 * (max[ dof_I ] - min[ dof_I ]);
+		FieldVariable_GetMinAndMaxLocalCoords( colourField, min, max );
+	}
+	else if ( colourMap ) 
+		lucColourMap_CalibrateFromFieldVariable( colourMap, self->isosurfaceField );
+
+
+	glFrontFace(GL_CW);
+	glBegin(GL_TRIANGLES);
+
+	if ( ! self->colourMap || ! colourField ) {
+		lucColour_SetOpenGLColour( &self->colour );
+	}
+	else if ( !colourField ) {
+		lucColourMap_SetOpenGLColourFromValue( colourMap, self->isovalue );
+	}
+	
+	for( triangle_I = 0 ; triangle_I < triangleCount ; triangle_I++) {
+		currentTriangle = (Surface_Triangle*) &triangleList[triangle_I];
+
+		/* Test for masked triangle */
+		if ( maskField != NULL ) {
+			if (lucIsosurface_TestMask( self, currentTriangle->pos1 ) == False) continue;
+			if (lucIsosurface_TestMask( self, currentTriangle->pos2 ) == False) continue;
+			if (lucIsosurface_TestMask( self, currentTriangle->pos3 ) == False) continue;
+		}
+
+		/* Plot First Vertex */
+		lucIsosurface_GetColourForPos( self, currentTriangle->pos1, min, max, fudgeFactor );
+		glNormal3dv(currentTriangle->normal1);
+		glVertex3dv(currentTriangle->pos1);
+		
+		/* Plot Second Vertex */
+		lucIsosurface_GetColourForPos( self, currentTriangle->pos3, min, max, fudgeFactor );
+		glNormal3dv(currentTriangle->normal3);
+		glVertex3dv(currentTriangle->pos3);	
+		
+		/* Plot Third Vertex */
+		lucIsosurface_GetColourForPos( self, currentTriangle->pos2, min, max, fudgeFactor );
+		glNormal3dv(currentTriangle->normal2);
+		glVertex3dv(currentTriangle->pos2);
+	}
+	glEnd();
+}
+
+Bool lucIsosurface_TestMask( lucIsosurface* self, Coord pos ) {
+	double value;
+
+	FieldVariable_InterpolateValueAt( self->maskField, pos, &value );
+
+	return lucDrawingObjectMask_Test( &self->mask, value );
+}
+
+/*
+   Given a grid cell and an isolevel, calculate the triangular
+   facets required to represent the isosurface through the cell.
+   Return the number of triangular facets, the array "triangleList"
+   will be loaded up with the vertices at most 5 triangular facets.
+	0 will be returned if the grid cell is either totally above
+   of totally below the isolevel.
+*/
+
+void VertexInterp(double isolevel, Vertex* point, Vertex* vertex1, Vertex* vertex2 ) ;
+double getQuadraticDerive(double y1, double y2, double y3, double x1, double x2, double x3) ;
+
+/* This algorithm for constructing an isosurface is taken from:
+Lorensen, William and Harvey E. Cline. Marching Cubes: A High Resolution 3D Surface Construction Algorithm. Computer Graphics (SIGGRAPH 87 Proceedings) 21(4) July 1987, p. 163-170) http://www.cs.duke.edu/education/courses/fall01/cps124/resources/p163-lorensen.pdf 
+The lookup table is taken from http://astronomy.swin.edu.au/~pbourke/modelling/polygonise/ 
+*/
+void lucIsosurface_MarchingCubes( lucIsosurface* self, Vertex*** vertex ) {
+	double isolevel = self->isovalue;
+	int i,j,k,n;
+	int triangleCount = 0;
+	int nx = self->resolution[ I_AXIS ];
+	int ny = self->resolution[ J_AXIS ];
+	int nz = self->resolution[ K_AXIS ];
+	int cubeindex;
+	Vertex points[12];
+
+int edgeTable[256]={
+0x0  , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
+0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
+0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,
+0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,
+0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,
+0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,
+0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,
+0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,
+0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,
+0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,
+0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,
+0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
+0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,
+0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,
+0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,
+0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,
+0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,
+0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
+0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,
+0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,
+0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,
+0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
+0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,
+0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,
+0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,
+0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,
+0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,
+0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,
+0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,
+0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,
+0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
+0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0   };
+int triTable[256][16] =
+{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1},
+{3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1},
+{3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1},
+{3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1},
+{9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1},
+{9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1},
+{2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1},
+{8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1},
+{9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1},
+{4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1},
+{3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1},
+{1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1},
+{4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1},
+{4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1},
+{9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1},
+{5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1},
+{2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1},
+{9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1},
+{0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1},
+{2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1},
+{10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1},
+{4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1},
+{5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1},
+{5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1},
+{9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1},
+{0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1},
+{1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1},
+{10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1},
+{8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1},
+{2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1},
+{7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1},
+{9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1},
+{2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1},
+{11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1},
+{9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1},
+{5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1},
+{11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1},
+{11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1},
+{1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1},
+{9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1},
+{5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1},
+{2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1},
+{0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1},
+{5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1},
+{6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1},
+{3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1},
+{6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1},
+{5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1},
+{1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1},
+{10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1},
+{6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1},
+{8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1},
+{7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1},
+{3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1},
+{5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1},
+{0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1},
+{9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1},
+{8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1},
+{5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1},
+{0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1},
+{6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1},
+{10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1},
+{10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1},
+{8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1},
+{1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1},
+{3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1},
+{0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1},
+{10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1},
+{3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1},
+{6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1},
+{9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1},
+{8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1},
+{3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1},
+{6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1},
+{0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1},
+{10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1},
+{10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1},
+{2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1},
+{7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1},
+{7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1},
+{2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1},
+{1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1},
+{11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1},
+{8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1},
+{0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1},
+{7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1},
+{10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1},
+{2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1},
+{6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1},
+{7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1},
+{2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1},
+{1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1},
+{10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1},
+{10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1},
+{0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1},
+{7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1},
+{6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1},
+{8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1},
+{9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1},
+{6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1},
+{4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1},
+{10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1},
+{8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1},
+{0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1},
+{1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1},
+{8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1},
+{10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1},
+{4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1},
+{10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1},
+{5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1},
+{11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1},
+{9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1},
+{6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1},
+{7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1},
+{3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1},
+{7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1},
+{9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1},
+{3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1},
+{6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1},
+{9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1},
+{1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1},
+{4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1},
+{7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1},
+{6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1},
+{3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1},
+{0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1},
+{6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1},
+{0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1},
+{11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1},
+{6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1},
+{5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1},
+{9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1},
+{1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1},
+{1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1},
+{10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1},
+{0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1},
+{5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1},
+{10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1},
+{11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1},
+{9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1},
+{7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1},
+{2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1},
+{8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1},
+{9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1},
+{9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1},
+{1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1},
+{9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1},
+{9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1},
+{5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1},
+{0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1},
+{10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1},
+{2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1},
+{0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1},
+{0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1},
+{9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1},
+{5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1},
+{3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1},
+{5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1},
+{8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1},
+{0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1},
+{9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1},
+{0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1},
+{1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1},
+{3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1},
+{4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1},
+{9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1},
+{11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1},
+{11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1},
+{2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1},
+{9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1},
+{3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1},
+{1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1},
+{4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1},
+{4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1},
+{0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1},
+{3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1},
+{3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1},
+{0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1},
+{9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1},
+{1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
+{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}};
+
+
+	for ( i = 0 ; i < nx - 1  ; i++ ) {
+		for ( j = 0 ; j < ny - 1 ; j++ ) {
+			for ( k = 0 ; k < nz - 1 ; k++ ) {
+				/* Determine the index into the edge table which tells us which vertices are inside of the surface */
+				cubeindex = 0;
+				if (vertex[i][j][k].value       < isolevel) cubeindex |= 1;	
+				if (vertex[i+1][j][k].value     < isolevel) cubeindex |= 2;
+				if (vertex[i+1][j][k+1].value   < isolevel) cubeindex |= 4;
+				if (vertex[i][j][k+1].value     < isolevel) cubeindex |= 8;
+				if (vertex[i][j+1][k].value     < isolevel) cubeindex |= 16;
+				if (vertex[i+1][j+1][k].value   < isolevel) cubeindex |= 32;
+				if (vertex[i+1][j+1][k+1].value < isolevel) cubeindex |= 64;
+				if (vertex[i][j+1][k+1].value   < isolevel) cubeindex |= 128;
+				
+				/* Cube is entirely in/out of the surface */
+				if (edgeTable[cubeindex] == 0) continue;
+					
+				/* Find the vertices where the surface intersects the cube */
+				if (edgeTable[cubeindex] & 1)
+					VertexInterp(isolevel, &points[0], &vertex[i][j][k] , &vertex[i+1][j][k]);
+				if (edgeTable[cubeindex] & 2)
+					VertexInterp(isolevel, &points[1], &vertex[i+1][j][k] , &vertex[i+1][j][k+1] );
+				if (edgeTable[cubeindex] & 4)
+					VertexInterp(isolevel, &points[2], &vertex[i+1][j][k+1] , &vertex[i][j][k+1] );
+				if (edgeTable[cubeindex] & 8)
+					VertexInterp(isolevel, &points[3], &vertex[i][j][k+1] , &vertex[i][j][k] );
+				if (edgeTable[cubeindex] & 16)
+					VertexInterp(isolevel, &points[4], &vertex[i][j+1][k] , &vertex[i+1][j+1][k] );
+				if (edgeTable[cubeindex] & 32)
+					VertexInterp(isolevel, &points[5], &vertex[i+1][j+1][k] , &vertex[i+1][j+1][k+1] );
+				if (edgeTable[cubeindex] & 64)
+					VertexInterp(isolevel, &points[6], &vertex[i+1][j+1][k+1] , &vertex[i][j+1][k+1] );
+				if (edgeTable[cubeindex] & 128)
+					VertexInterp(isolevel, &points[7], &vertex[i][j+1][k+1] , &vertex[i][j+1][k] );
+				if (edgeTable[cubeindex] & 256)
+					VertexInterp(isolevel, &points[8], &vertex[i][j][k] , &vertex[i][j+1][k] );
+				if (edgeTable[cubeindex] & 512)
+					VertexInterp(isolevel, &points[9], &vertex[i+1][j][k] , &vertex[i+1][j+1][k] );
+				if (edgeTable[cubeindex] & 1024)
+					VertexInterp(isolevel, &points[10], &vertex[i+1][j][k+1] , &vertex[i+1][j+1][k+1] );
+				if (edgeTable[cubeindex] & 2048)
+					VertexInterp(isolevel, &points[11], &vertex[i][j][k+1] , &vertex[i][j+1][k+1] );
+
+				/* Create the triangle */
+				for ( n = 0 ; triTable[cubeindex][n] != -1 ; n += 3 ) {
+					if (triangleCount > self->trianglesAlloced - 1 ) {
+						self->trianglesAlloced = self->trianglesAlloced + 100;
+						self->triangleList = Memory_Realloc_Array( self->triangleList, Surface_Triangle, self->trianglesAlloced );
+					}
+					/* Get positions */
+					memcpy( self->triangleList[triangleCount].pos1 , points[ triTable[cubeindex][n  ] ].pos , 3 * sizeof(double) );
+					memcpy( self->triangleList[triangleCount].pos2 , points[ triTable[cubeindex][n+1] ].pos , 3 * sizeof(double) );
+					memcpy( self->triangleList[triangleCount].pos3 , points[ triTable[cubeindex][n+2] ].pos , 3 * sizeof(double) );
+
+					/* Get Normals */
+					memcpy( self->triangleList[triangleCount].normal1 , points[ triTable[cubeindex][n  ] ].normal , 3 * sizeof(double) );
+					memcpy( self->triangleList[triangleCount].normal2 , points[ triTable[cubeindex][n+1] ].normal , 3 * sizeof(double) );
+					memcpy( self->triangleList[triangleCount].normal3 , points[ triTable[cubeindex][n+2] ].normal , 3 * sizeof(double) );
+
+					triangleCount++;
+				}
+			}
+		}
+	}
+	self->triangleCount = triangleCount;
+}
+
+/*
+   Linearly interpolate the position where an isosurface cuts
+   an edge between two vertices, each with their own scalar value
+*/
+void VertexInterp(double isolevel, Vertex* point, Vertex* vertex1, Vertex* vertex2 ) {
+	double mu;
+
+	if (fabs(isolevel - vertex1->value) < 0.00001) {
+		memcpy( point, vertex1, sizeof(Vertex) );
+		return;
+	}
+	if (fabs(isolevel - vertex2->value) < 0.00001) {
+		memcpy( point, vertex2, sizeof(Vertex) );
+		return;
+	}
+	if (fabs(vertex1->value - vertex2->value) < 0.00001) {
+		memcpy( point, vertex1, sizeof(Vertex) );
+		return;
+	}
+		
+	mu = (isolevel - vertex1->value) / (vertex2->value - vertex1->value);
+	
+	point->pos[0] = vertex1->pos[0] + mu * (vertex2->pos[0] - vertex1->pos[0]);
+	point->pos[1] = vertex1->pos[1] + mu * (vertex2->pos[1] - vertex1->pos[1]);
+	point->pos[2] = vertex1->pos[2] + mu * (vertex2->pos[2] - vertex1->pos[2]);
+
+	point->normal[0] = vertex1->normal[0] + mu * (vertex2->normal[0] - vertex1->normal[0]);
+	point->normal[1] = vertex1->normal[1] + mu * (vertex2->normal[1] - vertex1->normal[1]);
+	point->normal[2] = vertex1->normal[2] + mu * (vertex2->normal[2] - vertex1->normal[2]);
+}
+
+void lucIsosurface_Normals( lucIsosurface* self, Vertex*** vertex ) {
+	int i, j, k;
+	int nx = self->resolution[ I_AXIS ];
+	int ny = self->resolution[ J_AXIS ];
+	int nz = self->resolution[ K_AXIS ];
+
+	for ( i = 0 ; i < nx ; i++ ) {
+		for ( j = 0 ; j < ny ; j++ ) {
+			for ( k = 0 ; k < nz ; k++ ) {
+				/* Set up component in x direction */
+				if (i == 0) {
+					vertex[i][j][k].normal[0] = (vertex[i+1][j][k].value - vertex[i][j][k].value) / 
+									(vertex[i+1][j][k].pos[0] - vertex[i][j][k].pos[0] ) ;
+				}
+				else if (i == nx - 1)  {
+					vertex[i][j][k].normal[0] = (vertex[i][j][k].value - vertex[i-1][j][k].value) / 
+									(vertex[i][j][k].pos[0] - vertex[i-1][j][k].pos[0] ) ;
+				}
+				else {	
+					vertex[i][j][k].normal[0] = getQuadraticDerive(	
+					                              vertex[i-1][j][k].value, vertex[i][j][k].value, vertex[i+1][j][k].value,
+					                              vertex[i-1][j][k].pos[0], vertex[i][j][k].pos[0], vertex[i+1][j][k].pos[0]);
+				}
+				
+				/* Set up component in y direction */
+				if (j == 0) {
+					vertex[i][j][k].normal[1] = (vertex[i][j+1][k].value - vertex[i][j][k].value) / 
+									(vertex[i][j+1][k].pos[1] - vertex[i][j][k].pos[1] ) ;
+				}
+				else if (j == ny - 1)  {
+					vertex[i][j][k].normal[1] = (vertex[i][j][k].value - vertex[i][j-1][k].value) / 
+									(vertex[i][j][k].pos[1] - vertex[i][j-1][k].pos[1] ) ;
+				}
+				else {	
+					vertex[i][j][k].normal[1] = getQuadraticDerive(	
+					                              vertex[i][j-1][k].value, vertex[i][j][k].value, vertex[i][j+1][k].value,
+					                              vertex[i][j-1][k].pos[1], vertex[i][j][k].pos[1], vertex[i][j+1][k].pos[1]);
+				}			
+				
+				/* Set up component in z direction */
+				if (k == 0) {
+					vertex[i][j][k].normal[2] = (vertex[i][j][k+1].value - vertex[i][j][k].value) / 
+									(vertex[i][j][k+1].pos[2] - vertex[i][j][k].pos[2] ) ;
+				}
+				else if (k == nz - 1)  {
+					vertex[i][j][k].normal[2] = (vertex[i][j][k].value - vertex[i][j][k-1].value) / 
+									(vertex[i][j][k].pos[2] - vertex[i][j][k-1].pos[2] ) ;
+				}
+				else {	
+					vertex[i][j][k].normal[2] = getQuadraticDerive(	
+					                              vertex[i][j][k-1].value, vertex[i][j][k].value, vertex[i][j][k+1].value,
+					                              vertex[i][j][k-1].pos[2], vertex[i][j][k].pos[2], vertex[i][j][k+1].pos[2]);
+				}														
+				StGermain_VectorNormalise(vertex[i][j][k].normal, 3);	
+			}
+		}
+	}
+}
+
+double getQuadraticDerive(double y1, double y2, double y3, double x1, double x2, double x3) {
+	double dy12, dy32;
+	double dx12sq, dx32sq, dx12, dx32;
+	double a, b;
+	double result;
+
+	if (fabs(y2 - y1) < 0.0001 && fabs(y3 - y1) < 0.0001) {
+		return 0.0;
+	}
+	//  Get the problem variables
+	dy12 = y1-y2;
+	dy32 = y3-y2;
+	dx12 = x1-x2;
+	dx32 = x3-x2;
+	dx12sq = (x1*x1)-(x2*x2);
+	dx32sq = (x3*x3)-(x2*x2);
+	
+	//  Get a
+	a = dx12 * dy32 / dx32;
+	a -= dy12;
+	a /= ((dx32sq/dx32) + dx12sq);
+	
+	//  Get b
+	b = dy32;
+	b -= a * dx32sq;
+	b /= dx32;
+	
+	//  Now get the derivative
+	result = 2*a*x2 + b;
+	
+	return result;
+}
+
+
+#define gLucifer_CW	0
+#define gLucifer_CCW	1
+
+#define LEFT_BOTTOM     0
+#define RIGHT_BOTTOM    1
+#define LEFT_TOP        2
+#define RIGHT_TOP       3
+#define LEFT            4
+#define RIGHT           5
+#define TOP	            6
+#define BOTTOM          7
+
+void lucIsosurface_DrawWalls( lucIsosurface* self, Vertex ***array ) {
+	int nx = self->resolution[ I_AXIS ];
+	int ny = self->resolution[ J_AXIS ];
+	int nz = self->resolution[ K_AXIS ];
+	int i, j, k;
+	Vertex ** points;
+	Vertex * midVerticies;
+	char order;
+
+	/* Allocate Memory */
+	points = Memory_Alloc_Array( Vertex* , 8, "array for marching squares");
+	midVerticies = Memory_Alloc_Array( Vertex , 4, "array for marching squares");
+	points[LEFT] = &midVerticies[0];
+	points[RIGHT] = &midVerticies[1];
+	points[TOP] = &midVerticies[2];
+	points[BOTTOM] = &midVerticies[3];
+	
+	for ( i = 0 ; i < nx - 1 ; i++ ) {
+		for ( j = 0 ; j < ny - 1 ; j++ ) {
+			k = 0;
+			order = gLucifer_CCW;
+			lucIsosurface_SetupPointsZ( points, array, i, j, k );
+			lucIsosurface_WallElement( self, points, order, K_AXIS );
+
+			k = nz - 1;
+			order = gLucifer_CW;
+			lucIsosurface_SetupPointsZ( points, array, i, j, k );
+			lucIsosurface_WallElement( self, points, order, K_AXIS );
+		}
+	}
+	for ( k = 0 ; k < nz - 1 ; k++ ) {
+		for ( j = 0 ; j < ny - 1 ; j++ ) {
+			i = 0;
+			order = gLucifer_CW;
+			lucIsosurface_SetupPointsX( points, array, i, j, k );
+			lucIsosurface_WallElement( self, points, order, I_AXIS );
+
+			i = nx - 1;
+			order = gLucifer_CCW;
+			lucIsosurface_SetupPointsX( points, array, i, j, k );
+			lucIsosurface_WallElement( self, points, order, I_AXIS );
+
+		}
+	}
+	for ( i = 0 ; i < nx - 1 ; i++ ) {
+		for ( k = 0 ; k < nz - 1 ; k++ ) {
+			j = 0;
+			order = gLucifer_CW;
+			lucIsosurface_SetupPointsY( points, array, i, j, k );
+			lucIsosurface_WallElement( self, points, order, J_AXIS );
+
+			j = ny - 1;
+			order = gLucifer_CCW;
+			lucIsosurface_SetupPointsY( points, array, i, j, k );
+			lucIsosurface_WallElement( self, points, order, J_AXIS );
+		}
+	}
+	Memory_Free( points );
+	Memory_Free( midVerticies );
+}
+
+void lucIsosurface_SetupPointsX( Vertex** points, Vertex*** array, Index i, Index j, Index k ){
+	points[LEFT_BOTTOM]  = &array[i][ j ][ k ];
+	points[RIGHT_BOTTOM] = &array[i][j+1][ k ];
+	points[LEFT_TOP]     = &array[i][ j ][k+1];
+	points[RIGHT_TOP]    = &array[i][j+1][k+1];
+}
+
+void lucIsosurface_SetupPointsY( Vertex** points, Vertex*** array, Index i, Index j, Index k ){
+	points[LEFT_BOTTOM]  = &array[ i ][j][ k ];
+	points[RIGHT_BOTTOM] = &array[i+1][j][ k ];
+	points[LEFT_TOP]     = &array[ i ][j][k+1];
+	points[RIGHT_TOP]    = &array[i+1][j][k+1];
+}
+
+void lucIsosurface_SetupPointsZ( Vertex** points, Vertex*** array, Index i, Index j, Index k ){
+	points[LEFT_BOTTOM]  = &array[ i ][ j ][k];
+	points[RIGHT_BOTTOM] = &array[i+1][ j ][k];
+	points[LEFT_TOP]     = &array[ i ][j+1][k];
+	points[RIGHT_TOP]    = &array[i+1][j+1][k];
+}
+
+void lucIsosurface_WallElement( lucIsosurface* self, Vertex** points, char order, Dimension_Index axis ) {
+	double value  = self->isovalue;
+	char   cubeType = 0;
+
+	/* find cube type */
+	if (points[LEFT_BOTTOM]->value  > value) cubeType += 1;
+	if (points[RIGHT_BOTTOM]->value > value) cubeType += 2;
+	if (points[LEFT_TOP]->value     > value) cubeType += 4;
+	if (points[RIGHT_TOP]->value    > value) cubeType += 8;
+				
+	/* Create Points */
+	lucIsosurface_CreateIntermediatePoints( self, points, axis );
+	
+	lucIsosurface_MarchingRectangles( self, points, cubeType, order );
+}	
+
+void lucIsosurface_AddWallTriangle( lucIsosurface* self, int a , int b, int c, Vertex** points, char order) {
+	int n = self->triangleCount;
+	if ( n > self->trianglesAlloced - 1 ) {
+		self->trianglesAlloced = self->trianglesAlloced + 100;
+		self->triangleList = Memory_Realloc_Array( self->triangleList, Surface_Triangle, self->trianglesAlloced );
+	}
+	
+	if (order == gLucifer_CCW) {
+		memcpy( self->triangleList[n].pos1, points[a]->pos, 3*sizeof(double) );
+		memcpy( self->triangleList[n].pos2, points[c]->pos, 3*sizeof(double) );
+		memcpy( self->triangleList[n].pos3, points[b]->pos, 3*sizeof(double) );
+	}
+	else {
+		memcpy( self->triangleList[n].pos1, points[a]->pos, 3*sizeof(double) );
+		memcpy( self->triangleList[n].pos2, points[b]->pos, 3*sizeof(double) );
+		memcpy( self->triangleList[n].pos3, points[c]->pos, 3*sizeof(double) );
+	}
+
+	/* Calculate Normal */
+	StGermain_NormalToPlane( self->triangleList[n].normal1 , 
+		self->triangleList[n].pos1, self->triangleList[n].pos2, self->triangleList[n].pos3 );
+
+	memcpy( self->triangleList[n].normal2, self->triangleList[n].normal1 , 3 * sizeof(double) );
+	memcpy( self->triangleList[n].normal3, self->triangleList[n].normal1 , 3 * sizeof(double) );
+	self->triangleCount++;
+	
+}
+
+void lucIsosurface_CreateIntermediatePoints( lucIsosurface* self, Vertex **points, Dimension_Index axis ) {
+	double value = self->isovalue;
+	Dimension_Index A = ( axis == I_AXIS ? J_AXIS : I_AXIS );
+	Dimension_Index B = ( axis == K_AXIS ? J_AXIS : K_AXIS );
+	double dA = points[RIGHT_TOP]->pos[A] - points[LEFT_BOTTOM]->pos[A];
+	double dB = points[RIGHT_TOP]->pos[B] - points[LEFT_BOTTOM]->pos[B];
+
+	memcpy( points[ LEFT ]->pos, points[ LEFT_BOTTOM ]->pos, 3*sizeof(double) );
+	points[ LEFT ]->pos[B] += dB * (value - points[LEFT_BOTTOM]->value) 
+				/ (points[LEFT_TOP]->value - points[LEFT_BOTTOM]->value ) ;
+	
+	memcpy( points[ RIGHT ]->pos, points[ RIGHT_BOTTOM ]->pos, 3*sizeof(double) );
+	points[ RIGHT ]->pos[B] += dB * (value - points[RIGHT_BOTTOM]->value) 
+				/ (points[RIGHT_TOP]->value - points[RIGHT_BOTTOM]->value ) ;
+	
+	memcpy( points[ BOTTOM ]->pos, points[ LEFT_BOTTOM ]->pos, 3*sizeof(double) );
+	points[ BOTTOM ]->pos[A] += dA * (value - points[LEFT_BOTTOM]->value) 
+				/ (points[RIGHT_BOTTOM]->value - points[LEFT_BOTTOM]->value ) ;
+	
+	memcpy( points[ TOP ]->pos, points[ LEFT_TOP ]->pos, 3*sizeof(double) );
+	points[ TOP ]->pos[A] += dA * (value - points[LEFT_TOP]->value) 
+				/ (points[RIGHT_TOP]->value - points[LEFT_TOP]->value ) ;
+}		
+
+void lucIsosurface_MarchingRectangles( lucIsosurface* self, Vertex** points, char cubeType, char order) {
+	switch (cubeType) {
+		case 0:
+			/*  @@  */
+			/*  @@  */
+			break;
+		case 1:		
+			/*  @@  */
+			/*  #@  */
+			lucIsosurface_AddWallTriangle( self, LEFT_BOTTOM , LEFT, BOTTOM, points, order);
+			break;
+		case 2:
+			/*  @@  */
+			/*  @#  */	
+			lucIsosurface_AddWallTriangle(self, BOTTOM , RIGHT, RIGHT_BOTTOM, points, order);
+			break;
+		case 3:
+			/*  @@  */
+			/*  ##  */	
+			lucIsosurface_AddWallTriangle( self, LEFT_BOTTOM , LEFT, RIGHT, points, order);
+			lucIsosurface_AddWallTriangle(self, LEFT_BOTTOM , RIGHT, RIGHT_BOTTOM, points, order);
+			break;
+		case 4:
+			/*  #@  */
+			/*  @@  */
+			lucIsosurface_AddWallTriangle(self, LEFT_TOP , TOP, LEFT, points, order);
+			break;
+		case 5:
+			/*  #@  */
+			/*  #@  */
+			lucIsosurface_AddWallTriangle(self, LEFT_TOP , TOP, LEFT_BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, TOP , BOTTOM, LEFT_BOTTOM, points, order);
+			break;
+		case 6:
+			/*  #@  */
+			/*  @#  */
+			lucIsosurface_AddWallTriangle(self, LEFT_TOP , TOP, LEFT, points, order);
+			lucIsosurface_AddWallTriangle(self, BOTTOM , RIGHT, RIGHT_BOTTOM, points, order);
+			break;
+		case 7:
+			/*  #@  */
+			/*  ##  */
+			lucIsosurface_AddWallTriangle(self, RIGHT , RIGHT_BOTTOM, TOP, points, order);
+			lucIsosurface_AddWallTriangle(self, TOP , RIGHT_BOTTOM, LEFT_TOP, points, order);
+			lucIsosurface_AddWallTriangle(self, LEFT_TOP , RIGHT_BOTTOM, LEFT_BOTTOM, points, order);
+			break;
+		case 8:
+			/*  @#  */
+			/*  @@  */
+			lucIsosurface_AddWallTriangle(self, TOP , RIGHT_TOP, RIGHT, points, order);
+			break;
+		case 9:
+			/*  @#  */
+			/*  #@  */
+			lucIsosurface_AddWallTriangle(self, TOP , RIGHT_TOP, RIGHT, points, order);
+			lucIsosurface_AddWallTriangle(self, LEFT_BOTTOM , LEFT, BOTTOM, points, order);
+			break;
+		case 10:
+			/*  @#  */
+			/*  @#  */
+			lucIsosurface_AddWallTriangle(self, TOP , RIGHT_TOP, RIGHT_BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, BOTTOM , TOP, RIGHT_BOTTOM, points, order);
+			
+			break;
+		case 11:
+			/*  @#  */
+			/*  ##  */
+			lucIsosurface_AddWallTriangle(self, LEFT , LEFT_BOTTOM, TOP, points, order);
+			lucIsosurface_AddWallTriangle(self, TOP , LEFT_BOTTOM, RIGHT_TOP, points, order);
+			lucIsosurface_AddWallTriangle(self, RIGHT_TOP , LEFT_BOTTOM, RIGHT_BOTTOM, points, order);
+			break;
+		case 12:
+			/*  ##  */
+			/*  @@  */
+			lucIsosurface_AddWallTriangle(self, LEFT , LEFT_TOP, RIGHT, points, order);
+			lucIsosurface_AddWallTriangle(self, RIGHT , LEFT_TOP, RIGHT_TOP, points, order);
+			break;
+		case 13:
+			/*  ##  */
+			/*  #@  */
+			lucIsosurface_AddWallTriangle(self, RIGHT , RIGHT_TOP, BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, BOTTOM , RIGHT_TOP, LEFT_BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, LEFT_BOTTOM , RIGHT_TOP, LEFT_TOP, points, order);
+			break;
+		case 14:
+			/*  ##  */
+			/*  @#  */
+			lucIsosurface_AddWallTriangle(self, LEFT , LEFT_TOP, BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, BOTTOM , LEFT_TOP, RIGHT_BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, RIGHT_BOTTOM , LEFT_TOP, RIGHT_TOP, points, order);
+			break;
+		case 15:
+			/*  ##  */
+			/*  ##  */
+			lucIsosurface_AddWallTriangle(self, LEFT_TOP , RIGHT_TOP, RIGHT_BOTTOM, points, order);
+			lucIsosurface_AddWallTriangle(self, RIGHT_BOTTOM , LEFT_BOTTOM, LEFT_TOP, points, order);
+			break;
+		default:
+			Journal_Printf( self->errorStream, "In func %s: Cannot understand cube type %d\n", __func__, cubeType );
+			abort();
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Isosurface.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Isosurface.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,145 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Isosurface.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucIsosurface_h__
+#define __lucIsosurface_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucIsosurface_Type;
+
+	typedef struct {
+		double pos1[3], pos2[3], pos3[3];
+		double normal1[3], normal2[3], normal3[3];
+	} Surface_Triangle;
+	
+	typedef struct {
+		double value;
+		double pos[3];
+		double normal[3];
+	} Vertex;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucIsosurface \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     isosurfaceField;        \
+		double                                             isovalue;               \
+		IJK                                                resolution;             \
+		Bool                                               drawWalls;              \
+		Bool                                               wireframe;              \
+		Bool                                               cullFrontFace;          \
+		Bool                                               cullBackFace;           \
+		/* Colour Parameters */ \
+		lucColour                                          colour;                 \
+		lucColourMap*                                      colourMap;              \
+		FieldVariable*                                     colourField;            \
+		/* Masking parameters */\
+		FieldVariable*                                     maskField;              \
+		lucDrawingObjectMask                               mask;                   \
+		/* Calculated Values */ \
+		Surface_Triangle*                                  triangleList;           \
+		Index                                              triangleCount;          \
+		Index                                              trianglesAlloced;       \
+
+	struct lucIsosurface { __lucIsosurface };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucIsosurface* _lucIsosurface_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucIsosurface_Delete( void* drawingObject ) ;
+	void _lucIsosurface_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucIsosurface_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucIsosurface_DefaultNew( Name name ) ;
+	void _lucIsosurface_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucIsosurface_Build( void* drawingObject, void* data ) ;
+	void _lucIsosurface_Initialise( void* drawingObject, void* data ) ;
+	void _lucIsosurface_Execute( void* drawingObject, void* data );
+	void _lucIsosurface_Destroy( void* drawingObject, void* data ) ;
+	
+	/* Drawing Object Implementations */
+	void _lucIsosurface_Setup( void* drawingObject, void* _context ) ;
+	void _lucIsosurface_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucIsosurface_CleanUp( void* drawingObject, void* _context ) ;
+
+	/* OpenGL Drawing Object Implementation */
+	void _lucIsosurface_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+	Bool lucIsosurface_TestMask( lucIsosurface* self, Coord pos ) ;
+
+	void lucIsosurface_MarchingCubes( lucIsosurface* self, Vertex*** vertex ) ;
+	void lucIsosurface_Normals( lucIsosurface* self, Vertex*** vertex ) ;
+	void lucIsosurface_DrawWalls( lucIsosurface* self, Vertex*** array ) ;
+
+	void lucIsosurface_CreateIntermediatePoints( lucIsosurface* self, Vertex **points, Dimension_Index axis ) ;
+	void lucIsosurface_MarchingRectangles( lucIsosurface* self, Vertex** points, char cubeType, char order) ;
+	void lucIsosurface_WallElement( lucIsosurface* self, Vertex** points, char order, Dimension_Index axis ) ;
+	void lucIsosurface_AddWallTriangle( lucIsosurface* self, int a, int b, int c, Vertex** points, char order ) ;
+
+	void lucIsosurface_SetupPointsX( Vertex** points, Vertex*** array, Index i, Index j, Index k );
+	void lucIsosurface_SetupPointsY( Vertex** points, Vertex*** array, Index i, Index j, Index k );
+	void lucIsosurface_SetupPointsZ( Vertex** points, Vertex*** array, Index i, Index j, Index k );
+			
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/Isosurface.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/Isosurface.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucIsosurface</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Visualises a scalar field in 3D by the use of a surface over which all the values of the field are constant (an isosurface). It gets the value of the field on a 3D grid and uses the Marching Cubes algorithm to construct the surface. This algorithm is described in Lorensen, William and Harvey E. Cline. Marching Cubes: A High Resolution 3D Surface Construction Algorithm. Computer Graphics (SIGGRAPH 87 Proceedings) 21(4) July 1987, p. 163-170)</param>
+
+<!--Now the interesting stuff-->
+<list name="Params">
+	<struct>
+		<param name="Name">resolution</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">64</param>
+		<param name="Description">The default value for the resolutionX, resolutionY and resolutionZ. If these values aren't set the sampling grid will be uniform with this number of verticies in each direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionX</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of grid points in the X direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionY</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of grid points in the Y direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionZ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of grid points in the Z direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">isovalue</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">The value of the scalar field on the surface.</param>
+	</struct>
+	<struct>
+		<param name="Name">drawWalls</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">This will create an closed surface by drawing shapes along the side walls of the box.</param>
+	</struct>
+	<struct>
+		<param name="Name">wireframe</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">This draws only the triangle edges of the surface and not as solid shapes.</param>
+	</struct>
+	<struct>
+		<param name="Name">cullFrontFace</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">This tells OpenGL to not draw the front face of each triangle.</param>
+	</struct>
+	<struct>
+		<param name="Name">cullBackFace</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">This tells OpenGL to not draw the back face of each triangle.</param>
+	</struct>
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"White"</param>
+		<param name="Description">The colour of the isosurface. (If a lucColourMap is given - then this colour will not be used)</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">IsosurfaceField</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">The field that you want to visualise with an isosurface.</param>
+	</struct>
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">You may colour each of the verticies of the isosurface with a colour map if you specify it here. This will override the 'colour' given as a parameter.</param>
+	</struct>
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">ColourField</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">This is the field used to colour the isosurface if a lucColourMap is specified. If This is not given, the IsosurfaceField will be used instead.</param>
+	</struct>
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">MaskField</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/MeshViewer.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/MeshViewer.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,948 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#ifdef GLUCIFER_USE_PICELLERATOR
+	#include <StgFEM/StgFEM.h>
+	#include <PICellerator/PICellerator.h>
+#endif
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "MeshViewer.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucMeshViewer_Type = "lucMeshViewer";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucMeshViewer* _lucMeshViewer_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucMeshViewer*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucMeshViewer) );
+	self = (lucMeshViewer*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucMeshViewer_Init( 
+                lucMeshViewer*                                            self,
+		Mesh*                                                     mesh,
+		Name                                                      colourName,
+		lucColour                                                 localColour,
+		lucColour		                                  shadowColour, 
+		lucColour		                                  vacantColour)
+{
+	self->mesh  = mesh;
+	lucColour_FromString( &self->colour, colourName );
+	memcpy( &(self->localColour), &localColour, sizeof(lucColour) );
+	memcpy( &(self->shadowColour), &shadowColour, sizeof(lucColour) );
+	memcpy( &(self->vacantColour), &vacantColour, sizeof(lucColour) );
+	assert( Stg_Class_IsInstance( mesh, Mesh_Type ) );
+}
+
+void _lucMeshViewer_Delete( void* drawingObject ) {
+	lucMeshViewer*  self = (lucMeshViewer*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucMeshViewer_Print( void* drawingObject, Stream* stream ) {
+	lucMeshViewer*  self = (lucMeshViewer*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucMeshViewer_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucMeshViewer*  self = (lucMeshViewer*)drawingObject;
+	lucMeshViewer* newDrawingObject;
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+	memcpy( &(newDrawingObject->colour),       &(self->colour),       sizeof(lucColour) );
+	memcpy( &(newDrawingObject->localColour),       &(self->localColour),       sizeof(lucColour) );
+	memcpy( &(newDrawingObject->shadowColour),       &(self->shadowColour),       sizeof(lucColour) );
+	memcpy( &(newDrawingObject->vacantColour),       &(self->vacantColour),       sizeof(lucColour) );
+
+
+
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucMeshViewer_DefaultNew( Name name ) {
+	return (void*) _lucMeshViewer_New(
+		sizeof(lucMeshViewer),
+		lucMeshViewer_Type,
+		_lucMeshViewer_Delete,
+		_lucMeshViewer_Print,
+		NULL,
+		_lucMeshViewer_DefaultNew,
+		_lucMeshViewer_Construct,
+		_lucMeshViewer_Build,
+		_lucMeshViewer_Initialise,
+		_lucMeshViewer_Execute,
+		_lucMeshViewer_Destroy,
+		_lucMeshViewer_Setup,
+		_lucMeshViewer_Draw,
+		_lucMeshViewer_CleanUp,
+		_lucMeshViewer_BuildDisplayList,
+		name );
+}
+
+void _lucMeshViewer_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucMeshViewer*         self = (lucMeshViewer*)drawingObject;
+	Mesh*                  mesh;
+	Name localColourName;
+	Name shadowColourName;
+	Name vacantColourName;
+	
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+	
+	mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", Mesh, True, data );
+	localColourName = Stg_ComponentFactory_GetString( cf, self->name, "localColour", "Black") ;
+	shadowColourName = Stg_ComponentFactory_GetString( cf, self->name, "shadowColour", "Blue");
+	vacantColourName = Stg_ComponentFactory_GetString( cf, self->name, "vacantColour", "Grey");
+	self->nodeNumbers = Stg_ComponentFactory_GetBool( cf, self->name, "nodeNumbers", False);
+	self->elementNumbers = Stg_ComponentFactory_GetBool( cf, self->name, "elementNumbers", False);
+	self->displayNodes = Stg_ComponentFactory_GetBool( cf, self->name, "displayNodes", False);
+
+
+	lucColour_FromString( &self->localColour, localColourName );
+	lucColour_FromString( &self->shadowColour, shadowColourName );
+	lucColour_FromString( &self->vacantColour, vacantColourName );
+
+   
+	_lucMeshViewer_Init( 
+			self, 
+		        mesh,
+			Stg_ComponentFactory_GetString( cf, self->name, "colour", "black" ),
+			self->localColour,
+			self->shadowColour,
+	                self->vacantColour);
+}
+
+void _lucMeshViewer_Build( void* drawingObject, void* data ) {
+}
+
+void _lucMeshViewer_Initialise( void* drawingObject, void* data ) {
+}
+
+
+void _lucMeshViewer_Execute( void* drawingObject, void* data ) {}
+void _lucMeshViewer_Destroy( void* drawingObject, void* data ) {}
+
+void _lucMeshViewer_Setup( void* drawingObject, void* _context ) {
+	lucMeshViewer*          self                = (lucMeshViewer*)drawingObject;
+	
+	_lucOpenGLDrawingObject_Setup( self, _context );
+	 lucMeshViewer_UpdateVariables( self );
+	
+}
+void lucMeshViewer_UpdateVariables( void* drawingObject ) {
+}	
+
+void _lucMeshViewer_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucMeshViewer*          self          = (lucMeshViewer*)drawingObject;
+	lucCamera*               camera        = viewportInfo->viewport->camera;
+	XYZ                      normal;
+	
+	StGermain_VectorSubtraction( normal, camera->coord, camera->focalPoint, 3 );
+	glNormal3dv(normal);
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucMeshViewer_CleanUp( void* drawingObject, void* context ) {
+	lucMeshViewer*          self          = (lucMeshViewer*)drawingObject;
+	
+	_lucOpenGLDrawingObject_CleanUp( self, context );
+}
+
+void _lucMeshViewer_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucMeshViewer*          self                = (lucMeshViewer*)drawingObject;
+	lucColour              colour;
+
+	/*Geometry*		geometry;*/
+	Node_GlobalIndex	point_I;
+	Edge_Index          edge_I;
+	ElementLayout*      elementLayout;
+	Partition_Index		rank_I;
+
+	/* Stuff to construct the layout */
+	MeshDecomp*		decomp;
+	MeshLayout*		meshLayout;
+	Dimension_Index		numPartitionedDims;
+	Partition_Index		maxRank = 0;
+  	Node_Index nodeCount;
+
+	/*TODO*/     
+	numPartitionedDims = 2;
+	
+	meshLayout =  self->mesh->layout;
+	decomp = meshLayout->decomp;
+
+	/* Make sure "StoreAll" is set so proc 0 can get all info */
+	maxRank = decomp->procsInUse;
+	
+/*TODO	if( rank == 0 ) {
+		glMesh = GLMesh_New();
+		GLMesh_BuildFromMesh( glMesh, meshLayout );
+	}
+*/	
+
+   /* Ensure everything is already freed*/ 
+	_lucMeshViewer_CleanMem( self, NULL );
+	
+	/* Copy the vertices */
+	self->vertCnt = meshLayout->nodeLayout->nodeCount;
+	self->verts = Memory_Alloc_Array( GLdouble, self->vertCnt * 3, "lucMeshViewer->verts" );
+
+	assert( self->verts );
+
+	nodeCount = self->mesh->nodeLocalCount;
+	
+	for( point_I = 0; point_I < nodeCount; point_I++ ) {
+		double* nodeCoord = Mesh_CoordAt( self->mesh, point_I );
+		unsigned	vert_I = point_I * 3;
+			
+		self->verts[vert_I] = (GLdouble)nodeCoord[0];
+		self->verts[vert_I + 1] = (GLdouble)nodeCoord[1];
+		self->verts[vert_I + 2] = (GLdouble)nodeCoord[2];
+
+	}
+	
+	/* Build the edges */
+	elementLayout = meshLayout->elementLayout;
+	self->edgeCnt = elementLayout->edgeCount;
+	self->edges = Memory_Alloc_Array( unsigned, self->edgeCnt * 2, "lucMeshViewer->edges" );
+	assert( self->edges );
+
+	for( edge_I = 0; edge_I < elementLayout->edgeCount; edge_I++ ) {
+		unsigned	glEdge_I = edge_I * 2;
+		Edge		edge;
+		
+		elementLayout->edgeAt( elementLayout, edge_I, edge );
+		self->edges[glEdge_I] = (unsigned)edge[0];
+		self->edges[glEdge_I + 1] = (unsigned)edge[1];
+	}
+	
+	/* Build local edge indices */
+	self->rankCnt = meshLayout->decomp->procsInUse;
+	self->localEdgeCnts = Memory_Alloc_Array( unsigned, self->rankCnt, "lucMeshViewer->localEdgeCnts" );
+	memset( self->localEdgeCnts, 0, sizeof(unsigned) * self->rankCnt );
+	self->localEdges = Memory_Alloc_Array( unsigned*, self->rankCnt, "lucMeshViewer->localEdges" );
+	memset( self->localEdges, 0, sizeof(unsigned*) * self->rankCnt );
+	self->shadowEdgeCnts = Memory_Alloc_Array( unsigned, self->rankCnt, "lucMeshViewer->localEdges" );
+	memset( self->shadowEdgeCnts, 0, sizeof(unsigned) * self->rankCnt );
+	self->shadowEdges = Memory_Alloc_Array( unsigned*, self->rankCnt, "lucMeshViewer->shadowEdges" );
+	memset( self->shadowEdges, 0, sizeof(unsigned*) * self->rankCnt );
+	self->vacantEdgeCnts = Memory_Alloc_Array( unsigned, self->rankCnt, "lucMeshViewer->vacantEdgeCnts" );
+	memset( self->vacantEdgeCnts, 0, sizeof(unsigned) * self->rankCnt );
+	self->vacantEdges = Memory_Alloc_Array( unsigned*, self->rankCnt, "lucMeshViewer->vacantEdges" );
+	memset( self->vacantEdges, 0, sizeof(unsigned*) * self->rankCnt );
+	
+	for( rank_I = 0; rank_I < self->rankCnt; rank_I++ ) {
+		_lucMeshViewer_BuildLocalEdges( self, meshLayout, rank_I );
+		_lucMeshViewer_BuildShadowEdges( self, meshLayout, rank_I );
+		_lucMeshViewer_BuildVacantEdges( self, meshLayout, rank_I );
+	}
+
+	
+	/* Initialise colour value */
+	memcpy( &colour, &self->colour, sizeof(lucColour) );
+	lucColour_SetOpenGLColour( &colour );
+
+	glPointSize( 1.0 );
+	
+	/* Plot the mesh */
+	lucMeshViewer_RenderRank( drawingObject, 0 );
+}
+
+void lucMeshViewer_RenderGlobal( void* drawingObject ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	unsigned	edge_I;
+	unsigned	vert_I;
+	
+	glColor3f( self->localColour.red, self->localColour.green, self->localColour.blue );
+	
+	/* Render vertices */
+	glBegin( GL_POINTS );
+	for( vert_I = 0; vert_I < self->vertCnt * 3; vert_I += 3 ) {
+		glVertex3dv( &self->verts[vert_I] );
+	}
+	glEnd();
+	
+	/* Render edges */
+	glBegin( GL_LINES );
+	for( edge_I = 0; edge_I < self->edgeCnt * 2; edge_I += 2 ) {
+		unsigned	vert_I = self->edges[edge_I] * 3;
+		unsigned	vert_J = self->edges[edge_I + 1] * 3;
+		
+		glVertex3dv( &self->verts[vert_I] );
+		glVertex3dv( &self->verts[vert_J] );
+	}
+	glEnd();
+}
+
+
+
+
+void lucMeshViewer_PrintAllElementsNumber( void* drawingObject, Partition_Index rank ) {
+	lucMeshViewer*	     self = (lucMeshViewer*)drawingObject;
+	Coord                avgCoord;
+	Coord                offset;
+	char                 elementNumString[100];
+	Dimension_Index      dim_I;
+	Node_LocalIndex      node_lI;
+	Node_Index           elNode_I;
+	Element_LocalIndex   element_lI;
+
+
+	glDisable(GL_LIGHTING); /*if the lighting is not disabled, the colour won't appear for the numbers*/
+	glColor3f( self->localColour.red, self->localColour.green, self->localColour.blue );
+
+	/* Prints the element numbers */
+	offset[0] = -0.01;
+	offset[1] = -0.01;
+	offset[2] = 0;
+	for ( element_lI = 0; element_lI < self->mesh->elementLocalCount; element_lI++ ) 
+	{	
+		sprintf( elementNumString, "el%u", element_lI );
+
+		for ( dim_I=0; dim_I < 3; dim_I++) {	
+			avgCoord[dim_I] = 0;
+		}
+		for ( elNode_I=0; elNode_I < self->mesh->elementNodeCountTbl[element_lI]; elNode_I++ ) {
+			node_lI = self->mesh->elementNodeTbl[element_lI][elNode_I];
+			for ( dim_I=0; dim_I < ((HexaEL*)(self->mesh->layout->elementLayout))->dim; dim_I++) {	
+				avgCoord[dim_I] += self->mesh->nodeCoord[node_lI][dim_I];
+			}	
+		}
+		for ( dim_I=0; dim_I < ((HexaEL*)(self->mesh->layout->elementLayout))->dim; dim_I++) {	
+			avgCoord[dim_I] /= (double)self->mesh->elementNodeCountTbl[element_lI];
+		}
+
+		if ( ((HexaEL*)(self->mesh->layout->elementLayout))->dim == 2) {
+			glRasterPos2f( (float)avgCoord[0] + offset[0], (float)avgCoord[1] + offset[1] );		
+		}	
+		else {  
+			glRasterPos3f( (float)avgCoord[0] + offset[0], (float)avgCoord[1] + offset[1],
+				(float)avgCoord[2] + offset[2] );
+		}	
+
+		lucPrintString( elementNumString );
+	}
+	glEnable(GL_LIGHTING);
+
+
+}
+
+void lucMeshViewer_PrintAllNodesNumber( void* drawingObject, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	double*              coord;
+	char                 nodeNumString[100];
+	Node_LocalIndex      node_lI;
+
+	glDisable(GL_LIGHTING); /*if the lighting is not disabled, the colour won't appear for the numbers*/
+	glColor3f( self->localColour.red, self->localColour.green, self->localColour.blue );
+
+	/* Prints the node numbers */
+	for ( node_lI = 0; node_lI < self->mesh->nodeLocalCount; node_lI++ ) 
+	{	
+		sprintf( nodeNumString, "nl%u", node_lI );
+		coord = self->mesh->nodeCoord[node_lI];
+		if ( ((HexaEL*)(self->mesh->layout->elementLayout))->dim == 2)
+			glRasterPos2f( (float)coord[0] + 0.015, (float)coord[1] + 0.015 );		
+		else   
+			glRasterPos3f( (float)coord[0] + 0.015, (float)coord[1] + 0.015, (float)coord[2] + 0.015 );
+
+		lucPrintString( nodeNumString );
+	}
+	glEnable(GL_LIGHTING);
+
+}
+
+
+void lucMeshViewer_ClosestNode( void* self, Coord crd, int* nodeNumber ) {
+	Bool		done;
+        Mesh*		mesh = ((lucMeshViewer*)self)->mesh; 
+	Coord*		nodeCrds = mesh->nodeCoord;
+	unsigned	curNode;
+	unsigned        nDims;
+	
+	nDims  = ((HexaEL*)(mesh->layout->elementLayout))->dim ;
+
+	/* Begin somewhere in the middle. */
+	curNode = mesh->nodeLocalCount / 2;
+
+	if(!mesh->nodeNeighbourCountTbl){
+		Mesh_ActivateNodeNeighbourTbl( mesh ); 
+	}
+
+	/* Loop until we've found closest local node. */
+	do {
+		unsigned	nNbrs = mesh->nodeNeighbourCountTbl[curNode];
+		unsigned*	nbrs = mesh->nodeNeighbourTbl[curNode];
+		double		dist;
+		double		tmp;
+		unsigned	nbr_i, d_i;
+
+		/* Assume we'll be done after this loop. */
+		done = True;
+
+		/* Calc distance squared to current node. */
+		tmp = nodeCrds[curNode][0] - crd[0];
+		dist = tmp * tmp;
+		for( d_i = 1; d_i < nDims; d_i++ ) {
+			tmp = nodeCrds[curNode][d_i] - crd[d_i];
+			dist += tmp * tmp;
+		}
+
+		/* Compare to neighbours. */
+		for( nbr_i = 0; nbr_i < nNbrs; nbr_i++ ) {
+			double	nbrDist;
+
+			/* Just in case... */
+			if( nbrs[nbr_i] >= mesh->nodeLocalCount )
+				continue;
+
+			tmp = nodeCrds[nbrs[nbr_i]][0] - crd[0];
+			nbrDist = tmp * tmp;
+			for( d_i = 1; d_i < nDims; d_i++ ) {
+				tmp = nodeCrds[nbrs[nbr_i]][d_i] - crd[d_i];
+				nbrDist += tmp * tmp;
+			}
+
+			if( nbrDist < dist ) {
+				curNode = nbrs[nbr_i];
+				dist = nbrDist;
+				done = False;
+			}
+		}
+	}
+	while( !done );
+
+	*nodeNumber = curNode;
+}
+
+void lucMeshViewer_PrintNodeNumber( void* drawingObject, Coord coord, int* nodeNumber ) {
+	lucMeshViewer*	     self = (lucMeshViewer*)drawingObject;
+	char                 nodeNumString[100];
+
+	unsigned dim  = ((HexaEL*)(self->mesh->layout->elementLayout))->dim ;
+
+	lucMeshViewer_ClosestNode(self, coord, nodeNumber);
+	
+	glDisable(GL_LIGHTING); /*if the lighting is not disabled, the colour won't appear for the numbers*/
+	glColor3f( self->localColour.red, self->localColour.green, self->localColour.blue );
+
+	/* Prints the node numbers */
+	sprintf( nodeNumString, "nl%u", *nodeNumber );
+	if (dim == 2)
+		glRasterPos2f( (float)coord[0] + 0.015, (float)coord[1] + 0.015 );		
+	else   
+		glRasterPos3f( (float)coord[0] + 0.015, (float)coord[1] + 0.015, (float)coord[2] + 0.015 );
+
+	lucPrintString( nodeNumString );
+}
+
+void lucMeshViewer_FindElementNumber(void* drawingObject, Coord coord, int* elementNumber){
+	Mesh*		mesh = ((lucMeshViewer*)drawingObject)->mesh; 
+	MeshLayout*		mLayout = mesh->layout;
+	ElementLayout*		eLayout = mLayout->elementLayout;
+ 	Element_DomainIndex	elementCoordIn = (unsigned)-1;
+	
+	/* locate which mesh element given coord is in : use inclusive upper boundaries to save
+		the need to use shadow space if possible */
+	if( eLayout->type == ParallelPipedHexaEL_Type ) {
+		elementCoordIn = eLayout->elementWithPoint( eLayout, mLayout->decomp, coord, mesh, 
+							    INCLUSIVE_UPPER_BOUNDARY, 0, NULL );
+	}
+	else {
+		unsigned	cNode;
+ 
+		/* Find closest node to point. */
+		lucMeshViewer_ClosestNode( drawingObject, coord, (int*)&cNode );
+
+		/* Find with hint of incident elements. */
+		elementCoordIn = eLayout->elementWithPoint( eLayout, mLayout->decomp, coord, mesh, 
+							    INCLUSIVE_UPPER_BOUNDARY, 
+							    mesh->nodeElementCountTbl[cNode], mesh->nodeElementTbl[cNode] );
+
+		/* If still no cigar, brute force. */
+		if ( elementCoordIn >= mesh->elementDomainCount ) {
+			elementCoordIn = eLayout->elementWithPoint( eLayout, mLayout->decomp, coord, mesh, 
+								    INCLUSIVE_UPPER_BOUNDARY, 0, NULL );
+		}
+	}
+      	*elementNumber = 	elementCoordIn;
+}
+
+
+void lucMeshViewer_PrintElementNumber( void* drawingObject, Coord coord, int* elementNumber ) {
+	lucMeshViewer*	     self = (lucMeshViewer*)drawingObject;
+	Coord                avgCoord;
+	Coord                offset;
+	char                 elementNumString[100];
+	Dimension_Index      dim_I;
+	Node_LocalIndex      node_lI;
+	Node_Index           elNode_I;
+	Element_LocalIndex   element_lI;
+
+        lucMeshViewer_FindElementNumber(drawingObject, coord, elementNumber);
+
+	glDisable(GL_LIGHTING); /*if the lighting is not disabled, the colour won't appear for the numbers*/
+	glColor3f( self->localColour.red, self->localColour.green, self->localColour.blue );
+
+	/* Prints the element numbers */
+	offset[0] = -0.01;
+	offset[1] = -0.01;
+	offset[2] = 0;
+	element_lI = *elementNumber;
+	
+	sprintf( elementNumString, "el%u", element_lI );
+
+	for ( dim_I=0; dim_I < 3; dim_I++) {	
+		avgCoord[dim_I] = 0;
+	}
+	for ( elNode_I=0; elNode_I < self->mesh->elementNodeCountTbl[element_lI]; elNode_I++ ) {
+		node_lI = self->mesh->elementNodeTbl[element_lI][elNode_I];
+		for ( dim_I=0; dim_I < ((HexaEL*)(self->mesh->layout->elementLayout))->dim; dim_I++) {	
+			avgCoord[dim_I] += self->mesh->nodeCoord[node_lI][dim_I];
+		}	
+	}
+	for ( dim_I=0; dim_I < ((HexaEL*)(self->mesh->layout->elementLayout))->dim; dim_I++) {	
+		avgCoord[dim_I] /= (double)self->mesh->elementNodeCountTbl[element_lI];
+	}
+
+	if ( ((HexaEL*)(self->mesh->layout->elementLayout))->dim == 2) {
+		glRasterPos2f( (float)avgCoord[0] + offset[0], (float)avgCoord[1] + offset[1] );		
+	}	
+	else {  
+		glRasterPos3f( (float)avgCoord[0] + offset[0], (float)avgCoord[1] + offset[1],
+			(float)avgCoord[2] + offset[2] );
+	}	
+
+	lucPrintString( elementNumString );
+	glEnable(GL_LIGHTING);
+
+}
+
+
+
+void lucMeshViewer_RenderLocal( void* drawingObject, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	unsigned	lEdge_I;
+	Node_LocalIndex      node_lI;
+	unsigned	     edge_I;
+	Node_LocalIndex      node1_lI;
+	Node_LocalIndex      node2_lI;
+	double*              coord1;
+	double*              coord2;
+	
+	assert( rank < self->rankCnt );
+	
+	if( !self->localEdgeCnts[rank] || !self->localEdges[rank] ) {
+		return;
+	}
+	
+	glColor3f( self->localColour.red, self->localColour.green, self->localColour.blue );
+	
+	/* Render nodes */
+	if(self->displayNodes){
+		glPointSize( 5 );
+		glBegin( GL_POINTS );
+		for( node_lI = 0; node_lI < self->mesh->nodeLocalCount; node_lI ++ ) {
+			glVertex3dv( self->mesh->nodeCoord[node_lI] );
+		}
+		glEnd();
+	}
+	
+	/* Render edges */
+	glDisable(GL_LIGHTING);
+	glBegin( GL_LINES );
+	for( lEdge_I = 0; lEdge_I < self->localEdgeCnts[rank]; lEdge_I++ ) {
+		edge_I = self->localEdges[rank][lEdge_I] * 2;
+
+		node1_lI = Mesh_NodeMapGlobalToLocal( self->mesh, self->edges[edge_I] );
+		node2_lI = Mesh_NodeMapGlobalToLocal( self->mesh, self->edges[edge_I + 1] );
+
+		coord1 = self->mesh->nodeCoord[node1_lI];	
+		coord2 = self->mesh->nodeCoord[node2_lI];	
+		
+		glVertex3dv( coord1 );
+		glVertex3dv( coord2 );
+	}
+	glEnd();
+	glEnable(GL_LIGHTING);
+
+	/* Prints the element numbers */
+	if(self->elementNumbers)
+		lucMeshViewer_PrintAllElementsNumber(self, rank);
+
+	/* Prints the node numbers */
+	if(self->nodeNumbers)
+		lucMeshViewer_PrintAllNodesNumber(self, rank);
+	
+}
+
+
+void lucMeshViewer_RenderShadow( void* drawingObject, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	unsigned	sEdge_I;
+	
+	assert( rank < self->rankCnt );
+	
+	if( !self->shadowEdgeCnts[rank] || !self->shadowEdges[rank] ) {
+		return;
+	}
+	
+	glColor3f( self->shadowColour.red, self->shadowColour.green, self->shadowColour.blue );
+	
+
+	/* Render edges */
+	glBegin( GL_LINES );
+	for( sEdge_I = 0; sEdge_I < self->shadowEdgeCnts[rank]; sEdge_I++ ) {
+		unsigned	  edge_I = self->shadowEdges[rank][sEdge_I] * 2;
+		Node_DomainIndex  node1_dI = Mesh_NodeMapGlobalToDomain( self->mesh, self->edges[edge_I] );
+		Node_DomainIndex  node2_dI = Mesh_NodeMapGlobalToDomain( self->mesh, self->edges[edge_I + 1] );
+		double*         coord1;
+		double*         coord2;
+
+		coord1 = self->mesh->nodeCoord[node1_dI];
+		coord2 = self->mesh->nodeCoord[node2_dI];
+		
+		glVertex3dv( coord1 );
+		glVertex3dv( coord2 );
+	}
+	glEnd();
+
+	
+}
+
+
+void lucMeshViewer_RenderVacant( void* drawingObject, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	unsigned	     lEdge_I;
+	unsigned	     edge_I;
+	Node_LocalIndex      node1_lI;
+	Node_LocalIndex      node2_lI;
+	double*              coord1;
+	double*              coord2;
+	
+	assert( rank < self->rankCnt );
+	
+	assert( rank < self->rankCnt );
+	
+	if( !self->vacantEdgeCnts || !self->vacantEdgeCnts[rank] || !self->vacantEdges || !self->vacantEdges[rank] ) {
+		return;
+	}
+	
+	glColor3f( self->vacantColour.red, self->vacantColour.green, self->vacantColour.blue );
+	
+	glBegin( GL_LINES );
+	for( lEdge_I = 0; lEdge_I < self->localEdgeCnts[rank]; lEdge_I++ ) {
+		edge_I = self->localEdges[rank][lEdge_I] * 2;
+
+		node1_lI = Mesh_NodeMapGlobalToLocal( self->mesh, self->edges[edge_I] );
+		node2_lI = Mesh_NodeMapGlobalToLocal( self->mesh, self->edges[edge_I + 1] );
+
+		coord1 = self->mesh->nodeCoord[node1_lI];	
+		coord2 = self->mesh->nodeCoord[node2_lI];	
+		
+		glVertex3dv( coord1 );
+		glVertex3dv( coord2 );
+	}
+	glEnd();
+}
+
+
+void lucMeshViewer_RenderRank( void* drawingObject, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	Processor_Index         myRank = self->mesh->layout->decomp->rank;
+
+	if ( rank == myRank ) {
+		lucMeshViewer_RenderLocal( self, myRank );
+		lucMeshViewer_RenderShadow( self, myRank );
+        }
+	else{
+		lucMeshViewer_RenderVacant( self, myRank );
+	}
+}
+
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Private Member functions
+*/
+
+void _lucMeshViewer_BuildLocalEdges( void* meshViewer, MeshLayout* mesh, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)meshViewer;
+	Index		localElementCnt;
+	Index*		localElementSet;
+	int		lEl_i;
+	
+	/* Old code:
+	** IndexSet_GetMembers( mesh->decomp->localElementSets[rank], &localElementCnt, &localElementSet );
+	**
+	** This should really use a StGermain mesh, not the mesh layout. */
+	localElementCnt = mesh->decomp->elementLocalCount;
+	localElementSet = Memory_Alloc_Array( unsigned, localElementCnt, "localElementSet" );
+	for( lEl_i = 0; lEl_i < localElementCnt; lEl_i++ ) {
+		localElementSet[lEl_i] = mesh->decomp->elementMapLocalToGlobal( mesh->decomp, lEl_i );
+	}
+	
+	
+	if( localElementCnt ) {
+		if( self->localEdges[rank] ) {
+			Memory_Free( self->localEdges );
+		}
+		
+		self->localEdgeCnts[rank] = ElementLayout_BuildEdgeSubset( mesh->elementLayout, 
+									   localElementCnt, 
+									   localElementSet, 
+									   &self->localEdges[rank] );
+	}
+	
+	Memory_Free( localElementSet );
+}
+
+
+void _lucMeshViewer_BuildShadowEdges( void* meshViewer, MeshLayout* mesh, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)meshViewer;
+	Index		shadowElementCnt;
+	Index*		shadowElementSet;
+	
+	if( !mesh->decomp->shadowElementSets || !mesh->decomp->shadowElementSets[rank] ) {
+		return;
+	}
+	
+	IndexSet_GetMembers( mesh->decomp->shadowElementSets[rank], &shadowElementCnt, &shadowElementSet );
+	
+	if( shadowElementCnt ) {
+		IndexSet*	localEdgeSet;
+		IndexSet*	shadowEdgeSet;
+		Index		lEdge_I;
+		Index		sEdge_I;
+		
+		localEdgeSet = IndexSet_New( mesh->decomp->elementLayout->edgeCount );
+		for( lEdge_I = 0; lEdge_I < self->localEdgeCnts[rank]; lEdge_I++ ) {
+			IndexSet_Add( localEdgeSet, self->localEdges[rank][lEdge_I] );
+		}
+		
+		if( self->shadowEdges[rank] ) {
+			Memory_Free( self->shadowEdges );
+		}
+		self->shadowEdgeCnts[rank] = ElementLayout_BuildEdgeSubset( mesh->elementLayout, 
+									   shadowElementCnt, 
+									   shadowElementSet, 
+									   &self->shadowEdges[rank] );
+		shadowEdgeSet = IndexSet_New( mesh->decomp->elementLayout->edgeCount );
+		for( sEdge_I = 0; sEdge_I < self->shadowEdgeCnts[rank]; sEdge_I++ ) {
+			if( !IndexSet_IsMember( localEdgeSet, self->shadowEdges[rank][sEdge_I] ) ) {
+				IndexSet_Add( shadowEdgeSet, self->shadowEdges[rank][sEdge_I] );
+			}
+		}
+		
+		Memory_Free( self->shadowEdges[rank] );
+		IndexSet_GetMembers( shadowEdgeSet, &self->shadowEdgeCnts[rank], &self->shadowEdges[rank] );
+		Stg_Class_Delete( shadowEdgeSet );
+	}
+	
+	Memory_Free( shadowElementSet );
+}
+
+
+void _lucMeshViewer_BuildVacantEdges( void* meshViewer, MeshLayout* mesh, Partition_Index rank ) {
+	lucMeshViewer*		self = (lucMeshViewer*)meshViewer;
+	ElementLayout*	elementLayout = mesh->decomp->elementLayout;
+	IndexSet*	domainEdgeSet;
+	IndexSet*	vacantEdgeSet;
+	Index		gEdge_I;
+	
+	domainEdgeSet = IndexSet_New( elementLayout->edgeCount );
+	
+	if( self->localEdgeCnts && self->localEdgeCnts[rank] ) {
+		unsigned	lEdge_I;
+		
+		for( lEdge_I = 0; lEdge_I < self->localEdgeCnts[rank]; lEdge_I++ ) {
+			IndexSet_Add( domainEdgeSet, self->localEdges[rank][lEdge_I] );
+		}
+	}
+	
+	if( self->shadowEdgeCnts && self->shadowEdgeCnts[rank] ) {
+		unsigned	sEdge_I;
+		
+		for( sEdge_I = 0; sEdge_I < self->shadowEdgeCnts[rank]; sEdge_I++ ) {
+			IndexSet_Add( domainEdgeSet, self->shadowEdges[rank][sEdge_I] );
+		}
+	}
+	
+	vacantEdgeSet = IndexSet_New( elementLayout->edgeCount );
+	
+	for( gEdge_I = 0; gEdge_I < elementLayout->edgeCount; gEdge_I++ ) {
+		if( !IndexSet_IsMember( domainEdgeSet, gEdge_I ) ) {
+			IndexSet_Add( vacantEdgeSet, gEdge_I );
+		}
+	}
+	
+	IndexSet_GetMembers( vacantEdgeSet, &self->vacantEdgeCnts[rank], &self->vacantEdges[rank] );
+	
+	Stg_Class_Delete( domainEdgeSet );
+	Stg_Class_Delete( vacantEdgeSet );
+}
+
+void _lucMeshViewer_CleanMem( void* drawingObject, void* data ) {
+	lucMeshViewer*		self = (lucMeshViewer*)drawingObject;
+	
+	if( self->verts ) {
+		Memory_Free( self->verts );
+		self->verts = NULL;
+	}
+	
+	if( self->edges ) {
+		Memory_Free( self->edges );
+		self->edges = NULL;
+	}
+	
+	if( self->localEdgeCnts ) {
+		Memory_Free( self->localEdgeCnts );
+		self->localEdgeCnts = NULL;
+	}
+	
+	if( self->localEdges ) {
+		Partition_Index		rank_I;
+		
+		for( rank_I = 0; rank_I < self->rankCnt; rank_I++ ) {
+			if( self->localEdges[rank_I] ) {
+				Memory_Free( self->localEdges[rank_I] );
+			}
+		}
+		Memory_Free( self->localEdges );
+		self->localEdges = NULL;
+	}
+	
+	if( self->shadowEdgeCnts ) {
+		Memory_Free( self->shadowEdgeCnts );
+		self->shadowEdgeCnts = NULL;
+	}
+	
+	if( self->shadowEdges ) {
+		Partition_Index		rank_I;
+		
+		for( rank_I = 0; rank_I < self->rankCnt; rank_I++ ) {
+			if( self->shadowEdges[rank_I] ) {
+				Memory_Free( self->shadowEdges[rank_I] );
+			}
+		}
+		Memory_Free( self->shadowEdges );
+		self->shadowEdges = NULL;
+	}
+	
+	if( self->vacantEdgeCnts ) {
+		Memory_Free( self->vacantEdgeCnts );
+		self->vacantEdgeCnts = NULL;
+	}
+	
+	if( self->vacantEdges ) {
+		Partition_Index		rank_I;
+		
+		for( rank_I = 0; rank_I < self->rankCnt; rank_I++ ) {
+			if( self->vacantEdges[rank_I] ) {
+				Memory_Free( self->vacantEdges[rank_I] );
+			}
+		}
+		Memory_Free( self->vacantEdges );
+		self->vacantEdges = NULL;
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/MeshViewer.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/MeshViewer.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,146 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucMeshViewer_h__
+#define __lucMeshViewer_h__
+
+	typedef void (lucMeshViewer_PlotParticleFunction) ( void* object, void* context, Particle_Index lParticle_I );
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucMeshViewer_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucMeshViewer \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+	        Mesh*                                             mesh;          \
+		lucMeshViewer_PlotParticleFunction*               _plotParticle;          \
+		/* Other info */ \
+		/* Colour Stuff */ \
+		lucColour                                          colour;                 \
+	        /* Other Stuff */ \
+		/* Stg_Class info */ \
+		unsigned		vertCnt; \
+		/*GLdouble*		verts; */\
+		double*                 verts;\
+		unsigned		edgeCnt; \
+		unsigned*		edges; \
+		unsigned		rankCnt; \
+		unsigned*		localEdgeCnts; \
+		unsigned**		localEdges; \
+		unsigned*		shadowEdgeCnts; \
+		unsigned**		shadowEdges; \
+		unsigned*		vacantEdgeCnts; \
+		unsigned**		vacantEdges; \
+	        lucColour		localColour; \
+		lucColour		shadowColour; \
+		lucColour		vacantColour; \
+		Bool                    nodeNumbers; \
+		Bool                    elementNumbers;\
+		Bool                    displayNodes;
+
+
+	struct lucMeshViewer { __lucMeshViewer };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucMeshViewer* _lucMeshViewer_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,		
+		Name                                               name );
+
+	void _lucMeshViewer_Delete( void* drawingObject ) ;
+	void _lucMeshViewer_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucMeshViewer_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucMeshViewer_DefaultNew( Name name ) ;
+	void _lucMeshViewer_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucMeshViewer_Build( void* drawingObject, void* data ) ;
+	void _lucMeshViewer_Initialise( void* drawingObject, void* data ) ;
+	void _lucMeshViewer_Execute( void* drawingObject, void* data );
+	void _lucMeshViewer_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucMeshViewer_Setup( void* drawingObject, void* _context ) ;
+	void _lucMeshViewer_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucMeshViewer_CleanUp( void* drawingObject, void* context ) ;
+
+	void _lucMeshViewer_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+        void _lucMeshViewer_CleanMem( void* drawingObject, void* data );
+
+	void lucMeshViewer_UpdateVariables( void* drawingObject ) ;
+	
+	void _lucMeshViewer_BuildLocalEdges( void* meshViewer, MeshLayout* mesh, Partition_Index rank ) ;
+	void _lucMeshViewer_BuildShadowEdges( void* meshViewer, MeshLayout* mesh, Partition_Index rank ) ;
+	void _lucMeshViewer_BuildVacantEdges( void* meshViewer, MeshLayout* mesh, Partition_Index rank );
+
+	void lucMeshViewer_RenderGlobal( void* drawingObject );
+	void lucMeshViewer_RenderLocal( void* drawingObject, Partition_Index rank );
+	void lucMeshViewer_RenderShadow( void* drawingObject, Partition_Index rank );
+	void lucMeshViewer_RenderVacant( void* drawingObject, Partition_Index rank );
+	void lucMeshViewer_RenderRank( void* drawingObject, Partition_Index rank );
+
+        void lucMeshViewer_PrintNodeNumber( void* drawingObject, Coord coord, int* nodeNumber );
+	void lucMeshViewer_ClosestNode(void* self, Coord coord, int* NodeNumber);
+	void lucMeshViewer_FindElementNumber(void* self, Coord coord, int* elementNumber); 
+	void lucMeshViewer_PrintElementNumber( void* drawingObject, Coord coord, int* elementNumber );
+
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/MeshViewer.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/MeshViewer.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucMeshViewer</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Allows to diaply a mesh, using different coloutr for the different node categories (local, shadow..)</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">localColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"Black"</param>
+		<param name="Description">Colour used to draw the local nodes</param>
+	</struct>
+	<struct>
+		<param name="Name">shadowColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"Blue"</param>
+		<param name="Description">Colour used to draw the Shadow nodes</param>
+	</struct>
+	<struct>
+		<param name="Name">vacantColour</param>
+		<param name="Type">String</param>
+		<param name="Default">"Grey"</param>
+		<param name="Description">Colour used to draw the vacant nodes</param>
+	</struct>
+	<struct>
+		<param name="Name">nodeNumbers</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If true, all the nodes numbers will be drawn</param>
+	</struct>
+	<struct>
+		<param name="Name">elementNumbers</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">if True, all the element numbers will be drawn</param>
+	</struct>
+	<struct>
+		<param name="Name">displayNodes</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">If true, the nodes will appear as small squares</param>
+	</struct>
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">general colour used if the other ones are not set</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Mesh</param>
+		<param name="Type">Mesh</param>
+		<param name="Description">Mesh to draw</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 191 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/OpenGLDrawingObject.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/OpenGLDrawingObject.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,203 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: OpenGLDrawingObject.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucOpenGLDrawingObject_Type = "lucOpenGLDrawingObject";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucOpenGLDrawingObject* _lucOpenGLDrawingObject_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucOpenGLDrawingObject*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucOpenGLDrawingObject) );
+	self = (lucOpenGLDrawingObject*) _lucDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			name );
+
+	self->_buildDisplayList = _buildDisplayList;
+	
+	return self;
+}
+
+void _lucOpenGLDrawingObject_Init( 
+		lucOpenGLDrawingObject*                            self )
+{
+}
+
+void _lucOpenGLDrawingObject_Delete( void* drawingObject ) {
+	lucOpenGLDrawingObject*  self = (lucOpenGLDrawingObject*)drawingObject;
+
+	_lucDrawingObject_Delete( self );
+}
+
+void _lucOpenGLDrawingObject_Print( void* drawingObject, Stream* stream ) {
+	lucOpenGLDrawingObject*  self = (lucOpenGLDrawingObject*)drawingObject;
+
+	_lucDrawingObject_Print( self, stream );
+
+	Journal_PrintValue( stream, self->displayList );
+}
+
+void* _lucOpenGLDrawingObject_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucOpenGLDrawingObject*  self = (lucOpenGLDrawingObject*)drawingObject;
+	lucOpenGLDrawingObject* newDrawingObject;
+
+	newDrawingObject = _lucDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newDrawingObject->displayList = self->displayList;
+
+	return (void*) newDrawingObject;
+}
+
+
+
+void _lucOpenGLDrawingObject_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucOpenGLDrawingObject*         self               = (lucOpenGLDrawingObject*)drawingObject;
+
+	/* Construct Parent */
+	_lucDrawingObject_Construct( self, cf, data );
+
+	_lucOpenGLDrawingObject_Init( self );
+}
+
+void _lucOpenGLDrawingObject_Build( void* drawingObject, void* data ) {}
+void _lucOpenGLDrawingObject_Initialise( void* drawingObject, void* data ) {}
+void _lucOpenGLDrawingObject_Execute( void* drawingObject, void* data ) {}
+void _lucOpenGLDrawingObject_Destroy( void* drawingObject, void* data ) {}
+
+/* Drawing Object implementations */
+void _lucOpenGLDrawingObject_Setup( void* drawingObject, void* context ) {
+	lucOpenGLDrawingObject*           self            = (lucOpenGLDrawingObject*)drawingObject;
+
+	/* Create OpenGL list */
+	self->displayList = glGenLists( 1 );
+	glNewList( self->displayList, GL_COMPILE);
+
+	/* Run the virtual function for building the display list - 
+	 * this should contain as much of the opengl drawing primitives as possible */
+	lucOpenGLDrawingObject_BuildDisplayList( self, context );
+	
+	/* Tell OpenGL that we've finished creating the list now */
+	glEndList();	
+
+}
+	
+void _lucOpenGLDrawingObject_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucOpenGLDrawingObject*           self          = (lucOpenGLDrawingObject*)drawingObject;
+
+	/* We should make sure that the rendering engine for this window is the lucRenderingEngineGL */
+	Journal_Firewall( 
+			Stg_Class_IsInstance( window->renderingEngine, lucRenderingEngineGL_Type ),
+			self->errorStream,
+			"Error for %s '%s' - This class only works with rendering engines of type %s.\n"
+			"%s '%s' is using a rendering engine of type %s. Please correct this.\n", 
+			self->type, self->name, lucRenderingEngineGL_Type, window->type, window->name, window->renderingEngine->type );
+
+	/* All that we need to do to visualise this object now is to call the display list
+	 * this should have been created in the setup phase */
+	glCallList( self->displayList );
+}
+
+void _lucOpenGLDrawingObject_CleanUp( void* drawingObject, void* _context ) {
+	lucOpenGLDrawingObject*           self          = (lucOpenGLDrawingObject*)drawingObject;
+	
+	glDeleteLists( self->displayList, 1 );
+}
+
+/* Wrappers for virtual functions */
+void lucOpenGLDrawingObject_BuildDisplayList( void* drawingObject, void* context ) {
+	lucOpenGLDrawingObject*           self            = (lucOpenGLDrawingObject*)drawingObject;
+
+	self->_buildDisplayList( self, context );
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/OpenGLDrawingObject.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/OpenGLDrawingObject.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,102 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: OpenGLDrawingObject.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucOpenGLDrawingObject_h__
+#define __lucOpenGLDrawingObject_h__
+	
+	typedef void (lucOpenGLDrawingObject_BuildDisplayListFunction) ( void* object, void* context );
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucOpenGLDrawingObject_Type;
+
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucOpenGLDrawingObject \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucDrawingObject \
+		/* Virtual functions go here */ \
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList;            \
+		/* Other info */\
+		unsigned int                                       displayList;
+
+	struct lucOpenGLDrawingObject { __lucOpenGLDrawingObject };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucOpenGLDrawingObject* _lucOpenGLDrawingObject_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucOpenGLDrawingObject_Delete( void* drawingObject ) ;
+	void _lucOpenGLDrawingObject_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucOpenGLDrawingObject_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void _lucOpenGLDrawingObject_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucOpenGLDrawingObject_Build( void* drawingObject, void* data ) ;
+	void _lucOpenGLDrawingObject_Initialise( void* drawingObject, void* data ) ;
+	void _lucOpenGLDrawingObject_Execute( void* drawingObject, void* data );
+	void _lucOpenGLDrawingObject_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucOpenGLDrawingObject_Setup( void* drawingObject, void* _context ) ;
+	void _lucOpenGLDrawingObject_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucOpenGLDrawingObject_CleanUp( void* drawingObject, void* _context ) ;
+
+	void lucOpenGLDrawingObject_BuildDisplayList( void* drawingObject, void* context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/OpenGLDrawingObject.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/OpenGLDrawingObject.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucOpenGLDrawingObject</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">An abstract class to setup specific things to do with an OpenGL Drawing Object</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarField.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarField.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,248 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarField.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "ScalarFieldCrossSection.h"
+#include "ScalarField.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucScalarField_Type = "lucScalarField";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucScalarField* _lucScalarField_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucScalarField*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucScalarField) );
+	self = (lucScalarField*) _lucScalarFieldCrossSection_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucScalarField_Init( 
+		lucScalarField*                                              self,
+		Bool                                                         cullFace )
+{
+	self->cullFace = cullFace;
+}
+
+void _lucScalarField_Delete( void* drawingObject ) {
+	lucScalarField*  self = (lucScalarField*)drawingObject;
+
+	_lucScalarFieldCrossSection_Delete( self );
+}
+
+void _lucScalarField_Print( void* drawingObject, Stream* stream ) {
+	lucScalarField*  self = (lucScalarField*)drawingObject;
+
+	_lucScalarFieldCrossSection_Print( self, stream );
+}
+
+void* _lucScalarField_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucScalarField*  self = (lucScalarField*)drawingObject;
+	lucScalarField* newDrawingObject;
+
+	newDrawingObject = _lucScalarFieldCrossSection_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucScalarField_DefaultNew( Name name ) {
+	return (void*) _lucScalarField_New(
+		sizeof(lucScalarField),
+		lucScalarField_Type,
+		_lucScalarField_Delete,
+		_lucScalarField_Print,
+		NULL,
+		_lucScalarField_DefaultNew,
+		_lucScalarField_Construct,
+		_lucScalarField_Build,
+		_lucScalarField_Initialise,
+		_lucScalarField_Execute,
+		_lucScalarField_Destroy,
+		_lucScalarField_Setup,
+		_lucScalarField_Draw,
+		_lucScalarField_CleanUp,
+		_lucScalarField_BuildDisplayList,
+		name );
+}
+
+void _lucScalarField_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucScalarField*  self = (lucScalarField*)drawingObject;
+
+	/* Construct Parent */
+	_lucScalarFieldCrossSection_Construct( self, cf, data );
+
+	_lucScalarField_Init( 
+			self, 
+			Stg_ComponentFactory_GetBool( cf, self->name, "cullFace", True ) );
+}
+
+void _lucScalarField_Build( void* drawingObject, void* data ) {
+	lucScalarField*  self = (lucScalarField*)drawingObject;
+
+	/* Call parent function */
+	_lucScalarFieldCrossSection_Build( self, data );
+}
+void _lucScalarField_Initialise( void* drawingObject, void* data ) {
+	lucScalarField*  self = (lucScalarField*)drawingObject;
+
+	/* Call parent function */
+	_lucScalarFieldCrossSection_Initialise( self, data );
+}
+void _lucScalarField_Execute( void* drawingObject, void* data ) {}
+void _lucScalarField_Destroy( void* drawingObject, void* data ) {}
+
+void _lucScalarField_Setup( void* drawingObject, void* _context ) {
+	lucScalarField*          self          = (lucScalarField*)drawingObject;
+	
+	_lucScalarFieldCrossSection_Setup( self, _context );
+}
+	
+void _lucScalarField_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucScalarField*          self          = (lucScalarField*)drawingObject;
+	
+	_lucScalarFieldCrossSection_Draw( self, window, viewportInfo, _context );
+}
+
+void _lucScalarField_CleanUp( void* drawingObject, void* _context ) {
+	lucScalarField*          self          = (lucScalarField*)drawingObject;
+	
+	_lucScalarFieldCrossSection_CleanUp( self, _context );
+}
+
+void _lucScalarField_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucScalarField*          self          = (lucScalarField*)drawingObject;
+	DiscretisationContext*   context       = (DiscretisationContext*) _context;
+	FieldVariable*           fieldVariable = self->fieldVariable;
+	Coord                    min;
+	Coord                    max;
+	Dimension_Index          dim_I;
+
+	/* Scale Colour Map */
+	FieldVariable_GetMinAndMaxGlobalCoords( fieldVariable, min, max );
+
+	/* Crop the size of the cros-section that you wish to draw */
+	for ( dim_I = 0 ; dim_I < fieldVariable->dim ; dim_I++ ) {
+		min[ dim_I ] = MAX( self->minCropValues[ dim_I ], min[ dim_I ]);
+		max[ dim_I ] = MIN( self->maxCropValues[ dim_I ], max[ dim_I ]);
+	}
+
+	
+	if (context->dim == 2) {
+		lucScalarFieldCrossSection_DrawCrossSection( self, min[ K_AXIS ], K_AXIS );
+	}
+	else {
+		if ( self->cullFace ) 
+			glEnable(GL_CULL_FACE);
+	
+		glFrontFace(GL_CCW);
+		lucScalarFieldCrossSection_DrawCrossSection( self, min[ I_AXIS ], I_AXIS );
+		lucScalarFieldCrossSection_DrawCrossSection( self, max[ J_AXIS ], J_AXIS );
+		lucScalarFieldCrossSection_DrawCrossSection( self, min[ K_AXIS ], K_AXIS );
+	
+		glFrontFace(GL_CW);
+		lucScalarFieldCrossSection_DrawCrossSection( self, max[ I_AXIS ], I_AXIS );
+		lucScalarFieldCrossSection_DrawCrossSection( self, min[ J_AXIS ], J_AXIS );
+		lucScalarFieldCrossSection_DrawCrossSection( self, max[ K_AXIS ], K_AXIS );
+
+		glDisable(GL_CULL_FACE);
+	}
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarField.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarField.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarField.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucScalarField_h__
+#define __lucScalarField_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucScalarField_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucScalarField \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucScalarFieldCrossSection \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		Bool                                               cullFace;               \
+
+	struct lucScalarField { __lucScalarField };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucScalarField* _lucScalarField_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucScalarField_Delete( void* drawingObject ) ;
+	void _lucScalarField_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucScalarField_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucScalarField_DefaultNew( Name name ) ;
+	void _lucScalarField_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucScalarField_Build( void* drawingObject, void* data ) ;
+	void _lucScalarField_Initialise( void* drawingObject, void* data ) ;
+	void _lucScalarField_Execute( void* drawingObject, void* data );
+	void _lucScalarField_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucScalarField_Setup( void* drawingObject, void* _context ) ;
+	void _lucScalarField_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucScalarField_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucScalarField_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarField.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarField.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucScalarField</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucScalarFieldCrossSection</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Tiles the side walls of the model with colours derived from the value of a scalar field at the vertex of each tile.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">cullFace</param>
+		<param name="Type">Bool</param>
+		<param name="Default">True</param>
+		<param name="Description">If this is False, all walls of the box will be drawn and you will not be able to see insdie the box. If this is true, only the far walls of the box will be drawn, allowing other things in the box to be visualised. In 2D this feature is ignored.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldCrossSection.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldCrossSection.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,391 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarFieldCrossSection.c 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "ScalarFieldCrossSection.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+#include <ctype.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucScalarFieldCrossSection_Type = "lucScalarFieldCrossSection";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucScalarFieldCrossSection* _lucScalarFieldCrossSection_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucScalarFieldCrossSection*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucScalarFieldCrossSection) );
+	self = (lucScalarFieldCrossSection*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucScalarFieldCrossSection_Init( 
+		lucScalarFieldCrossSection*                                  self,
+		Name                                                         fieldVariableName,
+		lucColourMap*                                                colourMap,
+		IJK                                                          resolution,
+		double                                                       crossSectionValue,
+		Axis                                                         crossSectionAxis,
+		XYZ                                                          minCropValues,
+		XYZ                                                          maxCropValues ) 
+{
+//	self->fieldVariable = fieldVariable;
+	self->fieldVariableName = fieldVariableName;
+	self->colourMap = colourMap;
+	memcpy( self->resolution, resolution, sizeof(IJK) );
+	self->crossSectionValue = crossSectionValue;
+	self->crossSectionAxis = crossSectionAxis;
+	memcpy( self->minCropValues, minCropValues, sizeof(XYZ) );
+	memcpy( self->maxCropValues, maxCropValues, sizeof(XYZ) );
+}
+
+void _lucScalarFieldCrossSection_Delete( void* drawingObject ) {
+	lucScalarFieldCrossSection*  self = (lucScalarFieldCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucScalarFieldCrossSection_Print( void* drawingObject, Stream* stream ) {
+	lucScalarFieldCrossSection*  self = (lucScalarFieldCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucScalarFieldCrossSection_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucScalarFieldCrossSection*  self = (lucScalarFieldCrossSection*)drawingObject;
+	lucScalarFieldCrossSection* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucScalarFieldCrossSection_DefaultNew( Name name ) {
+	return (void*) _lucScalarFieldCrossSection_New(
+		sizeof(lucScalarFieldCrossSection),
+		lucScalarFieldCrossSection_Type,
+		_lucScalarFieldCrossSection_Delete,
+		_lucScalarFieldCrossSection_Print,
+		NULL,
+		_lucScalarFieldCrossSection_DefaultNew,
+		_lucScalarFieldCrossSection_Construct,
+		_lucScalarFieldCrossSection_Build,
+		_lucScalarFieldCrossSection_Initialise,
+		_lucScalarFieldCrossSection_Execute,
+		_lucScalarFieldCrossSection_Destroy,
+		_lucScalarFieldCrossSection_Setup,
+		_lucScalarFieldCrossSection_Draw,
+		_lucScalarFieldCrossSection_CleanUp,
+		_lucScalarFieldCrossSection_BuildDisplayList,
+		name );
+}
+
+void _lucScalarFieldCrossSection_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucScalarFieldCrossSection*     self = (lucScalarFieldCrossSection*)drawingObject;
+	lucColourMap*    colourMap;
+	Index            defaultResolution;
+	IJK              resolution;
+	char             axisChar;
+	double           value               = 0.0;
+	Axis             axis                = 0;
+	Name             crossSectionName;
+	Name             fieldVariableName;
+	XYZ              minCropValues;
+	XYZ              maxCropValues;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	fieldVariableName = Stg_ComponentFactory_GetString( cf, self->name, "FieldVariable", "defaultName" );
+
+	/* This variable is now construct in build phase.
+	   fieldVariable =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "FieldVariable", FieldVariable, True ) ;
+	*/
+
+
+	colourMap = Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap", lucColourMap, True, data ) ;
+
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 128 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+			
+	crossSectionName = Stg_ComponentFactory_GetString( cf, self->name, "crossSection", "" );
+	if ( sscanf( crossSectionName, "%c=%lf", &axisChar, &value ) == 2 ) {
+		if ( toupper( axisChar ) >= 'X' )
+			axis = toupper( axisChar ) - 'X';
+	}
+
+	/* Get Values with which to crop the cross section */
+	minCropValues[ I_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "minCropX", -HUGE_VAL );
+	minCropValues[ J_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "minCropY", -HUGE_VAL );
+	minCropValues[ K_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "minCropZ", -HUGE_VAL );
+	maxCropValues[ I_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "maxCropX", +HUGE_VAL );
+	maxCropValues[ J_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "maxCropY", +HUGE_VAL );
+	maxCropValues[ K_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "maxCropZ", +HUGE_VAL );
+	
+	_lucScalarFieldCrossSection_Init( 
+			self, 
+			fieldVariableName,
+			colourMap,
+			resolution,
+			value,
+			axis,
+			minCropValues,
+			maxCropValues );
+}
+
+void _lucScalarFieldCrossSection_Build( void* drawingObject, void* data ) {
+	lucScalarFieldCrossSection*     self        = (lucScalarFieldCrossSection*)drawingObject;
+	AbstractContext*                context     = Stg_CheckType( data, AbstractContext );
+	Stg_ComponentFactory*           cf          = context->CF;
+	Stream*                         errorStream = Journal_Register( Error_Type, self->type );
+
+	/* HACK - Get pointer to FieldVariable in build phase just to let FieldVariables be created in plugins */
+	self->fieldVariable = Stg_ComponentFactory_ConstructByName( cf, self->fieldVariableName, FieldVariable, True, data ); 
+	Journal_Firewall( self->fieldVariable->fieldComponentCount == 1, errorStream,
+		"Error - in %s(): provided FieldVariable \"%s\" has %u components - but %s Component "
+		"can only visualise FieldVariables with 1 component. Did you mean to visualise the "
+		"magnitude of the given field?\n", __func__, self->fieldVariable->name,
+		self->fieldVariable->fieldComponentCount, self->type );
+}
+
+void _lucScalarFieldCrossSection_Initialise( void* drawingObject, void* data ) {}
+void _lucScalarFieldCrossSection_Execute( void* drawingObject, void* data ) {}
+void _lucScalarFieldCrossSection_Destroy( void* drawingObject, void* data ) {}
+
+void _lucScalarFieldCrossSection_Setup( void* drawingObject, void* _context ) {
+	lucScalarFieldCrossSection*       self            = (lucScalarFieldCrossSection*)drawingObject;
+
+	lucColourMap_CalibrateFromFieldVariable( self->colourMap, self->fieldVariable );
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+	
+void _lucScalarFieldCrossSection_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucScalarFieldCrossSection*       self            = (lucScalarFieldCrossSection*)drawingObject;
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucScalarFieldCrossSection_CleanUp( void* drawingObject, void* _context ) {
+	lucScalarFieldCrossSection*       self            = (lucScalarFieldCrossSection*)drawingObject;
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}
+
+void _lucScalarFieldCrossSection_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucScalarFieldCrossSection*       self            = (lucScalarFieldCrossSection*)drawingObject;
+	lucScalarFieldCrossSection_DrawCrossSection( self, self->crossSectionValue, self->crossSectionAxis );
+}
+
+#define FUDGE_FACTOR 0.0001
+
+void lucScalarFieldCrossSection_DrawCrossSection( void* drawingObject, double crossSectionValue, Axis axis ) {
+	lucScalarFieldCrossSection*       self            = (lucScalarFieldCrossSection*)drawingObject;
+	FieldVariable* fieldVariable = self->fieldVariable;
+	Axis           aAxis;
+	Axis           bAxis;
+	Coord          min;
+	Coord          max;
+	Coord          pos;
+	Coord          interpolationCoord;
+	float          normal[3];
+	Index          aResolution;
+	Index          bResolution;
+	Index          aIndex;
+	Index          bIndex;
+	double         aLength;
+	double         bLength;
+	Dimension_Index dim_I;
+	
+	glDisable(GL_LIGHTING);
+	
+	aAxis = ( axis == I_AXIS ? J_AXIS : I_AXIS );
+	bAxis = ( axis == K_AXIS ? J_AXIS : K_AXIS );
+	
+	aResolution = self->resolution[ aAxis ];
+	bResolution = self->resolution[ bAxis ];
+	
+	Journal_DPrintfL( self->debugStream, 2, 
+			"%s called on field %s, with res[A] as %u, res[B] as %u, axis of cross section as %d, crossSectionValue as %g\n",
+			__func__, fieldVariable->name, aResolution, bResolution, axis, crossSectionValue );
+	
+	FieldVariable_GetMinAndMaxLocalCoords( fieldVariable, min, max );
+	/* Crop the size of the cros-section that you wish to draw */
+	for ( dim_I = 0 ; dim_I < fieldVariable->dim ; dim_I++ ) {
+		min[ dim_I ] = MAX( self->minCropValues[ dim_I ], min[ dim_I ]);
+		max[ dim_I ] = MIN( self->maxCropValues[ dim_I ], max[ dim_I ]);
+	}
+
+	/* Create normal */
+	normal[axis]  = 1.0;
+	normal[aAxis] = 0.0;
+	normal[bAxis] = 0.0;
+	glNormal3fv( normal );
+
+	/* Find position of cross - section */
+	pos[axis] = crossSectionValue;
+
+	aLength = (max[aAxis] - min[aAxis])/(double)aResolution;
+	bLength = (max[bAxis] - min[bAxis])/(double)bResolution;
+
+	Journal_DPrintfL( self->debugStream, 2, "Calculated aLength as %g, bLength as %g\n", aLength, bLength );
+
+	/* Plot a number of tiles with a colour map to represent scalar field */
+	/* OpenGL will interpolate colours within tile */
+	for ( aIndex = 0 ; aIndex < aResolution + 1 ; aIndex++ ) {
+		glBegin(GL_QUAD_STRIP);
+		for ( bIndex = 0 ; bIndex < bResolution + 2 ; bIndex++ ) {
+			/* Get position */
+			pos[ aAxis ] = min[ aAxis ] + (double)aIndex * aLength;
+			pos[ bAxis ] = min[ bAxis ] + (double)bIndex * bLength;
+
+			memcpy( interpolationCoord, pos, sizeof(Coord) );
+
+			if ( pos[ bAxis ] >= max[ bAxis ] ) { 
+				pos[ bAxis ] = max[ bAxis ];
+				interpolationCoord[ bAxis ] = max[ bAxis ] - FUDGE_FACTOR/bLength;
+			}
+			if (pos[ aAxis ] >= max[ aAxis ]) {
+				pos[ aAxis ] = max[ aAxis ];
+				interpolationCoord[ aAxis ] = max[ aAxis ] - FUDGE_FACTOR/aLength;
+			}
+			
+			/* Plot bottom left corner of coloured tile */
+			lucScalarFieldCrossSection_PlotColouredVertex( self, interpolationCoord, pos );
+
+			/* Plot top left corner of coloured tile */
+			pos[ aAxis ] += aLength;
+			if (pos[ aAxis ] >= max[ aAxis ]) {
+				pos[ aAxis ] = max[ aAxis ];
+				interpolationCoord[ aAxis ] = max[ aAxis ] - FUDGE_FACTOR/aLength;
+			}
+			
+			lucScalarFieldCrossSection_PlotColouredVertex( self, interpolationCoord, pos );
+		}
+		glEnd();
+	}
+
+	glEnable(GL_LIGHTING);
+}
+
+Bool lucScalarFieldCrossSection_PlotColouredVertex( void* drawingObject, Coord interpolationCoord, Coord plotCoord ) {
+	lucScalarFieldCrossSection*       self            = (lucScalarFieldCrossSection*)drawingObject;
+	FieldVariable* fieldVariable = self->fieldVariable;
+	lucColourMap*  cmap          = self->colourMap;
+	double         quantity;
+
+	Journal_DPrintfL( self->debugStream, 3, "%s called at interpolationCoord (%g,%g,%g)  - ",
+			__func__, interpolationCoord[0], interpolationCoord[1], interpolationCoord[2] );
+
+	/* Interpolate value to this position */
+	if ( LOCAL == FieldVariable_InterpolateValueAt( fieldVariable, interpolationCoord, &quantity )) {
+		/* Get colour for this value from colour map */
+		lucColourMap_SetOpenGLColourFromValue( cmap, quantity );
+
+		Journal_DPrintfL( self->debugStream, 3, "%s is %g there.\n", fieldVariable->name, quantity );
+		
+		Journal_DPrintfL( self->debugStream, 3, "Plotting At Vertex (%g,%g,%g).\n", 
+				plotCoord[0], plotCoord[1], plotCoord[2]  );
+
+		/* Plot Vertex */
+		glVertex3dv(plotCoord);
+
+		return True;
+	}
+
+	Journal_DPrintfL( self->debugStream, 3, "%s NOT FOUND THERE.\n", fieldVariable->name );
+	/* If value could not be interpolated return warning */
+	return False;
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldCrossSection.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldCrossSection.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,110 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarFieldCrossSection.h 628 2006-10-12 08:23:07Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucScalarFieldCrossSection_h__
+#define __lucScalarFieldCrossSection_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucScalarFieldCrossSection_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucScalarFieldCrossSection \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     fieldVariable;          \
+		Name                                               fieldVariableName;      \
+		lucColourMap*                                      colourMap;              \
+		IJK                                                resolution;             \
+		double                                             crossSectionValue;      \
+		Axis                                               crossSectionAxis;       \
+		XYZ                                                minCropValues;          \
+		XYZ                                                maxCropValues;          \
+
+	struct lucScalarFieldCrossSection { __lucScalarFieldCrossSection };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucScalarFieldCrossSection* _lucScalarFieldCrossSection_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucScalarFieldCrossSection_Delete( void* drawingObject ) ;
+	void _lucScalarFieldCrossSection_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucScalarFieldCrossSection_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucScalarFieldCrossSection_DefaultNew( Name name ) ;
+	void _lucScalarFieldCrossSection_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucScalarFieldCrossSection_Build( void* drawingObject, void* data ) ;
+	void _lucScalarFieldCrossSection_Initialise( void* drawingObject, void* data ) ;
+	void _lucScalarFieldCrossSection_Execute( void* drawingObject, void* data );
+	void _lucScalarFieldCrossSection_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucScalarFieldCrossSection_Setup( void* drawingObject, void* _context ) ;
+	void _lucScalarFieldCrossSection_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucScalarFieldCrossSection_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucScalarFieldCrossSection_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+	void lucScalarFieldCrossSection_DrawCrossSection( void* drawingObject, double crossSectionValue, Axis axis );
+	Bool lucScalarFieldCrossSection_PlotColouredVertex( void* drawingObject, Coord interpolationCoord, Coord plotCoord ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldCrossSection.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldCrossSection.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,109 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucScalarFieldCrossSection</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Tiles a plane with colours derived from the value of a scalar field at the vertex of each tile.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">resolution</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">128</param>
+		<param name="Description">The default value for the resolutionX, resolutionY and resolutionZ. If these values aren't set the sampling grid will be uniform with this number of verticies in each direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionX</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of sample points in the X direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionY</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of sample points in the Y direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionZ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">The number of sample points in the Z direction.</param>
+	</struct>
+	<struct>
+		<param name="Name">crossSection</param>
+		<param name="Type">String</param>
+		<param name="Default">""</param>
+		<param name="Description">The description of the plane in the format: "axis=value". e.g. x=1.5 will descrive a Y-Z plane where the X coordinate is 1.5. The axis is case insensitive.</param>
+	</struct>
+	<struct>
+		<param name="Name">minCropX</param>
+		<param name="Type">Double</param>
+		<param name="Default">-infinity</param>
+		<param name="Description">The minimum x value that it'll plot for this cross-secion.</param>
+	</struct>	
+	<struct>
+		<param name="Name">minCropY</param>
+		<param name="Type">Double</param>
+		<param name="Default">-infinity</param>
+		<param name="Description">The minimum y value that it'll plot for this cross-secion.</param>
+	</struct>	
+	<struct>
+		<param name="Name">minCropZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">-infinity</param>
+		<param name="Description">The minimum z value that it'll plot for this cross-secion.</param>
+	</struct>		
+	<struct>
+		<param name="Name">maxCropX</param>
+		<param name="Type">Double</param>
+		<param name="Default">+infinity</param>
+		<param name="Description">The maximum x value that it'll plot for this cross-secion.</param>
+	</struct>	
+	<struct>
+		<param name="Name">maxCropY</param>
+		<param name="Type">Double</param>
+		<param name="Default">+infinity</param>
+		<param name="Description">The maximum y value that it'll plot for this cross-secion.</param>
+	</struct>	
+	<struct>
+		<param name="Name">maxCropZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">+infinity</param>
+		<param name="Description">The maximum z value that it'll plot for this cross-secion.</param>
+	</struct>		
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FieldVariable</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">The scalar field that you wish visualise with these tiles.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">The colour map to find calculate what colour to use for the scalar value of the field for each sample point.</param>
+	</struct>
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldOnMesh.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMesh.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,240 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarField.c 564 2006-05-12 07:36:25Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "ScalarFieldOnMeshCrossSection.h"
+#include "ScalarFieldOnMesh.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+#ifndef MASTER
+	#define MASTER 0
+#endif
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucScalarFieldOnMesh_Type = "lucScalarFieldOnMesh";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucScalarFieldOnMesh* _lucScalarFieldOnMesh_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucScalarFieldOnMesh*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucScalarFieldOnMesh) );
+	self = (lucScalarFieldOnMesh*) _lucScalarFieldOnMeshCrossSection_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucScalarFieldOnMesh_Init( 
+		lucScalarFieldOnMesh*                                              self,
+		Bool                                                         cullFace )
+{
+	self->cullFace = cullFace;
+}
+
+void _lucScalarFieldOnMesh_Delete( void* drawingObject ) {
+	lucScalarFieldOnMesh*  self = (lucScalarFieldOnMesh*)drawingObject;
+
+	_lucScalarFieldOnMeshCrossSection_Delete( self );
+}
+
+void _lucScalarFieldOnMesh_Print( void* drawingObject, Stream* stream ) {
+	lucScalarFieldOnMesh*  self = (lucScalarFieldOnMesh*)drawingObject;
+
+	_lucScalarFieldOnMeshCrossSection_Print( self, stream );
+}
+
+void* _lucScalarFieldOnMesh_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucScalarFieldOnMesh*  self = (lucScalarFieldOnMesh*)drawingObject;
+	lucScalarFieldOnMesh* newDrawingObject;
+
+	newDrawingObject = _lucScalarFieldOnMeshCrossSection_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucScalarFieldOnMesh_DefaultNew( Name name ) {
+	return (void*) _lucScalarFieldOnMesh_New(
+		sizeof(lucScalarFieldOnMesh),
+		lucScalarFieldOnMesh_Type,
+		_lucScalarFieldOnMesh_Delete,
+		_lucScalarFieldOnMesh_Print,
+		NULL,
+		_lucScalarFieldOnMesh_DefaultNew,
+		_lucScalarFieldOnMesh_Construct,
+		_lucScalarFieldOnMesh_Build,
+		_lucScalarFieldOnMesh_Initialise,
+		_lucScalarFieldOnMesh_Execute,
+		_lucScalarFieldOnMesh_Destroy,
+		_lucScalarFieldOnMesh_Setup,
+		_lucScalarFieldOnMesh_Draw,
+		_lucScalarFieldOnMesh_CleanUp,
+		_lucScalarFieldOnMesh_BuildDisplayList,
+		name );
+}
+
+void _lucScalarFieldOnMesh_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucScalarFieldOnMesh*  self = (lucScalarFieldOnMesh*)drawingObject;
+
+	/* Construct Parent */
+	_lucScalarFieldOnMeshCrossSection_Construct( self, cf, data );
+
+	_lucScalarFieldOnMesh_Init( 
+			self, 
+			Stg_ComponentFactory_GetBool( cf, self->name, "cullFace", True ) );
+}
+
+void _lucScalarFieldOnMesh_Build( void* drawingObject, void* data ) {
+	lucScalarFieldOnMesh*  self = (lucScalarFieldOnMesh*)drawingObject;
+
+	/* Call parent function */
+	_lucScalarFieldOnMeshCrossSection_Build( self, data );
+}
+void _lucScalarFieldOnMesh_Initialise( void* drawingObject, void* data ) {
+	lucScalarFieldOnMesh*  self = (lucScalarFieldOnMesh*)drawingObject;
+
+	/* Call parent function */
+	_lucScalarFieldOnMeshCrossSection_Initialise( self, data );
+}
+void _lucScalarFieldOnMesh_Execute( void* drawingObject, void* data ) {}
+void _lucScalarFieldOnMesh_Destroy( void* drawingObject, void* data ) {}
+
+void _lucScalarFieldOnMesh_Setup( void* drawingObject, void* _context ) {
+	lucScalarFieldOnMesh*          self          = (lucScalarFieldOnMesh*)drawingObject;
+	
+	_lucScalarFieldOnMeshCrossSection_Setup( self, _context );
+}
+	
+void _lucScalarFieldOnMesh_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucScalarFieldOnMesh*          self          = (lucScalarFieldOnMesh*)drawingObject;
+	
+	_lucScalarFieldOnMeshCrossSection_Draw( self, window, viewportInfo, _context );
+}
+
+void _lucScalarFieldOnMesh_CleanUp( void* drawingObject, void* _context ) {
+	lucScalarFieldOnMesh*          self          = (lucScalarFieldOnMesh*)drawingObject;
+	
+	_lucScalarFieldOnMeshCrossSection_CleanUp( self, _context );
+}
+
+void _lucScalarFieldOnMesh_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucScalarFieldOnMesh*     self          = (lucScalarFieldOnMesh*)drawingObject;
+	DiscretisationContext*   context       = (DiscretisationContext*) _context;
+	FieldVariable*           fieldVariable = self->fieldVariable;
+	Coord                    min;
+	Coord                    max;
+
+	/* Scale Colour Map */
+	FieldVariable_GetMinAndMaxGlobalCoords( fieldVariable, min, max );
+	
+	if (context->dim == 2) {
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ K_AXIS ], K_AXIS );
+	}
+	else {
+		if ( self->cullFace ) 
+			glEnable(GL_CULL_FACE);
+	
+		glFrontFace(GL_CCW);
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ I_AXIS ], I_AXIS );
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, max[ J_AXIS ], J_AXIS );
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ K_AXIS ], K_AXIS );
+	
+		glFrontFace(GL_CW);
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, max[ I_AXIS ], I_AXIS );
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ J_AXIS ], J_AXIS );
+		lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, max[ K_AXIS ], K_AXIS );
+
+		glDisable(GL_CULL_FACE);
+	}
+}
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldOnMesh.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMesh.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarField.h 510 2006-02-17 04:33:32Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucScalarFieldOnMesh_h__
+#define __lucScalarFieldOnMesh_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucScalarFieldOnMesh_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucScalarFieldOnMesh \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucScalarFieldOnMeshCrossSection \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		Bool                                               cullFace;               \
+
+	struct lucScalarFieldOnMesh { __lucScalarFieldOnMesh };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucScalarFieldOnMesh* _lucScalarFieldOnMesh_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucScalarFieldOnMesh_Delete( void* drawingObject ) ;
+	void _lucScalarFieldOnMesh_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucScalarFieldOnMesh_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucScalarFieldOnMesh_DefaultNew( Name name ) ;
+	void _lucScalarFieldOnMesh_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucScalarFieldOnMesh_Build( void* drawingObject, void* data ) ;
+	void _lucScalarFieldOnMesh_Initialise( void* drawingObject, void* data ) ;
+	void _lucScalarFieldOnMesh_Execute( void* drawingObject, void* data );
+	void _lucScalarFieldOnMesh_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucScalarFieldOnMesh_Setup( void* drawingObject, void* _context ) ;
+	void _lucScalarFieldOnMesh_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucScalarFieldOnMesh_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucScalarFieldOnMesh_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldOnMesh.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMesh.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucScalarFieldOnMesh</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucScalarFieldOnMeshCrossSection</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">cullFace</param>
+		<param name="Type">Bool</param>
+		<param name="Default">True )</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldOnMeshCrossSection.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,496 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarFieldCrossSection.c 568 2006-06-02 06:21:50Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#ifdef GLUCIFER_USE_PICELLERATOR
+	#include <StgFEM/StgFEM.h>
+	#include <PICellerator/PICellerator.h>
+#endif
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "ScalarFieldOnMeshCrossSection.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+#include <ctype.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucScalarFieldOnMeshCrossSection_Type = "lucScalarFieldOnMeshCrossSection";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucScalarFieldOnMeshCrossSection* _lucScalarFieldOnMeshCrossSection_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name ) 
+{
+	lucScalarFieldOnMeshCrossSection*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucScalarFieldOnMeshCrossSection) );
+	self = (lucScalarFieldOnMeshCrossSection*) _lucOpenGLDrawingObject_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			name );
+	
+	return self;
+}
+
+void _lucScalarFieldOnMeshCrossSection_Init( 
+		lucScalarFieldOnMeshCrossSection*                                  self,
+		Name                                                         fieldVariableName,
+		lucColourMap*                                                colourMap,
+		IJK                                                          resolution,
+		double                                                       crossSectionValue,
+		Axis                                                         crossSectionAxis,
+		XYZ                                                          minCropValues,
+		XYZ                                                          maxCropValues ) 
+{
+//	self->fieldVariable = fieldVariable;
+	self->fieldVariableName = fieldVariableName;
+	self->colourMap = colourMap;
+	memcpy( self->resolution, resolution, sizeof(IJK) );
+	self->crossSectionValue = crossSectionValue;
+	self->crossSectionAxis = crossSectionAxis;
+	memcpy( self->minCropValues, minCropValues, sizeof(XYZ) );
+	memcpy( self->maxCropValues, maxCropValues, sizeof(XYZ) );
+}
+
+void _lucScalarFieldOnMeshCrossSection_Delete( void* drawingObject ) {
+	lucScalarFieldOnMeshCrossSection*  self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Delete( self );
+}
+
+void _lucScalarFieldOnMeshCrossSection_Print( void* drawingObject, Stream* stream ) {
+	lucScalarFieldOnMeshCrossSection*  self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+
+	_lucOpenGLDrawingObject_Print( self, stream );
+}
+
+void* _lucScalarFieldOnMeshCrossSection_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucScalarFieldOnMeshCrossSection*  self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	lucScalarFieldOnMeshCrossSection* newDrawingObject;
+
+	newDrawingObject = _lucOpenGLDrawingObject_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucScalarFieldOnMeshCrossSection_DefaultNew( Name name ) {
+	return (void*) _lucScalarFieldOnMeshCrossSection_New(
+		sizeof(lucScalarFieldOnMeshCrossSection),
+		lucScalarFieldOnMeshCrossSection_Type,
+		_lucScalarFieldOnMeshCrossSection_Delete,
+		_lucScalarFieldOnMeshCrossSection_Print,
+		NULL,
+		_lucScalarFieldOnMeshCrossSection_DefaultNew,
+		_lucScalarFieldOnMeshCrossSection_Construct,
+		_lucScalarFieldOnMeshCrossSection_Build,
+		_lucScalarFieldOnMeshCrossSection_Initialise,
+		_lucScalarFieldOnMeshCrossSection_Execute,
+		_lucScalarFieldOnMeshCrossSection_Destroy,
+		_lucScalarFieldOnMeshCrossSection_Setup,
+		_lucScalarFieldOnMeshCrossSection_Draw,
+		_lucScalarFieldOnMeshCrossSection_CleanUp,
+		_lucScalarFieldOnMeshCrossSection_BuildDisplayList,
+		name );
+}
+
+void _lucScalarFieldOnMeshCrossSection_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucScalarFieldOnMeshCrossSection*     self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	lucColourMap*    colourMap;
+	Index            defaultResolution;
+	IJK              resolution;
+	char             axisChar;
+	double           value               = 0.0;
+	Axis             axis                = 0;
+	Name             crossSectionName;
+	Name             fieldVariableName;
+	XYZ              minCropValues;
+	XYZ              maxCropValues;
+
+	/* Construct Parent */
+	_lucOpenGLDrawingObject_Construct( self, cf, data );
+
+	fieldVariableName = Stg_ComponentFactory_GetString( cf, self->name, "FieldVariable", "defaultName" );
+	
+	/* This variable is now constructed in the build phase 	
+	fieldVariable =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "FieldVariable", FieldVariable, True ) ;
+	*/
+	
+	colourMap = Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap", lucColourMap, True, data );
+
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 128 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+			
+	crossSectionName = Stg_ComponentFactory_GetString( cf, self->name, "crossSection", "" );
+	if ( sscanf( crossSectionName, "%c=%lf", &axisChar, &value ) == 2 ) {
+		if ( toupper( axisChar ) >= 'X' )
+			axis = toupper( axisChar ) - 'X';
+	}
+
+	/* Get Values with which to crop the cross section */
+	minCropValues[ I_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "minCropX", -HUGE_VAL );
+	minCropValues[ J_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "minCropY", -HUGE_VAL );
+	minCropValues[ K_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "minCropZ", -HUGE_VAL );
+	maxCropValues[ I_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "maxCropX", +HUGE_VAL );
+	maxCropValues[ J_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "maxCropY", +HUGE_VAL );
+	maxCropValues[ K_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "maxCropZ", +HUGE_VAL );
+	
+	_lucScalarFieldOnMeshCrossSection_Init( 
+			self, 
+			fieldVariableName,
+			colourMap,
+			resolution,
+			value,
+			axis,
+			minCropValues,
+			maxCropValues );
+}
+
+void _lucScalarFieldOnMeshCrossSection_Build( void* drawingObject, void* data ) {
+	lucScalarFieldOnMeshCrossSection*     self    = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	AbstractContext*                context = Stg_CheckType( data, AbstractContext );
+	Stg_ComponentFactory*           cf      = context->CF;
+
+	/* HACK - Get pointer to FieldVariable in build phase just to let FieldVariables be created in plugins */
+	self->fieldVariable = Stg_ComponentFactory_ConstructByName( cf, self->fieldVariableName, FieldVariable, True, 0 /* dummy */ );
+}
+
+void _lucScalarFieldOnMeshCrossSection_Initialise( void* drawingObject, void* data ) {}
+void _lucScalarFieldOnMeshCrossSection_Execute( void* drawingObject, void* data ) {}
+void _lucScalarFieldOnMeshCrossSection_Destroy( void* drawingObject, void* data ) {}
+
+void _lucScalarFieldOnMeshCrossSection_Setup( void* drawingObject, void* _context ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+
+	lucColourMap_CalibrateFromFieldVariable( self->colourMap, self->fieldVariable );
+	_lucOpenGLDrawingObject_Setup( self, _context );
+}
+	
+void _lucScalarFieldOnMeshCrossSection_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	_lucOpenGLDrawingObject_Draw( self, window, viewportInfo, _context );
+}
+
+
+void _lucScalarFieldOnMeshCrossSection_CleanUp( void* drawingObject, void* _context ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	_lucOpenGLDrawingObject_CleanUp( self, _context );
+}
+
+void _lucScalarFieldOnMeshCrossSection_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, self->crossSectionValue, self->crossSectionAxis );
+}
+
+#define FUDGE_FACTOR 0.0001
+
+Bool lucScalarFieldOnMeshCrossSection_IsInList(int nb, int *list, int nbList){
+	int i;
+	for (i=0; i<nbList; i++){
+		if(nb == list[i])
+			return True;
+	}
+	return False;
+}
+
+void lucScalarFieldOnMeshCrossSection_DrawCrossSection( void* drawingObject, double crossSectionValue, Axis axis ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	FieldVariable* fieldVariable = self->fieldVariable;
+	Axis           aAxis;
+	Axis           bAxis;
+	Coord          min;
+	Coord          max;
+	Coord          pos;
+	Coord          interpolationCoord;
+	float          normal[3];
+	Index          aResolution;
+	Index          bResolution;
+	Index          aIndex;
+	Index          bIndex;
+	double         aLength;
+	double         bLength;
+	Dimension_Index dim_I;
+	
+	Node_LocalIndex      node_lI;
+	Node_Index           elNode_I;
+	Element_LocalIndex   element_lI;
+
+	
+	glDisable(GL_LIGHTING);
+	
+	aAxis = ( axis == I_AXIS ? J_AXIS : I_AXIS );
+	bAxis = ( axis == K_AXIS ? J_AXIS : K_AXIS );
+	
+	aResolution = self->resolution[ aAxis ];
+	bResolution = self->resolution[ bAxis ];
+	
+	Journal_DPrintfL( self->debugStream, 2, 
+			"%s called on field %s, with res[A] as %u, res[B] as %u, axis of cross section as %d, crossSectionValue as %g\n",
+			__func__, fieldVariable->name, aResolution, bResolution, axis, crossSectionValue );
+	
+	FieldVariable_GetMinAndMaxLocalCoords( fieldVariable, min, max );
+	/* Crop the size of the cros-section that you wish to draw */
+	for ( dim_I = 0 ; dim_I < fieldVariable->dim ; dim_I++ ) {
+		min[ dim_I ] = MAX( self->minCropValues[ dim_I ], min[ dim_I ]);
+		max[ dim_I ] = MIN( self->maxCropValues[ dim_I ], max[ dim_I ]);
+	}
+
+	/* Create normal */
+	normal[axis]  = 1.0;
+	normal[aAxis] = 0.0;
+	normal[bAxis] = 0.0;
+	glNormal3fv( normal );
+
+	/* Find position of cross - section */
+	pos[axis] = crossSectionValue;
+
+	aLength = (max[aAxis] - min[aAxis])/(double)aResolution;
+	bLength = (max[bAxis] - min[bAxis])/(double)bResolution;
+
+	Journal_DPrintfL( self->debugStream, 2, "Calculated aLength as %g, bLength as %g\n", aLength, bLength );
+
+        /* Plots element per element from node to node in order to respect the 
+	geometry of a deforming mesh */
+
+	Mesh *mesh = (Mesh*)( ( (FeVariable*)(self->fieldVariable) )->feMesh);
+  #ifdef TEST
+	/* Get min max of fieldVariable... This is for test purpose */
+ 
+	float minVal = FieldVariable_GetMinGlobalFieldMagnitude( fieldVariable );
+	float maxVal =  FieldVariable_GetMaxGlobalFieldMagnitude( fieldVariable );
+	printf(" minVal is %f maxval is %f\n", minVal, maxVal);
+	printf("mesh->nodeLocalCount is %d\n", mesh->nodeLocalCount);
+	float ninterval = (maxVal - minVal) / (mesh->nodeLocalCount);
+	float myVal = minVal;
+
+	double* displayVal = Memory_Alloc(double, mesh->nodeLocalCount, "ScalarField_mesh->nodeLocalCount");
+	int i;
+	int k;
+
+	int minList[15]= {0,5,10,15,20, 2, 7, 12,17,22, 4,9,14,19,24};
+	int maxList[10] = {1,6,11,16,21,3,8,13,18,23};
+
+	
+	for(i = 0; i< mesh->nodeLocalCount; i++){
+	
+		if( lucScalarFieldOnMeshCrossSection_IsInList(i, minList, 15) ){
+			//displayVal[i] = minVal + i*ninterval;
+			displayVal[i] = minVal ;
+		}
+		else{	
+			displayVal[i] = maxVal;
+		}
+
+	}
+	#endif
+
+	
+	 /* TODO: The elements could have nodes insides...... !!!*/
+	#define NORMAL_LUCSCALARFIELD_BEHAVIOUR
+	#ifdef NORMAL_LUCSCALARFIELD_BEHAVIOUR
+	for ( element_lI = 0; element_lI < mesh->elementLocalCount; element_lI++ ) {
+		/* Normal general case, the element can have whatever number of nodes */
+		glBegin(GL_POLYGON);
+			for ( elNode_I=0; elNode_I < mesh->elementNodeCountTbl[element_lI]; elNode_I++ ) {
+				node_lI = mesh->elementNodeTbl[element_lI][elNode_I];
+				//printf("elNode_I is %d node_lI is %d  displayVal[node_lI] is %f \n", elNode_I, node_lI, displayVal[node_lI]);
+			
+				// Should be there when no test
+				memcpy( interpolationCoord, mesh->nodeCoord[node_lI], sizeof(Coord) );
+				
+				// Plot the node 
+				lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->nodeCoord[node_lI]);
+
+				#ifdef TEST
+				// Plot the node 
+			//	lucScalarFieldOnMeshCrossSection_PlotTestColouredVertex( self, displayVal[node_lI], mesh->nodeCoord[node_lI]);
+				#endif
+			}
+		glEnd();
+	}
+	#endif
+
+     	#ifdef LUC_SCALAR_FIELD_PLOTS_SQUAD_STRIP
+	Node_LocalIndex      node_0;
+	Node_LocalIndex      node_1;
+	Node_LocalIndex      node_2;
+	Node_LocalIndex      node_3;
+
+	/** testing the quad_strip way --- ASSUMES only 4 nodes per element */
+	/* checking that there is 4 nodes per element - If yes, the quad strips can be used */
+	if( mesh->elementNodeCountTbl[element_lI] == 4 ){
+		glBegin(GL_QUAD_STRIP);
+			/* The nodes are for 10, 10 msh for instance instance 0,1,10,9 We want to display 0,9 
+			and 1,10 for the quads, so display node 0,3,1,2 */
+			
+			node_0 = mesh->elementNodeTbl[element_lI][0];
+			node_1 = mesh->elementNodeTbl[element_lI][3];
+			node_2 = mesh->elementNodeTbl[element_lI][1];
+			node_3 = mesh->elementNodeTbl[element_lI][2];
+							
+			memcpy( interpolationCoord, mesh->nodeCoord[node_0], sizeof(Coord) );
+			lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->nodeCoord[node_0]);
+			
+			memcpy( interpolationCoord, mesh->nodeCoord[node_1], sizeof(Coord) ); 
+			lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->nodeCoord[node_1]);
+			
+			memcpy( interpolationCoord, mesh->nodeCoord[node_2], sizeof(Coord) );
+			lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->nodeCoord[node_2]);
+			
+			memcpy( interpolationCoord, mesh->nodeCoord[node_3], sizeof(Coord) );
+			lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->nodeCoord[node_3]);
+		
+		glEnd();
+      	}
+	#endif
+	glEnable(GL_LIGHTING);
+}
+
+
+
+
+Bool lucScalarFieldOnMeshCrossSection_PlotTestColouredVertex( void* drawingObject, double quantity, Coord plotCoord ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	FieldVariable* fieldVariable = self->fieldVariable;
+	lucColourMap*  cmap          = self->colourMap;
+	
+	
+//	if ( LOCAL == FieldVariable_InterpolateValueAt( fieldVariable, interpolationCoord, &quantity )) {
+		/* Get colour for this value from colour map */
+		//printf("quantity is : %f\n ", quantity);
+		
+		lucColourMap_SetOpenGLColourFromValue( cmap, quantity );
+
+	//	Journal_DPrintfL( self->debugStream, 3, "%s is %g there.\n", fieldVariable->name, quantity );
+		
+	//	Journal_DPrintfL( self->debugStream, 3, "Plotting At Vertex (%g,%g,%g).\n", 
+	//			plotCoord[0], plotCoord[1], plotCoord[2]  );
+
+		/* Plot Vertex */
+		glVertex3dv(plotCoord);
+
+		return True;
+//	}
+
+	Journal_DPrintfL( self->debugStream, 3, "%s NOT FOUND THERE.\n", fieldVariable->name );
+	/* If value could not be interpolated return warning */
+	return False;
+}
+
+
+Bool lucScalarFieldOnMeshCrossSection_PlotColouredVertex( void* drawingObject, Coord interpolationCoord, Coord plotCoord ) {
+	lucScalarFieldOnMeshCrossSection*       self            = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+	FieldVariable* fieldVariable = self->fieldVariable;
+	lucColourMap*  cmap          = self->colourMap;
+	double         quantity;
+
+	Journal_DPrintfL( self->debugStream, 3, "%s called at interpolationCoord (%g,%g,%g)  - ",
+			__func__, interpolationCoord[0], interpolationCoord[1], interpolationCoord[2] );
+
+
+	/* Interpolate value to this position */
+	if ( LOCAL == FieldVariable_InterpolateValueAt( fieldVariable, interpolationCoord, &quantity )) {
+		/* Get colour for this value from colour map */
+		lucColourMap_SetOpenGLColourFromValue( cmap, quantity );
+
+		Journal_DPrintfL( self->debugStream, 3, "%s is %g there.\n", fieldVariable->name, quantity );
+		
+		Journal_DPrintfL( self->debugStream, 3, "Plotting At Vertex (%g,%g,%g).\n", 
+				plotCoord[0], plotCoord[1], plotCoord[2]  );
+
+		/* Plot Vertex */
+		glVertex3dv(plotCoord);
+
+		return True;
+	}
+
+	Journal_DPrintfL( self->debugStream, 3, "%s NOT FOUND THERE.\n", fieldVariable->name );
+	/* If value could not be interpolated return warning */
+	return False;
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldOnMeshCrossSection.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,110 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: ScalarFieldCrossSection.h 568 2006-06-02 06:21:50Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucScalarFieldOnMeshCrossSection_h__
+#define __lucScalarFieldOnMeshCrossSection_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucScalarFieldOnMeshCrossSection_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucScalarFieldOnMeshCrossSection \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucOpenGLDrawingObject \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		FieldVariable*                                     fieldVariable;          \
+		Name                                               fieldVariableName;      \
+		lucColourMap*                                      colourMap;              \
+		IJK                                                resolution;             \
+		double                                             crossSectionValue;      \
+		Axis                                               crossSectionAxis;       \
+		XYZ                                                minCropValues;          \
+		XYZ                                                maxCropValues;          \
+
+	struct lucScalarFieldOnMeshCrossSection { __lucScalarFieldOnMeshCrossSection };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucScalarFieldOnMeshCrossSection* _lucScalarFieldOnMeshCrossSection_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		Name                                               name );
+
+	void _lucScalarFieldOnMeshCrossSection_Delete( void* drawingObject ) ;
+	void _lucScalarFieldOnMeshCrossSection_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucScalarFieldOnMeshCrossSection_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucScalarFieldOnMeshCrossSection_DefaultNew( Name name ) ;
+	void _lucScalarFieldOnMeshCrossSection_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucScalarFieldOnMeshCrossSection_Build( void* drawingObject, void* data ) ;
+	void _lucScalarFieldOnMeshCrossSection_Initialise( void* drawingObject, void* data ) ;
+	void _lucScalarFieldOnMeshCrossSection_Execute( void* drawingObject, void* data );
+	void _lucScalarFieldOnMeshCrossSection_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucScalarFieldOnMeshCrossSection_Setup( void* drawingObject, void* _context ) ;
+	void _lucScalarFieldOnMeshCrossSection_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucScalarFieldOnMeshCrossSection_CleanUp( void* drawingObject, void* _context ) ;
+
+	void _lucScalarFieldOnMeshCrossSection_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+	void lucScalarFieldOnMeshCrossSection_DrawCrossSection( void* drawingObject, double crossSectionValue, Axis axis );
+	Bool lucScalarFieldOnMeshCrossSection_PlotColouredVertex( void* drawingObject, Coord interpolationCoord, Coord plotCoord ) ;
+
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucScalarFieldOnMeshCrossSection</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">FieldVariable</param>
+		<param name="Type">String</param>
+		<param name="Default">"defaultName"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolution</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">128</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionX</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionY</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">resolutionZ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">crossSection</param>
+		<param name="Type">String</param>
+		<param name="Default">""</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">minCropX</param>
+		<param name="Type">Double</param>
+		<param name="Default">-HUGE_VAL</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">minCropY</param>
+		<param name="Type">Double</param>
+		<param name="Default">-HUGE_VAL</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">minCropZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">-HUGE_VAL</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">maxCropX</param>
+		<param name="Type">Double</param>
+		<param name="Default">+HUGE_VAL</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">maxCropY</param>
+		<param name="Type">Double</param>
+		<param name="Default">+HUGE_VAL</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">maxCropZ</param>
+		<param name="Type">Double</param>
+		<param name="Default">+HUGE_VAL</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FieldVariable</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 199 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 200 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">self->fieldVariableName</param>
+		<param name="Type">FieldVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 238 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmRGBColourViewer.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmRGBColourViewer.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,311 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "SwarmViewerBase.h"
+#include "SwarmViewer.h"
+#include "SwarmRGBColourViewer.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucSwarmRGBColourViewer_Type = "lucSwarmRGBColourViewer";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucSwarmRGBColourViewer* _lucSwarmRGBColourViewer_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		lucSwarmViewerBase_PlotParticleFunction*           _plotParticle,
+		lucSwarmViewerBase_SetParticleColourFunction*      _setParticleColour,
+		Name                                               name ) 
+{
+	lucSwarmRGBColourViewer*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucSwarmRGBColourViewer) );
+	self = (lucSwarmRGBColourViewer*) _lucSwarmViewer_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,	
+			_plotParticle,
+			_setParticleColour,
+			name );
+
+	return self;
+}
+
+void _lucSwarmRGBColourViewer_Init( 
+		lucSwarmRGBColourViewer*                                     self,
+		Name                                                         colourRedVariableName,
+		Name                                                         colourGreenVariableName,
+		Name                                                         colourBlueVariableName)
+{
+	self->colourRedVariableName           = colourRedVariableName;
+	self->colourGreenVariableName         = colourGreenVariableName;
+	self->colourBlueVariableName          = colourBlueVariableName;
+}
+
+void _lucSwarmRGBColourViewer_Delete( void* drawingObject ) {
+	lucSwarmRGBColourViewer*  self = (lucSwarmRGBColourViewer*)drawingObject;
+
+	_lucSwarmViewer_Delete( self );
+}
+
+void _lucSwarmRGBColourViewer_Print( void* drawingObject, Stream* stream ) {
+	lucSwarmRGBColourViewer*  self = (lucSwarmRGBColourViewer*)drawingObject;
+
+	_lucSwarmViewer_Print( self, stream );
+}
+
+void* _lucSwarmRGBColourViewer_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucSwarmRGBColourViewer*  self = (lucSwarmRGBColourViewer*)drawingObject;
+	lucSwarmRGBColourViewer* newDrawingObject;
+
+	newDrawingObject = _lucSwarmViewer_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucSwarmRGBColourViewer_DefaultNew( Name name ) {
+	return (void*) _lucSwarmRGBColourViewer_New(
+		sizeof(lucSwarmRGBColourViewer),
+		lucSwarmRGBColourViewer_Type,
+		_lucSwarmRGBColourViewer_Delete,
+		_lucSwarmRGBColourViewer_Print,
+		NULL,
+		_lucSwarmRGBColourViewer_DefaultNew,
+		_lucSwarmRGBColourViewer_Construct,
+		_lucSwarmRGBColourViewer_Build,
+		_lucSwarmRGBColourViewer_Initialise,
+		_lucSwarmRGBColourViewer_Execute,
+		_lucSwarmRGBColourViewer_Destroy,
+		_lucSwarmRGBColourViewer_Setup,
+		_lucSwarmRGBColourViewer_Draw,
+		_lucSwarmRGBColourViewer_CleanUp,
+		_lucSwarmRGBColourViewer_BuildDisplayList,
+		_lucSwarmViewer_PlotParticle,
+		_lucSwarmRGBColourViewer_SetParticleColour,
+		name );
+}
+
+void _lucSwarmRGBColourViewer_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucSwarmRGBColourViewer*         self = (lucSwarmRGBColourViewer*)drawingObject;
+	Name                    colourRedVariableName;
+	Name                    colourGreenVariableName;
+	Name                    colourBlueVariableName;
+
+	/* Construct Parent */
+	_lucSwarmViewer_Construct( self, cf, data );
+
+	colourRedVariableName = Stg_ComponentFactory_GetString( cf, self->name, "ColourRedVariable", "" );
+	colourGreenVariableName = Stg_ComponentFactory_GetString( cf, self->name, "ColourGreenVariable", "" );
+	colourBlueVariableName = Stg_ComponentFactory_GetString( cf, self->name, "ColourBlueVariable", "" );
+	
+	_lucSwarmRGBColourViewer_Init( 
+			self, 
+			colourRedVariableName, 
+			colourGreenVariableName, 
+			colourBlueVariableName );
+}
+
+void _lucSwarmRGBColourViewer_Build( void* drawingObject, void* data ) {}
+
+void _lucSwarmRGBColourViewer_Initialise( void* drawingObject, void* data ) {
+	lucSwarmRGBColourViewer*          self                   = (lucSwarmRGBColourViewer*)drawingObject;
+	SwarmVariable_Register*  swarmVariable_Register = self->swarm->swarmVariable_Register;
+	Stream*                  errorStr               = Journal_Register( Error_Type, self->type );
+
+	_lucSwarmViewer_Initialise( self, data );
+
+	if ( 0 != strcmp( self->colourRedVariableName, "" ) ) {
+		self->colourRedVariable  = SwarmVariable_Register_GetByName( swarmVariable_Register, self->colourRedVariableName );
+		Journal_Firewall( self->colourRedVariable != NULL, errorStr,
+					"Error - for gLucifer drawing object \"%s\" - in %s(): colour Variable name given was \"%s\", "
+					"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+					self->name, __func__, self->colourRedVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->colourRedVariable, data, False );
+		Stg_Component_Initialise( self->colourRedVariable, data, False );
+
+	}
+
+	if ( 0 != strcmp( self->colourGreenVariableName, "" ) ) {
+		self->colourGreenVariable  = SwarmVariable_Register_GetByName( swarmVariable_Register, self->colourGreenVariableName );
+		Journal_Firewall( self->colourGreenVariable != NULL, errorStr,
+					"Error - for gLucifer drawing object \"%s\" - in %s(): colour Variable name given was \"%s\", "
+					"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+					self->name, __func__, self->colourGreenVariableName, self->swarm->name );
+	
+		Stg_Component_Build( self->colourGreenVariable, data, False );
+		Stg_Component_Initialise( self->colourGreenVariable, data, False );
+	}
+	
+	if ( 0 != strcmp( self->colourBlueVariableName, "" ) ) {
+		self->colourBlueVariable  = SwarmVariable_Register_GetByName( swarmVariable_Register, self->colourBlueVariableName );
+		Journal_Firewall( self->colourBlueVariable != NULL, errorStr,
+					"Error - for gLucifer drawing object \"%s\" - in %s(): colour Variable name given was \"%s\", "
+					"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+					self->name, __func__, self->colourBlueVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->colourBlueVariable, data, False );
+		Stg_Component_Initialise( self->colourBlueVariable, data, False );
+	}
+
+}
+
+
+void _lucSwarmRGBColourViewer_Execute( void* drawingObject, void* data ) {}
+void _lucSwarmRGBColourViewer_Destroy( void* drawingObject, void* data ) {}
+
+void _lucSwarmRGBColourViewer_Setup( void* drawingObject, void* _context ) {
+	lucSwarmRGBColourViewer*          self                = (lucSwarmRGBColourViewer*)drawingObject;
+	
+	lucSwarmRGBColourViewer_UpdateVariables( self );
+		
+	_lucSwarmViewer_Setup( self, _context );
+}
+
+void _lucSwarmRGBColourViewer_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	_lucSwarmViewer_Draw( drawingObject, window, viewportInfo, _context );
+}
+
+
+void _lucSwarmRGBColourViewer_CleanUp( void* drawingObject, void* context ) {
+	_lucSwarmViewer_CleanUp( drawingObject, context );
+}
+
+void _lucSwarmRGBColourViewer_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucSwarmRGBColourViewer*          self                = (lucSwarmRGBColourViewer*)drawingObject;
+	
+	_lucSwarmViewer_BuildDisplayList( self, _context );
+}
+
+void _lucSwarmRGBColourViewer_SetParticleColour( void* drawingObject, void* _context, Particle_Index lParticle_I, lucColour* colour ) {
+	lucSwarmRGBColourViewer*          self                = (lucSwarmRGBColourViewer*)drawingObject;
+	double                   colourValueRed        = 0.0;
+	double                   colourValueGreen      = 0.0;
+	double                   colourValueBlue       = 0.0;
+
+	/* Get red colour */
+	if ( self->colourRedVariable){
+		SwarmVariable_ValueAt( self->colourRedVariable, lParticle_I, &colourValueRed );
+		(self->colour).red = colourValueRed;
+		/* Other way to do it... */
+		/* colour.red = Variable_GetValueFloat(colourRedVariable->variable, lParticle_I);*/
+	}
+	/* Get green colour */
+	if ( self->colourGreenVariable){
+		SwarmVariable_ValueAt( self->colourGreenVariable, lParticle_I, &colourValueGreen );
+		(self->colour).green = colourValueGreen;
+	}
+	
+	/* Get blue colour */
+	if ( self->colourBlueVariable){
+		SwarmVariable_ValueAt( self->colourBlueVariable, lParticle_I, &colourValueBlue );
+		(self->colour).blue = colourValueBlue;
+	}
+
+	
+	lucColourMap_SetOpenGLColourFromRGB_ExplicitOpacity( (self->colour).red, (self->colour).green, (self->colour).blue, (float)(self->colour).opacity );
+}
+
+
+
+
+void lucSwarmRGBColourViewer_UpdateVariables( void* drawingObject ) {
+	lucSwarmRGBColourViewer*          self                = (lucSwarmRGBColourViewer*)drawingObject;
+
+	lucSwarmViewerBase_UpdateVariables( drawingObject ) ;
+
+	if ( self->colourRedVariable && self->colourRedVariable->variable ) {
+		Variable_Update( self->colourRedVariable->variable );
+	}	
+	if ( self->colourGreenVariable && self->colourGreenVariable->variable ) {
+		Variable_Update( self->colourGreenVariable->variable );
+	}
+	if ( self->colourBlueVariable && self->colourBlueVariable->variable ) {
+		Variable_Update( self->colourBlueVariable->variable );
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmRGBColourViewer.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmRGBColourViewer.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,125 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: Arrhenius.c 78 2005-11-29 11:58:21Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucSwarmRGBColourViewer_h__
+#define __lucSwarmRGBColourViewer_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucSwarmRGBColourViewer_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucSwarmRGBColourViewer \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucSwarmViewer \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		ExtensionInfo_Index                                particleExtHandle;      \
+		/* Colour Stuff */ \
+		/* Opacity Stuff */ \
+		/* Mask Info */ \
+		/* Colour Info */ \
+		Name                                               colourRedVariableName;       \
+		SwarmVariable*                                     colourRedVariable;           \
+		Name                                               colourGreenVariableName;       \
+		SwarmVariable*                                     colourGreenVariable;          \
+		Name                                               colourBlueVariableName;       \
+		SwarmVariable*                                     colourBlueVariable;           \
+	
+	struct lucSwarmRGBColourViewer { __lucSwarmRGBColourViewer };
+	
+	typedef struct {
+		double red;
+		double green;
+		double blue;
+	} lucSwarmRGBColourViewer_ParticleExt;
+	
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucSwarmRGBColourViewer* _lucSwarmRGBColourViewer_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,		
+		lucSwarmViewerBase_PlotParticleFunction*           _plotParticle,
+		lucSwarmViewerBase_SetParticleColourFunction*      _setParticleColour,
+		Name                                               name );
+
+	void _lucSwarmRGBColourViewer_Delete( void* drawingObject ) ;
+	void _lucSwarmRGBColourViewer_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucSwarmRGBColourViewer_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucSwarmRGBColourViewer_DefaultNew( Name name ) ;
+	void _lucSwarmRGBColourViewer_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucSwarmRGBColourViewer_Build( void* drawingObject, void* data ) ;
+	void _lucSwarmRGBColourViewer_Initialise( void* drawingObject, void* data ) ;
+	void _lucSwarmRGBColourViewer_Execute( void* drawingObject, void* data );
+	void _lucSwarmRGBColourViewer_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucSwarmRGBColourViewer_Setup( void* drawingObject, void* _context ) ;
+	void _lucSwarmRGBColourViewer_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucSwarmRGBColourViewer_CleanUp( void* drawingObject, void* context ) ;
+
+	void _lucSwarmRGBColourViewer_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+	void _lucSwarmRGBColourViewer_PlotParticle( void* drawingObject, void* _context, Particle_Index lParticle_I ) ;
+	
+	/* SwarmViewer Implementations */	
+	void _lucSwarmRGBColourViewer_SetParticleColour( void* drawingObject, void* _context, Particle_Index lParticle_I, lucColour* colour ) ;
+
+	void lucSwarmRGBColourViewer_UpdateVariables( void* drawingObject ) ;
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmRGBColourViewer.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmRGBColourViewer.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucSwarmRGBColourViewer</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucOpenGLDrawingObject</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">ColourVariable</param>
+		<param name="Type">String</param>
+		<param name="Default">""</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">OpacityVariable</param>
+		<param name="Type">String</param>
+		<param name="Default">""</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">MaskVariable</param>
+		<param name="Type">String</param>
+		<param name="Default">""</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">colour</param>
+		<param name="Type">String</param>
+		<param name="Default">"black"</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">pointSize</param>
+		<param name="Type">Double</param>
+		<param name="Default">1.0</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Swarm</param>
+		<param name="Type">Swarm</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 153 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">ColourMap</param>
+		<param name="Type">lucColourMap</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 154 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">Material</param>
+		<param name="Type">Material</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 163 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmSquares.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmSquares.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,315 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: SwarmSquares.c 667 2007-03-01 06:43:11Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "SwarmViewerBase.h"
+#include "SwarmViewer.h"
+#include "SwarmSquares.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucSwarmSquares_Type = "lucSwarmSquares";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucSwarmSquares* _lucSwarmSquares_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		lucSwarmViewerBase_PlotParticleFunction*           _plotParticle,
+		lucSwarmViewerBase_SetParticleColourFunction*      _setParticleColour,
+		Name                                               name ) 
+{
+	lucSwarmSquares*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucSwarmSquares) );
+	self = (lucSwarmSquares*) _lucSwarmViewerBase_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			_plotParticle,
+			_setParticleColour,
+			name );
+	
+	return self;
+}
+
+void _lucSwarmSquares_Init( 
+		lucSwarmSquares*                                   self,
+		Name                                               colourVariableName,
+		lucColourMap*                                      colourMap,
+		Name                                               normalVariableName,
+		Name                                               planeVectorVariableName,
+		Name                                               lengthVariableName,
+		double                                             length )
+{
+	self->colourMap           = colourMap;
+	self->colourVariableName  = colourVariableName;
+	self->normalVariableName      = normalVariableName;
+	self->planeVectorVariableName = planeVectorVariableName;
+	self->lengthVariableName      = lengthVariableName;
+	self->length                  = length;
+}
+
+void _lucSwarmSquares_Delete( void* drawingObject ) {
+	lucSwarmSquares*  self = (lucSwarmSquares*)drawingObject;
+
+	_lucSwarmViewerBase_Delete( self );
+}
+
+void _lucSwarmSquares_Print( void* drawingObject, Stream* stream ) {
+	lucSwarmSquares*  self = (lucSwarmSquares*)drawingObject;
+
+	_lucSwarmViewerBase_Print( self, stream );
+}
+
+void* _lucSwarmSquares_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucSwarmSquares*  self = (lucSwarmSquares*)drawingObject;
+	lucSwarmSquares* newDrawingObject;
+
+	newDrawingObject = _lucSwarmViewerBase_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucSwarmSquares_DefaultNew( Name name ) {
+	return (void*) _lucSwarmSquares_New(
+		sizeof(lucSwarmSquares),
+		lucSwarmSquares_Type,
+		_lucSwarmSquares_Delete,
+		_lucSwarmSquares_Print,
+		NULL,
+		_lucSwarmSquares_DefaultNew,
+		_lucSwarmSquares_Construct,
+		_lucSwarmSquares_Build,
+		_lucSwarmSquares_Initialise,
+		_lucSwarmSquares_Execute,
+		_lucSwarmSquares_Destroy,
+		_lucSwarmSquares_Setup,
+		_lucSwarmSquares_Draw,
+		_lucSwarmSquares_CleanUp,
+		_lucSwarmSquares_BuildDisplayList,
+		_lucSwarmSquares_PlotParticle,
+		_lucSwarmViewerBase_SetParticleColourDefault,
+		name );
+}
+
+void _lucSwarmSquares_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucSwarmSquares*  self = (lucSwarmSquares*)drawingObject;
+	lucColourMap*           colourMap;
+	Name                    colourVariableName;
+	
+	/* Construct Parent */
+	_lucSwarmViewerBase_Construct( self, cf, data );
+	
+	colourMap     =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "ColourMap", lucColourMap,      False, data  ) ;
+	colourVariableName = Stg_ComponentFactory_GetString( cf, self->name, "ColourVariable", "" );
+
+	_lucSwarmSquares_Init( 
+			self,
+			colourVariableName,
+			colourMap,
+			Stg_ComponentFactory_GetString( cf, self->name, "NormalVariable", "" ),
+			Stg_ComponentFactory_GetString( cf, self->name, "PlaneVectorVariable", "" ),
+			Stg_ComponentFactory_GetString( cf, self->name, "LengthVariable", "" ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "length", 0.2 ) );
+}
+
+void _lucSwarmSquares_Build( void* drawingObject, void* data ) {}
+void _lucSwarmSquares_Initialise( void* drawingObject, void* data ) {
+	lucSwarmSquares*         self                   = (lucSwarmSquares*)drawingObject;
+	SwarmVariable_Register*  swarmVariable_Register = self->swarm->swarmVariable_Register;
+	Stream*                  errorStream            = Journal_MyStream( Error_Type, self );
+
+	_lucSwarmViewerBase_Initialise( self, data );
+
+	if ( 0 != strcmp( self->colourVariableName, "" ) ) {
+		self->colourVariable  = SwarmVariable_Register_GetByName( swarmVariable_Register, self->colourVariableName );
+		Journal_Firewall( self->colourVariable != NULL, errorStream,
+				  "Error - for gLucifer drawing object \"%s\" - in %s(): colour Variable name given was \"%s\", "
+				  "but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+				  self->name, __func__, self->colourVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->colourVariable, data, False );
+		Stg_Component_Initialise( self->colourVariable, data, False );
+
+	}
+	
+	if ( 0 != strcmp( self->normalVariableName, "" ) ) {
+		self->normalVariable = SwarmVariable_Register_GetByName( swarmVariable_Register, self->normalVariableName );
+		Journal_Firewall( self->normalVariable != NULL, errorStream,
+					"Error - for gLucifer drawing object \"%s\" - in %s(): normal Variable name given was \"%s\", "
+					"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+					self->name, __func__, self->normalVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->normalVariable, data, False );
+		Stg_Component_Initialise( self->normalVariable, data, False );
+	}
+
+	/*
+	self->planeVectorVariable = SwarmVariable_Register_GetByName( swarmVariable_Register, self->planeVectorVariableName );
+	Journal_Firewall( self->planeVectorVariable != NULL, errorStream, 
+			"Error in func %s for %s '%s' - Cannot find SwarmVariable %s to be variable for plane vector.\n", 
+			__func__, self->type, self->name, self->planeVectorVariableName );
+	*/		
+	
+	if ( 0 != strcmp( self->lengthVariableName, "" ) ) {
+		self->lengthVariable = SwarmVariable_Register_GetByName( swarmVariable_Register, self->lengthVariableName );
+		Journal_Firewall( self->lengthVariable != NULL, errorStream,
+					"Error - for gLucifer drawing object \"%s\" - in %s(): normal Variable name given was \"%s\", "
+					"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+					self->name, __func__, self->lengthVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->lengthVariable, data, False );
+		Stg_Component_Initialise( self->lengthVariable, data, False );
+	}
+
+}
+void _lucSwarmSquares_Execute( void* drawingObject, void* data ) {}
+void _lucSwarmSquares_Destroy( void* drawingObject, void* data ) {}
+
+void _lucSwarmSquares_Setup( void* drawingObject, void* _context ) {
+	lucSwarmSquares_UpdateVariables( drawingObject );
+	_lucSwarmViewerBase_Setup( drawingObject, _context );
+}
+	
+void _lucSwarmSquares_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	_lucSwarmViewerBase_Draw( drawingObject, window, viewportInfo, _context );
+}
+
+void _lucSwarmSquares_CleanUp( void* drawingObject, void* _context ) {
+	_lucSwarmViewerBase_CleanUp( drawingObject, _context );
+}
+
+void _lucSwarmSquares_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucSwarmViewer*          self                = (lucSwarmViewer*)drawingObject;
+
+        /* Hack to allow the transparency to work properly 
+	 *See : http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_render.html?page=2 
+	 * ROB IS COMMENTING THESE OUT NOW TO GET IT TO WORK - HAVE TO TRY THIS ANOTHER TIME - 1st MARCH 2007
+	 */
+//	glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+	
+	_lucSwarmViewerBase_BuildDisplayList( self, _context );
+	
+	/* Put back the blending to what it was by default */
+//	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+}
+
+void _lucSwarmSquares_PlotParticle( void* drawingObject, void* _context, Particle_Index lParticle_I ) {
+	lucSwarmSquares*         self                = (lucSwarmSquares*)drawingObject;
+	DiscretisationContext*   context             = (DiscretisationContext*) _context;
+	GlobalParticle*          particle            = (GlobalParticle*)Swarm_ParticleAt( self->swarm, lParticle_I );
+	SwarmVariable*           lengthVariable      = self->lengthVariable;
+	double*                  coord               = particle->coord;
+	double                   length              = self->length;
+	XYZ                      normal              = { 0, 0, 0 };
+	/*XYZ                      planeVector         = { 0, 0, 0 };*/
+
+	SwarmVariable_ValueAt( self->normalVariable, lParticle_I, normal );
+	/* SwarmVariable_ValueAt( self->planeVectorVariable, lParticle_I, planeVector );*/
+
+	if ( lengthVariable )
+		SwarmVariable_ValueAt( lengthVariable, lParticle_I, &length );
+
+		
+	luc_OpenGlFatSquare( context->dim, coord, normal, NULL, length, length * 0.1);
+}
+
+void lucSwarmSquares_UpdateVariables( void* drawingObject ) {
+	lucSwarmSquares*          self                = (lucSwarmSquares*)drawingObject;
+	
+	lucSwarmViewerBase_UpdateVariables( drawingObject ) ;
+
+	if ( self->normalVariable && self->normalVariable->variable ) {
+		Variable_Update( self->normalVariable->variable );
+	}
+	if ( self->planeVectorVariable && self->planeVectorVariable->variable ) {
+		Variable_Update( self->planeVectorVariable->variable );
+	}
+	if ( self->lengthVariable && self->lengthVariable->variable ) {
+		Variable_Update( self->lengthVariable->variable );
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmSquares.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmSquares.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,115 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: SwarmSquares.h 667 2007-03-01 06:43:11Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucSwarmSquares_h__
+#define __lucSwarmSquares_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucSwarmSquares_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucSwarmSquares \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucSwarmViewerBase \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		/* Colour Stuff */ \
+		SwarmVariable*                                     normalVariable;              \
+		Name                                               normalVariableName;          \
+		SwarmVariable*                                     planeVectorVariable;         \
+		Name                                               planeVectorVariableName;     \
+		SwarmVariable*                                     lengthVariable;              \
+		Name                                               lengthVariableName;          \
+		double                                             length;                      \
+
+	struct lucSwarmSquares { __lucSwarmSquares };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucSwarmSquares* _lucSwarmSquares_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		lucSwarmViewerBase_PlotParticleFunction*           _plotParticle,
+		lucSwarmViewerBase_SetParticleColourFunction*      _setParticleColour,
+		Name                                               name );
+
+	void _lucSwarmSquares_Delete( void* drawingObject ) ;
+	void _lucSwarmSquares_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucSwarmSquares_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucSwarmSquares_DefaultNew( Name name ) ;
+	void _lucSwarmSquares_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucSwarmSquares_Build( void* drawingObject, void* data ) ;
+	void _lucSwarmSquares_Initialise( void* drawingObject, void* data ) ;
+	void _lucSwarmSquares_Execute( void* drawingObject, void* data );
+	void _lucSwarmSquares_Destroy( void* drawingObject, void* data ) ;
+	
+	void _lucSwarmSquares_Setup( void* drawingObject, void* _context ) ;
+	void _lucSwarmSquares_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucSwarmSquares_CleanUp( void* drawingObject, void* _context ) ;
+
+	/* OpenGL Drawing Object Implementations */
+	void _lucSwarmSquares_BuildDisplayList( void* drawingObject, void* _context ) ;
+
+	/* SwarmViewer Implementations */	
+	void _lucSwarmSquares_PlotParticle( void* drawingObject, void* _context, Particle_Index lParticle_I ) ;
+	void _lucSwarmSquares_SetParticleColour( void* drawingObject, void* _context, Particle_Index lParticle_I, lucColour* colour ) ;
+
+	void lucSwarmSquares_UpdateVariables( void* drawingObject ) ;
+#endif
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmSquares.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmSquares.meta	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">lucSwarmSquares</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">gLucifer</param>
+<param name="Location">./gLucifer/DrawingObjects/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/gLucifer</param>
+<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">lucSwarmViewer</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Plots a square on each of the particles in a swarm.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">length</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.2</param>
+		<param name="Description">This is a factor to scale the size of the squares by.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">NormalVariable</param>
+		<param name="Type">SwarmViewer</param>
+		<param name="Description">This is the vector quantity to define the normal for the square drawn on each particle.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">LengthVariable</param>
+		<param name="Type">SwarmViewer</param>
+		<param name="Description">This is a scalar quantity used to scale the length of the squares. This overrides the value of the 'length' parameter.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmVectors.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmVectors.c	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,301 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: SwarmVectors.c 667 2007-03-01 06:43:11Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include <glucifer/Base/Base.h>
+#include <glucifer/RenderingEngines/RenderingEngines.h>
+
+#include "types.h"
+#include "OpenGLDrawingObject.h"
+#include "SwarmViewerBase.h"
+#include "SwarmViewer.h"
+#include "SwarmVectors.h"
+
+#include <assert.h>
+#include <gl.h>
+#include <glu.h>
+#include <string.h>
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type lucSwarmVectors_Type = "lucSwarmVectors";
+
+/* Private Constructor: This will accept all the virtual functions for this class as arguments. */
+lucSwarmVectors* _lucSwarmVectors_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		lucSwarmViewerBase_PlotParticleFunction*           _plotParticle,
+		lucSwarmViewerBase_SetParticleColourFunction*      _setParticleColour,
+		Name                                               name ) 
+{
+	lucSwarmVectors*					self;
+
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	assert( sizeOfSelf >= sizeof(lucSwarmVectors) );
+	self = (lucSwarmVectors*) _lucSwarmViewerBase_New( 
+			sizeOfSelf,
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_setup,
+			_draw,
+			_cleanUp,
+			_buildDisplayList,
+			_plotParticle,
+			_setParticleColour,
+			name );
+	
+	return self;
+}
+
+void _lucSwarmVectors_Init( 
+		lucSwarmVectors*                                   self,
+		Name                                               directionVariableName,
+		double                                             arrowHeadSize,
+		Name                                               thicknessVariableName,
+		double                                             thickness,
+		Name                                               lengthVariableName,
+		double                                             length )
+{
+	Stream* errorStream         = Journal_MyStream( Error_Type, self );
+	
+	self->directionVariableName = directionVariableName;
+	self->arrowHeadSize         = arrowHeadSize;
+	Journal_Firewall( ( arrowHeadSize <= 1 && arrowHeadSize >= 0 ), errorStream,
+			"Error in %s:\narrowHeadSize given for %s was not in the range [0, 1]. " 
+			"Please use an arrowHeadSize within this range\n", __func__, self->name );
+	self->thicknessVariableName = thicknessVariableName;
+	self->thickness             = thickness;
+	self->lengthVariableName    = lengthVariableName;
+	self->length                = length;
+}
+
+void _lucSwarmVectors_Delete( void* drawingObject ) {
+	lucSwarmVectors*  self = (lucSwarmVectors*)drawingObject;
+
+	_lucSwarmViewerBase_Delete( self );
+}
+
+void _lucSwarmVectors_Print( void* drawingObject, Stream* stream ) {
+	lucSwarmVectors*  self = (lucSwarmVectors*)drawingObject;
+
+	_lucSwarmViewerBase_Print( self, stream );
+}
+
+void* _lucSwarmVectors_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) {
+	lucSwarmVectors*  self = (lucSwarmVectors*)drawingObject;
+	lucSwarmVectors* newDrawingObject;
+
+	newDrawingObject = _lucSwarmViewerBase_Copy( self, dest, deep, nameExt, ptrMap );
+
+	/* TODO */
+	abort();
+
+	return (void*) newDrawingObject;
+}
+
+
+void* _lucSwarmVectors_DefaultNew( Name name ) {
+	return (void*) _lucSwarmVectors_New(
+		sizeof(lucSwarmVectors),
+		lucSwarmVectors_Type,
+		_lucSwarmVectors_Delete,
+		_lucSwarmVectors_Print,
+		NULL,
+		_lucSwarmVectors_DefaultNew,
+		_lucSwarmVectors_Construct,
+		_lucSwarmVectors_Build,
+		_lucSwarmVectors_Initialise,
+		_lucSwarmVectors_Execute,
+		_lucSwarmVectors_Destroy,
+		_lucSwarmVectors_Setup,
+		_lucSwarmVectors_Draw,
+		_lucSwarmVectors_CleanUp,
+		_lucSwarmVectors_BuildDisplayList,
+		_lucSwarmVectors_PlotParticle,
+		_lucSwarmViewerBase_SetParticleColourDefault,
+		name );
+}
+
+void _lucSwarmVectors_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data ){
+	lucSwarmVectors*  self = (lucSwarmVectors*)drawingObject;
+
+	/* Construct Parent */
+	_lucSwarmViewerBase_Construct( self, cf, data );
+
+	_lucSwarmVectors_Init( 
+			self,
+			Stg_ComponentFactory_GetString( cf, self->name, "DirectionVariable", "" ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "arrowHeadSize", 0.5 ),
+			Stg_ComponentFactory_GetString( cf, self->name, "ThicknessVariable", "" ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "thickness", 1.0 ),
+			Stg_ComponentFactory_GetString( cf, self->name, "LengthVariable", "" ),
+			Stg_ComponentFactory_GetDouble( cf, self->name, "length", 0.2 ) );
+}
+
+void _lucSwarmVectors_Build( void* drawingObject, void* data ) {
+	lucSwarmVectors*         self                   = (lucSwarmVectors*)drawingObject;
+
+	_lucSwarmViewerBase_Build( self, data );
+}
+void _lucSwarmVectors_Initialise( void* drawingObject, void* data ) {
+	lucSwarmVectors*         self                   = (lucSwarmVectors*)drawingObject;
+	SwarmVariable_Register*  swarmVariable_Register = self->swarm->swarmVariable_Register;
+	Stream*                  errorStream            = Journal_MyStream( Error_Type, self );
+
+	_lucSwarmViewerBase_Initialise( self, data );
+
+	if ( 0 != strcmp( self->directionVariableName, "" ) ) {
+		self->directionVariable    = SwarmVariable_Register_GetByName( swarmVariable_Register, self->directionVariableName );
+		Journal_Firewall( self->directionVariable != NULL, errorStream, 
+				"Error in func %s for %s '%s' - Cannot find SwarmVariable %s to be variable for direction vector.\n", 
+				__func__, self->type, self->name, self->directionVariableName );
+		Stg_Component_Build( self->directionVariable, data, False );
+		Stg_Component_Initialise( self->directionVariable, data, False );
+	}
+
+	if ( 0 != strcmp( self->thicknessVariableName, "" ) ) {
+		self->thicknessVariable    = SwarmVariable_Register_GetByName( swarmVariable_Register, self->thicknessVariableName );
+		Journal_Firewall( self->thicknessVariable != NULL, errorStream,
+			"Error - for gLucifer drawing object \"%s\" - in %s(): thickness Variable name given was \"%s\", "
+			"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+			self->name, __func__, self->thicknessVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->thicknessVariable, data, False );
+		Stg_Component_Initialise( self->thicknessVariable, data, False );
+	}
+	if ( 0 != strcmp( self->lengthVariableName, "" ) ) {
+		self->lengthVariable       = SwarmVariable_Register_GetByName( swarmVariable_Register, self->lengthVariableName );
+		Journal_Firewall( self->lengthVariable != NULL, errorStream,
+			"Error - for gLucifer drawing object \"%s\" - in %s(): length Variable name given was \"%s\", "
+			"but no corresponding SwarmVariable found in the register for swarm \"%s\".\n",
+			self->name, __func__, self->lengthVariableName, self->swarm->name );
+		
+		Stg_Component_Build( self->lengthVariable, data, False );
+		Stg_Component_Initialise( self->lengthVariable, data, False );
+	}
+}
+void _lucSwarmVectors_Execute( void* drawingObject, void* data ) {}
+void _lucSwarmVectors_Destroy( void* drawingObject, void* data ) {}
+
+void _lucSwarmVectors_Setup( void* drawingObject, void* _context ) {
+	_lucSwarmViewerBase_Setup( drawingObject, _context );
+	lucSwarmVectors_UpdateVariables( drawingObject );
+}
+	
+void _lucSwarmVectors_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
+	_lucSwarmViewerBase_Draw( drawingObject, window, viewportInfo, _context );
+}
+
+void _lucSwarmVectors_CleanUp( void* drawingObject, void* _context ) {
+	_lucSwarmViewerBase_CleanUp( drawingObject, _context );
+}
+
+void _lucSwarmVectors_BuildDisplayList( void* drawingObject, void* _context ) {
+	lucSwarmVectors*         self                = (lucSwarmVectors*)drawingObject;
+	
+	_lucSwarmViewerBase_BuildDisplayList( self, _context );
+}
+
+void _lucSwarmVectors_PlotParticle( void* drawingObject, void* _context, Particle_Index lParticle_I ) {
+	lucSwarmVectors*         self                = (lucSwarmVectors*)drawingObject;
+	DiscretisationContext*   context             = (DiscretisationContext*) _context;
+	GlobalParticle*          particle            = (GlobalParticle*)Swarm_ParticleAt( self->swarm, lParticle_I );
+	SwarmVariable*           lengthVariable      = self->lengthVariable;
+	SwarmVariable*           thicknessVariable   = self->thicknessVariable;
+	double*                  coord               = particle->coord;
+	double                   length              = self->length;
+	double                   thickness           = self->thickness;
+	XYZ                      direction           = { 0, 0, 0 };
+
+	SwarmVariable_ValueAt( self->directionVariable, lParticle_I, direction );
+
+	if ( lengthVariable )
+		SwarmVariable_ValueAt( lengthVariable, lParticle_I, &length );
+
+	if ( thicknessVariable )
+		SwarmVariable_ValueAt( thicknessVariable, lParticle_I, &thickness );
+
+	glLineWidth( (float) thickness );
+
+	luc_DrawVector( context->dim, coord, direction, length, self->arrowHeadSize );
+}
+
+void lucSwarmVectors_UpdateVariables( void* drawingObject ) {
+	lucSwarmVectors*          self                = (lucSwarmVectors*)drawingObject;
+	lucSwarmViewerBase_UpdateVariables( drawingObject ) ;
+
+	if ( self->directionVariable && self->directionVariable->variable ) {
+		Variable_Update( self->directionVariable->variable );
+	}
+	if ( self->thicknessVariable && self->thicknessVariable->variable ) {
+		Variable_Update( self->thicknessVariable->variable );
+	}
+	if ( self->lengthVariable && self->lengthVariable->variable ) {
+		Variable_Update( self->lengthVariable->variable );
+	}
+}
diff -r c3d217e50ce0 -r 28d655bec240 DrawingObjects/src/SwarmVectors.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/src/SwarmVectors.h	Wed Apr 04 14:50:57 2007 +0000
@@ -0,0 +1,116 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Cecile Duboz - Cecile.Duboz at sci.monash.edu.au
+*%
+** Contributors:
+*+		Cecile Duboz
+*+		Robert Turnbull
+*+		Alan Lo
+*+		Louis Moresi
+*+		David Stegman
+*+		David May
+*+		Stevan Quenette
+*+		Patrick Sunter
+*+		Greg Watson
+*+
+** $Id: SwarmVectors.h 667 2007-03-01 06:43:11Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __lucSwarmVectors_h__
+#define __lucSwarmVectors_h__
+
+	/** Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+	extern const Type lucSwarmVectors_Type;
+		
+	/** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */
+	#define __lucSwarmVectors \
+		/* Macro defining parent goes here - This means you can cast this class as its parent */ \
+		__lucSwarmViewerBase \
+		/* Virtual functions go here */ \
+		/* Other info */\
+		SwarmVariable*                                     directionVariable;           \
+		Name                                               directionVariableName;       \
+		double                                             arrowHeadSize;               \
+		SwarmVariable*                                     thicknessVariable;           \
+		Name                                               thicknessVariableName;       \
+		double                                             thickness;                   \
+		SwarmVariable*                                     lengthVariable;              \
+		Name                                               lengthVariableName;          \
+		double                                             length;                      \
+
+	struct lucSwarmVectors { __lucSwarmVectors };
+	
+	/** Private Constructor: This will accept all the virtual functions for this class as arguments. */
+	lucSwarmVectors* _lucSwarmVectors_New( 
+		SizeT                                              sizeOfSelf,
+		Type                                               type,
+		Stg_Class_DeleteFunction*                          _delete,
+		Stg_Class_PrintFunction*                           _print,
+		Stg_Class_CopyFunction*                            _copy, 
+		Stg_Component_DefaultConstructorFunction*          _defaultConstructor,
+		Stg_Component_ConstructFunction*                   _construct,
+		Stg_Component_BuildFunction*                       _build,
+		Stg_Component_InitialiseFunction*                  _initialise,
+		Stg_Component_ExecuteFunction*                     _execute,
+		Stg_Component_DestroyFunction*                     _destroy,
+		lucDrawingObject_SetupFunction*                    _setup,
+		lucDrawingObject_DrawFunction*                     _draw,
+		lucDrawingObject_CleanUpFunction*                  _cleanUp,
+		lucOpenGLDrawingObject_BuildDisplayListFunction*   _buildDisplayList,
+		lucSwarmViewerBase_PlotParticleFunction*           _plotParticle,
+		lucSwarmViewerBase_SetParticleColourFunction*      _setParticleColour,
+		Name                                               name );
+
+	void _lucSwarmVectors_Delete( void* drawingObject ) ;
+	void _lucSwarmVectors_Print( void* drawingObject, Stream* stream ) ;
+	void* _lucSwarmVectors_Copy( void* drawingObject, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap) ;
+
+	/* 'Stg_Component' implementations */
+	void* _lucSwarmVectors_DefaultNew( Name name ) ;
+	void _lucSwarmVectors_Construct( void* drawingObject, Stg_ComponentFactory* cf, void* data );
+	void _lucSwarmVectors_Build( void* drawingObject, void* data ) ;
+	void _lucSwarmVectors_Initialise( void* drawingObject, void* data ) ;
+	void _lucSwarmVectors_Execute( void* drawingObject, void* data );
+	void _lucSwarmVectors_Destroy( void* drawingObject, void* data ) ;
+	
+	/* Drawing Object Implementations */
+	void _lucSwarmVectors_Setup( void* drawingObject, void* _context ) ;
+	void _lucSwarmVectors_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) ;
+	void _lucSwarmVectors_CleanUp( void* drawingObject, void* _contex