Index: GTP/trunk/Lib/Vis/Preprocessing/include/SceneGraph.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/include/SceneGraph.h	(revision 68)
+++ GTP/trunk/Lib/Vis/Preprocessing/include/SceneGraph.h	(revision 2600)
@@ -7,23 +7,54 @@
 namespace GtpVisibilityPreprocessor {
   
-  /** Basic scene graph node, we are interested only in bounding boxes and topology
-      of the scene graph */
-  class SceneGraphNode {
-  public:
-    
-    
-  protected:
-    MeshContainer mGeometry;
-    NodeContainer mChildren;
-    AxisAlignedBox3 mBox;
-  };
+/** Basic scene graph node, we are interested only in bounding boxes and topology
+    of the scene graph 
+*/
+class SceneGraphNode
+{
+public:
+	virtual bool IsLeaf() const = NULL;
+
+protected:
+
+	AxisAlignedBox3 mBox;
+};
   
 
-  /** Scene graph class */
-  class SceneGraph {
-    
-  protected:
-    SceneGraphNode *mRoot;
-  };
+
+/** Basic scene graph node, we are interested only in bounding boxes and topology
+  of the scene graph */
+class SceneGraphInterior: public SceneGraphNode
+{
+public:
+	~SceneGraphInterior();
+
+	virtual bool IsLeaf() const { return false; }
+
+protected:
+
+	NodeContainer mChildren;
+};
+
+
+/** Basic scene graph node, we are interested only in bounding boxes and topology
+  of the scene graph */
+class SceneGraphLeaf: public SceneGraphNode 
+{
+public:
+	~SceneGraphLeaf();
+	virtual bool IsLeaf() const { return true; }
+
+protected:
+	MeshContainer mGeometry;
+};
+
+
+/** Scene graph class 
+*/
+class SceneGraph 
+{
+protected:
+	SceneGraphNode *mRoot;
+};
   
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h	(revision 1379)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h	(revision 2600)
@@ -16,5 +16,5 @@
   
   virtual bool ParseFile(const std::string filename, 
-						 SceneGraphNode *root, 
+						 SceneGraphLeaf *root, 
 						 const bool loadMeshes = false,
 						 vector<FaceParentInfo> *parents = NULL);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp	(revision 2539)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp	(revision 2600)
@@ -85,5 +85,5 @@
 //  StdInParseHandlers: Constructors and Destructor
 // ---------------------------------------------------------------------------
-X3dParseHandlers::X3dParseHandlers(SceneGraphNode *root, 
+X3dParseHandlers::X3dParseHandlers(SceneGraphLeaf *root, 
 								   const bool loadMeshes):
   mElementCount(0)
@@ -637,5 +637,5 @@
 bool
 X3dParser::ParseFile(const string filename,
-					 SceneGraphNode *root,
+					 SceneGraphLeaf *root,
 					 const bool loadMeshes,
 					 vector<FaceParentInfo> *parents)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 2600)
@@ -3,22 +3,58 @@
 
 #include <string>
-//
-
 #include "Containers.h"
 #include "AxisAlignedBox3.h"
 
+
 namespace GtpVisibilityPreprocessor {
-  
+
+
 /** Basic scene graph node, we are interested only in bounding boxes and topology
     of the scene graph 
-	*/
-class SceneGraphNode {
+*/
+class SceneGraphNode 
+{
 public:
-  ObjectContainer mGeometry;
-  SceneGraphNodeContainer mChildren;
-  AxisAlignedBox3 mBox;
-  ~SceneGraphNode();
-  void UpdateBox();
+
+	virtual ~SceneGraphNode();
+	virtual bool IsLeaf() const = 0;
+
+	virtual void UpdateBox() = 0;
+
+//protected:
+
+	AxisAlignedBox3 mBox;
 };
+  
+
+
+/** Scene graph interior node.
+*/
+class SceneGraphInterior: public SceneGraphNode 
+{
+public:
+	virtual bool IsLeaf() const { return false; }
+	virtual void UpdateBox();
+
+//protected:
+
+	NodeContainer mChildren;
+};
+
+
+/** Scene graph leaf node.
+*/
+class SceneGraphLeaf: public SceneGraphNode 
+{
+public:
+
+	virtual bool IsLeaf() const { return true; }
+	virtual void UpdateBox();
+
+//protected:
+
+	MeshContainer mGeometry;
+};
+
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 2544)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 2600)
@@ -32,8 +32,19 @@
 SceneGraphNode::~SceneGraphNode()
 {
-	CLEAR_CONTAINER(mGeometry);
+}
+
+
+SceneGraphLeaf::~SceneGraphLeaf()
+{
+    CLEAR_CONTAINER(mGeometry);
+}
+
+
+SceneGraphInterior::~SceneGraphInterior()
+{
 	// recursivly delete all children
 	CLEAR_CONTAINER(mChildren);
 }
+
 
 
@@ -61,5 +72,5 @@
 
 
-void SceneGraph::SetRoot(SceneGraphNode *root)
+void SceneGraph::SetRoot(SceneGraphLeaf *root)
 {
 	mRoot = root;
@@ -67,6 +78,5 @@
 
 
-int
-SceneGraph::CollectObjects(ObjectContainer *instances)
+int SceneGraph::CollectObjects(ObjectContainer &instances)
 {
 	instances->clear();
@@ -74,34 +84,4 @@
 
 	stack<SceneGraphNode *> nodeStack;
-	nodeStack.push(mRoot);
-
-	while (!nodeStack.empty()) {
-		SceneGraphNode *node = nodeStack.top();
-		nodeStack.pop();
-		
-		ObjectContainer::const_iterator mi = node->mGeometry.begin();
-		for (; mi != node->mGeometry.end(); mi++)
-		{
-			instances->push_back(*mi);
-		}
-	
-		SceneGraphNodeContainer::iterator ni = node->mChildren.begin();
-		for (; ni != node->mChildren.end(); ni++) {
-			nodeStack.push(*ni);	
-			number++;
-		}
-	}
-
-	return number;
-}
-
-
-int
-SceneGraph::AssignObjectIds()
-{
-	// matt: rather start with id zero
-	int id = 0;
-	stack<SceneGraphNode *> nodeStack;
-
 	nodeStack.push(mRoot);
 
@@ -111,15 +91,64 @@
 		nodeStack.pop();
 
-		ObjectContainer::iterator mi = node->mGeometry.begin();
-
-		for (; mi != node->mGeometry.end(); mi ++) 
-		{
-			(*mi)->SetId(id ++);
-		}
-
-		SceneGraphNodeContainer::iterator ni = node->mChildren.begin();
-		for (; ni != node->mChildren.end(); ni ++) 
-		{
-			nodeStack.push(*ni);
+		if (node->IsLeaf())
+		{
+			SceneGraphLeaf *leaf = static_cast<SceneGraphNodeLeaf *>(node);
+
+			ObjectContainer::const_iterator mi = leaf->mGeometry.begin();
+
+			for (; mi != leaf->mGeometry.end(); mi++)
+			{
+				instances->push_back(*mi);
+			}
+		}
+		else
+		{
+			SceneGraphInterior *interior = static_cast<SceneGraphNodeInterior *>(node);
+			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+
+			for (; ni != interior->mChildren.end(); ++ ni) 
+			{
+				nodeStack.push(*ni);	
+				number++;
+			}
+		}
+	}
+
+	return number;
+}
+
+
+int
+SceneGraph::AssignObjectIds()
+{
+	// matt: rather start with id zero
+	int id = 0;
+	stack<SceneGraphNode *> nodeStack;
+
+	nodeStack.push(mRoot);
+
+	while (!nodeStack.empty()) 
+	{
+		SceneGraphNode *node = nodeStack.top();
+		nodeStack.pop();
+
+		if (node->IsLeaf)
+		{
+			SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node);
+			ObjectContainer::iterator mi = leaf->mGeometry.begin();
+
+			for (; mi != leaf->mGeometry.end(); mi ++) 
+			{
+				(*mi)->SetId(id ++);
+			}
+		}
+		else
+		{
+			SceneGraphInterior *interior = static_cast<SceneGraphInterior *>(node);
+			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+			for (; ni != node->mChildren.end(); ni ++) 
+			{
+				nodeStack.push(*ni);
+			}
 		}
 	}
@@ -132,47 +161,58 @@
 SceneGraph::GetStatistics(int &intersectables, int &faces) const
 {
-  stack<SceneGraphNode *> nodeStack;
-  
-  nodeStack.push(mRoot);
-  faces = 0;
+	stack<SceneGraphNode *> nodeStack;
+
+	nodeStack.push(mRoot);
+	faces = 0;
 	intersectables = 0;
-  while (!nodeStack.empty()) {
-    SceneGraphNode *node = nodeStack.top();
-    nodeStack.pop();
-		
-    ObjectContainer::const_iterator mi = node->mGeometry.begin();
-    for (; mi != node->mGeometry.end(); mi++) {
+	while (!nodeStack.empty()) {
+		SceneGraphNode *node = nodeStack.top();
+		nodeStack.pop();
+
+		ObjectContainer::const_iterator mi = node->mGeometry.begin();
+		for (; mi != node->mGeometry.end(); mi++) {
 			intersectables++;
 			faces += (*mi)->NumberOfFaces();
 		}
-    
-    SceneGraphNodeContainer::iterator ni = node->mChildren.begin();
-    for (; ni != node->mChildren.end(); ni++) {
-      nodeStack.push(*ni);
-    }
-  }
+
+		SceneGraphNodeContainer::iterator ni = node->mChildren.begin();
+		for (; ni != node->mChildren.end(); ni++) {
+			nodeStack.push(*ni);
+		}
+	}
+
+}
+
+
+void SceneGraphInterior::UpdateBox()
+{
+	AxisAlignedBox3 box;
+	box.Initialize();
+
+	ObjectContainer::const_iterator mi = mGeometry.begin();
+	for (; mi != mGeometry.end(); mi++)
+		box.Include((*mi)->GetBox());
+
+	mBox = box;
+}
+
+
+void SceneGraphLeaf::UpdateBox()
+{
+	AxisAlignedBox3 box;
+
+	box.Initialize();
+
+	SceneGraphNodeContainer::iterator ni = mChildren.begin();
 	
-}
-
-
-void
-SceneGraphNode::UpdateBox()
-{
-  AxisAlignedBox3 box;
-  
-  box.Initialize();
-  
-  ObjectContainer::const_iterator mi = mGeometry.begin();
-  for (; mi != mGeometry.end(); mi++)
-	box.Include((*mi)->GetBox());
-  
-  SceneGraphNodeContainer::iterator ni = mChildren.begin();
-  for (; ni != mChildren.end(); ni++) {
-	(*ni)->UpdateBox();
-	box.Include((*ni)->mBox);
-  }
-  
-  mBox = box;
-}
+	for (; ni != mChildren.end(); ++ ni) 
+	{
+		(*ni)->UpdateBox();
+		box.Include((*ni)->mBox);
+	}
+
+	mBox = box;
+}
+
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2599)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2600)
@@ -187,5 +187,5 @@
 
 bool Preprocessor::LoadBinaryObj(const string &filename,
-								 SceneGraphNode *root,
+								 SceneGraphLeaf *root,
 								 vector<FaceParentInfo> *parents)
 {
@@ -1617,5 +1617,5 @@
 							   const ObjectContainer &preprocessorObjects)
 {
-//	bool success = LoadBinaryObj(filename, mSceneGraph->GetRoot(), &mFaseParents);
+//	bool success = LoadBinaryObj(filename, mSceneGraph->GetRoot(), &mFaceParents);
 	bool success = LoadBinaryObj(filename, mSceneGraph->GetRoot(), NULL);
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h	(revision 2600)
@@ -15,5 +15,5 @@
   
   bool ParseFile(const std::string filename,
-				 SceneGraphNode *root,
+				 SceneGraphLeaf *root,
 				 const bool loadMeshes = true,
 				 std::vector<FaceParentInfo> *parents = NULL);
@@ -23,5 +23,5 @@
   bool
   ParseSingleFile(const std::string filename,
-				  SceneGraphNode *root);
+				  SceneGraphLeaf *root);
 	
 };
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp	(revision 2600)
@@ -190,15 +190,24 @@
   stream<<"<Group>"<<endl;
 
