Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh	(revision 2099)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh	(revision 2130)
@@ -13,5 +13,6 @@
 export PATH=$PATH:../bin
 
-NUM_SAMPLE_RAYS=1000000000
+#NUM_SAMPLE_RAYS=1000000000
+NUM_SAMPLE_RAYS=10000000
 
 $PREPROCESSOR -total_samples=$NUM_SAMPLE_RAYS \
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility.sh	(revision 2124)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility.sh	(revision 2130)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-#PREPROCESSOR=../bin/release/preprocessor.exe
-PREPROCESSOR=../bin/debug/preprocessor.exe
+PREPROCESSOR=../bin/release/preprocessor.exe
+#PREPROCESSOR=../bin/debug/preprocessor.exe
 
 if [ $# -ne 3 ]
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2120)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2130)
@@ -81,5 +81,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing;Timer"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NO_QT;USE_VERBOSE_PVS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NO_QT"
 				RuntimeLibrary="2"
 				EnableEnhancedInstructionSet="2"
@@ -199,5 +199,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				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;;QtInterface"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_BIT_PVS"
 				ExceptionHandling="TRUE"
 				RuntimeLibrary="2"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2124)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2130)
@@ -2785,4 +2785,8 @@
 					"99990.0");
 	
+	RegisterOption("Hierarchy.useTraversalTree",
+					optBool,
+					"hierarchy_use_traversal_tree=",
+					"false");
 
 	///////////////////////////////////////////////////////
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2123)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2130)
@@ -222,5 +222,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_BIT_PVS"
 				ExceptionHandling="TRUE"
 				RuntimeLibrary="2"
@@ -383,7 +383,4 @@
 			</File>
 			<File
-				RelativePath=".\BitVectorPvs.cpp">
-			</File>
-			<File
 				RelativePath=".\BitVectorPvs.h">
 			</File>
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2124)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2130)
@@ -612,4 +612,6 @@
 	BvHierarchy *mBvHierarchy;
 	
+	bool mUseTraversalTree;
+
 protected:
 
@@ -682,6 +684,4 @@
 
 	ViewCellContainer mOldViewCells;
-
-	//ObjectPvs mOldPvs;
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp	(revision 2066)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp	(revision 2130)
@@ -137,5 +137,5 @@
 	  
 
-	  rssSamples += vssRays.size();
+	  rssSamples += (int)vssRays.size();
 	  for (int j=0; j < vssRays.size(); j++)
 		if (vssRays[j]->mFlags & VssRay::Valid) {
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2124)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2130)
@@ -389,5 +389,5 @@
 			if (IsValidViewSpace(viewCell) && 
 				GenerateViewPoints(viewCell, nViewPoints, viewPoints))
-			{cout << "here99" << endl;
+			{
 				Debug << "vc: " << viewCell->GetId() << endl;
 
@@ -1289,5 +1289,5 @@
 	ViewCellContainer viewCells;
 #ifdef USE_BIT_PVS
-	cout << "objects size: " << ObjectPvsIterator::sObjects.size() << endl;
+	cout << "objects size: " << (int)ObjectPvsIterator::sObjects.size() << endl;
 	cout << "pvs size: " <<  ObjectPvs::sPvsSize << endl;
 #endif
@@ -7022,9 +7022,13 @@
 
 	if (1)
-	{	// create a traversal tree for optimal view cell casting
-		mHierarchyManager->CreateTraversalTree();
-	}
-}
-
-
-}
+	{	
+		if (mHierarchyManager->mUseTraversalTree)
+		{
+			// create a traversal tree for optimal view cell casting
+			mHierarchyManager->CreateTraversalTree();
+		}
+	}
+}
+
+
+}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp	(revision 2124)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp	(revision 2130)
@@ -640,5 +640,5 @@
 			// hack: assume that we use vsp tree, 
 			//P so we can just test intersection with bounding boxes
