Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vienna.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vienna.sh	(revision 2596)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vienna.sh	(revision 2601)
@@ -7,4 +7,7 @@
 TARGET=release
 PROGRAM=../bin/$TARGET/Preprocessor.exe
+
+COMMAND="../bin/$TARGET/Preprocessor.exe -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000"
+
 
 echo "starting $TARGET version"
@@ -22,5 +25,5 @@
 
 
-$PROGRAM $ENVIRONMENT \
+$COMMAND $ENVIRONMENT \
 -scene_filename=$SCENE \
 -preprocessor=gvs \
@@ -29,5 +32,5 @@
 -gvs_samples_per_pass=50000 \
 -gvs_initial_samples=16 \
--gvs_max_viewcells=10 \
+-gvs_max_viewcells=100 \
 -gvs_min_contribution=50 \
 -gvs_per_viewcell=true \
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_arena.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_arena.sh	(revision 2596)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_arena.sh	(revision 2601)
@@ -6,5 +6,5 @@
 #TARGET=debug
 TARGET=release
-PROGRAM=../bin/$TARGET/Preprocessor.exe
+COMMAND="../bin/$TARGET/Preprocessor.exe -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000"
 
 echo "starting $TARGET version"
@@ -21,5 +21,5 @@
 
 
-$PROGRAM $ENVIRONMENT \
+$COMMAND $ENVIRONMENT \
 -scene_filename=$SCENE \
 -preprocessor=gvs \
@@ -28,5 +28,5 @@
 -gvs_samples_per_pass=50000 \
 -gvs_initial_samples=16 \
--gvs_max_viewcells=10 \
+-gvs_max_viewcells=200 \
 -gvs_min_contribution=50 \
 -gvs_per_viewcell=true \
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 2601)
@@ -162,18 +162,28 @@
 	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/SceneGraph.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 2601)
@@ -39,5 +39,5 @@
 //protected:
 
-	NodeContainer mChildren;
+	SceneGraphNodeContainer mChildren;
 };
 
@@ -54,5 +54,6 @@
 //protected:
 
-	MeshContainer mGeometry;
+	//MeshContainer mGeometry;
+	ObjectContainer mGeometry;
 };
 
@@ -69,5 +70,5 @@
 	bool Export(const std::string filename);
   
-	int CollectObjects(ObjectContainer *instances);
+	int CollectObjects(ObjectContainer &instances);
   
 	int AssignObjectIds();
@@ -85,12 +86,16 @@
 	void LoadScene(const std::string filename);
 
-	SceneGraphNode *GetRoot();
+	SceneGraphInterior *GetRoot();
 
-	void SetRoot(SceneGraphNode *sgNnode);
+	//void SetRoot(SceneGraphNode *sgNnode);
+	void SetRoot(SceneGraphInterior *sgNnode);
 
+	void AddChild(SceneGraphNode *node);
+
+	int GetSize() const;
 
 protected:
 
-	 SceneGraphNode *mRoot;
+	 SceneGraphInterior *mRoot;
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ObjExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ObjExporter.cpp	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ObjExporter.cpp	(revision 2601)
@@ -26,17 +26,26 @@
 ObjExporter::ExportSceneNode(SceneGraphNode *node)
 {
-  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);
+		}
+	}
 }
