Index: /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh	(revision 2695)
@@ -7,5 +7,5 @@
 TARGET=release
 
-COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=10000000 -total_samples=250000000 -preprocessor_pvs_rendererror_samples=100000 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+ -kd_pvs_area=1e-4 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ -view_cells_import_random_viewcells+ -view_cells_export_random_viewcells-" 
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=10000000 -total_samples=250000000 -preprocessor_pvs_rendererror_samples=100000 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace- -kd_pvs_area=1e-4 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ -view_cells_import_random_viewcells+ -view_cells_export_random_viewcells-" 
 
 echo "starting $TARGET version"
Index: /GTP/trunk/Lib/Vis/Preprocessing/scripts/gvs.env
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/scripts/gvs.env	(revision 2687)
+++ /GTP/trunk/Lib/Vis/Preprocessing/scripts/gvs.env	(revision 2695)
@@ -99,9 +99,15 @@
 
 	Termination {
-		minCost 0
-		maxDepth 20
-		
-		maxCostRatio 1.5
+		minCost 1
+		maxDepth 30
+		maxCostRatio 0.98
 		ct_div_ci 0.5
+		maxNodes 100000
+
+		#minCost 0
+		#maxDepth 20
+		
+		#maxCostRatio 1.5
+		#ct_div_ci 0.5
 	}
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna	(revision 2695)
@@ -8,6 +8,6 @@
 
 
-SCENE=../data/vienna/vienna_cropped.obj
-#SCENE=../data/vienna/city_full.obj
+#SCENE=../data/vienna/vienna_cropped.obj
+SCENE=../data/vienna/city_full.obj
 
 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
@@ -36,5 +36,5 @@
 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \
 -preprocessor_stats=$PREFIX-i-mixed-b1-n4a.log \
--preprocessor_detect_empty_viewspace- \
+-preprocessor_detect_empty_viewspace+ \
 -preprocessor_use_vbos- \
 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h	(revision 2695)
@@ -37,5 +37,5 @@
 		mReverseSamples = 0;
 		mBorderSamples = 0;
-		mGvsPass = 0;
+		mGvsRuns = 0;
 
 		mTotalPvs = 0;
@@ -60,5 +60,5 @@
 	int mReverseSamples;
 	int mBorderSamples;
-	int mGvsPass;
+	int mGvsRuns;
 
 	int mTotalPvs;
@@ -287,7 +287,4 @@
 	int mMaxViewCells;
 
-	ObjectContainer mTrianglePvs;
-
-	// HACK
 	int mGvsSamplesPerPass;
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2690)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2695)
@@ -362,5 +362,5 @@
 	/** Sets a view space boundary.
 	*/
-	void SetViewSpaceBox(const AxisAlignedBox3 &box);
+	virtual void SetViewSpaceBox(const AxisAlignedBox3 &box);
 	/** Returns the boundaries of the view space.
 	*/
@@ -1248,4 +1248,8 @@
 							   const ObjectContainer &objects);
 
+	/** Sets a view space boundary.
+	*/
+	virtual void SetViewSpaceBox(const AxisAlignedBox3 &box);
+
 #if TEST_PACKETS
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2695)
@@ -662,9 +662,9 @@
 		cout << "loading objects from " << buf << endl;
 
-		// load scene objects used as pvs entries
+		// load scene objects which are the entities used as pvs entries
 		ObjectContainer pvsObjects;
 		if (0) LoadObjects(buf, pvsObjects, mObjects);
 
-		const bool finalizeViewCells = true;
+		const bool finalizeViewCells = false;
 		cout << "loading view cells from " << buf << endl;
 		
@@ -689,23 +689,16 @@
 		mViewCellsManager = CreateViewCellsManager(buf);
 
-		// default view space is the extent of the scene
-		AxisAlignedBox3 viewSpaceBox;
-
 		if (mUseViewSpaceBox)
 		{
-			viewSpaceBox = mSceneGraph->GetBox();
+			// default view space is the extent of the scene
+			AxisAlignedBox3 viewSpaceBox = mSceneGraph->GetBox();
 
 			// use a small box outside of the scene
 			viewSpaceBox.Scale(Vector3(0.15f, 0.3f, 0.5f));
-			//viewSpaceBox.Translate(Vector3(Magnitude(mSceneGraph->GetBox().Size()) * 0.5f, 0, 0));
 			viewSpaceBox.Translate(Vector3(Magnitude(mSceneGraph->GetBox().Size()) * 0.3f, 0, 0));
 			mViewCellsManager->SetViewSpaceBox(viewSpaceBox);
 		}