-			if (viewCell->GetBox().Intersects(lStart, lEnd));
+			if (viewCell->GetBox().Intersects(lStart, lEnd))
 			{
 				hitViewCells.push_back(viewCell);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp	(revision 2119)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp	(revision 2130)
@@ -403,5 +403,5 @@
   cout<<"Dirr Bbox = "<<dirBBox<<endl;
   
-  stat.rays = rays.size();
+  stat.rays = (int)rays.size();
   stat.initialPvsSize = 0;
   for (int i=0; i < mRoots.size(); i++) {
@@ -862,5 +862,5 @@
 	info.axis = axis;
 	info.costRatio = 0.5f; // not true but good for speeding up the subdivision at the top levels!
-	info.raysBack = info.raysFront = leaf->rays.size()/2;
+	info.raysBack = info.raysFront = (int)leaf->rays.size()/2;
 	return;
   }
@@ -953,5 +953,5 @@
 
   currInfo.raysBack = 0;
-  currInfo.raysFront = leaf->rays.size();
+  currInfo.raysFront = (int)leaf->rays.size();
   
   currInfo.pvsBack = 0;
@@ -1135,5 +1135,5 @@
   splitCandidates->clear();
   
-  int requestedSize = 2*(node->rays.size());
+  int requestedSize = 2*((int)node->rays.size());
   // creates a sorted split candidates array
   if (splitCandidates->capacity() > 500000 &&
@@ -1195,6 +1195,6 @@
   }
 
-  if ( (int)(leaf->rays.size()) > stat.maxRayRefs)
-    stat.maxRayRefs = leaf->rays.size();
+  if ((int)leaf->rays.size() > stat.maxRayRefs)
+    stat.maxRayRefs = (int)leaf->rays.size();
 
 }
@@ -1321,5 +1321,5 @@
   // update stats
   stat.rayRefs -= (int)leaf->rays.size();
-  stat.rayRefs += back->rays.size() + front->rays.size();
+  stat.rayRefs += (int)(back->rays.size() + front->rays.size());
 
   
@@ -1461,5 +1461,5 @@
   Debug<<"done."<<endl<<flush;
 
-  stat.rayRefs += add.size() - remove.size();
+  stat.rayRefs += (int)add.size() - (int)remove.size();
 
   Debug<<"Updating statistics..."<<endl<<flush;
@@ -1817,5 +1817,5 @@
 	}
   }
-  return pvs.size();
+  return (int)pvs.size();
 }
 
@@ -2021,5 +2021,5 @@
 					  )
 {
-  int nrays = leaf->rays.size();
+  int nrays = (int)leaf->rays.size();
 
   if (nrays == 2) {
@@ -2040,5 +2040,5 @@
 
   if (r1 == r2)
-	r2 = (r1+1)%leaf->rays.size();
+	r2 = (r1+1)%(int)leaf->rays.size();
 
 #else
@@ -2158,5 +2158,5 @@
   int indices[3];
 
-  int size = rays.size();
+  int size = (int)rays.size();
   // use russian roulete selection for the tripple
   // number of free positions for the bullet
@@ -2230,5 +2230,5 @@
 	for (; ri != rays.end(); ++ri, ++rayIndex) {
 	  RssTreeNode::RayInfo *ray = *ri;
-	  int tries = rays.size();
+	  int tries = (int)rays.size();
 	  for (int i = 0; i < tries; i++) {
 		int r1, r2, r3;
@@ -2648,5 +2648,5 @@
   }
   
-  return rays.size();
+  return (int)rays.size();
   
 }
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp	(revision 2123)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp	(revision 2130)
@@ -364,5 +364,4 @@
 
 			GzFileInputSource isource(myFilePath);
-			Debug<<"here93" << endl;
 			parser->parse(isource);
 #else
@@ -370,5 +369,5 @@
 
 #endif
-Debug<<"here932" << endl;
+
 			const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
 			duration = endMillis - startMillis;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2124)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2130)
@@ -160,4 +160,7 @@
 		"Hierarchy.Construction.minAvgRayContri", mMinAvgRayContri);
 
+	Environment::GetSingleton()->GetBoolValue(
+		"Hierarchy.useTraversalTree", mUseTraversalTree);
+
 	// for comparing it with byte - value
 	mTermMaxMemory *= (1024.0f * 1024.0f);
@@ -399,5 +402,5 @@
 
 	// create a traversal tree which is optimized for view cell casting 
-	if (1) 
+	if (mUseTraversalTree) 
 	{
 		CreateTraversalTree();