-
 
 void
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 2601)
@@ -66,5 +66,5 @@
 
 
-SceneGraphNode *SceneGraph::GetRoot()
+SceneGraphInterior *SceneGraph::GetRoot()
 {
 	return mRoot;
@@ -72,5 +72,5 @@
 
 
-void SceneGraph::SetRoot(SceneGraphLeaf *root)
+void SceneGraph::SetRoot(SceneGraphInterior *root)
 {
 	mRoot = root;
@@ -80,5 +80,5 @@
 int SceneGraph::CollectObjects(ObjectContainer &instances)
 {
-	instances->clear();
+	instances.clear();
 	int number = 0;
 
@@ -93,5 +93,5 @@
 		if (node->IsLeaf())
 		{
-			SceneGraphLeaf *leaf = static_cast<SceneGraphNodeLeaf *>(node);
+			SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node);
 
 			ObjectContainer::const_iterator mi = leaf->mGeometry.begin();
@@ -99,10 +99,10 @@
 			for (; mi != leaf->mGeometry.end(); mi++)
 			{
-				instances->push_back(*mi);
-			}
-		}
-		else
-		{
-			SceneGraphInterior *interior = static_cast<SceneGraphNodeInterior *>(node);
+				instances.push_back(*mi);
+			}
+		}
+		else
+		{
+			SceneGraphInterior *interior = static_cast<SceneGraphInterior *>(node);
 			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
 
@@ -133,5 +133,5 @@
 		nodeStack.pop();
 
-		if (node->IsLeaf)
+		if (node->IsLeaf())
 		{
 			SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node);
@@ -146,6 +146,8 @@
 		{
 			SceneGraphInterior *interior = static_cast<SceneGraphInterior *>(node);
-			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
-			for (; ni != node->mChildren.end(); ni ++) 
+
+			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+			
+			for (; ni != interior->mChildren.end(); ni ++) 
 			{
 				nodeStack.push(*ni);
@@ -166,24 +168,36 @@
 	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++) {
-			intersectables++;
-			faces += (*mi)->NumberOfFaces();
-		}
-
-		SceneGraphNodeContainer::iterator ni = node->mChildren.begin();
-		for (; ni != node->mChildren.end(); ni++) {
-			nodeStack.push(*ni);
-		}
-	}
-
-}
-
-
-void SceneGraphInterior::UpdateBox()
+
+	while (!nodeStack.empty()) 
+	{
+		SceneGraphNode *node = nodeStack.top();
+		nodeStack.pop();
+
+		if (node->IsLeaf())
+		{
+			SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node);
+
+			ObjectContainer::const_iterator mi = leaf->mGeometry.begin();
+			for (; mi != leaf->mGeometry.end(); mi++) 
+			{
+				intersectables++;
+				faces += (*mi)->NumberOfFaces();
+			}
+		}
+		else
+		{
+			SceneGraphInterior *interior = static_cast<SceneGraphInterior *>(node);
+
+			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+			for (; ni != interior->mChildren.end(); ni++) 
+			{
+				nodeStack.push(*ni);
+			}
+		}
+	}
+}
+
+
+void SceneGraphLeaf::UpdateBox()
 {
 	AxisAlignedBox3 box;
@@ -198,5 +212,5 @@
 
 
-void SceneGraphLeaf::UpdateBox()
+void SceneGraphInterior::UpdateBox()
 {
 	AxisAlignedBox3 box;
@@ -229,3 +243,36 @@
 
 
-}
+int SceneGraph::GetSize() const
+{
+	stack<SceneGraphNode *> nodeStack;
+
+	nodeStack.push(mRoot);
+	int size = 0;
+
+	while (!nodeStack.empty()) 
+	{
+		SceneGraphNode *node = nodeStack.top();
+		nodeStack.pop();
+
+		if (node->IsLeaf())
+		{
+			SceneGraphLeaf *leaf = static_cast<SceneGraphLeaf *>(node);
+
+			size += leaf->mGeometry.size();
+		}
+		else
+		{
+			SceneGraphInterior *interior = static_cast<SceneGraphInterior *>(node);
+
+			SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+			for (; ni != interior->mChildren.end(); ni++) 
+			{
+				nodeStack.push(*ni);
+			}
+		}
+	}
+
+	return size;
+}
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2601)
@@ -240,5 +240,5 @@
 
 
-bool Preprocessor::ExportBinaryObj(const string &filename, SceneGraphNode *root)
+bool Preprocessor::ExportBinaryObj(const string &filename, SceneGraphLeaf *root)
 {
 	ogzstream samplesOut(filename.c_str());
@@ -406,5 +406,5 @@
 
 	// root for different files
-	mSceneGraph->SetRoot(new SceneGraphNode());
+	mSceneGraph->SetRoot(new SceneGraphInterior());
 
 	// intel ray caster can only trace triangles
@@ -421,24 +421,26 @@
 	if (files == 1) 
 	{
+		SceneGraphLeaf *leaf = new SceneGraphLeaf();
+
 		if (strstr(filename.c_str(), ".x3d"))
 		{
 			parser = new X3dParser;
-
+			
 			result = parser->ParseFile(filename, 
-				mSceneGraph->GetRoot(),
+									   leaf,
+									   mLoadMeshes,
+									   fi);
+			delete parser;
+		}
+		else if (strstr(filename.c_str(), ".ply") || strstr(filename.c_str(), ".plb"))
+		{
+			parser = new PlyParser;
+
+			result = parser->ParseFile(filename, 
+				leaf,
 				mLoadMeshes,
 				fi);
 			delete parser;
 		}
-		else if (strstr(filename.c_str(), ".ply") || strstr(filename.c_str(), ".plb"))
-		{
-			parser = new PlyParser;
-
-			result = parser->ParseFile(filename, 
-				mSceneGraph->GetRoot(),
-				mLoadMeshes,
-				fi);
-			delete parser;
-		}
 		else if (strstr(filename.c_str(), ".obj"))
 		{
@@ -450,5 +452,5 @@
 			if (!mLoadMeshes)
 			{
-				result = LoadBinaryObj(bnFile, mSceneGraph->GetRoot(), fi);
+				result = LoadBinaryObj(bnFile, leaf, fi);
 			}
 
@@ -459,7 +461,7 @@
 				parser = new ObjParser;
 
-				result = parser->ParseFile(filename, mSceneGraph->GetRoot(), mLoadMeshes, fi);
-
-				cout << "loaded " << (int)mSceneGraph->GetRoot()->mGeometry.size() << " entities" << endl;
+				result = parser->ParseFile(filename, leaf, mLoadMeshes, fi);
+
+				cout << "loaded " << (int)leaf->mGeometry.size() << " entities" << endl;
 
 				// only works for triangles
@@ -468,5 +470,5 @@
 					cout << "exporting binary obj to " << bnFile << "... " << endl;
 
-					ExportBinaryObj(bnFile, mSceneGraph->GetRoot());
+					ExportBinaryObj(bnFile, leaf);
 
 					cout << "finished" << endl;
@@ -479,6 +481,11 @@
 		{
 			parser = new UnigraphicsParser;
-			result = parser->ParseFile(filename, mSceneGraph->GetRoot(), mLoadMeshes, fi);
+			result = parser->ParseFile(filename, leaf, mLoadMeshes, fi);
 			delete parser;
+		}
+
+		if (result)
+		{
+			mSceneGraph->GetRoot()->mChildren.push_back(leaf);
 		}
 
@@ -499,5 +506,6 @@
 				parser = new UnigraphicsParser;
 
-			SceneGraphNode *node = new SceneGraphNode();
+			SceneGraphLeaf *node = new SceneGraphLeaf();
+
 			const bool success = 
 				parser->ParseFile(filename, node, mLoadMeshes, fi);
@@ -526,5 +534,5 @@
 		
 		mObjects.reserve(intersectables);
-		mSceneGraph->CollectObjects(&mObjects);
+		mSceneGraph->CollectObjects(mObjects);
 	
 		mSceneGraph->AssignObjectIds();
@@ -584,5 +592,5 @@
   KdLeaf *root = (KdLeaf *)mKdTree->GetRoot();
  	
-  mSceneGraph->CollectObjects(&root->mObjects);
+  mSceneGraph->CollectObjects(root->mObjects);
   
   const long startTime = GetTime();
@@ -1618,8 +1626,13 @@
 {
 //	bool success = LoadBinaryObj(filename, mSceneGraph->GetRoot(), &mFaceParents);
-	bool success = LoadBinaryObj(filename, mSceneGraph->GetRoot(), NULL);
-
-	return success;
-}
-
-}
+	SceneGraphLeaf *leaf = new SceneGraphLeaf();
+	if (LoadBinaryObj(filename, leaf, NULL))
+	{
+		mSceneGraph->GetRoot()->mChildren.push_back(leaf);
+		return true;
+	}
+
+	return false;
+}
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2593)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2601)
@@ -1008,5 +1008,5 @@
 				//		  cout<<i<<":"<<costFunction[i]<<" ";
 				// update cost function to an absolute value based on the total geometry count
