Index: /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1344)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1501)
@@ -193,5 +193,5 @@
 				OptimizeForProcessor="3"
 				OptimizeForWindowsApplication="TRUE"
-				AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces"
+				AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL"
 				RuntimeLibrary="2"
@@ -205,8 +205,8 @@
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib"
+				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtGlRenderer.lib"
 				OutputFile="../bin/release/Preprocessor.exe"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release"
+				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;&quot;$(QTDIR)\lib&quot;;.\QtGlRenderer\Release"
 				GenerateDebugInformation="FALSE"
 				SubSystem="1"
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 1486)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 1501)
@@ -217,5 +217,5 @@
 				OptimizeForProcessor="3"
 				OptimizeForWindowsApplication="TRUE"
-				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing"
+				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL"
 				ExceptionHandling="TRUE"
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp	(revision 1500)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp	(revision 1501)
@@ -2474,5 +2474,5 @@
 
   // prune more rays to amortize  the procedure
-  int desired = maxRays*0.8f;
+  int desired = (int)(maxRays * 0.8f);
 
   Debug<<"Prunning rays...\nOriginal size "<<stat.rayRefs<<endl<<flush;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 1492)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 1501)
@@ -1,11 +1,12 @@
 #ifdef GTP_INTERNAL
-//#define USE_QT 0
-#endif
-
-#define USE_QT 0
+	#define USE_QT 1
+#else
+	#define USE_QT 0
+#endif
+
 #if USE_QT
 #define USE_BOOST 0
 #else
-#define USE_BOOST 0
+#define USE_BOOST 1
 #endif
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 1500)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 1501)
@@ -26,4 +26,6 @@
 	Debug << "number of initial samples: " << mInitialSamples << endl;
 	Debug << "number of samples per pass: " << mSamplesPerPass << endl;
+	Debug << "threshold: " << mThreshold << endl;
+	Debug << "eps: " << mEps << endl;
 
 	mStats.open("gvspreprocessor.log");
@@ -55,6 +57,7 @@
 bool GvsPreprocessor::HandleRay(VssRay &vssRay)
 {
-	if (!mViewCellsManager->ComputeSampleContribution(vssRay, true, false))
-	{
+	if (mViewCellsManager->ComputeSampleContribution(vssRay, true, false))
+	{
+		//cout << "h";
 		mRayQueue.push(&vssRay);
 		return true;
@@ -198,5 +201,5 @@
 	// add to ray queue
 	EnqueueRays(vssRays);
-
+/*
     // recursivly subdivide each edge
 	for (int i = 0; i < 9; ++ i)
@@ -210,5 +213,5 @@
 			currentRay);
 	}
-
+*/
 	return (int)vssRays.size();
 }
@@ -240,6 +243,4 @@
 {
 	cout << "r" << endl;
-	
-	
 	//-- The plane p = (xp, hit(x), hit(xold)) is intersected
 	//-- with the newly found triangle (xold is the previous ray from
@@ -306,5 +307,9 @@
 
 		const int gvsSamples = ProcessQueue();
+#if 0
 		castSamples += gvsSamples;
+#else
+		castSamples += mInitialSamples;
+#endif
 		//cout << "\ncast " << castSamples << " of " << mSamplesPerPass << endl;
 	}
@@ -324,5 +329,5 @@
 		mRayQueue.pop();
 		
-		castSamples += HandleRay(*ray);
+		castSamples += AdaptiveBorderSampling(*ray);
 	}
 