-  SceneGraphNodeContainer::iterator ni = node->mChildren.begin();
-  for (; ni != node->mChildren.end(); ni++)
-    ExportSceneNode(*ni);
-  
-  
-  ObjectContainer::const_iterator mi = node->mGeometry.begin();
-  for (; mi != node->mGeometry.end(); mi++) {
-    // export the transform...
-    ExportIntersectable(*mi);
-  }
-  
+  if (!node->IsLeaf())
+  {
+	  SceneGraphInterior *interior = static_cast<SceneGraphInterior *>(node);
+
+	  SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+	  for (; ni != interior->mChildren.end(); ni++)
+		  ExportSceneNode(*ni);
+  }
+  else
+  {
+	  SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node);
+
+	  ObjectContainer::const_iterator mi = leaf->mGeometry.begin();
+	  for (; mi != leaf->mGeometry.end(); ++ mi) 
+	  {
+		  // export the transform...
+		  ExportIntersectable(*mi);
+	  }
+  }
+
   stream<<"</Group>"<<endl;
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2593)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2600)
@@ -31,4 +31,5 @@
 class RayCaster;
 class GlobalLinesRenderer;
+class SceneGraphLeaf;
 
 
@@ -277,8 +278,8 @@
 
 	bool LoadBinaryObj(const std::string &filename,
-                       SceneGraphNode *root,
+                       SceneGraphLeaf *root,
 					   std::vector<FaceParentInfo> *parents);
 
