Index: GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2699)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2700)
@@ -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_evaluation=50000000 -samples_per_pass=1000000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_detect_empty_viewspace+ -total_time=140"
+COMMAND="../scripts/preprocessor-debug.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=50000000 -samples_per_pass=1000000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_detect_empty_viewspace+ -total_time=140"
 
 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2699)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2700)
@@ -254,5 +254,4 @@
 		{
 			Triangle3 tri = static_cast<TriangleIntersectable *>(obj)->GetItem();
-			//tri.mVertices[0] *= 10; tri.mVertices[1] *= 10; tri.mVertices[2] *= 10;
 
 			samplesOut.write(reinterpret_cast<char *>(tri.mVertices + 0), sizeof(Vector3));
@@ -527,5 +526,5 @@
 		cout << "finished loading" << endl;
 	}
-	
+
 	return result;
 }
@@ -663,9 +662,9 @@
 		cout << "loading objects from " << buf << endl;
 
-		// load scene objects which are the entities used as pvs entries
+		// load scene objects used as pvs entries
 		ObjectContainer pvsObjects;
 		if (0) LoadObjects(buf, pvsObjects, mObjects);
 
-		const bool finalizeViewCells = false;
+		const bool finalizeViewCells = true;
 		cout << "loading view cells from " << buf << endl;
 		
@@ -690,16 +689,23 @@
 		mViewCellsManager = CreateViewCellsManager(buf);
 
+		// default view space is the extent of the scene
+		AxisAlignedBox3 viewSpaceBox;
+
 		if (mUseViewSpaceBox)
 		{
-			// default view space is the extent of the scene
-			AxisAlignedBox3 viewSpaceBox = mSceneGraph->GetBox();
+			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);
@@ -1037,44 +1043,32 @@
 	GetIntValue("Preprocessor.rayCastMethod", rayCastMethod);
 
-  // first buildup the tree for havran ray caster if it is used
+#ifdef USE_HAVRAN_RAYCASTER
+
   if ((rayCastMethod == 2) || (rayCastMethod == 3)) 