-				costFunction[i]*=mSceneGraph->GetRoot()->mGeometry.size();
+				costFunction[i] *= mSceneGraph->GetSize();
 				if (costFunction[i] > maxCost)
 					maxCost = costFunction[i];
@@ -1334,5 +1334,4 @@
 {
 	mUseFalseColors = true;
-
 	//glPushAttrib(GL_CURRENT_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT);
 
@@ -1341,12 +1340,12 @@
 	//glDisable(GL_CULL_FACE);
 
-	double eq[4];
-	eq[0] = mSceneCutPlane.mNormal.x;
-	eq[1] = mSceneCutPlane.mNormal.y;
-	eq[2] = mSceneCutPlane.mNormal.z;
-	eq[3] = mSceneCutPlane.mD;
-
 	if (mCutViewCells) 
 	{
+		double eq[4];
+		eq[0] = mSceneCutPlane.mNormal.x;
+		eq[1] = mSceneCutPlane.mNormal.y;
+		eq[2] = mSceneCutPlane.mNormal.z;
+		eq[3] = mSceneCutPlane.mD;
+
 		glClipPlane(GL_CLIP_PLANE0, eq);
 		glEnable(GL_CLIP_PLANE0);
@@ -1362,5 +1361,6 @@
 	int i;
 
-	if (!mShowPvsSizes && !mShowPiercingRays && !mShowWeightedRays && !mShowWeightedCost)
+	// normal rendering
+	if (!mShowPvsSizes && !mShowPiercingRays && !mShowWeightedRays && !mShowWeightedCost && !mShowComparison)
 	{
 		for (i = 0; i < viewcells.size(); ++ i) 
@@ -1383,5 +1383,5 @@
 		}
 	}
-	else
+	else // using specialised colors
 	{
 		// transparency	
Index: GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp	(revision 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp	(revision 2601)
@@ -195,5 +195,5 @@
 
 	  SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
-	  for (; ni != interior->mChildren.end(); ni++)
+	  for (; ni != interior->mChildren.end(); ++ ni)
 		  ExportSceneNode(*ni);
   }
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2601)
@@ -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 SceneGraphLeaf();
+		SceneGraphLeaf *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 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2601)
@@ -84,5 +84,5 @@
 mCurrentFrame(-1)
 {
-	mSceneGraph->CollectObjects(&mObjects);
+	mSceneGraph->CollectObjects(mObjects);
 
 #if 1
@@ -400,5 +400,12 @@
 	OcclusionQuery::GenQueries(mOcclusionQueries, 10);
 
-	CreateVertexArrays(static_cast<SceneGraphLeaf *>(mSceneGraph->GetRoot()));
+	SceneGraphInterior *interior = mSceneGraph->GetRoot();
+
+	SceneGraphNodeContainer::iterator ni = interior->mChildren.begin();
+
+	for (; ni != interior->mChildren.end(); ni++) 
+	{
+		CreateVertexArrays(static_cast<SceneGraphLeaf *>(*ni));
+	}
 }
 