-	bool ExportBinaryObj(const std::string &filename, SceneGraphNode *root);
+	bool ExportBinaryObj(const std::string &filename, SceneGraphLeaf *root);
 
 	void SetupRay(Ray &ray, const Vector3 &point,
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2599)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2600)
@@ -1688,5 +1688,5 @@
 		// create temporary scene graph for loading the view cells geometry
 		// note: delete the meshes as they are created two times for transformed mesh instances.
-		SceneGraphNode *root = new SceneGraphNode();
+		SceneGraphNode *root = new SceneGraphLeaf();
 		const bool success = parser.ParseFile(filename, root, true);
 		
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2598)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2600)
@@ -15,4 +15,5 @@
 #include "SamplingStrategy.h"
 #include "Preprocessor.h"
+#include "SceneGraph.h"
 
 
@@ -399,5 +400,5 @@
 	OcclusionQuery::GenQueries(mOcclusionQueries, 10);
 
-	CreateVertexArrays();
+	CreateVertexArrays(static_cast<SceneGraphLeaf *>(mSceneGraph->GetRoot()));
 }
 
@@ -484,26 +485,26 @@
 GlRenderer::RenderScene()
 {
-  Intersectable::NewMail();
+	Intersectable::NewMail();
 
 #if 1
-  
-  _RenderSceneTrianglesWithDrawArrays();
+
+	_RenderSceneTrianglesWithDrawArrays();
 
 #else
-  static int glList = -1;
-  if (mUseGlLists) {
-	if (glList == -1) {
-	  glList = glGenLists(1);
-	  glNewList(glList, GL_COMPILE);
-	  _RenderSceneTriangles();
-	  glEndList();
-	}
-	
-	glCallList(glList);
-  } else
-	_RenderSceneTriangles();
-	
-#endif
-  return true;
+	static int glList = -1;
+	if (mUseGlLists) {
+		if (glList == -1) {
+			glList = glGenLists(1);
+			glNewList(glList, GL_COMPILE);
+			_RenderSceneTriangles();
+			glEndList();
+		}
+
+		glCallList(glList);
+	} else
+		_RenderSceneTriangles();
+
+#endif
+	return true;
 }
 