-		else
-		{
-			viewSpaceBox = mSceneGraph->GetBox();
-			mViewCellsManager->SetViewSpaceBox(viewSpaceBox);
-		}
-
+		
+		
 		bool loadVcGeometry;
 		Environment::GetSingleton()->GetBoolValue("ViewCells.loadGeometry", loadVcGeometry);
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2575)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2695)
@@ -278,9 +278,9 @@
 	
 	void EvaluateSubdivision(std::ofstream &splitsStats,
-							  const int splitsStepSize,
-							  const bool useFilter,
-							  const bool useHisto,
-							  const int histoMem,
-							  const int pass);
+							 int splitsStepSize,
+							 bool useFilter,
+							 bool useHisto,
+							 int histoMem,
+							 int pass);
 
 
@@ -290,7 +290,8 @@
 	void CreateUniqueObjectIds();
 
-	float EvalCorrectedPvs(const float pvsFront, 
-						   const float totalPvs,
-						   const float raysPerObjects) const;
+	float EvalCorrectedPvs(float pvsFront, 
+						   float totalPvs,
+						   float raysPerObjects) const;
+
 	/** Casts line segment into the view cells tree.
 		@param origin the origin of the line segment
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2695)
@@ -141,4 +141,25 @@
 
 
+void QtGlRendererBuffer::RenderTrianglePvs()
+{
+	ObjectContainer::const_iterator oit, oit_end = 
+		mViewCellsManager->GetPreprocessor()->mTrianglePvs.end();
+
+	//int sz = mViewCellsManager->GetPreprocessor()->mDummyBuffer.size();
+
+	int i = 0;
+	for (oit = mViewCellsManager->GetPreprocessor()->mTrianglePvs.begin();
+		 oit != oit_end; ++ oit, ++ i)
+	{
+		//int dum = mViewCellsManager->GetPreprocessor()->mDummyBuffer[i];
+		//glColor3f(0, (float)dum / 20.0f, 1);
+		if (mUseFalseColors) SetupFalseColor((*oit)->mId);
+
+		RenderIntersectable(*oit);
+	}
+}
+
+
+
 // reimplemented here so that we can snap the error windows
 float QtGlRendererBuffer::GetPixelError(int &pvsSize)
@@ -182,8 +203,7 @@
 	pvsSize = pvs.GetSize();
 	
+	// hack: assume that view cell empty
 	if (pvsSize == 0)
 		return 0.0f;
-
-	mUseForcedColors = true;
 
 	SetupCamera();
@@ -270,7 +290,8 @@
 
 	// some error happened
-	if (pixelCount > pixelThres) 
-	{
-		cout << "f " << mFrame << " id " << viewcell->GetId() << " pvs " << pvsSize << " e " << pixelCount << " vp " << mViewPoint << " vd " << mViewDirection << endl;
+	if (1)//pixelCount > pixelThres) 
+	{
+		cout << "f " << mFrame << " id " << viewcell->GetId() << " pvs " << pvsSize 
+			 << " e " << pixelCount << " vp " << mViewPoint << " vd " << mViewDirection << endl;
 	
 		if (mSnapErrorFrames) 
@@ -292,9 +313,10 @@
 			im.save(qstr, "PNG");
 
-#if 0
+#if 1
 			///////////
 			//-- output computed pvs
-
-			//mUseFalseColors = true;
+			
+			//mUseFalseColors = false;
+			mUseFalseColors = true;
 			glPushAttrib(GL_CURRENT_BIT);
 			glColor3f(0, 1, 0);
@@ -309,9 +331,11 @@
 
 			// render pvs once
-			RenderPvs(pvs);
+			//RenderPvs(pvs);
+			RenderTrianglePvs();
 
 			glFlush();
 
-			//mUseForcedColors = false;
+			mUseFalseColors = false;
+
 			im = toImage();
 			sprintf(filename, "error-frame-%04d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount);
@@ -338,4 +362,5 @@
 	int pvsSize = 0;
 	QImage image = toImage();
+
 	Intersectable::NewMail();
 
@@ -1218,4 +1243,10 @@
 
 
+QtGlRendererWidget::~QtGlRendererWidget() 
+{ 
+	delete mPlacer; 
+}
+
+
 void
 QtGlRendererWidget::RenderRenderCost()
@@ -2571,4 +2602,51 @@
 }
 
-
-}
+/*
+
+int ExampleRenderThread::faceAtPosition(const QPoint &pos) 
+{ 
+	// we need to lock the rendering context 
+	glw.lockGLContext(); 
+	// this is the same as in every OpenGL picking example 
+	const int MaxSize = 512; 
+	// see below for an explanation on the buffer content 
+	GLuint buffer[MaxSize]; 
+	GLint viewport[4];
+	glGetIntegerv(GL_VIEWPORT, viewport); 
+	glSelectBuffer(MaxSize, buffer); 
+	// enter select mode 
+	glRenderMode(GL_SELECT); 
+	glInitNames(); 
+	glPushName(0); 
+	glMatrixMode(GL_PROJECTION); 
+	glPushMatrix(); 
+	glLoadIdentity(); 
+	gluPickMatrix((GLdouble)pos.x(), 215 (GLdouble)(viewport[3] - pos.y()), 216 5.0, 5.0, viewport); 
+	GLfloat x = (GLfloat)viewport_size.width() / viewport_size.height(); 
+	glFrustum(-x, x, -1.0, 1.0, 4.0, 15.0); 
+	draw(); 
+	glMatrixMode(GL_PROJECTION); 
+	glPopMatrix();
+	// finally release the rendering context again 
+	if (!glRenderMode(GL_RENDER)) 
+	{ 
+		glw.unlockGLContext(); 
+		return -1; 
+	} 
+	
+	glw.unlockGLContext(); 
+	
+	// Each hit takes 4 items in the buffer. 
+	// The first item is the number of names on the name stack when the hit occured. 
+	// The second item is the minimum z value of all the verticies that intersected
+	// the viewing area at the time of the hit. The third item is the maximum z value 
+	// of all the vertices that intersected the viewing area at the time of the hit 
+	// and the last item is the content of the name stack at the time of the hit 
+	// (name of the object). We are only interested in the object name 
+	// (number of the surface). 
+	// return the name of the clicked surface 
+	
+	return buffer[3]; 
+}
+*/
+}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2695)
@@ -76,4 +76,7 @@
 	int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const;
 