@@ -1736,5 +1743,5 @@
 		glNormalPointer(GL_FLOAT, 0, (char *)NULL + offset * sizeof(Vector3));
 
-		glBufferDataARB(GL_ARRAY_BUFFER_ARB, leaf->mObjects.size() * 6 * sizeof(Vector3), mData, GL_STATIC_DRAW_ARB);
+		glBufferDataARB(GL_ARRAY_BUFFER_ARB, leaf->mGeometry.size() * 6 * sizeof(Vector3), mData, GL_STATIC_DRAW_ARB);
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp	(revision 2176)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp	(revision 2601)
@@ -521,5 +521,5 @@
     
     exporter->SetWireframe();
-    //    exporter->ExportScene(mSceneGraph->GetRoot());
+    // exporter->ExportScene(mSceneGraph->GetRoot());
 
     exporter->ExportBox(mSource);
@@ -682,34 +682,33 @@
 
 MutualVisibilitySampler::MutualVisibilitySampler(SceneGraph *sceneGraph,
-																								 KdTree *kdTree,
-																								 const AxisAlignedBox3 &source,
-																								 const AxisAlignedBox3 &target,
-																								 const float solidAngleThreshold)
-{
-  mSceneGraph = sceneGraph;
-  mKdTree = kdTree;
-  mSource = source;
-  mTarget = target;
-  mUseBoxes = true;
-  mSolidAngleThreshold = solidAngleThreshold;
-}
-  
+												 KdTree *kdTree,
+												 const AxisAlignedBox3 &source,
+												 const AxisAlignedBox3 &target,
+												 const float solidAngleThreshold)
+{
+	mSceneGraph = sceneGraph;
+	mKdTree = kdTree;
+	mSource = source;
+	mTarget = target;
+	mUseBoxes = true;
+	mSolidAngleThreshold = solidAngleThreshold;
+}
+
 
 int
 ComputeBoxVisibility(SceneGraph *sceneGraph,
-										 KdTree *kdTree,
-										 const AxisAlignedBox3 &source,
-										 const AxisAlignedBox3 &target,
-										 const float solidAngleThreshold)
-{
-  MutualVisibilitySampler
+					 KdTree *kdTree,
+					 const AxisAlignedBox3 &source,
+					 const AxisAlignedBox3 &target,
+					 const float solidAngleThreshold)
+{
+	MutualVisibilitySampler
 		sampler(sceneGraph, kdTree, source, target, solidAngleThreshold);
 
-  
-  int visibility = sampler.ComputeVisibility();
-
-  return visibility;
-  
-}
-  
-}
+	int visibility = sampler.ComputeVisibility();
+
+	return visibility;
+
+}
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2598)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2601)
@@ -343,5 +343,7 @@
 		hitTriangle = static_cast<TriangleIntersectable *>(tObj)->GetItem();
 	else
