Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh	(revision 2232)
@@ -9,5 +9,6 @@
 PROGRAM=../bin/$TARGET/Preprocessor.exe
 
-SCENE=vienna_cropped.obj
+EXT=obj
+SCENE=vienna_cropped
 SCENE_PATH=../data/vienna
 
@@ -22,27 +23,5 @@
 echo "starting $TARGET mode for $SCENE scene ($PROGRAM)"
 
-
-##################################################################################
-
-USE_HEUR=true
- METHOD=int-$USE_HEUR
- echo "$SCENE $METHOD"
-
-
-#$PROGRAM $ENVIRONMENT \
-#-scene_filename=$SCENE_PATH/$SCENE \
-#  -view_cells_sampling_type=box \
-#  -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
-#  -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
-#  -view_cells_filename=$LOG_PREFIX-$METHOD-viewcells.xml.gz \
-#  -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \
-#  -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \
-#  -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
- # -hierarchy_construction_type=2 \
-#  -hierarchy_construction_consider_memory=true \
-#  -bvh_use_sah=false \
-#  -vsp_use_cost_heuristics=$USE_HEUR
-
-#sh movefiles.sh $LOG_PREFIX-$METHOD
+SCENE_FILENAME=$SCENE_PATH/$SCENE.$EXT
 
 #######################################################
@@ -54,5 +33,5 @@
 
 $PROGRAM $ENVIRONMENT \
-  -scene_filename=$SCENE_PATH/$SCENE \
+  -scene_filename=$SCENE_FILENAME \
   -view_cells_sampling_type=object_directional \
   -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
@@ -82,5 +61,5 @@
 
 $PROGRAM $ENVIRONMENT \
--scene_filename=$SCENE_PATH/$SCENE \
+-scene_filename=$SCENE_FILENAME \
   -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
   -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
@@ -106,5 +85,5 @@
 
 $PROGRAM $ENVIRONMENT \
--scene_filename=$SCENE_PATH/$SCENE \
+-scene_filename=$SCENE_FILENAME \
   -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
   -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env	(revision 2232)
@@ -183,7 +183,7 @@
 		samplesForStats  30000000
 
-		samplesPerPass  1000000
-
-#		#stepSize	500
+		samplesPerPass  250000
+
+		#stepSize	500
 		stepSize	100
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2231)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2232)
@@ -183,6 +183,6 @@
 		<Configuration
 			Name="Release Internal|Win32"
-			OutputDirectory="bin\Release"
-			IntermediateDirectory="bin\Release"
+			OutputDirectory="..\bin\Release"
+			IntermediateDirectory="..\obj\Release"
 			ConfigurationType="1"
 			CharacterSet="2"
@@ -249,8 +249,9 @@
 		<Configuration
 			Name="release_noqt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2">
+			OutputDirectory="..\bin\Release"
+			IntermediateDirectory="..\obj\Release"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="FALSE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -262,4 +263,5 @@
 				OmitFramePointers="TRUE"
 				EnableFiberSafeOptimizations="TRUE"
+				WholeProgramOptimization="FALSE"
 				OptimizeForProcessor="1"
 				OptimizeForWindowsApplication="TRUE"
@@ -280,5 +282,5 @@
 				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;&quot;$(QTDIR)\lib&quot;;.\QtGlRenderer\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"
 				GenerateDebugInformation="FALSE"
 				SubSystem="1"
@@ -311,6 +313,6 @@
 		<Configuration
 			Name="Release_Qt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
+			OutputDirectory="..\bin\Release"
+			IntermediateDirectory="..\obj\Release"
 			ConfigurationType="1"
 			CharacterSet="2">
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 2232)
@@ -278,5 +278,6 @@
 				IntermediateDirectory="Release"
 				ConfigurationType="4"
-				CharacterSet="2"/>
+				CharacterSet="2"
+				WholeProgramOptimization="1"/>
 			<Tool 
 				Name="DebugTool"/>
@@ -313,5 +314,5 @@
 			<Tool 
 				Name="LibrarianTool"
-				OutputFile="../lib/Release/$(ProjectName).lib"/>
+				OutputFile="../lib/Release/Preprocessor.lib"/>
 			<Tool 
 				Name="ResCmplrTool"/>
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2227)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2232)
@@ -839,4 +839,6 @@
 	int mVisualizationSamples;
 
+	int mEvaluationSamples;
+
 	float mTotalAreaValid;
 	float mTotalArea;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2232)
@@ -206,6 +206,6 @@
 		<Configuration
 			Name="Release Internal|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
+			OutputDirectory="..\libRelease"
+			IntermediateDirectory="...\obj\Release"
 			ConfigurationType="4"
 			CharacterSet="2">
@@ -238,5 +238,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="../lib/Release/$(ProjectName).lib"/>
+				OutputFile="../lib/Release/Preprocessor.lib"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -260,8 +260,9 @@
 		<Configuration
 			Name="release_noqt|Win32"
-			OutputDirectory="Release"
-			IntermediateDirectory="Release"
+			OutputDirectory="..\lib\Release"
+			IntermediateDirectory="..\obj\Release"
 			ConfigurationType="4"
