Index: GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 1141)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp	(revision 1166)
@@ -177,6 +177,7 @@
 	case Intersectable::KD_INTERSECTABLE:
 		ExportKdIntersectable(*(dynamic_cast<KdIntersectable *>(object)));
+		break;
 	default:
-		cerr << "Sorry the export for object not yet defined" << endl;
+		cerr << "Sorry the export for object type " << Intersectable::GetTypeName(object) << " is not available yet" << endl;
 		break;
 	}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 1002)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h	(revision 1166)
@@ -44,4 +44,12 @@
   AxisAlignedBox3 GetBox() const { return mRoot->mBox; }
   
+  /** Exports binary version of the scene.
+  */
+  void ExportScene(const string filename);
+
+  /** Loads binary version of the scene.
+  */
+  void LoadScene(const string filename);
+
 protected:
 };
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 1002)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp	(revision 1166)
@@ -152,3 +152,14 @@
 }
 
+
+void SceneGraph::ExportScene(const string filename)
+{
+	// export binary version of mesh
 }
+
+void SceneGraph::LoadScene(const string filename)
+{
+	//  load binary version of mesh
+}
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1160)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp	(revision 1166)
@@ -813,4 +813,5 @@
 	
 	//Debug << "f: " << frontData.mRays->size() << " b: " << backData.mRays->size() << "d: " << tData.mRays->size() << endl;
+
 	//-- compute pvs
 	frontData.mPvs = ComputePvsSize(*frontData.mRays);
@@ -843,5 +844,5 @@
 #ifdef _DEBUG
 	Debug << interior << endl;
-#endif
+#endif+
 
 
@@ -1157,5 +1158,5 @@
 		// add objects without the objects which are in several kd leaves
 		pvsSize += (int)(leaf->mObjects.size() - leaf->mMultipleObjects.size());
-		//Debug << "here11 " << (int)leaf->mObjects.size() << " " << leaf->mMultipleObjects.size() << endl;
+		//Debug << "adding " << (int)leaf->mObjects.size() << " " << leaf->mMultipleObjects.size() << endl;
 	}
 	else
@@ -3229,4 +3230,15 @@
 									   int &objectsBack)
 {
+	RayInfoContainer usedRays;
+int mMaxTests = 5000;
+	if (mMaxTests < (int)tData.mRays->size())
+	{
+		GetRayInfoSets(*tData.mRays, mMaxTests, usedRays);
+	}
+	else
+	{
+		usedRays = *tData.mRays;
+	}
+
 	// go through the lists, count the number of objects left and right
 	// and evaluate the following cost funcion:
@@ -3253,5 +3265,6 @@
 	int vcr = numViewCells;
   
-	const int totalPvs = tData.mNode->mObjects.size();
+	/// this is kind of a reverse pvs
+	const int totalPvs = (int)tData.mNode->mObjects.size();
 	
 	int pvsl = 0;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.cpp	(revision 1153)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.cpp	(revision 1166)
@@ -25,5 +25,4 @@
 	Camera camera;
 
-	cout << "here79\n"; 
 	if (0)
 	{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1161)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1166)
@@ -21,5 +21,5 @@
 
 // should not count origin object for sampling because it disturbs heuristics