+	/** quick hack in order to be able to render gvs pvs.
+	*/
+	void RenderTrianglePvs();
 
 public:
@@ -260,5 +263,5 @@
 	QtGlRendererWidget() {};
 
-	~QtGlRendererWidget() { delete mPlacer; }
+	~QtGlRendererWidget();
 
 	void SetThread(QtPreprocessorThread *t)
@@ -266,9 +269,11 @@
 		mPreprocessorThread = t;
 	}
+
 	void RenderRenderCost();
 
 	virtual void SetupCamera();
 
-	void initializeGL() {
+	void initializeGL() 
+	{
 		InitGL();
 	}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2695)
@@ -283,4 +283,11 @@
 	void UpdateDynamicObjects();
 
+	/// triangle pvs for gvs 
+	// hack: should be in gvspreprocessor but pulled 
+	// out here for visualization purpose
+	ObjectContainer mTrianglePvs;
+
+	//std::vector<int> mDummyBuffer;
+
 
 protected:
@@ -324,5 +331,7 @@
 	PreprocessorThread *mThread;
 
-  bool mUpdateDynamicObjects;
+	bool mUpdateDynamicObjects;
+
+	
 };
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp	(revision 2686)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp	(revision 2695)
@@ -139,5 +139,8 @@
 	AxisAlignedBox3 bbox = mViewCellsManager->GetViewSpaceBox();
 
