Index: GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp	(revision 2575)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp	(revision 2612)
@@ -11,4 +11,6 @@
 #include <SDL/SDL_opengl.h>
 #endif
+
+#define _ARBGL
 
 using namespace std;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2611)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2612)
@@ -101,5 +101,6 @@
 QtGlRendererBuffer::GetPixelError(int &pvsSize)
 {
-	float pErrorPixels = -1.0f;
+
+  float pErrorPixels = -1.0f;
 
 
@@ -135,7 +136,7 @@
 	Intersectable::NewMail();
 	while (it.HasMoreEntries()) 
-	{
+	  {
 		RenderIntersectable(it.Next());
-	}
+	  }
 
 
@@ -147,6 +148,5 @@
 
 	OcclusionQuery *query = mOcclusionQueries[0];
-
-
+	
 	query->BeginQuery();
 
@@ -157,4 +157,5 @@
 	query->EndQuery();
 	glDisable(GL_STENCIL_TEST); 
+
 	// reenable other state
 	//  int wait=0;
@@ -162,5 +163,5 @@
 	//  	wait++;
 	//  }
-
+	
 
 	pixelCount = query->GetQueryResult();
@@ -170,56 +171,56 @@
 
 	if (mSnapErrorFrames && pErrorPixels >= 0.01f) {
-		glReadBuffer(GL_BACK);
-
-		char filename[256];
-		sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels);
-		QImage im = toImage();
-		string str = mSnapPrefix + filename;
-		QString qstr(str.c_str());
-
-		im.save(qstr, "PNG");
-		if (1) { //0 && mFrame == 1543) {
-			int x,y;
-			int lastIndex = -1;
-			for (y=0; y < im.height(); y++)
-				for (x=0; x < im.width(); x++) {
-					QRgb p = im.pixel(x,y);
-					int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16);
-					if (qGreen(p) != 255 && index!=0) {
-						if (index != lastIndex) {
-							//				Debug<<"ei="<<index<<" ";
-							lastIndex = index;
-						}
-					}
-				}
-		}
-
-
-		mUseFalseColors = false;
-		glPushAttrib(GL_CURRENT_BIT);
-		glColor3f(0,1,0);
-		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-		SetupCamera();
-		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-		// Render PVS
-		Intersectable::NewMail();
-
-		ObjectPvsIterator it = pvs.GetIterator();
-		for (; it.HasMoreEntries(); ) 
-		{
-			RenderIntersectable(it.Next());
-		}
-
-		im = toImage();
-		sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels);
-		str = mSnapPrefix + filename;
-		qstr = str.c_str();
-		im.save(qstr, "PNG");
-		glPopAttrib();
-	}
-
+	  glReadBuffer(GL_BACK);
+	  
+	  char filename[256];
+	  sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels);
+	  QImage im = toImage();
+	  string str = mSnapPrefix + filename;
+	  QString qstr(str.c_str());
+	  
+	  im.save(qstr, "PNG");
+	  if (1) { //0 && mFrame == 1543) {
+		int x,y;
+		int lastIndex = -1;
+		for (y=0; y < im.height(); y++)
+		  for (x=0; x < im.width(); x++) {
+			QRgb p = im.pixel(x,y);
+			int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16);
+			if (qGreen(p) != 255 && index!=0) {
+			  if (index != lastIndex) {
+				//				Debug<<"ei="<<index<<" ";
+				lastIndex = index;
+			  }
+			}
+		  }
+	  }
+	  
+	  
+	  mUseFalseColors = false;
+	  glPushAttrib(GL_CURRENT_BIT);
+	  glColor3f(0,1,0);
+	  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+	  SetupCamera();
+	  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+	  
+	  // Render PVS
+	  Intersectable::NewMail();
+	  
+	  ObjectPvsIterator it = pvs.GetIterator();
+	  for (; it.HasMoreEntries(); ) 
+		{
+		  RenderIntersectable(it.Next());
+		}
+	  
+	  im = toImage();
+	  sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels);
+	  str = mSnapPrefix + filename;
+	  qstr = str.c_str();
+	  im.save(qstr, "PNG");
+	  glPopAttrib();
+	}
+	
 	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-
+	
 	return pErrorPixels;
 }
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2611)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2612)
@@ -1350,5 +1350,5 @@
 
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, depthMapSize, 
-		depthMapSize, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
+				 depthMapSize, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -1393,5 +1393,4 @@
 
 #endif
-
 #endif
 	DoneCurrent();
@@ -1414,5 +1413,5 @@
 
 	bool result = GlRenderer::ValidViewPoint();
-
+	
 	DoneCurrent();
 	
@@ -1443,5 +1442,5 @@
 	  if (!ValidViewPoint())
 		mPvsErrorBuffer[i].mError = -1.0f;
-
+	  
 	  // manualy corrected view point
 	  if (mFrame == 5105)
@@ -1594,8 +1593,8 @@
 	glEnable( GL_CULL_FACE );
 
-	//  int wait = 0;
-	//  while (!query.ResultAvailable()) {
-	//	wait++;
-	//  }
+	//	int wait = 0;
+	//	while (!query->ResultAvailable()) {
+	//	  wait++;
+	//	}
 
 	// reenable other state
@@ -1603,5 +1602,4 @@
 	//  cout<<"VV4 ";
 
-	//cout<<"count: " << pixelCount<<endl;
 
 	if (pixelCount > 0)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2610)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2612)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 17. I 22:17:44 2008
+# Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 17. I 23:22:18 2008
 # Project:  preprocessor.pro
 # Template: app
@@ -63,5 +63,5 @@
 	$(MAKE) -f $(MAKEFILE).Debug uninstall
 
-Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
+Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
 		C:\Qt\4.1.2\mkspecs\features\qt_config.prf \
 		C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_pixel
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_pixel	(revision 2611)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_pixel	(revision 2612)
@@ -4,5 +4,5 @@
 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+"
 #COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=500000 -samples_per_evaluation=10000000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+"
-COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=500000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+"
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=500000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+"
 
 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2610)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2612)
@@ -28,6 +28,6 @@
 unix:INCLUDEPATH += ../support/src/xerces-c-src_2_7_0/include
 
-#XERCES = $$NONGTP/Xerces/xerces
-XERCES = $$NONGTP/Xerces/xerces-c_2_8_0
+XERCES = $$NONGTP/Xerces/xerces
+#XERCES = $$NONGTP/Xerces/xerces-c_2_8_0
   
 INCLUDEPATH += ../src ../src/Timer ../src/QtInterface $$XERCES/include  $$NONGTP/Zlib/include $$NONGTP/Boost $$NONGTP/Devil/include