-#define COUNT_ORIGIN_OBJECTS 0
+#define SAMPLE_ORIGIN_OBJECTS 0
 
 namespace GtpVisibilityPreprocessor {
@@ -1898,5 +1898,5 @@
 			// made in one direction!!!
 			// the other contributions of this sample will be counted for the oposite ray!
-#if COUNT_ORIGIN_OBJECTS
+#if SAMPLE_ORIGIN_OBJECTS
 			if (ray.mOriginObject && 
 				viewcell->GetPvs().GetSampleContribution(ray.mOriginObject,
@@ -1927,5 +1927,5 @@
 					viewcell->GetPvs().AddSample(ray.mTerminationObject, ray.mPdf);
 				}				
-#if COUNT_ORIGIN_OBJECTS
+#if SAMPLE_ORIGIN_OBJECTS
 				 if (ray.mOriginObject)
 				 {
@@ -5809,5 +5809,5 @@
 			// made in one direction!!!
 			// the other contributions of this sample will be counted for the oposite ray!
-#if COUNT_ORIGIN_OBJECTS
+#if SAMPLE_ORIGIN_OBJECTS
 			if (ray.mOriginObject && 
 				viewcell->GetPvs().GetSampleContribution(ray.mOriginObject,
@@ -5850,5 +5850,5 @@
 				}
 				
-#if COUNT_ORIGIN_OBJECTS
+#if SAMPLE_ORIGIN_OBJECTS
 				 if (ray.mOriginObject)
 					 viewcell->AddPvsSample(ray.mOriginObject, ray.mPdf, ray.mPvsContribution);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 1161)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 1166)
@@ -1426,4 +1426,34 @@
 
 
+void ViewCellsTree::UpdateStats(ofstream &stats,
+								const int pass,
+								const int viewCells,
+								const float renderCostDecrease,
+								const float totalRenderCost,
+								const int currentPvs,
+								const float expectedCost,
+								const float avgRenderCost,
+								const float deviation,
+								const int totalPvs,
+								const int entriesInPvs,
+								const int pvsSizeDecr,
+								const float volume)
+{
+	 stats << "#Pass\n" << pass << endl
+		//<< "#Merged\n" << mergeStats.merged << endl 
+		<< "#ViewCells\n" << viewCells << endl 
+        << "#RenderCostDecrease\n" << renderCostDecrease << endl // TODO
+		<< "#TotalRenderCost\n" << totalRenderCost << endl
+		<< "#CurrentPvs\n" << currentPvs << endl
+		<< "#ExpectedCost\n" << expectedCost << endl
+		<< "#AvgRenderCost\n" << avgRenderCost << endl
+		<< "#Deviation\n" << deviation << endl
+		<< "#TotalPvs\n" << totalPvs << endl
+		<< "#TotalEntriesInPvs\n" << entriesInPvs << endl
+		<< "#PvsSizeDecrease\n" << pvsSizeDecr << endl // TODO
+		<< "#Volume\n" << volume << endl
+		<< endl;
+}
+
 void ViewCellsTree::ExportStats(const string &mergeStats)
 {
@@ -1444,9 +1474,10 @@
 	*/
 
-	int totalPvs;
 	float totalRenderCost, avgRenderCost, expectedCost;
 
 	float deviation = 0;
-	totalPvs = rootPvs;
+	int totalPvs = rootPvs;
+	int entriesInPvs = rootEntries;
+
 	totalRenderCost = avgRenderCost = expectedCost = (float)rootPvs;
 
@@ -1455,19 +1486,9 @@
 
 	//-- first view cell
-	stats 
-		<< "#Pass\n" << 0 << endl
-		//<< "#Merged\n" << mergeStats.merged << endl 
-		<< "#ViewCells\n" << numViewCells << endl 
-        << "#RenderCostDecrease\n" << 0 << endl // TODO
-		<< "#TotalRenderCost\n" << totalRenderCost << endl
-		<< "#CurrentPvs\n" << rootPvs << endl
-		<< "#CurrentEntries\n" << rootEntries << endl
-		<< "#ExpectedCost\n" << expectedCost << endl
-		<< "#AvgRenderCost\n" << avgRenderCost << endl
-		<< "#Deviation\n" << deviation << endl
-		<< "#TotalPvs\n" << totalPvs << endl
-		<< "#PvsSizeDecrease\n" << 0 << endl // TODO
-		<< "#Volume\n" << mRoot->GetVolume() << endl
-		<< endl;
+	UpdateStats(stats,
+				0, numViewCells, 0, totalRenderCost, 
+				rootPvs, expectedCost, avgRenderCost, deviation,
+				totalPvs, entriesInPvs, 0, mRoot->GetVolume());
+		
 
 	//-- go through tree in the order of render cost decrease
@@ -1484,9 +1505,12 @@
 		{	
 			ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc);
-			
+
 			const int parentPvs = GetPvsSize(interior);
-			const float parentCost = (float)parentPvs * interior->GetVolume();
+			const int parentPvsEntries = GetPvsEntries(interior);
+            const float parentCost = (float)parentPvs * interior->GetVolume();
+
 			float childCost = 0;
 			int childPvs = 0;
+			int childPvsEntries = 0;
 
 			-- numViewCells;
@@ -1496,9 +1520,13 @@
 			for (it = interior->mChildren.begin(); it != it_end; ++ it)
 			{
-				const int pvsSize = GetPvsSize(*it);
-				childCost += (float) pvsSize * (*it)->GetVolume();
+				ViewCell *vc = *it;
+				const int pvsSize = GetPvsSize(vc);
+				const int pvsEntries = GetPvsEntries(vc);
+
+				childCost += (float) pvsSize * vc->GetVolume();
 				childPvs += pvsSize;
-
-				tqueue.push(*it);
+				childPvsEntries += pvsEntries;
+
+				tqueue.push(vc);
 				++ numViewCells;
 			}
@@ -1509,22 +1537,14 @@
 			totalRenderCost -= costDecr;
 			totalPvs += childPvs - parentPvs;
-			
+			entriesInPvs += childPvsEntries - parentPvsEntries;
+
 			expectedCost = totalRenderCost / (float)numViewCells;
 			avgRenderCost = (float)totalPvs / (float)numViewCells;
 
-			stats 
-				<< "#Pass\n" << 0 << endl
-				//<< "#Merged\n" << mergeStats.merged << endl 
-				<< "#ViewCells\n" << numViewCells << endl 
-				<< "#RenderCostDecrease\n" << costDecr << endl // TODO
-				<< "#TotalRenderCost\n" << totalRenderCost << endl
-				<< "#CurrentPvs\n" << parentPvs << endl
-				<< "#ExpectedCost\n" << expectedCost << endl
-				<< "#AvgRenderCost\n" << avgRenderCost << endl
-				<< "#Deviation\n" << deviation << endl
-				<< "#TotalPvs\n" << totalPvs << endl
-				<< "#PvsSizeDecrease\n" << childPvs - parentPvs << endl // TODO
-				<< "#Volume\n" << vc->GetVolume() << endl
-				<< endl;
+			UpdateStats(stats,
+						0, numViewCells, costDecr, totalRenderCost,
+						parentPvs, expectedCost, avgRenderCost, deviation,
+                        totalPvs, entriesInPvs, childPvs - parentPvs,
+						vc->GetVolume());
 
 		}
@@ -1635,5 +1655,5 @@
 }
 
-// TODO matt: implement for different storing methods
+// TODO matt: implement this function for different storing methods
 void ViewCellsTree::GetPvs(ViewCell *vc, ObjectPvs &pvs) const
 {
@@ -1686,4 +1706,188 @@
 
 
+int ViewCellsTree::GetPvsSizeForLeafStorage(ViewCell *vc) const
+{
+	int pvsSize = 0;
+
+	// pvs is always stored directly in leaves
+	if (vc->IsLeaf())
+	{
+		pvsSize = vc->GetPvs().CountPvs();
+		//int pvsSize1 = vc->GetPvs().GetSize();
+		//Debug << "entries num: " << pvsSize1 << " size: "" << pvsSize << endl;
+	}
+	else // interior node
+	{
+		// interior nodes: pvs is either stored as a scalar or
+		// has to be reconstructed from the leaves
+
+		// the stored pvs size is the valid pvs size => just return scalar
+		if (vc->mPvsSizeValid)
+		{
+			pvsSize = vc->mPvsSize;
+		}
+		
+		// if no valid pvs size stored as a scalar => 
+		// compute current pvs size of interior from it's leaf nodes
+		ViewCellContainer leaves;
+		CollectLeaves(vc, leaves);
+
+		ViewCellContainer::const_iterator it, it_end = leaves.end();
+
+		Intersectable::NewMail();
+
+		// sum different intersectables
+		for (it = leaves.begin(); it != it_end; ++ it)
+		{
+			pvsSize = GetPvsSizeForLeafStorage(*it);
+		}
+	}
+
+	return pvsSize;
+}
+
+
+int ViewCellsTree::GetEntriesInPvsForLeafStorage(ViewCell *vc) const
+{
+	int pvsSize = 0;
+
+	// pvs is always stored directly in leaves
+	if (vc->IsLeaf())
+	{
+		pvsSize = vc->GetPvs().GetSize();
+	}
+	else // interior node
+	{
+		// interior nodes: pvs is either stored as a scalar or
+		// has to be reconstructed from the leaves
+
+		// the stored pvs size is the valid pvs size => just return scalar
+		if (vc->mPvsSizeValid)
+		{
+			pvsSize = vc->mEntriesInPvs;
+		}
+		
+		// if no valid pvs size stored as a scalar => 
+		// compute current pvs size of interior from it's leaf nodes
+		ViewCellContainer leaves;
+		CollectLeaves(vc, leaves);
+
+		ViewCellContainer::const_iterator it, it_end = leaves.end();
+
+		Intersectable::NewMail();
+
+		// sum different intersectables
+		for (it = leaves.begin(); it != it_end; ++ it)
+		{
+			pvsSize = GetEntriesInPvsForLeafStorage(*it);
+		}
+	}
+
+	return pvsSize;
+}
+
+
+int ViewCellsTree::GetPvsSizeForCompressedStorage(ViewCell *vc) const
+{
+	int pvsSize = 0;
+
+	//-- compressed pvs
+
+	// the stored pvs size is the valid pvs size => just return scalar
+	if (vc->mPvsSizeValid)
+	{
+		pvsSize = vc->mPvsSize;
+	}
+
+	// if no pvs size stored, compute new one
+	ViewCell *root = vc;
+	
+	// also add pvs from this view cell to root
+	while (root->GetParent())
+	{
+		root = root->GetParent();
+	
+		// matt: bug! must evaluate kd pvss also
+		pvsSize += CountDiffPvs(root);
+	}
+
+	stack<ViewCell *> tstack;
+	tstack.push(vc);
+
+	while (!tstack.empty())
+	{
+		vc = tstack.top();
+		tstack.pop();
+		// matt: bug! must evaluate kd pvss also
+		pvsSize += CountDiffPvs(vc);
+
+		if (!vc->IsLeaf())
+		{
+			ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc);
+
+			ViewCellContainer::const_iterator it, it_end = interior->mChildren.end();
+
+			for (it = interior->mChildren.begin(); it != it_end; ++ it)
+			{
+				tstack.push(*it);
+			}		
+		}
+	}
+
+	return pvsSize;
+}
+
+
+int ViewCellsTree::GetEntriesInPvsForCompressedStorage(ViewCell *vc) const
+{
+	int pvsSize = 0;
+
+	//-- compressed pvs
+
+	// the stored pvs size is the valid pvs size => just return scalar
+	if (vc->mPvsSizeValid)
+	{
+		pvsSize = vc->mEntriesInPvs;
+	}
+
+	// if no pvs size stored, compute new one
+	ViewCell *root = vc;
+	
+	// also add pvs from this view cell to root
+	while (root->GetParent())
+	{
+		root = root->GetParent();
+		// count the pvs entries different from the already found ones	
+		pvsSize += CountDiffPvs(root);
+	}
+
+	stack<ViewCell *> tstack;
+	tstack.push(vc);
+
+	while (!tstack.empty())
+	{
+		vc = tstack.top();
+		tstack.pop();
+	
+		// count the pvs entries different from the already found ones	
+		pvsSize += CountDiffPvs(vc);
+
+		if (!vc->IsLeaf())
+		{
+			ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc);
+
+			ViewCellContainer::const_iterator it, it_end = interior->mChildren.end();
+
+			for (it = interior->mChildren.begin(); it != it_end; ++ it)
+			{
+				tstack.push(*it);
+			}		
+		}
+	}
+
+	return pvsSize;
+}
+
+
 int ViewCellsTree::GetPvsSize(ViewCell *vc) const
 {
@@ -1700,97 +1904,10 @@
 	case PVS_IN_LEAVES: //-- store pvs only in leaves
 		{			
-			// pvs is always stored directly in leaves
-			if (vc->IsLeaf())
-			{
-				pvsSize = vc->GetPvs().CountPvs();
-			}
-			else // interior node
-			{
-				// interior nodes: pvs is either stored as a scalar or
-				// has to be reconstructed from the leaves
-
-				// the stored pvs size is the valid pvs size => just return scalar
-				if (vc->mPvsSizeValid)
-				{
-					pvsSize = vc->mPvsSize;
-					break;
-				}
-		
-				//-- if no valid pvs size stored as a scalar => 
-				//-- compute current pvs size of interior from it's leaf nodes
-				ViewCellContainer leaves;
-				CollectLeaves(vc, leaves);
-
-				ViewCellContainer::const_iterator it, it_end = leaves.end();
-
-				Intersectable::NewMail();
-
-				// sum different intersectables
-				for (it = leaves.begin(); it != it_end; ++ it)
-				{
-					ObjectPvsMap::iterator oit, oit_end = (*it)->GetPvs().mEntries.end();
-
-					// mail all from first pvs
-					for (oit = (*it)->GetPvs().mEntries.begin(); oit != oit_end; ++ oit)
-					{
-						Intersectable *intersect = (*oit).first;
-
-						if (!intersect->Mailed())
-						{
-							++ pvsSize;
-							intersect->Mail();					
-						}
-					}
-				}
-
-				break;
-			}
+			pvsSize = GetPvsSizeForLeafStorage(vc);			
+			break;
 		}
 	case COMPRESSED:
 		{
-			////////////////////////
-			//-- compressed pvs
-
-			// the stored pvs size is the valid pvs size => just return scalar
-			if (vc->mPvsSizeValid)
-			{
-				pvsSize = vc->mPvsSize;
-				break;
-			}
-
-			// if no pvs size stored, compute new one
-			int pvsSize = 0;
-			ViewCell *root = vc;
-	
-			// also add pvs from this view cell to root
-			while (root->GetParent())
-			{
-				root = root->GetParent();
-				// matt: bug! must evaluate kd pvss also
-				pvsSize += CountDiffPvs(root);
-			}
-
-			stack<ViewCell *> tstack;
-			tstack.push(vc);
-
-			while (!tstack.empty())
-			{
-				vc = tstack.top();
-				tstack.pop();
-	
-				pvsSize += CountDiffPvs(vc);
-
-				if (!vc->IsLeaf())
-				{
-					ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc);
-
-					ViewCellContainer::const_iterator it, it_end = interior->mChildren.end();
-
-					for (it = interior->mChildren.begin(); it != it_end; ++ it)
-					{
-						tstack.push(*it);
-					}		
-				}
-			}
+			pvsSize = GetPvsSizeForCompressedStorage(vc);
 			break;
 		}