- 	string buf;
+	cout << "old view space box: " << bbox << endl;
+
+	string buf;
+
 	while (!(getline(inStream, buf)).eof())
 	{
@@ -161,7 +164,7 @@
 				sscanf(buf.c_str(), "p %f %f %f %f %f %f", &pt.x, &pt.y, &pt.z, &dir.x, &dir.y, &dir.z);
 				
-				if (0)
-				{
-					// add new point to view space box
+				if (1)
+				{
+					// include new point into view space box
 					if (!bbox.IsInside(pt))
 						bbox.Include(pt);
@@ -194,4 +197,6 @@
 	// set updated view space box containing all view points
 	mViewCellsManager->SetViewSpaceBox(bbox);
+
+	cout << "new view space box: " << mViewCellsManager->GetViewSpaceBox() << endl;
 
 	return true;
@@ -278,5 +283,5 @@
 		viewPoint =  box.GetPoint(pVector);
 	
-		const Vector3 dVector = Vector3(2 * M_PI * Random(1.0f), M_PI * Random(1.0f), 0.0f);
+		const Vector3 dVector = Vector3(2.0f * M_PI * Random(1.0f), M_PI * Random(1.0f), 0.0f);
 		direction = Normalize(Vector3(sin(dVector.x), 0.0f, cos(dVector.x)));
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h	(revision 2588)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h	(revision 2695)
@@ -354,4 +354,5 @@
 	friend class ViewCellsParseHandlers;
 	friend class HierarchyManager;
+	friend class VspOspViewCellsManager;
 
 public:
@@ -552,5 +553,5 @@
 	*/ 
 	VspTree();
-	/** Constructor just setting the bounds of the tree.
+	/** Constructor setting the bounds of the tree.
 	*/ 
 	VspTree(const AxisAlignedBox3 &bbox);
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2690)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2695)
@@ -2277,4 +2277,17 @@
 
 
+void VspOspViewCellsManager::SetViewSpaceBox(const AxisAlignedBox3 &box)
+{
+	mViewSpaceBox = box;
+	mHierarchyManager->mVspTree->mBoundingBox = box;
+
+	cout << "vsp bounding box: " << box << endl;
+	// hack: create clip plane relative to new view space box
+	CreateClipPlane();
+	// the total area of the view space has changed
+	mTotalAreaValid = false;
+}
+
+
 void ViewCellsManager::CreateClipPlane()
 {
@@ -6218,8 +6231,5 @@
 		if (exporter)
 		{
-			if (CLAMP_TO_BOX)
-			{	
-				exporter->mClampToBox = true; 	
-			}
+			if (CLAMP_TO_BOX) exporter->mClampToBox = true; 	
 
 			const long starttime = GetTime();
@@ -6534,5 +6544,5 @@
 	CreateUniqueViewCellIds();
 
-	int numBoxes = mPreprocessor->mKdTree->mKdIntersectables.size();
+	int numBoxes = (int)mPreprocessor->mKdTree->mKdIntersectables.size();
 	stream.write(reinterpret_cast<char *>(&numBoxes), sizeof(int));
 
@@ -6566,5 +6576,5 @@
 	//-- export the view cells and the pvs
 
-	int numViewCells = mViewCells.size();
+	int numViewCells = (int)mViewCells.size();
 	stream.write(reinterpret_cast<char *>(&numViewCells), sizeof(int));
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj	(revision 2680)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj	(revision 2695)
@@ -202,4 +202,630 @@
 	<Files>
 		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\AxisAlignedBox3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Beam.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Timer\BenchTimer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\BitVectorPvs.h"
+				>
+			</File>
+			<File
+				RelativePath=".\BoostPreprocessorThread.h"
+				>
+			</File>
+			<File
+				RelativePath=".\BoundingBoxConverter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\BvHierarchy.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Camera.h"
+				>
+			</File>
+			<File
+				RelativePath=".\common.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\configh.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Containers.h"
+				>
+			</File>
+			<File
+				RelativePath=".\DifferenceSampling.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Environment.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ExactPreprocessor.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Exporter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\FilterBasedDistribution.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\FilterBasedDistribution.h"
+				>
+			</File>
+			<File
+				RelativePath=".\FlexibleHeap.h"
+				>
+			</File>
+			<File
+				RelativePath=".\GzBinFileInputStream.h"
+				>
+			</File>
+			<File
+				RelativePath=".\GzFileInputSource.h"
+				>
+			</File>
+			<File
+				RelativePath=".\gzstream.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Halton.h"
+				>
+			</File>
+			<File
+				RelativePath=".\HashPvs.h"
+				>
+			</File>
+			<File
+				RelativePath=".\HavranRayCaster.h"
+				>
+			</File>
+			<File
+				RelativePath=".\HierarchyManager.h"
+				>
+			</File>
+			<File
+				RelativePath=".\IntelRayCaster.h"
+				>
+			</File>
+			<File
+				RelativePath=".\InternalRayCaster.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Intersectable.h"
+				>
+			</File>
+			<File
+				RelativePath=".\IntersectableWrapper.h"
+				>
+			</File>
+			<File
+				RelativePath=".\IntersectionBoundingBoxConverter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\KdTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\LogManager.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Mailable.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Material.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Matrix4x4.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Timer\merror.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Mesh.h"
+				>
+			</File>
+			<File
+				RelativePath=".\MeshKdTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Timer\mstring.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Mutation.h"
+				>
+			</File>
+			<File
+				RelativePath=".\MutualVisibility.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ObjectPvs.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ObjExporter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\OcclusionQuery.h"
+				>
+			</File>
+			<File
+				RelativePath=".\OspTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Parser.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Timer\PerfTimer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Timer\PerfTimerSkeleton.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Plane3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ply.h"
+				>
+			</File>
+			<File
+				RelativePath=".\PlyParser.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Polygon3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Polytope.h"
+				>
+			</File>
+			<File
+				RelativePath=".\PreprocessorThread.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Pvs.h"
+				>
+			</File>
+			<File
+				RelativePath=".\PvsBase.h"
+				>
+			</File>
+			<File
+				RelativePath=".\PvsDefinitions.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RandomViewCellsHandler.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Ray.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RayCaster.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RayInfo.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\raypack.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Timer\RDTSCTimer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Rectangle3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Renderer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RenderSimulator.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RenderTexture.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ResourceManager.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ReverseGvs.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RndGauss.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RssTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SamplingStrategy.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SceneGraph.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SimpleRay.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Statistics.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SubdivisionCandidate.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Tetrahedron3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\timer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Trackball.h"
+				>
+			</File>
+			<File
+				RelativePath=".\TraversalTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Triangle3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\UnigraphicsParser.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Vector2.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Vector3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ViewCell.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ViewCellBsp.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ViewCellsManager.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VrmlExporter.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VspBspTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VspTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VssRay.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VssTree.h"
+				>
+			</File>
+			<File
+				RelativePath=".\X3dParserXerces.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="havran"
+			>
+			<File
+				RelativePath=".\havran\allocgo2.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\allocgo2.h"
+				>
+			</File>
+			<File
+				RelativePath=".\HavranDynRayCaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\HavranRayCaster.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktb.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktb.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktb8b.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktb8b.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbai.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbai.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktball.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktball.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbconf.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbf2trv.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbftrav.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbs.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbs.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbtrav.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\ktbtrav.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\sbbox.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\sbbox.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\subdivm.h"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\testrt.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\havran\testrt.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Renderer"
+			>
+			<File
+				RelativePath=".\glInterface.h"
+				>
+			</File>
+			<File
+				RelativePath=".\GlobalLinesRenderer.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\GlobalLinesRenderer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\GlRenderer.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\GlRenderer.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Loader"
+			>
+			<File
+				RelativePath=".\ObjectsParser.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\ObjectsParser.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ObjectsParserXerces.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ObjParser.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\ObjParser.h"
+				>
+			</File>
+			<File
+				RelativePath=".\plyfile.c"
+				>
+			</File>
+			<File
+				RelativePath=".\PlyParser.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\PreprocessorFactory.h"
+				>
+			</File>
+			<File
+				RelativePath=".\UnigraphicsParser.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\ViewCellsParser.h"
+				>
+			</File>
+			<File
+				RelativePath=".\ViewCellsParserXerces.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VrmlExporter.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\X3dParser.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\X3dParser.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Preprocessors"
+			>
+			<File
+				RelativePath=".\CombinedPreprocessor.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\CombinedPreprocessor.h"
+				>
+			</File>
+			<File
+				RelativePath=".\GvsPreprocessor.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\GvsPreprocessor.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Preprocessor.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\Preprocessor.h"
+				>
+			</File>
+			<File
+				RelativePath=".\PreprocessorFactory.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\RenderSampler.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\RenderSampler.h"
+				>
+			</File>
+			<File
+				RelativePath=".\RssPreprocessor.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\RssPreprocessor.h"
+				>
+			</File>
+			<File
+				RelativePath=".\SamplingPreprocessor.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\SamplingPreprocessor.h"
+				>
+			</File>
+			<File
+				RelativePath=".\VssPreprocessor.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\VssPreprocessor.h"
+				>
+			</File>
+		</Filter>
+		<Filter
 			Name="Source Files"
 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
@@ -231,8 +857,4 @@
 			</File>
 			<File
-				RelativePath=".\CombinedPreprocessor.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\common.cpp"
 				>
@@ -255,16 +877,4 @@
 			</File>
 			<File
-				RelativePath=".\GlobalLinesRenderer.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\GlRenderer.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\GvsPreprocessor.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\GzBinFileInputStream.cpp"
 				>
@@ -283,12 +893,4 @@
 			</File>
 			<File
-				RelativePath=".\HavranDynRayCaster.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\HavranRayCaster.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\HierarchyManager.cpp"
 				>
@@ -359,16 +961,8 @@
 			</File>
 			<File
-				RelativePath=".\ObjectsParser.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\ObjExporter.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\ObjParser.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\OcclusionQuery.cpp"
 				>
@@ -383,12 +977,4 @@
 			</File>
 			<File
-				RelativePath=".\plyfile.c"
-				>
-			</File>
-			<File
-				RelativePath=".\PlyParser.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Polygon3.cpp"
 				>
@@ -399,12 +985,4 @@
 			</File>
 			<File
-				RelativePath=".\Preprocessor.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\PreprocessorFactory.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\PreprocessorThread.cpp"
 				>
@@ -439,8 +1017,4 @@
 			</File>
 			<File
-				RelativePath=".\RenderSampler.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\RenderSimulator.cpp"
 				>
@@ -455,16 +1029,8 @@
 			</File>
 			<File
-				RelativePath=".\RssPreprocessor.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\RssTree.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\SamplingPreprocessor.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\SamplingStrategy.cpp"
 				>
@@ -499,8 +1065,4 @@
 			</File>
 			<File
-				RelativePath=".\UnigraphicsParser.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Vector2.cpp"
 				>
@@ -527,8 +1089,4 @@
 			</File>
 			<File
-				RelativePath=".\VrmlExporter.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\VspBspTree.cpp"
 				>
@@ -539,8 +1097,4 @@
 			</File>
 			<File
-				RelativePath=".\VssPreprocessor.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\VssRay.cpp"
 				>
@@ -555,547 +1109,5 @@
 			</File>
 			<File
-				RelativePath=".\X3dParser.cpp"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
-			>
-			<File
-				RelativePath=".\AxisAlignedBox3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Beam.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Timer\BenchTimer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\BitVectorPvs.h"
-				>
-			</File>
-			<File
-				RelativePath=".\BoostPreprocessorThread.h"
-				>
-			</File>
-			<File
-				RelativePath=".\BoundingBoxConverter.h"
-				>
-			</File>
-			<File
-				RelativePath=".\BvHierarchy.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Camera.h"
-				>
-			</File>
-			<File
-				RelativePath=".\CombinedPreprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\common.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\configh.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Containers.h"
-				>
-			</File>
-			<File
-				RelativePath=".\DifferenceSampling.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Environment.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ExactPreprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Exporter.h"
-				>
-			</File>
-			<File
-				RelativePath=".\FilterBasedDistribution.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\FilterBasedDistribution.h"
-				>
-			</File>
-			<File
-				RelativePath=".\FlexibleHeap.h"
-				>
-			</File>
-			<File
-				RelativePath=".\glInterface.h"
-				>
-			</File>
-			<File
-				RelativePath=".\GlobalLinesRenderer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\GlRenderer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\GvsPreprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\GzBinFileInputStream.h"
-				>
-			</File>
-			<File
-				RelativePath=".\GzFileInputSource.h"
-				>
-			</File>
-			<File
-				RelativePath=".\gzstream.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Halton.h"
-				>
-			</File>
-			<File
-				RelativePath=".\HashPvs.h"
-				>
-			</File>
-			<File
-				RelativePath=".\HavranRayCaster.h"
-				>
-			</File>
-			<File
-				RelativePath=".\HierarchyManager.h"
-				>
-			</File>
-			<File
-				RelativePath=".\IntelRayCaster.h"
-				>
-			</File>
-			<File
-				RelativePath=".\InternalRayCaster.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Intersectable.h"
-				>
-			</File>
-			<File
-				RelativePath=".\IntersectableWrapper.h"
-				>
-			</File>
-			<File
-				RelativePath=".\IntersectionBoundingBoxConverter.h"
-				>
-			</File>
-			<File
-				RelativePath=".\KdTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\LogManager.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Mailable.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Material.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Matrix4x4.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Timer\merror.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Mesh.h"
-				>
-			</File>
-			<File
-				RelativePath=".\MeshKdTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Timer\mstring.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Mutation.h"
-				>
-			</File>
-			<File
-				RelativePath=".\MutualVisibility.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ObjectPvs.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ObjectsParser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ObjectsParserXerces.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ObjExporter.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ObjParser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\OcclusionQuery.h"
-				>
-			</File>
-			<File
-				RelativePath=".\OspTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Parser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Timer\PerfTimer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Timer\PerfTimerSkeleton.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Plane3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ply.h"
-				>
-			</File>
-			<File
-				RelativePath=".\PlyParser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Polygon3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Polytope.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Preprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\PreprocessorFactory.h"
-				>
-			</File>
-			<File
-				RelativePath=".\PreprocessorThread.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Pvs.h"
-				>
-			</File>
-			<File
-				RelativePath=".\PvsBase.h"
-				>
-			</File>
-			<File
-				RelativePath=".\PvsDefinitions.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RandomViewCellsHandler.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Ray.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RayCaster.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RayInfo.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\raypack.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Timer\RDTSCTimer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Rectangle3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Renderer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RenderSampler.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RenderSimulator.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RenderTexture.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ResourceManager.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ReverseGvs.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RndGauss.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RssPreprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\RssTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\SamplingPreprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\SamplingStrategy.h"
-				>
-			</File>
-			<File
-				RelativePath=".\SceneGraph.h"
-				>
-			</File>
-			<File
-				RelativePath=".\SimpleRay.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Statistics.h"
-				>
-			</File>
-			<File
-				RelativePath=".\SubdivisionCandidate.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Tetrahedron3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\timer.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Trackball.h"
-				>
-			</File>
-			<File
-				RelativePath=".\TraversalTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Triangle3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\UnigraphicsParser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Vector2.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Vector3.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ViewCell.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ViewCellBsp.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ViewCellsManager.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ViewCellsParser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ViewCellsParserXerces.h"
-				>
-			</File>
-			<File
-				RelativePath=".\VrmlExporter.h"
-				>
-			</File>
-			<File
-				RelativePath=".\VspBspTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\VspTree.h"
-				>
-			</File>
-			<File
-				RelativePath=".\VssPreprocessor.h"
-				>
-			</File>
-			<File
-				RelativePath=".\VssRay.h"
-				>
-			</File>
-			<File
-				RelativePath=".\VssTree.h"
-				>
-			</File>
-			<File
 				RelativePath=".\X3dExporter.h"
-				>
-			</File>
-			<File
-				RelativePath=".\X3dParser.h"
-				>
-			</File>
-			<File
-				RelativePath=".\X3dParserXerces.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="havran"
-			>
-			<File
-				RelativePath=".\havran\allocgo2.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\allocgo2.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktb.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktb.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktb8b.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktb8b.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbai.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbai.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktball.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktball.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbconf.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbf2trv.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbftrav.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbs.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbs.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbtrav.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\ktbtrav.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\sbbox.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\sbbox.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\subdivm.h"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\testrt.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\havran\testrt.h"
 				>
 			</File>
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2690)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2695)
@@ -125,4 +125,11 @@
 		mViewPoint = Vector3(680.682, 189.552, -278.177);
 		mViewDirection = Vector3(0.942709, -0, -0.333584);
+
+		// strange error for gvs
+		mViewPoint = Vector3(1186.9, 193.552, -377.044);
+		mViewDirection = Vector3(-0.963031, -0, -0.269365);
+
+		mViewPoint = Vector3(1189.54, 220.087, -462.869);
+		mViewDirection = Vector3(-0.996972, -0, -0.0776569);
 	}
 