-	{
- 	  HavranRayCaster *hr = 0;
-
- 	  if (rayCastMethod == 3)
-		hr = reinterpret_cast<HavranDynRayCaster*>(mRayCaster);
- 	  else
-		hr = reinterpret_cast<HavranRayCaster*>(mRayCaster);
-	  
-	  hr->Build(this->mObjects);
-	}
-  
-// #ifdef USE_HAVRAN_RAYCASTER
-//   if ((rayCastMethod == 2) || (rayCastMethod == 3)) 
-//   {
-// 	  HavranRayCaster *hr = 0;
-
-// 	  if (rayCastMethod == 3)
-// 		  hr = reinterpret_cast<HavranDynRayCaster*>(mRayCaster);
-// 	  else
-// 		  hr = reinterpret_cast<HavranRayCaster*>(mRayCaster);
-
-// 	  string ktbFilename = internKdTree;
-// 	  int l = (int)ktbFilename.length();
-// 	  ktbFilename[l-1] = 't';
-// 	  ktbFilename[l-2] = 'b';
-// 	  ktbFilename[l-3] = 'k';
-
-// 	  cout << "Trying to load tree from file " << ktbFilename << endl;
-// 	  if (hr->ImportBinTree(ktbFilename, this->mObjects)) {
-// 		  cout << "Loading failed - building kd-tree" << endl;
-// 		  hr->Build(this->mObjects);
-// 		  cout << "Exporting kd-tree to file " << ktbFilename << endl;
-// 		  hr->ExportBinTree(ktbFilename);
-// 	  }
-// 	  else
-// 		  cout << " done." << endl;
-//   }
-// #endif
+  {
+	  HavranRayCaster *hr = 0;
+
+	  if (rayCastMethod == 3)
+		  hr = reinterpret_cast<HavranDynRayCaster*>(mRayCaster);
+	  else
+		  hr = reinterpret_cast<HavranRayCaster*>(mRayCaster);
+
+	  string ktbFilename = internKdTree;
+	  int l = (int)ktbFilename.length();
+	  ktbFilename[l-1] = 't';
+	  ktbFilename[l-2] = 'b';
+	  ktbFilename[l-3] = 'k';
+
+	  cout << "Trying to load tree from file " << ktbFilename << endl;
+	  if (hr->ImportBinTree(ktbFilename, this->mObjects)) {
+		  cout << "Loading failed - building kd-tree" << endl;
+		  hr->Build(this->mObjects);
+		  cout << "Exporting kd-tree to file " << ktbFilename << endl;
+		  hr->ExportBinTree(ktbFilename);
+	  }
+	  else
+		  cout << " done." << endl;
+  }
+#endif
 
 
@@ -1679,16 +1673,18 @@
 
 
-void Preprocessor::ObjectMoved(SceneGraphLeaf *object)
-{
-	// first invalidate all PVS from which this object is visible
-	ViewCellContainer::const_iterator vit, vit_end = mViewCellsManager->GetViewCells().end();
-
-	AxisAlignedBox3 box = object->GetBox();
-
-	ObjectContainer objects;
-
-	if (0) 
-	{
-		// simplified computation taking only the objects intersecting the box
+/** Object has moved - must dynamically update all affected PVSs */
+void
+Preprocessor::ObjectMoved(SceneGraphLeaf *object)
+{
+  // first invalidate all PVS from which this object is visible
+  ViewCellContainer::const_iterator vit, vit_end = mViewCellsManager->GetViewCells().end();
+
+  AxisAlignedBox3 box = object->GetBox();
+
+  ObjectContainer objects;
+
+  if (0) 
+	{
+	  // simplified computation taking only the objects intersecting the box
 		KdNode::NewMail();
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/default.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2698)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2700)
@@ -520,13 +520,13 @@
 
 BSP {
-  # termCrit	  auto
+   termCrit	  auto
   # termCrit	  auto2
-   termCrit	  adhoc
+  # termCrit	  adhoc
   # For Arena
   #maxDepthAllowed 15
   #maxListLength    8
   # For Vienna
-   maxDepthAllowed 22
-   maxListLength    6
+  # maxDepthAllowed 22
+  # maxListLength    6
   # For Powerplant
   # maxDepthAllowed  27
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2699)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2700)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: pá 23. V 13:41:28 2008
+# Generated by qmake (2.00a) (Qt 4.1.2) on: pá 23. V 14:49:37 2008
 # Project:  preprocessor.pro
 # Template: app
@@ -7,7 +7,7 @@
 #############################################################################
 
-first: release
-install: release-install
-uninstall: release-uninstall
+first: debug
+install: debug-install
+uninstall: debug-uninstall
 MAKEFILE      = Makefile
 QMAKE         = qmake
@@ -27,7 +27,23 @@
 MKDIR         = mkdir
 SUBTARGETS    =  \
-		release \
-		debug
+		debug \
+		release
 
+debug: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug
+debug-make_default: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug 
+debug-make_first: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug first
+debug-all: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug all
+debug-clean: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug clean
+debug-distclean: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug distclean
+debug-install: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug install
+debug-uninstall: $(MAKEFILE).Debug FORCE
+	$(MAKE) -f $(MAKEFILE).Debug uninstall
 release: $(MAKEFILE).Release FORCE
 	$(MAKE) -f $(MAKEFILE).Release
@@ -46,27 +62,11 @@
 release-uninstall: $(MAKEFILE).Release FORCE
 	$(MAKE) -f $(MAKEFILE).Release uninstall
-debug: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug
-debug-make_default: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug 
-debug-make_first: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug first
-debug-all: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug all
-debug-clean: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug clean
-debug-distclean: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug distclean
-debug-install: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug install
-debug-uninstall: $(MAKEFILE).Debug FORCE
-	$(MAKE) -f $(MAKEFILE).Debug uninstall
 
-Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
+Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\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 \
 		C:\Qt\4.1.2\mkspecs\features\default_pre.prf \
 		C:\Qt\4.1.2\mkspecs\features\win32\default_pre.prf \
-		C:\Qt\4.1.2\mkspecs\features\release.prf \
+		C:\Qt\4.1.2\mkspecs\features\debug.prf \
 		C:\Qt\4.1.2\mkspecs\features\debug_and_release.prf \
 		C:\Qt\4.1.2\mkspecs\features\default_post.prf \
@@ -89,5 +89,5 @@
 C:\Qt\4.1.2\mkspecs\features\default_pre.prf:
 C:\Qt\4.1.2\mkspecs\features\win32\default_pre.prf:
-C:\Qt\4.1.2\mkspecs\features\release.prf:
+C:\Qt\4.1.2\mkspecs\features\debug.prf:
 C:\Qt\4.1.2\mkspecs\features\debug_and_release.prf:
 C:\Qt\4.1.2\mkspecs\features\default_post.prf:
@@ -109,25 +109,29 @@
 qmake_all: FORCE
 
-make_default: release-make_default debug-make_default FORCE
-make_first: release-make_first debug-make_first FORCE
-all: release-all debug-all FORCE
-clean: release-clean debug-clean FORCE
+make_default: debug-make_default release-make_default FORCE
+make_first: debug-make_first release-make_first FORCE
+all: debug-all release-all FORCE
+clean: debug-clean release-clean FORCE
 	-$(DEL_FILE) "..\bin\release"\preprocessor.exp
-distclean: release-distclean debug-distclean FORCE
+	-$(DEL_FILE) "..\bin\release"\preprocessor.pdb
+	-$(DEL_FILE) "..\bin\release"\preprocessor.ilk
+	-$(DEL_FILE) vc*.pdb
+	-$(DEL_FILE) vc*.idb
+distclean: debug-distclean release-distclean FORCE
 	-$(DEL_FILE) Makefile
 
+debug-mocclean: $(MAKEFILE).Debug
+	$(MAKE) -f $(MAKEFILE).Debug mocclean
 release-mocclean: $(MAKEFILE).Release
 	$(MAKE) -f $(MAKEFILE).Release mocclean
-debug-mocclean: $(MAKEFILE).Debug
-	$(MAKE) -f $(MAKEFILE).Debug mocclean
-mocclean: release-mocclean debug-mocclean
+mocclean: debug-mocclean release-mocclean
 
+debug-mocables: $(MAKEFILE).Debug
+	$(MAKE) -f $(MAKEFILE).Debug mocables
 release-mocables: $(MAKEFILE).Release
 	$(MAKE) -f $(MAKEFILE).Release mocables
-debug-mocables: $(MAKEFILE).Debug
-	$(MAKE) -f $(MAKEFILE).Debug mocables
-mocables: release-mocables debug-mocables
+mocables: debug-mocables release-mocables
 FORCE:
 
+$(MAKEFILE).Debug: Makefile
 $(MAKEFILE).Release: Makefile
-$(MAKEFILE).Debug: Makefile
Index: GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2699)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2700)
@@ -1,4 +1,4 @@
-CONFIG += release
-#CONFIG += debug
+#CONFIG += release
+CONFIG += debug
 CONFIG += console warn_off thread mlrt qt
 