@@ -1820,96 +1937,10 @@
 	case PVS_IN_LEAVES: //-- store pvs only in leaves
 		{			
-			// pvs is always stored directly in leaves
-			if (vc->IsLeaf())
-			{
-				pvsSize = vc->GetPvs().GetSize();
-			}
-			else // interior node
-			{
-				// interior nodes: pvs is either stored as a scalar or
-				// has to be reconstructed from the leaves
-
-				// the stored pvs size is the valid pvs size => just return scalar
-				if (vc->mPvsSizeValid)
-				{
-					pvsSize = vc->mPvsSize;
-					break;
-				}
-		
-				// if no valid pvs size stored as a scalar => 
-				// compute current pvs size of interior from it's leaf nodes
-				ViewCellContainer leaves;
-				CollectLeaves(vc, leaves);
-
-				ViewCellContainer::const_iterator it, it_end = leaves.end();
-
-				Intersectable::NewMail();
-
-				// sum different intersectables
-				for (it = leaves.begin(); it != it_end; ++ it)
-				{
-					ObjectPvsMap::iterator oit, oit_end = (*it)->GetPvs().mEntries.end();
-
-					// mail all from first pvs
-					for (oit = (*it)->GetPvs().mEntries.begin(); oit != oit_end; ++ oit)
-					{
-						Intersectable *intersect = (*oit).first;
-
-						if (!intersect->Mailed())
-						{
-							++ pvsSize;
-							intersect->Mail();					
-						}
-					}
-				}
-
-				break;
-			}
+			pvsSize = GetEntriesInPvsForLeafStorage(vc);
+			break;
 		}
 	case COMPRESSED:
 		{
-			////////////////////////
-			//-- compressed pvs
-
-			// the stored pvs size is the valid pvs size => just return scalar
-			if (vc->mPvsSizeValid)
-			{
-				pvsSize = vc->mPvsSize;
-				break;
-			}
-
-			// if no pvs size stored, compute new one
-			int pvsSize = 0;
-			ViewCell *root = vc;
-	
-			// also add pvs from this view cell to root
-			while (root->GetParent())
-			{
-				root = root->GetParent();
-				pvsSize += CountDiffPvs(root);
-			}
-
-			stack<ViewCell *> tstack;
-			tstack.push(vc);
-
-			while (!tstack.empty())
-			{
-				vc = tstack.top();
-				tstack.pop();
-	
-				pvsSize += CountDiffPvs(vc);
-
-				if (!vc->IsLeaf())
-				{
-					ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc);
-
-					ViewCellContainer::const_iterator it, it_end = interior->mChildren.end();
-
-					for (it = interior->mChildren.begin(); it != it_end; ++ it)
-					{
-						tstack.push(*it);
-					}		
-				}
-			}
+			pvsSize = GetEntriesInPvsForCompressedStorage(vc);
 			break;
 		}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1161)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1166)