@@ -194,6 +201,5 @@
 	glPushAttrib(GL_CURRENT_BIT);
 
-	if (mUseFalseColors)
-		SetupFalseColor(object->mId);
+	if (mUseFalseColors) SetupFalseColor(object->mId);
 
 	switch (object->Type()) 
@@ -1882,6 +1888,4 @@
 		TriangleIntersectable *obj = static_cast<TriangleIntersectable *>(leaf->mGeometry[i]);
 
-		if (obj->GetId() != i)
-			cerr << "****\n****riesenfehler" << endl;
 		Triangle3 tri = obj->GetItem();
 		const Vector3 n = tri.GetNormal();
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 2176)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 2695)
@@ -722,24 +722,19 @@
 	/// Pointer to the root of the tree
 	BspNode *mRoot;
-	
 	/// the pointer to the view cells manager
 	ViewCellsManager *mViewCellsManager;
-	
 	/// View cell corresponding to the space outside the valid view space
 	BspViewCell *mOutOfBoundsCell;
-
 	/// the bsp tree statistics
 	BspTreeStatistics mBspStats;
-
 	/// sorted split candidates used for sweep-heuristics
 	vector<SortableEntry> *mLocalSubdivisionCandidates;
-
 	/// box around the whole view domain
 	AxisAlignedBox3 mBoundingBox;