-			CharacterSet="2">
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -273,4 +274,5 @@
 				OmitFramePointers="TRUE"
 				EnableFiberSafeOptimizations="TRUE"
+				WholeProgramOptimization="TRUE"
 				OptimizeForProcessor="1"
 				OptimizeForWindowsApplication="TRUE"
@@ -293,5 +295,5 @@
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="../lib/Release/$(ProjectName).lib"/>
+				OutputFile="../lib/Release/Preprocessor.lib"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -315,6 +317,6 @@
 		<Configuration
 			Name="Release_Qt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
+			OutputDirectory="..\lib\Release"
+			IntermediateDirectory="..\obj\Release"
 			ConfigurationType="4"
 			CharacterSet="2">
@@ -1166,8 +1168,8 @@
 			</File>
 			<File
+				RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">
+			</File>
+			<File
 				RelativePath=".\sparsehash\src\windows\hash_fun.h">
-			</File>
-			<File
-				RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">
 			</File>
 			<File
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2231)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2232)
@@ -77,5 +77,6 @@
 mViewCellsTree(viewCellsTree),
 mUsePredefinedViewCells(false),
-mMixtureDistribution(NULL)
+mMixtureDistribution(NULL),
+mEvaluationSamples(0)
 {
 	mViewSpaceBox.Initialize();
@@ -96,9 +97,9 @@
 	SimpleRayContainer rays;
 	rays.reserve(samplesPerPass);
-	passSamples.reserve(samplesPerPass * 2);
+	//passSamples.reserve(samplesPerPass * 2);
   
 	long startTime = GetTime();
 
-  	//cout<<"Progress :"<<i/1e6f<<"M rays, "<<(100.0f*i)/mTotalSamples<<"%"<<endl;
+  	cout<<"Progress :"<<totalRays / 1e6f << " M rays, " << (100.0f * totalRays) / (mEvaluationSamples + 1) << "%" << endl;
 	
 	//rays.clear();
@@ -120,5 +121,5 @@
 		"#Pass\n" << pass ++ <<endl<<
 		"#Time\n" << time <<endl<<
-		"#TotalSamples\n" <<totalRays<<endl;
+		"#TotalSamples\n" << totalRays << endl;
 	
 
@@ -6820,5 +6821,4 @@
 {
 	int samplesPerPass;
-	int numSamples;
 	int castSamples = 0;
 	int oldSamples = 0;
@@ -6830,5 +6830,5 @@
 	Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass);
 	Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samplesForStats", samplesForStats);
-	Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samples", numSamples);
+	Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samples", mEvaluationSamples);
 	Environment::GetSingleton()->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix);
 	Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.stepSize", splitsStepSize);
@@ -6842,5 +6842,5 @@
 	Debug << "step size: " << splitsStepSize << endl;
 	Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl;
-	Debug << "view cell evaluation samples: " << numSamples << endl;
+	Debug << "view cell evaluation samples: " << mEvaluationSamples << endl;
 	Debug << "view cell stats prefix: " << statsPrefix << endl;
 
@@ -6855,5 +6855,5 @@
 	int pass = 0;
 
-	while (castSamples < numSamples)
+	while (castSamples < mEvaluationSamples)
 	{		
 		///////////////
@@ -6882,5 +6882,5 @@
 
 		if ((castSamples >= samplesForStats + oldSamples) || 
-			(castSamples >= numSamples))
+			(castSamples >= mEvaluationSamples))
 		{
 			oldSamples += samplesForStats;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 2228)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 2232)
@@ -252,8 +252,9 @@
 			<Tool 
 				Name="GeneralTool"
-				OutputDirectory="$(ConfigurationName)"
-				IntermediateDirectory="$(ConfigurationName)"
-				ConfigurationType="1"
-				CharacterSet="2"/>
+				OutputDirectory="Release"
+				IntermediateDirectory="Release"
+				ConfigurationType="1"
+				CharacterSet="2"
+				WholeProgramOptimization="0"/>
 			<Tool 
 				Name="DebugTool"/>
@@ -286,5 +287,5 @@
 				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;&quot;$(QTDIR)\lib&quot;;.\QtGlRenderer\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"
 				GenerateDebugInformation="0"
 				SubSystem="1"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2231)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2232)
@@ -853,5 +853,5 @@
 	if (avgRaysPerObjects <= mMinAvgRaysPerObject)
 	{
-		cout << "t ";// << avgRaysPerObjects << " ";
+		//cout << "t ";// << avgRaysPerObjects << " ";
 		return totalPvs;
 	}
@@ -872,5 +872,5 @@
 	const float newPvs = alpha * childPvs + (1.0f - alpha) * totalPvs;
 #endif
-	cout << "b ";// << avgRaysPerObjects << " ";
+//cout << "b ";// << avgRaysPerObjects << " ";
 	//cout << "alpha " << alpha << " beta: " << beta << " child: " << childPvs << " parent: " << totalPvs << endl;
 	
@@ -896,5 +896,5 @@
 	if (!success) // split was not taken
 	{
-		cout << "x";
+		//cout << "x";
 		return false;
 	}