-		cout << "border sampling: " << tObj->Type() << " not yet implemented" << endl;
+		cout << "border sampling: " << Intersectable::GetTypeName(tObj) << " not yet implemented" << endl;
+
+	//cout << "type: " << Intersectable::GetTypeName(tObj) << endl;
 
 	VertexContainer enlargedTriangle;
@@ -912,8 +914,17 @@
 		// exchange triangle pvs with objects
 		//UpdatePvs(mCurrentViewCell);
-		GetObjectPvs(objectPvs);
+        GetObjectPvs(objectPvs);
+
+		// add pvs
+		ObjectContainer::const_iterator it, it_end = objectPvs.end();
+
+		for (it = objectPvs.begin(); it != it_end; ++ it)
+		{
+			mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f);
+		}
 
 		cout << "triangle pvs of " << (int)mTrianglePvs.size() 
 			 << " was converted to object pvs of " << (int)objectPvs.size() << endl;
+		
 
 		////////
Index: GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 2600)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 2601)
@@ -167,5 +167,5 @@
  ply_close (ply);
 
- SceneGraphNode *currentNode = root;
+ SceneGraphLeaf *currentNode = root;
 
  cerr<<"Baking faces into meshes"<<endl;
@@ -217,24 +217,24 @@
    meshProxy.mFaces.push_back(new Face(vc));
  }
- 
+
  if (meshProxy.mFaces.size()) {
 
-   if (indexVertices)
-	 meshProxy.IndexVertices();
-
-   Mesh *mesh = new Mesh((int)meshProxy.mVertices.size(),
-						 (int)meshProxy.mFaces.size());
-
-   mesh->mVertices = meshProxy.mVertices;
-   
-   mesh->mFaces = meshProxy.mFaces;
-   
-   if (useRandomMaterial)
-	 mesh->AssignRandomMaterial();
-   
-   mesh->Preprocess();
-   // make an instance of this mesh
-   MeshInstance *mi = new MeshInstance(mesh);
-   currentNode->mGeometry.push_back(mi);
+	 if (indexVertices)
+		 meshProxy.IndexVertices();
+
+	 Mesh *mesh = new Mesh((int)meshProxy.mVertices.size(),
+		 (int)meshProxy.mFaces.size());
+
+	 mesh->mVertices = meshProxy.mVertices;
+
+	 mesh->mFaces = meshProxy.mFaces;
+
+	 if (useRandomMaterial)
+		 mesh->AssignRandomMaterial();
+
+	 mesh->Preprocess();
+	 // make an instance of this mesh
+	 MeshInstance *mi = new MeshInstance(mesh);
+	 currentNode->mGeometry.push_back(mi);
  }
 