-
 	/// pointer to the hierarchy of view cells
 	ViewCellsTree *mViewCellsTree;
 
 
+	///////////
 	//-- termination critera
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2689)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2695)
@@ -283,5 +283,8 @@
 	}
 
-
+	// create meshes of view cells
+	preprocessor->mViewCellsManager->FinalizeViewCells(true);
+
+	cout << "view space box: " << preprocessor->mViewCellsManager->GetViewSpaceBox() << endl;
 	bool useHwGlobalLines;
 	Environment::GetSingleton()->GetBoolValue("Preprocessor.useHwGlobalLines",
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2695)
@@ -87,5 +87,5 @@
 	mGvsStats.Reset();
 
-	// hack: some generic statistical values that can be read
+	// hack: some generic statistical values that can be used
 	// by an application using the preprocessor
 	for (int i = 0; i < 2; ++ i)
@@ -110,5 +110,5 @@
 		mRayQueue.pop();
 
-		//delete ray;
+		// note: deletion of the ray is handled by ray pool
 	}
 }
@@ -145,8 +145,9 @@
 	const float len = Magnitude(currentRay.mTermination - currentRay.mOrigin);
 	
+#if 1
 	// distance large => this is likely to be a discontinuity
-#if 1
 	if ((predictedLen - len) > mThreshold)