@@ -1701,14 +1702,15 @@
 #endif
 
-void GlRenderer::CreateVertexArrays()
-{
-	mData = new Vector3[mObjects.size() * 6];
-	mIndices = new unsigned int[mObjects.size() * 3];
-
-	size_t offset = mObjects.size() * 3;
-
-	for (size_t i = 0; i < mObjects.size(); ++ i)
-	{
-		TriangleIntersectable *obj = static_cast<TriangleIntersectable *>(mObjects[i]);
+
+void GlRenderer::CreateVertexArrays(SceneGraphLeaf *leaf)
+{
+    mData = new Vector3[leaf->mGeometry.size() * 6];
+	mIndices = new unsigned int[leaf->mGeometry.size() * 3];
+
+	size_t offset = leaf->mGeometry.size() * 3;
+
+	for (size_t i = 0; i < leaf->mGeometry.size(); ++ i)
+	{
+		TriangleIntersectable *obj = static_cast<TriangleIntersectable *>(leaf->mGeometry[i]);
 
 		Triangle3 tri = obj->GetItem();
@@ -1734,5 +1736,5 @@
 		glNormalPointer(GL_FLOAT, 0, (char *)NULL + offset * sizeof(Vector3));
 
-		glBufferDataARB(GL_ARRAY_BUFFER_ARB, mObjects.size() * 6 * sizeof(Vector3), mData, GL_STATIC_DRAW_ARB);
+		glBufferDataARB(GL_ARRAY_BUFFER_ARB, leaf->mObjects.size() * 6 * sizeof(Vector3), mData, GL_STATIC_DRAW_ARB);
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dParserXerces.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dParserXerces.h	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dParserXerces.h	(revision 2600)
@@ -17,4 +17,5 @@
 
 class SceneGraphNode;
+class SceneGraphLeaf;
 class Mesh;
 class Material;
@@ -41,5 +42,5 @@
   //  Constructors and Destructor
   // -----------------------------------------------------------------------
-  X3dParseHandlers(SceneGraphNode *root, const bool loadMeshes = false);
+  X3dParseHandlers(SceneGraphLeaf *root, const bool loadMeshes = false);
   ~X3dParseHandlers();
   
@@ -78,5 +79,5 @@
   void resetDocument();
 
-  SceneGraphNode *mCurrentNode;
+  SceneGraphLeaf *mCurrentNode;
  
   vector<VertexIndexContainer> mCurrentVertexIndices;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp	(revision 2572)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp	(revision 2600)
@@ -46,5 +46,5 @@
 bool
 UnigraphicsParser::ParseFile(const string filename,
-							 SceneGraphNode *root,
+							 SceneGraphLeaf *root,
 							 const bool loadMeshes,
 							 vector<FaceParentInfo> *parents)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h	(revision 1786)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h	(revision 2600)
@@ -10,4 +10,5 @@
 
 class SceneGraphNode;
+class SceneGraphLeaf;
 class Intersectable;
 
@@ -19,5 +20,5 @@
 
   virtual bool ParseFile(const std::string filename,
-						 SceneGraphNode *root,
+						 SceneGraphLeaf *root,
 						 const bool loadMeshes = true,
 						 std::vector<FaceParentInfo> *parents = NULL) 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.h	(revision 1379)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.h	(revision 2600)
@@ -16,5 +16,5 @@
   
   virtual bool ParseFile(const std::string filename, 
-						 SceneGraphNode *root,
+						 SceneGraphLeaf *root,
 						 const bool loadMeshes = true,
 						 vector<FaceParentInfo> *parents = NULL);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp	(revision 2575)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp	(revision 2600)
@@ -183,5 +183,5 @@
 static void ProcessMesh(FaceContainer &faces, 
 						map<int, Vector3> &hashTable,
-						SceneGraphNode *root,
+						SceneGraphLeaf *root,
 						vector<FaceParentInfo> *parents)
 {
@@ -222,5 +222,5 @@
 
 bool ObjParser::ParseFile(const string filename,
-						  SceneGraphNode *root,
+						  SceneGraphLeaf *root,
 						  const bool loadMeshes,
 						  vector<FaceParentInfo> *parents)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h	(revision 2598)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h	(revision 2600)
@@ -28,4 +28,5 @@
 class BvhNode;
 class SimpleRayContainer;
+class SceneGraphLeaf;
 
 struct VssRayContainer;
@@ -222,5 +223,5 @@
 protected:
 
-	void CreateVertexArrays();
+	void CreateVertexArrays(SceneGraphLeaf *leaf);
 	void DeleteVbos();
 	void EnableDrawArrays();
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h	(revision 2600)
@@ -15,7 +15,6 @@
 	X3dParser();
   
-	bool ParseFile(
-				   const std::string filename, 
-				   SceneGraphNode *root, 
+	bool ParseFile(const std::string filename, 
+				   SceneGraphLeaf *root, 
 				   const bool loadMeshes = false,
 				   vector<FaceParentInfo> *parents = NULL);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 2575)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 2600)
@@ -56,5 +56,5 @@
 bool
 PlyParser::ParseSingleFile(const std::string filename,
-						   SceneGraphNode *root)
+						   SceneGraphLeaf *root)
 {
   /*** the PLY object ***/
@@ -260,5 +260,5 @@
 bool
 PlyParser::ParseFile(const string filename,
-					 SceneGraphNode *root,
+					 SceneGraphLeaf *root,
 					 const bool loadMeshes,
 					 vector<FaceParentInfo> *parents)