@@ -619,4 +619,23 @@
 #endif
 
+	int GetEntriesInPvsForCompressedStorage(ViewCell *vc) const;
+	int GetPvsSizeForCompressedStorage(ViewCell *vc) const;
+	int GetPvsSizeForLeafStorage(ViewCell *vc) const;
+	int GetEntriesInPvsForLeafStorage(ViewCell *vc) const;
+
+	void UpdateStats(
+		ofstream &stats,
+		const int pass,
+		const int viewCells,
+		const float renderCostDecrease,
+		const float totalRenderCost,
+		const int currentPvs,
+		const float expectedCost,
+		const float avgRenderCost,
+		const float deviation,
+		const int totalPvs,
+		const int entriesInPvs,
+		const int pvsSizeDecr,
+		const float volume);
 
 	/// if the view cell tree hold compressed pvs
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h	(revision 1143)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h	(revision 1166)
@@ -95,4 +95,31 @@
 		return a->mCounter > b->mCounter;
 	}
+
+	static string GetTypeName(Intersectable *obj)
+	{
+		switch(obj->Type())
+		{
+		case MESH_INSTANCE:
+			return "mesh_instance\n";
+		
+		case TRANSFORMED_MESH_INSTANCE:
+			return "transformed_mesh_instance\n";
+			
+		case SPHERE:
+			return "sphere\n";
+
+		case VIEW_CELL:
+			return "view cell\n";
+		
+		case OGRE_MESH_INSTANCE:
+			return "ogre_mesh_instance\n";
+
+		case KD_INTERSECTABLE:
+			return "kd_intersectable\n";
+
+		default:
+			return "unknown\n";
+		}
+	}
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 1146)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 1166)
@@ -24,5 +24,5 @@
 	Vector3 normal;
 	  