-#else // rather use relative distance
+#else 
+	// q: rather use relative distance?
 	if ((predictedLen / len) > mThreshold)
 #endif
@@ -155,14 +156,16 @@
 		VssRay *newRay = ReverseSampling(currentRay, hitTriangle, oldRay);
 
-		if (!newRay)
+		// check if reverse sampling was successful
+		if (newRay)
+		{
+			// set flag for visualization
+			if (0) newRay->mFlags |= VssRay::ReverseSample;
+		
+			// check if ray can be processed further
+			// note: ray deletion handled by ray pool)
+			HandleRay(newRay);
+
 			return 1;
-
-		// set flag for visualization
-		if (0) newRay->mFlags |= VssRay::ReverseSample;
-		
-		// check if ray is not further processed (ray not deleted because using ray pool)
-		HandleRay(newRay);
-		
-		return 1;
+		}
 	}
 
@@ -510,12 +513,10 @@
 	const Vector3 pt3 = oldRay.mOrigin + t * (oldRay.mTermination - oldRay.mOrigin);
 
-	// Evaluate new hitpoint just outside the triangle
-	const float eps = mEps;
-
+	// evaluate new hitpoint just outside the triangle
 	// the point is chosen to be on the side closer to the original ray
 	if (Distance(pt1, pt3) < Distance(pt2, pt3))
