Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1283)
@@ -128,4 +128,5 @@
 				AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL"
+				MinimalRebuild="TRUE"
 				RuntimeLibrary="2"
 				RuntimeTypeInfo="TRUE"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 1283)
@@ -116,7 +116,7 @@
 				Name="CppCmplrTool"
 				Optimization="1000"
-				GlobalOptimizations="0"
+				GlobalOptimizations="1"
 				InlineFunctionExpansion="0"
-				EnableIntrinsicFunctions="0"
+				EnableIntrinsicFunctions="1"
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="1"
@@ -136,6 +136,6 @@
 				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"
-				UseProcExt="0"
-				Parallelization="0"/>
+				UseProcExt="4"
+				Parallelization="1"/>
 			<Tool 
 				Name="LinkerTool"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1283)
@@ -1015,12 +1015,12 @@
 int
 Preprocessor::ProcessRay(
-						 Vector3 &viewPoint,
-						 Vector3 &direction,
+						 const Vector3 &viewPoint,
+						 const Vector3 &direction,
 						 Intersectable *objectA,
 						 Vector3 &pointA,
-						 Vector3 &normalA,
+						 const Vector3 &normalA,
 						 Intersectable *objectB,
 						 Vector3 &pointB,
-						 Vector3 &normalB,
+						 const Vector3 &normalB,
 						 const float probability,
 						 VssRayContainer &vssRays,
@@ -1036,5 +1036,4 @@
   sbox.Enlarge(Vector3(-Limits::Small));
 
-  
   if (!sbox.IsInside(viewPoint))
 	return 0;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 1283)
@@ -108,7 +108,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				GlobalOptimizations="FALSE"
+				GlobalOptimizations="TRUE"
 				InlineFunctionExpansion="0"
-				EnableIntrinsicFunctions="FALSE"
+				EnableIntrinsicFunctions="TRUE"
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 1283)
@@ -664,9 +664,12 @@
   
   while (1) {
-	SimpleRayContainer rays;
-	VssRayContainer vssRays;
+	static SimpleRayContainer rays;
+	static VssRayContainer vssRays;
+	static VssRayContainer tmpVssRays;
+	rays.clear();
+	vssRays.clear();
+	tmpVssRays.clear();
 	int castRays = 0;
 	if (mUseImportanceSampling) {
-	  VssRayContainer tmpVssRays;
 
 	  static float ratios[] = {0.9f,0.05f,0.05f};
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1279)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1283)
@@ -153,4 +153,5 @@
 
 	void ExportObjectSpaceHierarchyForViz(const ObjectContainer &objects) const;
+    ~HierarchyManager();
 
 protected:
Index: GTP/trunk/Lib/Vis/Preprocessing/src/default.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 1272)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 1283)
@@ -6,5 +6,6 @@
 Scene {
 
-filename ../data/CityModel/CityModel.obj
+filename ../data/City4M/City4M.obj
+#filename ../data/CityModel/CityModel.obj
 # filename ../data/GrandCanyon/grandcanyon1_RotXmin90.obj
 # filename ../data/glasgow/glasgow1.x3d
@@ -221,5 +222,5 @@
 	#number of active view cells
 	active 5000
-	maxStaticMemory	40
+	maxStaticMemory	200
 
 	exportToFile true
@@ -297,5 +298,6 @@
 #	filename ../data/soda/soda5-viewcell-single.xm
 #	filename ../data/soda/vienna-viewcell-single.xml
-	filename ../data/CityModel/CityModel-viewcells-5000.xml
+#	filename ../data/CityModel/CityModel-viewcells-5000.xml
+	filename ../data/City4M/City4M-viewcells-5000.xml
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1283)
@@ -223,12 +223,12 @@
   int
   ProcessRay(
-			 Vector3 &viewPoint,
-			 Vector3 &direction,
+			 const Vector3 &viewPoint,
+			 const Vector3 &direction,
 			 Intersectable *objectA,
 			 Vector3 &pointA,
-			 Vector3 &normalA,
+			 const Vector3 &normalA,
 			 Intersectable *objectB,
 			 Vector3 &pointB,
-			 Vector3 &normalB,
+			 const Vector3 &normalB,
 			 const float probability,
 			 VssRayContainer &vssRays,
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 1281)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 1283)
@@ -132,4 +132,5 @@
 				AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL"
+				MinimalRebuild="1"
 				RuntimeLibrary="2"
 				RuntimeTypeInfo="1"