-	const int i = RandomValue(0, mPreprocessor.mObjects.size() - 1);
+	const int i = RandomValue(0, (int)mPreprocessor.mObjects.size() - 1);
 
 	Intersectable *object = mPreprocessor.mObjects[i];
Index: GTP/trunk/Lib/Vis/QtRenderer/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/QtRenderer/QtGlRenderer.cpp	(revision 1151)
+++ GTP/trunk/Lib/Vis/QtRenderer/QtGlRenderer.cpp	(revision 1166)
@@ -1359,6 +1359,6 @@
 
 	
-	int currentPos = mViewCellsManager->GetViewCells().size();
-	float currentCost=-1;
+	int currentPos = (int)mViewCellsManager->GetViewCells().size();
+	float currentCost= -1;
 
 	if (currentPos < costFunction.size())
Index: GTP/trunk/Lib/Vis/QtRenderer/QtRenderer.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/QtRenderer/QtRenderer.vcproj	(revision 1163)
+++ GTP/trunk/Lib/Vis/QtRenderer/QtRenderer.vcproj	(revision 1166)
@@ -20,5 +20,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\Preprocessing\src;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;"
+				AdditionalIncludeDirectories="&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\Preprocessing\src;..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;QTRENDERER_EXPORTS"
 				MinimalRebuild="TRUE"
@@ -28,15 +28,15 @@
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
+				DebugInformationFormat="4"/>
 			<Tool
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib QtCore4.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib"
-				OutputFile="$(OutDir)/QtGlRenderer.dll"
-				LinkIncremental="1"
+				AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4d.lib Qt3Support4d.lib QAxContainerd.lib QtCore4d.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib"
+				OutputFile="$(OutDir)/QtRenderer.dll"
+				LinkIncremental="2"
 				AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;..\..\..\..\..\NonGTP\Zlib\lib;&quot;$(CG_LIB_PATH)&quot;;&quot;..\Preprocessing\lib\$(ConfigurationName)&quot;;..\Preprocessing\src\GL;..\..\..\..\..\NonGTP\Xerces\xercesc\lib"
 				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+				ProgramDatabaseFile="$(OutDir)/QtRenderer.pdb"
 				SubSystem="2"
 				ImportLibrary="$(OutDir)/QtRenderer.lib"