-		newPoint = pt1 + eps * (pt1 - pt2);
+		newPoint = pt1 + mEps * (pt1 - pt2);
 	else
-		newPoint = pt2 + eps * (pt2 - pt1);
+		newPoint = pt2 + mEps * (pt2 - pt1);
 
 	//cout << "passing point: " << newPoint << endl << endl;
@@ -548,5 +549,5 @@
     Vector3 newPoint;
 
-	// why is there sometimes no intersecton found?
+	// q: why is there sometimes no intersecton found?
 	if (!GetPassingPoint(currentRay, occluder, oldRay, newPoint))
 		return NULL;
@@ -589,10 +590,10 @@
 	}
 
+	++ mGvsStats.mReverseSamples;
+
 	const SimpleRay simpleRay(newOrigin, newDir, SamplingStrategy::GVS, 1.0f);
 
 	VssRay *reverseRay = 
 		mRayCaster->CastRay(simpleRay, mViewCellsManager->GetViewSpaceBox(), !mPerViewCell);
-
-    ++ mGvsStats.mReverseSamples;
 
 	return reverseRay;
@@ -646,5 +647,5 @@
 int GvsPreprocessor::ProcessQueue()
 {
-	++ mGvsStats.mGvsPass;
+	++ mGvsStats.mGvsRuns;
 
 	int castSamples = 0;
@@ -1006,7 +1007,7 @@
 void GvsPreprocessor::GetObjectPvs(ObjectContainer &objectPvs) const
 {
+	BvhLeaf::NewMail();
+
 	objectPvs.reserve((int)mTrianglePvs.size());
-
-	BvhLeaf::NewMail();
 
 	ObjectContainer::const_iterator oit, oit_end = mTrianglePvs.end();
@@ -1200,5 +1201,5 @@
 		app << "#Pass\n" << mPass << endl;
 		app << "#ScDiff\n" << mPassContribution << endl;
-		app << "#GvsRuns\n" << mGvsPass << endl;	
+		app << "#GvsRuns\n" << mGvsRuns << endl;	
 
 		app	<< "#SamplesContri\n" << mTotalContribution << endl;
@@ -1211,4 +1212,9 @@
 void GvsPreprocessor::ComputeViewCell()
 {
+	if (mCurrentViewCell->GetId() != 499) return;
+
+	// clean up
+	mTrianglePvs.clear();
+
 	mCurrentViewCell->GetMesh()->ComputeBoundingBox();
 
@@ -1224,7 +1230,7 @@
 	mGvsStats.mPerViewCellSamples = 0;
 
-	int oldContribution = mGvsStats.mTotalContribution;
+	int oldContribution = 0;
 	int passSamples = 0;
-
+	
 	for (int i = 0; i < 0; ++ i)
 		mGenericStats[i] = 0;
@@ -1233,5 +1239,5 @@
 	{
 		int oldPvsSize = mCurrentViewCell->GetPvs().GetSize();
-
+		
 		mRayCaster->InitPass();
 
@@ -1282,5 +1288,5 @@
 				break;
 
-			// reset
+			// reset stats
 			oldContribution = mGvsStats.mTotalContribution;
 			mGvsStats.mPassContribution = 0;
@@ -1300,7 +1306,4 @@
 
 	ComputeStats();
-
-	// clean up
-	mTrianglePvs.clear();
 }
 
@@ -1421,4 +1424,5 @@
 
 		mTrianglePvs.push_back(triObj);
+		//mDummyBuffer.push_back(mGvsStats.mGvsRuns);
 		mGenericStats[0] = (int)mTrianglePvs.size();
 		return true;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2672)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2695)
@@ -638,4 +638,6 @@
 	mViewSpaceBox = AxisAlignedBox3(bmin, bmax);
 
+	// hack for submission: enlarge by some margin
+	mViewSpaceBox.SetMax(1, mViewSpaceBox.Max().y + 40.0f);
 	// create the hierarchy based on this information
 	CreateViewSpaceHierarchy();
@@ -922,5 +924,5 @@
 
 void ViewCellsParseHandlers::CreateViewSpaceHierarchy()
-{cout<<"y";
+{
 	if (mViewSpaceHierarchyType == BSP)
 	{
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2694)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp	(revision 2695)
@@ -822,5 +822,5 @@
 
 	// get point on view cell surface
-	if (0)
+	if (1)
 	{
 		//mViewCell->GetRandomEdgePoint(origin, normal);
@@ -829,5 +829,5 @@
 		// move a little bit back to avoid piercing through walls
 		// that bound the view cell
-		if (0) origin -= 0.01f * normal;
+		if (1) origin -= 0.01f * normal;
 	}
 	else
