Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h	(revision 2306)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h	(revision 2332)
@@ -159,7 +159,9 @@
 	std::vector<HierarchyNode *> *GetVisibleNodes();
 
-	virtual void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const = 0;
-	virtual void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const = 0;
-	virtual float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const = 0;
+	virtual void PullUpLastVisited(HierarchyNode *node, const int frameId) const = 0;
+	virtual void DetermineVisibilityRatio(HierarchyNode *node) const = 0;
+	virtual float GetNodeVisibilityRatio(HierarchyNode *node) const = 0;
+
+	virtual HierarchyNode *GetParent(HierarchyNode *node) = 0;
 
 protected:
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager.h	(revision 1492)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager.h	(revision 2332)
@@ -30,4 +30,5 @@
 
 protected:
+
 	/** Decides if node is considered to be visible depeding on the 
 		assumed visibility factor.
@@ -36,8 +37,13 @@
 	bool DecideVisible(HierarchyNode *node) const;
 
-
 	/** Skip query for this node.
 	*/
 	void SkipQuery(HierarchyNode *node) const;
+
+	/** If this node is still valid for traversal in this frame.
+		It is possible that the parent was tested invisible before
+		so this node can be skipped.
+	*/
+	bool NodeInvalid(HierarchyNode *node) const;
 
 	/** number of steps the visibility is assumed to be valid.
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp	(revision 2306)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp	(revision 2332)
@@ -33,18 +33,24 @@
 	while (!mHierarchyInterface->GetQueue()->empty() || !queryQueue.empty())
 	{
-		bool resultAvailable = false;
-
+		//////////
 		//-- only wait for result if there are no nodes to process
 		while (!queryQueue.empty() && 
-				queryQueue.front().second->GetQueryResult(visiblePixels, 
-				mHierarchyInterface->GetQueue()->empty()))
+			   (NodeInvalid(queryQueue.front().first) ||
+			    queryQueue.front().second->GetQueryResult(
+				             visiblePixels, mHierarchyInterface->GetQueue()->empty())))
 		{
 			HierarchyNode *node = queryQueue.front().first;
-			
 			queryQueue.pop();
-			
+
+			// parent was tested invisible => remove children from queue
+			if (NodeInvalid(node))
+			{
+				//CullingLogManager::GetSingleton()->LogMessage("skipping this node");
+				continue;
+			}
+			// tested visible
 			if (visiblePixels > mVisibilityThreshold)
 			{
-				// in case geometry is in omterior node: ensure that we only traverse once
+				// in case geometry is in interior node: ensure that we only traverse once
 				if (!mHierarchyInterface->IsNodeVisible(node))
 				{
@@ -58,5 +64,5 @@
 				mHierarchyInterface->SetNodeVisible(node, false);
 
-				++ mNumQueryCulledNodes;
+                ++ mNumQueryCulledNodes;
 				
 				if (mVisualizeCulledNodes)
@@ -65,4 +71,7 @@
 				}
 			}
+			
+			// update node's visited flag
+			mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId());	
 		}
 		
@@ -73,4 +82,11 @@
 			mHierarchyInterface->GetQueue()->pop();
 				
+			// parent was tested invisible => remove children from queue
+			if (NodeInvalid(node))
+			{
+				//CullingLogManager::GetSingleton()->LogMessage("skipping this node");
+				continue;
+			}
+
 			bool intersects = false;
 
@@ -96,6 +112,8 @@
 				
 				// if we assume node to be visible in this frame => skip query 
-				bool skipQuery = wasVisible && (mAssumedVisibility > 0) && 
-					DecideVisible(node) && mHierarchyInterface->HasGeometry(node);
+				const bool skipQuery = wasVisible && 
+					                   (mAssumedVisibility > 0) && 
+									   DecideVisible(node) && 
+									   mHierarchyInterface->HasGeometry(node);
 
 				if (skipQuery)
@@ -113,7 +131,4 @@
 				mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery);
 
-				// update node's visited flag
-				mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId());
-				
 				// skip testing previously visible nodes without geometry
 				if (issueQuery)
@@ -124,5 +139,10 @@
 						IssueNodeOcclusionQuery(node, wasVisible)));
 				}
-				
+				else
+				{
+					// update node's visited flag
+					mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId());
+				}
+
 				// always traverse a node if it was visible
 				if (wasVisible)
@@ -164,4 +184,13 @@
 	mHierarchyInterface->TraverseNode(node);
 }
-
+//-----------------------------------------------------------------------
+bool CoherentHierarchicalCullingManager::NodeInvalid(HierarchyNode *node) const
+{
+	// parent was tested invisible in this frame
+	HierarchyNode *parent = mHierarchyInterface->GetParent(node);
+    return 
+		parent && 
+		(mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId()) && 
+		!mHierarchyInterface->IsNodeVisible(parent);
+}
 } // namespace GtpVisibility
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp	(revision 2306)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp	(revision 2332)
@@ -105,18 +105,5 @@
 			else
 			{
-				// identify previously visible nodes
-				const bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 
-					(mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1);
-				
-				// if we assume node to be visible in this frame => skip query 
-				const bool skipQuery = wasVisible && (mAssumedVisibility > 0) && 
-					DecideVisible(node) && mHierarchyInterface->HasGeometry(node);
-
-				if (skipQuery)
-				{
-					SkipQuery(node);
-					continue;
-				}
-								
+				
 				if (mHierarchyInterface->IsNodeFullyVisible(node))
 				{
@@ -162,4 +149,19 @@
 				}
 
+				// identify previously visible nodes
+				const bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 
+					(mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1);
+					
+
+				// if we assume node to be visible in this frame => skip query 
+				const bool skipQuery = wasVisible && (mAssumedVisibility > 0) && 
+					DecideVisible(node) && mHierarchyInterface->HasGeometry(node);
+
+				if (skipQuery)
+				{
+					SkipQuery(node);
+					continue;
+				}
+							
                 // identify nodes that we cannot skip queries for
 				// geometry not only in leaves => test for renderable geometry
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2306)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2332)
@@ -67,4 +67,7 @@
 	float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const;
 
+	GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node);
+
+
 protected:
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h	(revision 2306)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h	(revision 2332)
@@ -130,5 +130,9 @@
 	float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const { return 1.0f;}
 
+	GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node) { return NULL;}
+
+
 protected:
+
 	/** Renders the given geometry 
 	*/
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2318)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2332)
@@ -113,5 +113,5 @@
 				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)&quot;;&quot;..\..\..\Preprocessing\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;..\..\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\lib\$(ConfigurationName)&quot;"
 				ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def"
-				GenerateDebugInformation="TRUE"
+				GenerateDebugInformation="FALSE"
 				SubSystem="2"
 				OptimizeReferences="2"
@@ -371,5 +371,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2306)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2332)
@@ -188,5 +188,5 @@
 //-----------------------------------------------------------------------
 void OctreeHierarchyInterface::DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const
-{		
+{	
 	Octree *octant = static_cast<Octree *>(node);
 
@@ -394,4 +394,11 @@
 }
 
+//-----------------------------------------------------------------------
+GtpVisibility::HierarchyNode *OctreeHierarchyInterface::GetParent(GtpVisibility::HierarchyNode *node)
+{
+	Octree *octree = static_cast<Octree *>(node);
+
+	return octree->getParent();
+}
 
 } // namespace Ogre
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjReader.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjReader.h	(revision 2124)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjReader.h	(revision 2332)
@@ -21,7 +21,5 @@
 				  const std::string &visibilitySolution,
 				  Ogre::SceneNode *root);
-	void dummy();
-	Ogre::Entity * dummy2(const std::string &name,
-				GtpVisibilityPreprocessor::Intersectable *object);
+	
 	Ogre::Entity *CreateEntity(const std::string &name,
 							   GtpVisibilityPreprocessor::Intersectable *object);
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj	(revision 2318)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj	(revision 2332)
@@ -295,5 +295,5 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include"
+				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;..\include;..\..\..\Preprocessing\src"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE"
 				RuntimeLibrary="2"
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2288)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2332)
@@ -38,5 +38,5 @@
 				LinkIncremental="2"
 				AdditionalLibraryDirectories="..\include;..\src\GL;&quot;..\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib"
-				GenerateDebugInformation="TRUE"
+				GenerateDebugInformation="FALSE"
 				ProgramDatabaseFile="$(OutDir)/TestPreprocessor.pdb"
 				SubSystem="1"
@@ -126,60 +126,4 @@
 		</Configuration>
 		<Configuration
-			Name="mlrt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				GlobalOptimizations="FALSE"
-				FavorSizeOrSpeed="1"
-				OptimizeForProcessor="3"
-				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"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib RTWorld.lib RTScene.lib"
-				OutputFile="$(OutDir)/Preprocessor.exe"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\src\mlrt;&quot;$(CG_LIB_PATH)&quot;;..\src\GL;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\..\Preprocessing\MultiLevelRayTracing\RTScene\Release;..\..\Preprocessing\MultiLevelRayTracing\RTWorld\Release"
-				GenerateDebugInformation="FALSE"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-				FixedBaseAddress="1"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCWebDeploymentTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
-		<Configuration
 			Name="Release Internal|Win32"
 			OutputDirectory="..\bin\Release"
@@ -201,5 +145,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;..\src\sparsehash\src\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;$(NOINHERIT)"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PV;USE_SSE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PV"
 				StringPooling="TRUE"
 				MinimalRebuild="TRUE"
@@ -269,5 +213,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;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;NO_QT"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;NO_QT;USE_SSE"
 				RuntimeLibrary="2"
 				EnableEnhancedInstructionSet="2"
@@ -285,5 +229,5 @@
 				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"
-				GenerateDebugInformation="FALSE"
+				GenerateDebugInformation="TRUE"
 				SubSystem="1"
 				OptimizeReferences="2"
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 2255)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 2332)
@@ -943,7 +943,7 @@
 			RelativePath=".\sparsehash\src\google\sparsehash\densehashtable.h"/>
 		<File 
+			RelativePath=".\sparsehash\src\windows\hash_fun.h"/>
+		<File 
 			RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h"/>
-		<File 
-			RelativePath=".\sparsehash\src\windows\hash_fun.h"/>
 		<File 
 			RelativePath=".\sparsehash\src\windows\hash_map.h"/>
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2232)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2332)
@@ -8,4 +8,5 @@
 #include "ViewCell.h"
 
+#define TEST_PACKETS 0
 
 namespace GtpVisibilityPreprocessor {
@@ -162,8 +163,8 @@
 		@param storeViewCells true if view cells should be stored in the ray
 	*/
-	float ComputeSampleContributions(const VssRayContainer &rays,
-									 const bool addContributions,
-									 const bool storeViewCells,
-									 const bool useHitObject = false);
+	virtual float ComputeSampleContributions(const VssRayContainer &rays,
+		                                     const bool addContributions,
+											 const bool storeViewCells,
+											 const bool useHitObject = false);
 
 	/** Computes sample contribution of a simgle ray to the view cells PVS.
@@ -495,8 +496,6 @@
 										 ViewCellContainer &viewCells);
 
-	/** Evaluates the render cost of a view cell.
-	*/
-	static float EvalRenderCost(Intersectable *obj);
-   
+	float ComputeRenderCost(const int tri, const int obj); //const
+
 	/** Sets pvs size of view cell as a scalar. Used when storing pvs only in the leaves
 		of the hierarchy.
@@ -906,7 +905,9 @@
 	bool mUsePredefinedViewCells;
 
-  
-  vector<PerViewCellStat> mPerViewCellStat;
-  SamplesStatistics mSamplesStat;
+	float mTriangleWeight;
+	float mObjectWeight;
+
+	vector<PerViewCellStat> mPerViewCellStat;
+	SamplesStatistics mSamplesStat;
 };
 
@@ -1299,4 +1300,15 @@
 	virtual void FinalizeViewCells(const bool createMesh);
 
+#if TEST_PACKETS
+#ifdef USE_SSE
+
+	float ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays,
+		                                               const bool addContributions,
+													   const bool storeViewCells,
+													   const bool useHitObjects);
+
+#endif
+#endif
+
 protected:
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp	(revision 2176)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp	(revision 2332)
@@ -91,5 +91,5 @@
 
 		leaf->Mail();
-		return BvHierarchy::EvalAbsCost(leaf->mObjects);
+		return (float)leaf->mObjects.size();
 	}			 
 
@@ -114,5 +114,5 @@
 
 				// add #objects exclusivly in this node
-				pvs += BvHierarchy::EvalAbsCost(leaf->mObjects);
+				pvs += (float)leaf->mObjects.size();
 			}
 			else // traverse tree
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2228)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2332)
@@ -1532,4 +1532,14 @@
 					"0.1");
 
+	RegisterOption("ViewCells.triangleWeight",
+					optFloat,
+					"view_cells_triangle_weight=",
+					"1.0");
+
+	RegisterOption("ViewCells.objectWeight",
+					optFloat,
+					"view_cells_object_weight=",
+					"0.0");
+
 	RegisterOption("ViewCells.filename",
 					optString,
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2288)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2332)
@@ -106,56 +106,5 @@
 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
 		</Configuration>
-		<Configuration
-			Name="mlrt|Win32"
-			OutputDirectory="$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="2">
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				GlobalOptimizations="FALSE"
-				InlineFunctionExpansion="0"
-				EnableIntrinsicFunctions="FALSE"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="FALSE"
-				EnableFiberSafeOptimizations="FALSE"
-				OptimizeForProcessor="3"
-				OptimizeForWindowsApplication="TRUE"
-				AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\..\Preprocessing\MultiLevelRayTracing"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL"
-				MinimalRebuild="TRUE"
-				ExceptionHandling="TRUE"
-				RuntimeLibrary="2"
-				DisableLanguageExtensions="FALSE"
-				ForceConformanceInForLoopScope="FALSE"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="2"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
-			<Tool
-				Name="VCCustomBuildTool"/>
-			<Tool
-				Name="VCLibrarianTool"/>
-			<Tool
-				Name="VCMIDLTool"/>
-			<Tool
-				Name="VCPostBuildEventTool"/>
-			<Tool
-				Name="VCPreBuildEventTool"/>
-			<Tool
-				Name="VCPreLinkEventTool"/>
-			<Tool
-				Name="VCResourceCompilerTool"/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
-		</Configuration>
+	
 		<Configuration
 			Name="Release_Internal|Win32"
@@ -224,5 +173,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;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src;..\src\ootl\;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\cpp\include\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\src\cpp\include\ootl\mswin"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PV;USE_SSE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PV"
 				StringPooling="TRUE"
 				MinimalRebuild="TRUE"
@@ -268,5 +217,5 @@
 			ConfigurationType="4"
 			CharacterSet="2"
-			WholeProgramOptimization="FALSE">
+			WholeProgramOptimization="TRUE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -282,6 +231,6 @@
 				OptimizeForProcessor="1"
 				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;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;NO_QT"
+				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;NO_QT;USE_SSE"
 				StringPooling="TRUE"
 				MinimalRebuild="TRUE"
@@ -688,12 +637,5 @@
 						Outputs=""/>
 				</FileConfiguration>
-				<FileConfiguration
-					Name="mlrt|Win32">
-					<Tool
-						Name="VCCustomBuildTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
+			
 				<FileConfiguration
 					Name="Release_Internal|Win32">
@@ -748,12 +690,5 @@
 						Outputs=""/>
 				</FileConfiguration>
-				<FileConfiguration
-					Name="mlrt|Win32">
-					<Tool
-						Name="VCCustomBuildTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
+				
 				<FileConfiguration
 					Name="Release_Internal|Win32">
@@ -1174,8 +1109,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/RayInfo.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.h	(revision 2239)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.h	(revision 2332)
@@ -120,6 +120,4 @@
 }
 
-
-
 #if USE_FIXEDPOINT_T
 	float RayInfo::GetMinT () const 
@@ -166,4 +164,7 @@
 	}
 #endif 
+
+
+
 }
 #endif 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2237)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 2332)
@@ -294,9 +294,5 @@
 	inline bool ConsiderMemory() const { return mConsiderMemory; }
 	
-	void EvaluateSubdivision(const VssRayContainer &sampleRays,											 
-							 const ObjectContainer &objects,
-							 const std::string &filename);
-
-	void EvaluateSubdivision2(std::ofstream &splitsStats,
+	void EvaluateSubdivision(std::ofstream &splitsStats,
 							  const int splitsStepSize,
 							  const bool useFilter,
@@ -409,7 +405,7 @@
 								SubdivisionCandidateContainer &dirtyList);
 
-	/** Evaluate subdivision stats for log.
-	*/
-	void EvalSubdivisionStats();
+	/** Print subdivision stats for log.
+	*/
+	void PrintSubdivisionStats();
 
 	void AddSubdivisionStats(const int splits,
@@ -563,5 +559,5 @@
 						  bool &histoUsed);
 
-	void ComputePvs(const ObjectPvs &pvs, float &rc, int &pvsEntries);
+	void ComputePvs(const ObjectPvs &pvs, float &triangles, int &pvsEntries);
 	void GetPvsIncrementially(ViewCell *vc, ObjectPvs &pvs) const;
 	void PullUpPvsIncrementally(ViewCell *viewCell) const;
@@ -571,4 +567,5 @@
 	float EvalFullMem() const;
 
+	ViewCellsManager *GetViewCellsManager();
 
 protected:
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 2283)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 2332)
@@ -463,9 +463,4 @@
 				"#AvgRayContrib\n" << avgRayContrib << endl;
 		}
-
-		cout << "#totalPvsSize=" << mKdTree->CollectLeafPvs() << endl;
-
-
-
 	}
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h	(revision 2288)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h	(revision 2332)
@@ -45,5 +45,4 @@
 
 
-#define WORK_WITH_VIEWCELLS 0
 
 /** View space partition statistics.
@@ -573,4 +572,7 @@
 		float mBackPvs;
 
+		float mFrontTriangles;
+		float mBackTriangles;
+		
 		float mCorrectedFrontRenderCost;
 		float mCorrectedBackRenderCost;
@@ -733,16 +735,4 @@
 	void SetViewCellsTree(ViewCellsTree *vt) { mViewCellsTree = vt; }
 
-#if WORK_WITH_VIEWCELLS
-	/** Remove the references of the parent view cell from the kd nodes associated with
-		the objects.
-	*/
-	void RemoveParentViewCellReferences(ViewCell *parent) const;
-
-	/** Adds references to the view cell to the kd nodes associated with the objects.
-	*/
-	void AddViewCellReferences(ViewCell *vc) const;
-#endif
-
-	VspNode *SubdivideAndCopy(SplitQueue &tQueue, SubdivisionCandidate *splitCandidate);
 
 	PerfTimer mSortTimer;
@@ -1075,5 +1065,8 @@
 								ViewCell *back) const;
 
-	void CreateViewCell(VspTraversalData &tData, const bool updatePvs);
+	void CreateViewCell(VspTraversalData &tData, 
+						const bool updatePvs,
+						const float renderCost,
+						const int pvs);
 
 	/** Collect split candidates which are affected by the last split
@@ -1113,11 +1106,10 @@
 	*/
 	void Initialise(const VssRayContainer &rays,
-					AxisAlignedBox3 *forcedBoundingBox);
+					AxisAlignedBox3 *forcedBoundingBox,
+					const ObjectContainer &objects);
 
 	int CompressObjects();
 
 	int CompressObjects(VspLeaf *leaf);
-
-	void TraverseRayPacket();
 
 #ifdef USE_SSE
@@ -1125,11 +1117,42 @@
 	struct RayPacket
 	{
-		union { float ox[4]; __m128 ox4; };
-		union { float oy[4]; __m128 oy4; };
-		union { float oz[4]; __m128 oz4; };
-		union { float dx[4]; __m128 dx4; };
-		union { float dy[4]; __m128 dy4; };
-		union { float dz[4]; __m128 dz4; };
+		union { float mOriginX[4]; __m128 mOriginX4; };
+		union { float mOriginY[4]; __m128 mOriginY4; };
+		union { float mOriginZ[4]; __m128 mOriginZ4; };
+
+		union { float mTerminationX[4]; __m128 mTerminationX4; };
+		union { float mTerminationY[4]; __m128 mTerminationY4; };
+		union { float mTerminationZ[4]; __m128 mTerminationZ4; };
+
+		ViewCellContainer mViewCells[4];
 	};
+
+	struct PacketTraversalData
+	{
+		VspNode *mNode;
+
+		union { float mExitPointX[4]; __m128 mExitPointX4; };
+		union { float mExitPointY[4]; __m128 mExitPointY4; };
+		union { float mExitPointZ[4]; __m128 mExitPointZ4; };
+
+		union { float mMaxT[4]; __m128 mMaxT4; };
+		union { float mMask[4]; __m128 mMask4; };
+
+		PacketTraversalData () {}
+		PacketTraversalData (VspNode *n, 
+							 const __m128 &px, const __m128 &py, const __m128 &pz, 
+							 const __m128 &maxt,
+							 const __m128 &mask):
+		mNode(n), 
+		mExitPointX4(px), mExitPointY4(py), mExitPointZ4(pz),
+		mMaxT4(maxt),
+		mMask4(mask)
+		{}
+	};
+
+	
+	int TraverseRayPacket(RayPacket &rp,
+						  const bool useMailboxing);
+
 #endif
 
@@ -1141,7 +1164,4 @@
 	HierarchyManager *mHierarchyManager;
 	BvHierarchy *mBvHierarchy;
-
-	//OspTree *mOspTree;
-	//bool mUseKdPvsForHeuristics;
 	
 	ViewCellsManager *mViewCellsManager;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Trackball.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Trackball.cpp	(revision 1743)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Trackball.cpp	(revision 2332)
@@ -193,7 +193,7 @@
      * Avoid problems with out-of-control values...
      */
-    if (t > 1.0) t = 1.0;
-    if (t < -1.0) t = -1.0;
-    phi = 2.0 * asin(t);
+    if (t > 1.0f) t = 1.0f;
+    if (t < -1.0f) t = -1.0f;
+    phi = 2.0f * asin(t);
 
     axis_to_quat(a,phi,q);
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2255)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2332)
@@ -27,5 +27,5 @@
 #define USE_VOLUMES_FOR_HEURISTICS 1
 #define TEST_POWERPLANT 0
-#define USE_BETTER_RENDERCOST_EST 0
+
 
 //int BvhNode::sMailId = 10000;
@@ -53,5 +53,4 @@
 /*              class BvhNode implementation                   */
 /***************************************************************/
-
 
 BvhNode::BvhNode(): 
@@ -387,4 +386,76 @@
 
 
+void BvHierarchy::UpdateViewCells(const BvhSubdivisionCandidate &sc)
+{
+	ViewCellContainer viewCells, frontViewCells, backViewCells;
+	
+	CollectViewCells(*sc.mParentData.mSampledObjects, viewCells, false, false);
+	CollectViewCells(sc.mSampledFrontObjects, frontViewCells, false, false);
+	CollectViewCells(sc.mSampledBackObjects, backViewCells, false, false);
+
+	const float frontTri = (float)sc.mFrontObjects.size();
+	const float backTri = (float)sc.mBackObjects.size();
+	const float totalTri = (float)(*sc.mParentData.mSortedObjects[0]).size();
+
+	ViewCell::NewMail(3);
+
+	ViewCellContainer::const_iterator fit, fit_end = frontViewCells.end();
+
+	for (fit = frontViewCells.begin(); fit != fit_end; ++ fit)
+	{
+		ViewCell *vc = *fit;
+		vc->Mail(0);
+	}
+
+	ViewCellContainer::const_iterator bit, bit_end = backViewCells.end();
+
+	for (bit = backViewCells.begin(); bit != bit_end; ++ bit)
+	{
+		ViewCell *vc = *bit;
+
+		if (vc->Mailed(0))
+			vc->Mail(2);
+		else
+			vc->Mail(1);
+	}
+
+	ViewCellContainer::const_iterator vit, vit_end = viewCells.end();
+	
+	for (vit = viewCells.begin(); vit != viewCells.end(); ++ vit)
+	{
+		ViewCell *vc = *vit;
+
+		float vcTri;
+		int vcObj;
+
+		float oldVcTri = vc->GetPvsCost();
+		int oldVcObj = vc->GetEntriesInPvs();
+
+		// both objects in view cell
+		if (vc->Mailed(2))
+		{
+			vcTri = oldVcTri;
+			vcObj = oldVcObj + 1;   
+		}
+		else if (vc->Mailed(1))
+		{
+			vcTri = oldVcTri - totalTri + backTri; 
+			vcObj = oldVcObj;   
+		}
+		else // (vc->Mailed(0))
+		{
+			vcTri = oldVcTri - totalTri + frontTri; 
+			vcObj = oldVcObj;
+		}
+
+		vc->SetPvsCost(vcTri);
+		vc->SetEntriesInPvs(vcObj);
+
+		//cout << "old pvs tri: " << oldVcTri << " new: " << vcTri << endl;
+		//cout << "old pvs obj: " << oldVcObj << " new: " << vcObj<< endl;
+	}
+}
+
+
 BvhInterior *BvHierarchy::SubdivideNode(const BvhSubdivisionCandidate &sc,
 										BvhTraversalData &frontData,
@@ -439,5 +510,5 @@
 
  
-	////////////////////////////////////////
+	////////////////////////////////
 	//-- fill front and back traversal data with the new values
 
@@ -467,6 +538,6 @@
 	//-- compute pvs correction to cope with undersampling
 
-	frontData.mPvs = (float)sc.mNumFrontViewCells;//(float)CountViewCells(sc.mSampledFrontObjects);
-	backData.mPvs = (float)sc.mNumBackViewCells;//(float)CountViewCells(sc.mSampledBackObjects);
+	frontData.mPvs = (float)sc.mNumFrontViewCells;
+	backData.mPvs = (float)sc.mNumBackViewCells;
 
 	frontData.mCorrectedPvs = sc.mCorrectedFrontPvs;
@@ -476,6 +547,6 @@
 	// compute probability of this node being visible, 
 	// i.e., volume of the view cells that can see this node
-	frontData.mVolume = sc.mVolumeFrontViewCells;//EvalViewCellsVolume(sc.mSampledFrontObjects) / GetViewSpaceVolume();
-	backData.mVolume = sc.mVolumeBackViewCells;//EvalViewCellsVolume(sc.mSampledBackObjects) / GetViewSpaceVolume();
+	frontData.mVolume = sc.mVolumeFrontViewCells;
+	backData.mVolume = sc.mVolumeBackViewCells;
 
 	frontData.mCorrectedVolume = sc.mCorrectedFrontVolume;
@@ -495,4 +566,7 @@
 		AssignSortedObjects(sc, frontData, backData);
 	}
+
+	// compute e.g., new render cost decrease after this split
+	UpdateViewCells(sc);
 
 	mNodeTimer.Exit();
@@ -649,4 +723,7 @@
 	mPlaneTimer.Entry();
 
+	const BvhTraversalData &tData = splitCandidate.mParentData;
+	BvhLeaf *leaf = tData.mNode;
+
 #if STORE_VIEWCELLS_WITH_BVH
 	if (preprocessViewCells) // fill view cells cache
@@ -658,11 +735,10 @@
 		splitCandidate.mFrontObjects.clear();
 		splitCandidate.mBackObjects.clear();
+
 		splitCandidate.mSampledFrontObjects.clear();
 		splitCandidate.mSampledBackObjects.clear();
 
 		const bool sufficientSamples = 
-			splitCandidate.mParentData.mNumRays > mMinRaysForVisibility;
-
-		//if (!sufficientSamples) cout << splitCandidate.mParentData.mNumRays << " ";
+			tData.mNumRays > mMinRaysForVisibility;
 
 		const bool useVisibiliyBasedHeuristics = 
@@ -673,5 +749,5 @@
 
 		// compute best object partition
-		const float ratio =	SelectObjectPartition(splitCandidate.mParentData, 
+		const float ratio =	SelectObjectPartition(tData, 
 												  splitCandidate.mFrontObjects, 
 												  splitCandidate.mBackObjects,
@@ -691,78 +767,148 @@
 	mPlaneTimer.Exit();
 
+
+	///////////////////
+
 	mEvalTimer.Entry();
 
-	const BvhTraversalData &tData = splitCandidate.mParentData;
-	BvhLeaf *leaf = tData.mNode;
-
-	// avg contribution of a ray to a pvs
-	const float pvs = (float)CountViewCells(*tData.mSampledObjects);
-	//const float avgRayContri = AvgRayContribution((int)pvs, tData.mNumRays);
+	ViewCellContainer viewCells, frontViewCells, backViewCells;
+	
+	CollectViewCells(*tData.mSampledObjects, viewCells, false, false);
+	CollectViewCells(splitCandidate.mSampledFrontObjects, frontViewCells, false, false);
+	CollectViewCells(splitCandidate.mSampledBackObjects, backViewCells, false, false);
+
+	// compute view cells seen from front and back side of the split
+	float volFront = 0, volBack = 0, parentVol = 0;
+
+	ViewCell::NewMail(3);
+
+	ViewCellContainer::const_iterator fvit, fvit_end = frontViewCells.end();
+
+	for (fvit = frontViewCells.begin(); fvit != fvit_end; ++ fvit)
+	{
+		ViewCell *vc = *fvit;
+		vc->Mail(0);
+		
+		volFront += vc->GetVolume();
+		parentVol += vc->GetVolume();
+	}
+
+	ViewCellContainer::const_iterator bvit, bvit_end = backViewCells.end();
+	
+	int frontAndBackViewCells = 0;
+
+	for (bvit = backViewCells.begin(); bvit != bvit_end; ++ bvit)
+	{
+		ViewCell *vc = *bvit;
+
+		if (vc->Mailed(0))
+		{
+			// view cell sees front AND on back side
+			++ frontAndBackViewCells;
+			vc->Mail(2);
+		}
+		else
+		{
+			vc->Mail(1);
+			parentVol += vc->GetVolume();
+		}
+
+		volBack += vc->GetVolume();
+	}
+
+	
+	/////////////////////
+	//-- this bvh node is a pvs entry in all the view cells that see one of the objects.
+	
+	// pvs size induced by this bvh node is #view cells
+	const float pvs = (float)viewCells.size();
 	const float avgRaysPerObject = AvgRaysPerObject((int)pvs, tData.mNumRays);
 
-	// high avg ray contri, the result is influenced by undersampling
+	// for low #rays per object => the result is influenced by undersampling
 	splitCandidate.SetAvgRaysPerObject(avgRaysPerObject);
 	const float viewSpaceVol = GetViewSpaceVolume();
 
-	const float oldVolume = EvalViewCellsVolume(*tData.mSampledObjects) / viewSpaceVol;
-	const float oldRatio = (tData.mVolume > 0) ? oldVolume / tData.mVolume : 1;
-	const float parentVol = tData.mCorrectedVolume * oldRatio;
-
-	//cout << "h " << avgRaysPerObject << " ";
-	// this leaf is a pvs entry in all the view cells
-	// that see one of the objects.
-	splitCandidate.mVolumeFrontViewCells = EvalViewCellsVolume(splitCandidate.mSampledFrontObjects) / viewSpaceVol;
-	splitCandidate.mVolumeBackViewCells = EvalViewCellsVolume(splitCandidate.mSampledBackObjects) / viewSpaceVol;
-
-	splitCandidate.mNumFrontViewCells = CountViewCells(splitCandidate.mSampledFrontObjects);
-	splitCandidate.mNumBackViewCells = CountViewCells(splitCandidate.mSampledBackObjects);
-
+	splitCandidate.mVolumeFrontViewCells = volFront / viewSpaceVol;
+	splitCandidate.mVolumeBackViewCells = volBack / viewSpaceVol;
+
+	splitCandidate.mNumFrontViewCells = (int)frontViewCells.size();
+	splitCandidate.mNumBackViewCells = (int)backViewCells.size();
+
+	// currently not working!!
+	// todo matt: fix this to cope with undersampling for new evaluation method
 	splitCandidate.mCorrectedFrontVolume = 
-		mHierarchyManager->EvalCorrectedPvs(splitCandidate.mVolumeFrontViewCells, parentVol, avgRaysPerObject);
+		mHierarchyManager->EvalCorrectedPvs(splitCandidate.mVolumeFrontViewCells, 
+											parentVol, 
+											avgRaysPerObject);
 	
 	splitCandidate.mCorrectedBackVolume = 
-		mHierarchyManager->EvalCorrectedPvs(splitCandidate.mVolumeBackViewCells, parentVol, avgRaysPerObject);
-	
-	const float relfrontCost = splitCandidate.mCorrectedFrontVolume * 
-		EvalAbsCost(splitCandidate.mFrontObjects);
-	const float relBackCost =  splitCandidate.mCorrectedBackVolume * 
-		EvalAbsCost(splitCandidate.mBackObjects);
-	const float relParentCost = parentVol * EvalAbsCost(leaf->mObjects);
+		mHierarchyManager->EvalCorrectedPvs(splitCandidate.mVolumeBackViewCells, 
+											parentVol, 
+											avgRaysPerObject);
+
+	///////////////////////////////////
+
+
+	float newRenderCost = 0, oldRenderCost = 0;
+
+	const float frontTri = (float)splitCandidate.mFrontObjects.size();
+	const float backTri = (float)splitCandidate.mBackObjects.size();
+	// total #triangles in parent
+	const float totalTri = (float)(*tData.mSortedObjects[0]).size();
+
+
+	// compute render cost decrease in the seen view cells
+	ViewCellContainer::const_iterator vit, vit_end = viewCells.end();
+	
+	for (vit = viewCells.begin(); vit != viewCells.end(); ++ vit)
+	{
+		ViewCell *vc = *vit;
+
+		// triangles in this view cell
+		float vcTri;
+		// #entries in this view cell
+		int vcObj;
+
+		float oldVcTri = vc->GetPvsCost();
+		int oldVcObj = vc->GetEntriesInPvs();
+
+		// both nodes in this view cell
+		if (vc->Mailed(2))
+		{
+			vcTri = oldVcTri;
+			// #entries is increasing
+			vcObj = oldVcObj + 1;   
+		}
+		else if (vc->Mailed(1))
+		{
+			// only front node in this view cell: #triangles is decreasing
+			vcTri = oldVcTri - totalTri + backTri; 
+			vcObj = oldVcObj;   
+		}
+		else // (vc->Mailed(0))
+		{
+			// // only back node in this view cell: #triangles is decreasing
+			vcTri = oldVcTri - totalTri + frontTri; 
+			vcObj = oldVcObj;
+		}
+
+		oldRenderCost += mViewCellsManager->ComputeRenderCost((int)oldVcTri, (int)oldVcObj) * vc->GetVolume()  / viewSpaceVol;
+		newRenderCost += mViewCellsManager->ComputeRenderCost((int)vcTri, (int)vcObj) * vc->GetVolume() / viewSpaceVol;
+		//cout << "old rc=" << oldRenderCost << " new rc " << newRenderCost << endl;
+	}
 
 	// compute global decrease in render cost
-	const float newRenderCost = relfrontCost + relBackCost;
-	const float renderCostDecr = relParentCost - newRenderCost;
-	
+	const float renderCostDecr = (oldRenderCost - newRenderCost);
+
+	// for each view cell seen from front and back there is a new entry
+	const int pvsEntriesIncr = frontAndBackViewCells;
+
 	splitCandidate.SetRenderCostDecrease(renderCostDecr);
-
-	// increase in pvs entries
-	const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate, 
-												  avgRaysPerObject, 
-												  (int)pvs, 
-												  splitCandidate.mNumFrontViewCells, 
-												  splitCandidate.mNumBackViewCells);
-
 	splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr);
 
-	if (0)
-	{
-		cout << "bvh volume cost"
-		 << " avg rays per object: " << avgRaysPerObject << " ratio: " << oldRatio 
-		 << " parent: " << parentVol << " old vol: " << oldVolume 
-		 << " frontvol: " << splitCandidate.mVolumeFrontViewCells << " corr. " << splitCandidate.mCorrectedFrontVolume 
-		 << " backvol: " << splitCandidate.mVolumeBackViewCells << " corr. " << splitCandidate.mCorrectedBackVolume << endl;
-	}
-
-#ifdef GTP_DEBUG
-	Debug << "old render cost: " << oldRenderCost << endl;
-	Debug << "new render cost: " << newRenderCost << endl;
-	Debug << "render cost decrease: " << renderCostDecr << endl;
-#endif
-
-	float priority = EvalPriority(splitCandidate, 
-								  renderCostDecr,
-								  relParentCost);
-
-  	// compute global decrease in render cost
+	//cout << "bvh render cost decrease=" << renderCostDecr << endl;
+
+	// at last computed priority based on render cost reduction / memory increase
+	const float priority = EvalPriority(splitCandidate, renderCostDecr,	oldRenderCost);
 	splitCandidate.SetPriority(priority);
 
@@ -782,11 +928,12 @@
 									const int numBackViewCells) //const
 {
-	const float oldPvsSize = (float)numParentViewCells;//CountViewCells(*splitCandidate.mParentData.mSampledObjects);
-	const float oldPvsRatio = (splitCandidate.mParentData.mPvs > 0) ? oldPvsSize / splitCandidate.mParentData.mPvs : 1;
+	const float oldPvsSize = (float)numParentViewCells;
+	const float oldPvsRatio = 
+		(splitCandidate.mParentData.mPvs > 0) ? oldPvsSize / splitCandidate.mParentData.mPvs : 1;
 
 	const float parentPvs = splitCandidate.mParentData.mCorrectedPvs * oldPvsRatio;
 
-	const int frontViewCells = numFrontViewCells;//CountViewCells(splitCandidate.mSampledFrontObjects);
-	const int backViewCells = numBackViewCells;//CountViewCells(splitCandidate.mSampledBackObjects);
+	const int frontViewCells = numFrontViewCells;
+	const int backViewCells = numBackViewCells;
 	
 	splitCandidate.mCorrectedFrontPvs = 
@@ -1036,5 +1183,5 @@
 	PrepareLocalSubdivisionCandidates(tData, axis);
 
-	const float totalRenderCost = EvalAbsCost(tData.mNode->mObjects);
+	const float totalRenderCost = (float)tData.mNode->mObjects.size();
 	float objectsLeft = 0, objectsRight = totalRenderCost;
   
@@ -1088,18 +1235,8 @@
 		Intersectable *obj = (*cit).mObject;
 
-#if USE_BETTER_RENDERCOST_EST
-		const float renderCost = ViewCellsManager::EvalRenderCost(obj);
-		
-		objectsLeft += renderCost;
-		objectsRight -= renderCost;
-
-		const bool noValidSplit = ((objectsLeft <= Limits::Small) || (objectsRight <= Limits::Small));
-
-#else
 		++ objectsLeft;
 		-- objectsRight;
 
-		const bool noValidSplit = !objectsLeft || !objectsRight;
-#endif
+		const bool noValidSplit = ((objectsLeft <= Limits::Small) || (objectsRight <= Limits::Small));
 		const AxisAlignedBox3 obox = obj->GetBox();
 
@@ -1131,8 +1268,4 @@
 		const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar;
 #endif
-		/*cout << "pos=" << (*cit).mPos << "\t q=(" << objectsLeft << "," << objectsRight <<")\t r=(" 
-			 << lbox.SurfaceArea() << "," << rbox.SurfaceArea() << ")" << endl;
-		cout << "minborder: " << minBorder << " maxborder: " << maxBorder << endl;
-	    cout << "cost= " << sum << endl;*/
 	
 		if (sum < minSum) 
@@ -1183,5 +1316,5 @@
 	PrepareLocalSubdivisionCandidates(tData, axis);
 
-	const float totalRenderCost = EvalAbsCost(tData.mNode->mObjects);
+	const float totalRenderCost = (float)tData.mNode->mObjects.size();
 	float objectsLeft = 0, objectsRight = totalRenderCost;
   
@@ -1242,8 +1375,6 @@
 		Intersectable *obj = (*cit).mObject;
 
-		const float renderCost = ViewCellsManager::EvalRenderCost(obj);
-		
-		objectsLeft += renderCost;
-		objectsRight -= renderCost;
+		objectsLeft ++;;
+		objectsRight --;
 
 		const AxisAlignedBox3 obox = obj->GetBox();
@@ -1270,11 +1401,6 @@
 	
 		const bool noValidSplit = ((objectsLeft <= Limits::Small) || (objectsRight <= Limits::Small));
-		const float sum =  noValidSplit ? 1e25 : objectsLeft * al + objectsRight * ar;
+		const float sum =  noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar;
       
-		/*cout << "pos=" << (*cit).mPos << "\t q=(" << objectsLeft << "," << objectsRight <<")\t r=(" 
-			 << lbox.SurfaceArea() << "," << rbox.SurfaceArea() << ")" << endl;
-		cout << "minborder: " << minBorder << " maxborder: " << maxBorder << endl;
-	    cout << "cost= " << sum << endl;*/
-	
 		if (sum < minSum) 
 		{	
@@ -1367,5 +1493,5 @@
 	//-- left and right and evaluate the cost funcion
 
-	// prepare the heuristics by setting mailboxes and counters
+	// prepare the heuristics, set mailboxes and counters
 	const float totalVol = PrepareHeuristics(tData, axis);
 	
@@ -1374,5 +1500,5 @@
 	float volRight = totalVol;
 	
-	const float nTotalObjects = EvalAbsCost(tData.mNode->mObjects);
+	const float nTotalObjects = (float)tData.mNode->mObjects.size();
 	float nObjectsLeft = 0;
 	float nObjectsRight = nTotalObjects;
@@ -1419,33 +1545,14 @@
 		EvalHeuristicsContribution(object, volLeft, volRight);
 
-#if USE_BETTER_RENDERCOST_EST
-
-		const float rc = ViewCellsManager::EvalRenderCost(object);
-		
-		nObjectsLeft += rc;
-		nObjectsRight -= rc;
-	
-#else
 		++ nObjectsLeft;
 		-- nObjectsRight;
-#endif
 	
 		// split is only valid if #objects on left and right is not zero
 		const bool noValidSplit = (nObjectsRight <= Limits::Small);
 
-#if BOUND_RENDERCOST
-
-		const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST);
-		const float rcRight = max(nObjectsRight, MIN_RENDERCOST);
-		
-		// the heuristics
-	    const float sum = noValidSplit ? 
-			1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight;
-#else
-	
 		// the heuristics
 	    const float sum = noValidSplit ? 
 			1e25f : volLeft * (float)nObjectsLeft + volRight * (float)nObjectsRight;
-#endif
+
 		
 #ifdef GTP_DEBUG
@@ -1829,5 +1936,4 @@
 #endif
 		}
-
 	}
 
@@ -1887,5 +1993,5 @@
 	const float viewSpaceArea = mViewCellsManager->GetViewSpaceBox().SurfaceArea();
 
-	return EvalAbsCost(leaf->mObjects) * area / viewSpaceArea;
+	return (float)leaf->mObjects.size() * area / viewSpaceArea;
 }
 
@@ -1896,5 +2002,5 @@
 	//-- render cost heuristics
 
-	const float objRenderCost = EvalAbsCost(objects);
+	const float objRenderCost = (float)objects.size();
 
 	const float viewSpaceVol = mViewCellsManager->GetViewSpaceBox().GetVolume();
@@ -2923,79 +3029,4 @@
 
 
-BvhNode *BvHierarchy::SubdivideAndCopy(SplitQueue &tQueue, 
-									   SubdivisionCandidate *splitCandidate)
-{
-	BvhSubdivisionCandidate *sc = 
-		static_cast<BvhSubdivisionCandidate *>(splitCandidate);
-	BvhTraversalData &tData = sc->mParentData;
-
-	BvhNode *currentNode = tData.mNode;
-	BvhNode *oldNode = (BvhNode *)splitCandidate->mEvaluationHack;
-
-	if (!oldNode->IsLeaf())
-	{	
-		//////////////
-		//-- continue subdivision
-
-		BvhTraversalData tFrontData;
-		BvhTraversalData tBackData;
-			
-		BvhInterior *oldInterior = static_cast<BvhInterior *>(oldNode);
-		
-		sc->mFrontObjects.clear();
-		sc->mBackObjects.clear();
-
-		oldInterior->GetFront()->CollectObjects(sc->mFrontObjects);
-		oldInterior->GetBack()->CollectObjects(sc->mBackObjects);
-		
-		// evaluate the changes in render cost and pvs entries
-		EvalSubdivisionCandidate(*sc, false, true);
-
-		// create new interior node and two leaf node
-		currentNode = SubdivideNode(*sc, tFrontData, tBackData);
-	
-		//oldNode->mRenderCostDecr += sc->GetRenderCostDecrease();
-		//oldNode->mPvsEntriesIncr += sc->GetPvsEntriesIncr();
-		
-		//oldNode->mRenderCostDecr = sc->GetRenderCostDecrease();
-		//oldNode->mPvsEntriesIncr = sc->GetPvsEntriesIncr();
-		
-		///////////////////////////
-		//-- push the new split candidates on the queue
-		
-		BvhSubdivisionCandidate *frontCandidate = new BvhSubdivisionCandidate(tFrontData);
-		BvhSubdivisionCandidate *backCandidate = new BvhSubdivisionCandidate(tBackData);
-
-		frontCandidate->SetPriority((float)-oldInterior->GetFront()->GetTimeStamp());
-		backCandidate->SetPriority((float)-oldInterior->GetBack()->GetTimeStamp());
-
-		frontCandidate->mEvaluationHack = oldInterior->GetFront();
-		backCandidate->mEvaluationHack = oldInterior->GetBack();
-
-		// cross reference
-		tFrontData.mNode->SetSubdivisionCandidate(frontCandidate); 
-		tBackData.mNode->SetSubdivisionCandidate(backCandidate);
-
-		//cout << "f: " << frontCandidate->GetPriority() << " b: " << backCandidate->GetPriority() << endl;
-		tQueue.Push(frontCandidate);
-		tQueue.Push(backCandidate);
-	}
-
-	/////////////////////////////////
-	//-- node is a leaf => terminate traversal
-
-	if (currentNode->IsLeaf())
-	{
-		// this leaf is no candidate for splitting anymore
-		// => detach subdivision candidate
-		tData.mNode->SetSubdivisionCandidate(NULL); 
-		// detach node so we don't delete it with the traversal data
-		tData.mNode = NULL;
-	}
-	
-	return currentNode;
-}
-
-
 void BvHierarchy::CollectObjects(const AxisAlignedBox3 &box,
 								 ObjectContainer &objects)
@@ -3171,13 +3202,13 @@
 
 // HACK
-float BvHierarchy::GetRenderCostIncrementially(BvhNode *node) const
-{
-	if (node->mRenderCost < 0) // render cost must be evaluated ...
-	{
+float BvHierarchy::GetTriangleSizeIncrementially(BvhNode *node) const
+{
+	if (node->mRenderCost < 0)
+	{
+		//cout <<"p";
 		if (node->IsLeaf())
 		{
 			BvhLeaf *leaf = static_cast<BvhLeaf *>(node);
-			node->mRenderCost = EvalAbsCost(leaf->mObjects);		
-			//if (leaf->mObjects.size() < 100) cout <<"p";
+			node->mRenderCost = (float)leaf->mObjects.size();
 		}
 		else
@@ -3185,6 +3216,6 @@
 			BvhInterior *interior = static_cast<BvhInterior *>(node);
 		
-			node->mRenderCost = GetRenderCostIncrementially(interior->GetFront()) + 
-								GetRenderCostIncrementially(interior->GetBack());
+			node->mRenderCost = GetTriangleSizeIncrementially(interior->GetFront()) + 
+								GetTriangleSizeIncrementially(interior->GetBack());
 		}
 	}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp	(revision 2239)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp	(revision 2332)
@@ -109,4 +109,6 @@
 
 
+
+
 void GetRayInfoSets(const RayInfoContainer &sourceRays,
                     const int maxSize,
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2280)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2332)
@@ -166,4 +166,7 @@
 	Environment::GetSingleton()->GetStringValue("ViewCells.samplingType", buf);
 
+	Environment::GetSingleton()->GetFloatValue("ViewCells.triangleWeight", mTriangleWeight);
+	Environment::GetSingleton()->GetFloatValue("ViewCells.objectWeight", mObjectWeight);
+
 	// mix of sampling strategies
 	if (1)
@@ -306,4 +309,7 @@
 	Debug << "export pvs for view cells: " << mExportPvs << endl;
 	Debug << "use kd pvs " << mUseKdPvs << endl;
+
+	Debug << "triangle weight: " << mTriangleWeight << endl;
+	Debug << "object weight: " << mObjectWeight << endl;
 
 	Debug << endl;
@@ -1702,22 +1708,8 @@
 
 
-float ViewCellsManager::EvalRenderCost(Intersectable *obj) //const
-{
-	switch (sRenderCostEvaluationType)
-	{
-	case PER_OBJECT:
-		return 1.0f;
-	
-	case PER_TRIANGLE:
-		{
-			return (float)obj->NumberOfFaces();
-		}
-	default:
-		cout << "default" << endl;
-		return 1.0f;
-	}
-
-	// should not come here
-	return 0.0f;
+
+float ViewCellsManager::ComputeRenderCost(const int tri, const int obj) //const
+{
+	return max((float)tri * mTriangleWeight, (float)obj * mObjectWeight);
 }
 
@@ -2095,4 +2087,5 @@
 			sum += ComputeSampleContribution(*(*it), addContributions, storeViewCells, useHitObjects);
 		}
+
 	}
 
@@ -2792,8 +2785,8 @@
 
 	++ mSamplesStat.mRays;
-	
+
 	if (!ray.mTerminationObject)
-	  return 0.0f;
-	
+		return 0.0f;
+
 	static Ray hray;
 	hray.Init(ray);
@@ -2801,19 +2794,20 @@
 	float tmin = 0, tmax = 1.0;
 
-	if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) {
-	  // cerr<<"ray outside view space box\n";
-	  return 0;
+	if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) 
+	{
+		// cerr<<"ray outside view space box\n";
+		return 0;
 	}
 
 	Vector3 origin = hray.Extrap(tmin);
 	Vector3 termination = hray.Extrap(tmax);
-	
+
 	ViewCell::NewMail();
-	
+
 	viewCellCastTimer.Entry();
 
 	static ViewCellContainer viewCells;
 	static VssRay *lastVssRay = NULL;
-	
+
 	// check if last ray was not same ray with reverse direction
 	if (1) 
@@ -2824,11 +2818,11 @@
 	{
 		viewCells.clear();
-		
+
 		// traverse the view space subdivision
 		CastLineSegment(origin, termination, viewCells);
 
-        lastVssRay = &ray;
-	}
-	
+		lastVssRay = &ray;
+	}
+
 	viewCellCastTimer.Exit();
 
@@ -2837,24 +2831,24 @@
 	if (storeViewCells)
 	{	
-	  // cerr << "Store viewcells should not be used in the test!" << endl;
-	  // copy viewcells memory efficiently
+		// cerr << "Store viewcells should not be used in the test!" << endl;
+		// copy viewcells memory efficiently
 #if VSS_STORE_VIEWCELLS
-	  ray.mViewCells.reserve(viewCells.size());
-	  ray.mViewCells = viewCells;
+		ray.mViewCells.reserve(viewCells.size());
+		ray.mViewCells = viewCells;
 #else
-	  cerr << "Vss store viewcells not supported." << endl;
-	  exit(1);
+		cerr << "Vss store viewcells not supported." << endl;
+		exit(1);
 #endif
 	}
-	
+
 	Intersectable *terminationObj;
-	
+
 	objTimer.Entry();
 
 	// obtain pvs entry (can be different from hit object)
 	terminationObj = ray.mTerminationObject;
-	
+
 	objTimer.Exit();
-	
+
 	pvsTimer.Entry();
 
@@ -2864,5 +2858,5 @@
 	{
 		ComputeViewCellContribution(*it, 
-									ray, 
+			                        ray, 
 									terminationObj, 
 									ray.mTermination, 
@@ -2875,18 +2869,18 @@
 	if (ray.mPvsContribution)
 		++ mSamplesStat.mContributingRays;
-	
+
 #if AVG_RAY_CONTRIBUTIONS
 	ray.mRelativePvsContribution /= (float)viewCells.size();
 #endif
-  
+
 #if USE_RAY_LENGTH_AS_CONTRIBUTION
 	float c = 0.0f;
 	if (terminationObj) 
-	  c = ray.Length();
+		c = ray.Length();
 	ray.mRelativePvsContribution = ray.mPvsContribution = c;
 	return c;
 #else
 	return ABS_CONTRIBUTION_WEIGHT*ray.mPvsContribution +
-	  (1.0f - ABS_CONTRIBUTION_WEIGHT)*ray.mRelativePvsContribution;
+		(1.0f - ABS_CONTRIBUTION_WEIGHT)*ray.mRelativePvsContribution;
 #endif
 }
@@ -6898,5 +6892,5 @@
 
 			ofstream ofstr(filename.c_str());
-			mHierarchyManager->EvaluateSubdivision2(ofstr, splitsStepSize, false, useHisto, histoMem, pass);
+			mHierarchyManager->EvaluateSubdivision(ofstr, splitsStepSize, false, useHisto, histoMem, pass);
 
 			timeDiff = TimeDiff(startTime, GetTime());
@@ -7000,3 +6994,66 @@
 
 
-}
+#if TEST_PACKETS
+#ifdef USE_SSE
+
+float ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays,
+												   const bool addContributions,
+												   const bool storeViewCells,
+												   const bool useHitObjects)
+{
+	float sum = 0.0f;
+
+	VssRayContainer::const_iterator it, it_end = rays.end();
+
+	VssRayContainer tmpRays;	
+	RayPacket packet;
+
+	for (it = rays.begin(); it != it_end; ++ it) 
+	{
+		if (!ViewCellsConstructed()) 
+		{
+			// view cells not yet constructed
+			// just take the lenghts of the rays as contributions
+			if ((*it)->mTerminationObject)
+			{
+				sum += (*it)->Length();
+			}
+		} 
+		else 
+		{
+			sum += ComputeSampleContribution(*(*it), addContributions, storeViewCells, useHitObjects);
+
+			tmpRays.push_back(new VssRay(*it));
+			
+			if (tmpRays.size() == 4)
+			{
+				RayPacket packet(tmpRays);
+
+				mHierarchyManager->CastLineSegment(packet);
+
+				for (int i = 0; i < 4; ++ i)
+				{
+					ComputeSampleContribution(tmpRays[i], addContributions, true, useHitObjects);
+				}
+
+				// compare results
+				//////////
+
+				CLEAR_CONTAINER(tmpRays);
+			}
+		}
+	}
+
+	cout << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl;
+	Debug << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl;
+
+	cout << "pvs time: " << pvsTimer.TotalTime() << " s" << endl;
+	Debug << "pvs time: " << pvsTimer.TotalTime() << " s" << endl;
+	
+	return sum;
+}
+
+#endif
+#endif
+
+}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 2227)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 2332)
@@ -824,5 +824,5 @@
 
 		obj->Mail();
-		renderCost += mViewCellsManager->EvalRenderCost(obj);
+		renderCost ++;
 	}
 
@@ -836,5 +836,5 @@
 		if (!obj->Mailed())
 		{
-			renderCost += ViewCellsManager::EvalRenderCost(obj);
+			renderCost ++;
 		}
 	}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h	(revision 2255)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h	(revision 2332)
@@ -52,5 +52,5 @@
 	int Nodes() const {return nodes;}
 	int Interior() const { return nodes / 2; }
-	int Leaves() const { return (nodes / 2) + 1; }
+	int Leaves() const { return nodes / 2 + 1; }
 	
 	double AvgDepth() const 
@@ -668,16 +668,9 @@
 	void StoreSampledObjects(ObjectContainer &sampledObjects, const ObjectContainer &objects);
 
-	///////////////////////////
-	// hacks in order to provide interleaved heurisitcs
-
-	BvhNode *SubdivideAndCopy(SplitQueue &tQueue, SubdivisionCandidate *splitCandidate);
-
 	/////////////////////////////////
 
-	static inline float EvalAbsCost(const ObjectContainer &objects);
-
 	void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects);
 
-	float GetRenderCostIncrementially(BvhNode *node) const;
+	float GetTriangleSizeIncrementially(BvhNode *node) const;
 
 	void Compress();
@@ -995,4 +988,7 @@
 	*/
 	void SetUniqueNodeIds();
+
+	void UpdateViewCells(const BvhSubdivisionCandidate &sc);
+
 
 protected:
@@ -1101,44 +1097,6 @@
 
 
-float BvHierarchy::EvalAbsCost(const ObjectContainer &objects)
-{
-	float result;
-
-#if USE_BETTER_RENDERCOST_EST
-	
-	const float switchcost = 1.0f;
-
-	float o = 0;
-
-	ObjectContainer::const_iterator oit, oit_end = objects.end();
-
-	for (oit = objects.begin(); oit != oit_end; ++ oit)
-	{
-		o += ViewCellsManager::GetRendercost(*oit);
-	}
-
-	float n = (float)objects.size() * switchcost;
-	
-#else
-	
-	result = (float)objects.size();
+
+}
 
 #endif
-
-#if BOUND_RENDERCOST
-	
-	if (result > MIN_RENDERCOST)
-		return result;
-	else
-	{
-		//std::cout << "b";
-		return MIN_RENDERCOST;
-	}
-#endif
-
-	return result;
-}
-
-}
-
-#endif
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 2176)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp	(revision 2332)
@@ -15,4 +15,8 @@
 // $$JB HACK
 #define KD_PVS_AREA (1e-5f)
+
+#define TYPE_INTERIOR -2
+#define TYPE_LEAF -3
+
 
 namespace GtpVisibilityPreprocessor {
@@ -1098,46 +1102,4 @@
 }
 
-int
-KdTree::CollectLeafPvs()
-{
-
-	// matt: no more kd pvs
-    int totalPvsSize = 0;
-	/*
-  stack<KdNode *> nodeStack;
-  
-  nodeStack.push(mRoot);
-  
-  while (!nodeStack.empty()) {
-    KdNode *node = nodeStack.top();
-    nodeStack.pop();
-    if (node->IsLeaf()) {
-      KdLeaf *leaf = (KdLeaf *)node;
-      for (int j=0; j < leaf->mObjects.size(); j++) {
-	Intersectable *object = leaf->mObjects[j];
-	if (!object->Mailed()) {
-	  object->Mail();
-	  // add this node to pvs of all nodes it can see
-	  KdPvsMap::iterator ni = object->mKdPvs.mEntries.begin();
-	  for (; ni != object->mKdPvs.mEntries.end(); ni++) {
-	    KdNode *node = (*ni).first;
-	    // $$ JB TEMPORARY solution -> should add object PVS or explictly computed
-	    // kd tree PVS
-		float contribution;
-		if (leaf->mKdPvs.AddSample(node, 1.0f, contribution))
-	      totalPvsSize++;
-	  }
-	}
-      }
-    } else {
-      KdInterior *interior = (KdInterior *)node;
-      nodeStack.push(interior->mFront);
-      nodeStack.push(interior->mBack);
-    }
-  }
-*/
-  return totalPvsSize;
-}
-
 
 KdNode *
@@ -1223,8 +1185,4 @@
 
 
-#define TYPE_INTERIOR -2
-#define TYPE_LEAF -3
-
-
 void KdTree::ExportBinLeaf(OUT_STREAM &stream, KdLeaf *leaf)
 {
@@ -1319,5 +1277,5 @@
 	OUT_STREAM stream(filename.c_str(), OUT_BIN_MODE);
 	
-	//if (!stream.is_open()) return false;
+	if (!stream.is_open()) return false;
 
 	// export binary version of mesh
@@ -1400,8 +1358,7 @@
 	DEL_PTR(mRoot);
   
-	KdNode *node = LoadNextNode(stream, NULL, objects);
-	mRoot = node;
-
-	tStack.push(TraversalData(node, mBox, 0));
+	mRoot = LoadNextNode(stream, NULL, objects);
+
+	tStack.push(TraversalData(mRoot, mBox, 0));
 	mStat.Reset();
 	mStat.nodes = 1;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 2199)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 2332)
@@ -291,6 +291,14 @@
 	}
 
+	void SetEntriesInPvs(const int e) {
+		mEntriesInPvs = e;
+	}
+
 	float GetPvsCost() const {
 		return mPvsCost;
+	}
+
+	int GetEntriesInPvs() const {
+		return mEntriesInPvs;
 	}
 
@@ -324,8 +332,5 @@
 	/// store pvs size, used for evaluation purpose when pvss are stored only in the leaves
 	float mPvsCost;
-	/** stores number of entries in pvs
-	    this variable has the same value as mPvsSize for object pvs, 
-		but usually not for kd cell based pvs
-	*/
+	/// stores number of entries in pvs
 	int mEntriesInPvs;
 	/** if the pvs size scalar (+ entries into pvs)
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 2288)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp	(revision 2332)
@@ -59,64 +59,4 @@
 }
 
-#if WORK_WITH_VIEWCELLS
-static bool ViewCellHasMultipleReferences(Intersectable *obj, 
-										  ViewCell *vc, 
-										  bool checkOnlyMailed)
-{
-	MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);
-
-	if (vdata)
-	{
-		// more than one view cell sees this object inside different kd cells
-		if (!checkOnlyMailed || !vdata->Mailed())
-		{
-			if (checkOnlyMailed)
-				vdata->Mail();
-			//Debug << "sumpdf: " << vdata->mSumPdf << endl;
-			if (vdata->mSumPdf > 1.5f) 
-				return true;
-		}
-	}
-	
-	return false;
-}
-
-
-void VspTree::RemoveParentViewCellReferences(ViewCell *parent) const
-{
-	KdLeaf::NewMail();
-
-	// remove the parents from the object pvss
-	ObjectPvsEntries::const_iterator oit, oit_end = parent->GetPvs().mEntries.end();
-
-	for (oit = parent->GetPvs().mEntries.begin(); oit != oit_end; ++ oit)
-	{
-		Intersectable *object = (*oit).first;
-		// HACK: make sure that the view cell is removed from the pvs
-		const float high_contri = 9999999;
-
-		// remove reference count of view cells
-		object->mViewCellPvs.RemoveSample(parent, high_contri);
-	}
-}
-
-
-void VspTree::AddViewCellReferences(ViewCell *vc) const
-{
-	KdLeaf::NewMail();
-
-	// Add front view cell to the object pvsss
-	ObjectPvsEntries::const_iterator oit, oit_end = vc->GetPvs().mEntries.end();
-
-	for (oit = vc->GetPvs().mEntries.begin(); oit != oit_end; ++ oit)
-	{
-		Intersectable *object = (*oit).first;
-
-		// increase reference count of view cells
-		object->mViewCellPvs.AddSample(vc, 1);
-	}
-}
-
-#endif
 
 void VspTreeStatistics::Print(ostream &app) const
@@ -185,7 +125,4 @@
 mTreeValid(true), 
 mTimeStamp(0)
-//,mRenderCostDecr(0)
-//,mMemoryIncr(0)
-//,mPvsEntriesIncr(0)
 {}
 
@@ -194,7 +131,4 @@
 mParent(parent), 
 mTreeValid(true), 
-//,mMemoryIncr(0)
-//,mRenderCostDecr(0)
-//,mPvsEntriesIncr(0)
 mTimeStamp(0)
 {}
@@ -602,5 +536,8 @@
 
 
-void VspTree::CreateViewCell(VspTraversalData &tData, const bool updatePvs)
+void VspTree::CreateViewCell(VspTraversalData &tData, 
+							 const bool updatePvs, 
+							 const float renderCost,
+							 const int pvs)
 {
 	///////////////
@@ -628,4 +565,11 @@
 		mVspStats.contributingSamples += conSamp;
 		mVspStats.sampleContributions += (int)sampCon;
+	}
+	else
+	{
+		// todo: set correct scalars
+		viewCell->SetPvsCost(renderCost);
+		viewCell->SetEntriesInPvs(pvs);
+		//cout << "create view cell with tri=" << (int)renderCost << " pvs=" << pvs << endl; 
 	}
 
@@ -802,5 +746,5 @@
 	VspLeaf *leaf = static_cast<VspLeaf *>(splitCandidate.mParentData.mNode);
 
-		//////////////
+	//////////////
 	//-- compute global decrease in render cost
 
@@ -810,5 +754,6 @@
 
 	float frontRenderCost = 0, backRenderCost = 0, totalRenderCost = 0;
-	int  frontSize = 0, backSize = 0, totalSize = 0;
+	float frontTriangles = 0, backTriangles = 0, totalTriangles = 0;
+	int  frontObjects = 0, backObjects = 0, totalObjects = 0;
 
 	Intersectable::NewMail(3);
@@ -827,4 +772,5 @@
 
 		VssRay *ray = rayInf.mRay;
+
 #if HACK_PERFORMANCE
 		Intersectable *obj = (*ray).mTerminationObject;
@@ -835,6 +781,6 @@
 		// and back pvs with respect to the classification
 		UpdateContributionsToPvs(leaf, cf, 
-								 frontRenderCost, backRenderCost, totalRenderCost,
-								 frontSize, backSize, totalSize);
+								 frontTriangles, backTriangles, totalTriangles,
+								 frontObjects, backObjects, totalObjects);
 
 #if COUNT_ORIGIN_OBJECTS
@@ -847,6 +793,6 @@
 
 			UpdateContributionsToPvs(leaf, cf, 
-									 frontRenderCost, backRenderCost, totalRenderCost,
-									 frontSize, backSize, totalSize);
+									 frontTriangles, backTriangles, totalTriangles,
+									 frontObjects, backObjects, totalObjects);
 		}
 #endif
@@ -857,8 +803,13 @@
 	}
 
+	totalRenderCost = mViewCellsManager->ComputeRenderCost((int)totalTriangles, totalObjects);
+	backRenderCost = mViewCellsManager->ComputeRenderCost((int)backTriangles, backObjects);
+	frontRenderCost = mViewCellsManager->ComputeRenderCost((int)frontTriangles, frontObjects);
+
+	
 	/////////////
 	// avg ray contri
 
-	const float avgRayContri = (float)totalSize / 
+	const float avgRayContri = (float)totalObjects / 
 		((float)splitCandidate.mParentData.mRays->size() + Limits::Small);
 
@@ -866,5 +817,5 @@
 
 	const float avgRaysPerObject = 
-		(float)splitCandidate.mParentData.mRays->size() / ((float)totalSize + Limits::Small);
+		(float)splitCandidate.mParentData.mRays->size() / ((float)totalTriangles + Limits::Small);
 
 	splitCandidate.SetAvgRayContribution(avgRayContri);
@@ -872,13 +823,22 @@
 
 
+	// todo: compute old render cost in the function
+	// using michi's render cost evaluation
 	float oldRenderCost;
-	const float renderCostDecr = EvalRenderCostDecrease(splitCandidate, oldRenderCost,
-														 totalRenderCost, frontRenderCost, backRenderCost);
+	const float renderCostDecr = EvalRenderCostDecrease(splitCandidate, 
+														oldRenderCost,
+														totalRenderCost, 
+														frontRenderCost, 
+														backRenderCost);
+
 	splitCandidate.SetRenderCostDecrease(renderCostDecr);
 
 	// the increase in pvs entries num induced by this split
-	const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate, totalSize, frontSize, backSize);
+	const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate, totalObjects, frontObjects, backObjects);
 	splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr);
 
+	splitCandidate.mFrontTriangles = frontTriangles;
+	splitCandidate.mBackTriangles = backTriangles;
+	
 	// take render cost of node into account 
 	// otherwise danger of being stuck in a local minimum!
@@ -894,4 +854,5 @@
 	splitCandidate.SetPriority(priority);
 
+	//cout << "vsp render cost decrease=" << renderCostDecr<<endl;
 	mEvalTimer.Exit();
 }
@@ -958,6 +919,6 @@
 
 	//-- compute pvs
-	frontData.mPvs = sc.mFrontPvs;//(float)EvalPvsEntriesSize(*frontData.mRays);
-	backData.mPvs = sc.mBackPvs;//(float)EvalPvsEntriesSize(*backData.mRays);
+	frontData.mPvs = sc.mFrontPvs;
+	backData.mPvs = sc.mBackPvs;
 	
 	//-- compute pvs correction for coping with undersampling
@@ -975,6 +936,6 @@
 
 	//-- compute render cost
-	frontData.mRenderCost = sc.mFrontRenderCost;//(float)EvalPvsCost(*frontData.mRays);
-	backData.mRenderCost = sc.mBackRenderCost;//(float)EvalPvsCost(*backData.mRays);
+	frontData.mRenderCost = sc.mFrontRenderCost;
+	backData.mRenderCost = sc.mBackRenderCost;
 	
 	frontData.mCorrectedRenderCost = sc.mCorrectedFrontRenderCost;
@@ -1006,9 +967,4 @@
 		parent->ReplaceChildLink(leaf, interior);
 		interior->SetParent(parent);
-
-#if WORK_WITH_VIEWCELLS
-		// remove "parent" view cell from pvs of all objects (traverse through rays)
-		RemoveParentViewCellReferences(tData.mNode->GetViewCell());
-#endif
 	}
 	else // new root
@@ -1031,6 +987,6 @@
 
 	// create front and back view cell for the new leaves
-	CreateViewCell(frontData, false);
-	CreateViewCell(backData, false);
+	CreateViewCell(frontData, false, sc.mFrontTriangles, (int)sc.mFrontPvs);
+	CreateViewCell(backData, false, sc.mBackTriangles, (int)sc.mBackPvs);
 
 	// set the time stamp so the order of traversal can be reconstructed
@@ -1444,5 +1400,5 @@
 	
 	const int leaves = mVspStats.Leaves();
-	const bool showViz = (leaves % 30 == 0);
+	const bool showViz = (leaves >= 3000) && (leaves % 497 == 0);
 
 	if (showViz)
@@ -1685,8 +1641,7 @@
 	
 	const AxisAlignedPlane &candidatePlane = sc.mSplitPlane;
-	//const float avgRayContri = sc.GetAvgRayContribution();
 	const float avgRaysPerObject = sc.GetAvgRaysPerObject();
 
-	//////////////////////////////////////////////
+	/////////////////////////
 	// mark objects in the front / back / both using mailboxing
 	// then count pvs sizes
@@ -1713,5 +1668,4 @@
 
 	const float oldRenderCostRatio = (tData.mRenderCost > 0)? (totalPvs / tData.mRenderCost) : 1;
-
 	const float penaltyOld = tData.mCorrectedRenderCost * oldRenderCostRatio;
 
@@ -1731,19 +1685,4 @@
 	// the render cost decrase for this split
 	const float renderCostDecrease = (oldRenderCost - newRenderCost) / viewSpaceVol;
-
-	if (0)
-	cout << "vsp render cost"
-		 << " avg rays per object: " << avgRaysPerObject << " ratio: " << oldRenderCostRatio
-		 << " parent: " << penaltyOld << " " << " old vol: " << totalPvs 
-		 << " front cost: " << sc.mCorrectedFrontRenderCost << " corr. " << sc.mCorrectedFrontRenderCost
-		 << " back cost: " << sc.mCorrectedBackRenderCost << " corr. " << sc.mCorrectedBackRenderCost << endl;
-
-#ifdef GTP_DEBUG
-	Debug << "\nvsp render cost decrease" << endl
-		  << "back pvs: " << pvsBack << " front pvs " << pvsFront << " total pvs: " << totalPvs << endl 
-		  << "back p: " << pBack / viewSpaceVol << " front p " << pFront / viewSpaceVol << " p: " << pOverall / viewSpaceVol << endl
-		  << "old rc: " << normalizedOldRenderCost << " new rc: " << newRenderCost / viewSpaceVol << endl
-		  << "render cost decrease: " << renderCostDecrease << endl;
-#endif
 
 	return renderCostDecrease;
@@ -1809,10 +1748,8 @@
 	if (!obj) return;
 
-	const float renderCost = ViewCellsManager::EvalRenderCost(obj);
-
 	// object in none of the pvss => new object
 	if (!obj->Mailed() && !obj->Mailed(1) && !obj->Mailed(2))
 	{
-		totalPvs += renderCost;
+		totalPvs += 1.0f;
 	}
 
@@ -1824,5 +1761,5 @@
 		if (!obj->Mailed() && !obj->Mailed(2))
 		{
-			frontPvs += renderCost;
+			frontPvs += 1.0f;
 		
 			// already in back pvs => in both pvss
@@ -1838,5 +1775,5 @@
 		if (!obj->Mailed(1) && !obj->Mailed(2))
 		{
-			backPvs += renderCost;
+			backPvs += 1.0f;
 		
 			// already in front pvs => in both pvss
@@ -1860,5 +1797,5 @@
 
 	const float renderCost = countEntries ? 1 : 
-		mBvHierarchy->EvalAbsCost(leaf->mObjects);
+		(float)leaf->mObjects.size();
 	
 	// leaf in no pvs => new
@@ -1907,10 +1844,10 @@
 									   int &totalSize) const
 {
-	const float renderCost = mBvHierarchy->EvalAbsCost(leaf->mObjects);
-	
-	// leaf in no pvs => new
+	const float triSize = (float)leaf->mObjects.size();
+	
+	// object in no pvs => count as new
 	if (!leaf->Mailed() && !leaf->Mailed(1) && !leaf->Mailed(2))
 	{
-		totalPvs += renderCost;
+		totalPvs += triSize;
 		++ totalSize;
 	}
@@ -1920,5 +1857,5 @@
 		if (!leaf->Mailed() && !leaf->Mailed(2))
 		{
-			frontPvs += renderCost;
+			frontPvs += triSize;
 			++ frontSize;
 
@@ -1935,5 +1872,5 @@
 		if (!leaf->Mailed(1) && !leaf->Mailed(2))
 		{
-			backPvs += renderCost;
+			backPvs += triSize;
 			++ backSize;
 
@@ -2569,5 +2506,6 @@
 					// cases N1,N2,N3,P5,Z2,Z3
 					continue;
-				} else
+				} 
+				else
 				{
 					// case N4
@@ -2639,4 +2577,219 @@
 	return hits;
 }
+
+
+#ifdef USE_SSE
+int VspTree::TraverseRayPacket(RayPacket &rp,
+							   const bool useMailboxing)
+{
+	int hits = 0;
+
+	// reciprocal of ray directions
+	float one = 1.0f;
+	float zero = 0.0f;
+
+	__m128 one4 = _mm_load_ps(&one);
+	__m128 zero4 = _mm_load_ps(&zero);
+
+	__m128 *entp4;
+	__m128 *extp4;
+
+	union { float mask[4]; __m128 mask4; };
+	mask4 = one4;
+
+	__m128 entpX4 = rp.mOriginX4;
+	__m128 entpY4 = rp.mOriginY4;
+	__m128 entpZ4 = rp.mOriginZ4;
+	
+	__m128 extpX4 = rp.mTerminationX4;
+	__m128 extpY4 = rp.mTerminationY4;
+	__m128 extpZ4 = rp.mTerminationZ4;
+
+	__m128 *origin = &rp.mOriginX4;
+	__m128 *termination = &rp.mTerminationX4;
+
+	// ray directions
+	__m128 dirX4 = _mm_sub_ps(rp.mTerminationX4, rp.mOriginX4);
+	__m128 dirY4 = _mm_sub_ps(rp.mTerminationY4, rp.mOriginY4);;
+	__m128 dirZ4 = _mm_sub_ps(rp.mTerminationZ4, rp.mOriginZ4);;
+	
+	__m128 rdx4 = _mm_div_ps(one4, dirX4);
+	__m128 rdy4 = _mm_div_ps(one4, dirY4);
+	__m128 rdz4 = _mm_div_ps(one4, dirZ4);
+
+	__m128 maxT4 = one4;
+	__m128 minT4 = zero4;
+
+	stack<PacketTraversalData *> tStack;
+
+
+	VspNode *node = mRoot;
+	VspNode *farChild;
+
+	float position;
+	int axis;
+
+	__m128 position4;
+
+	while (1)
+	{
+		if (!node->IsLeaf())
+		{
+			VspInterior *in = static_cast<VspInterior *>(node);
+			
+			entp4 = &entpX4;
+			extp4 = &extpX4;
+
+			position = in->GetPosition();
+			axis = in->GetAxis();
+
+			position4 = _mm_load_ps(&position);
+
+			// are the entry points all in near leaf?
+			if (_mm_movemask_ps(_mm_and_ps(_mm_cmple_ps(entp4[axis], position4), mask4)))
+			{
+				// are the exit points all in near leaf?
+				if (_mm_movemask_ps(_mm_and_ps(_mm_cmpgt_ps(extp4[axis], position4), mask4)))
+				{
+					node = in->GetBack();
+					// cases N1,N2,N3,P5,Z2,Z3
+					continue;
+				} 
+				else // traverse both children
+				{
+					// case N4
+					node = in->GetBack();
+					farChild = in->GetFront();
+				}
+			}
+			else
+			{
+				if (_mm_movemask_ps(_mm_and_ps(_mm_cmpgt_ps(position4, extp4[axis]), mask4)))
+				{
+					node = in->GetFront();
+					// cases P1,P2,P3,N5,Z1
+					continue;
+				}
+				else // traverse both children
+				{
+					node = in->GetFront();
+					farChild = in->GetBack();
+					// case P4
+				}
+			}
+
+ 			// $$ modification 3.5.2004 - hints from Kamil Ghais
+			// case N4 or P4
+			const __m128 tDist4 = _mm_mul_ps(_mm_sub_ps(position4, origin[axis]), termination[axis]);
+			
+			// push far child for further processing
+			tStack.push(new PacketTraversalData(farChild, extpX4, extpY4, extpZ4, maxT4, mask4));
+
+			// compute new exit point
+			extpX4 = _mm_add_ps(_mm_mul_ps(dirX4, tDist4), rp.mOriginX4);
+			extpY4 = _mm_add_ps(_mm_mul_ps(dirY4, tDist4), rp.mOriginY4);
+			extpZ4 = _mm_add_ps(_mm_mul_ps(dirZ4, tDist4), rp.mOriginZ4);
+
+			maxT4 = tDist4;
+
+			mask4 = _mm_cmplt_ps( maxT4, minT4);
+		}
+		else
+		{
+			// compute intersection with all objects in this leaf
+			VspLeaf *leaf = static_cast<VspLeaf *>(node);
+			ViewCell *viewCell;
+
+			viewCell = leaf->GetViewCell();
+
+			// note: don't have to mail if each view 
+			// cell belongs to exactly one leaf
+			if (!useMailboxing || !viewCell->Mailed())
+			{
+				if (useMailboxing)
+					viewCell->Mail();
+
+				for (int i = 0; i < 4; ++i)
+				{
+					if (mask[i]) 
+						rp.mViewCells[i].push_back(viewCell);
+				}
+
+				++ hits;
+			}
+
+			// get the next node from the stack
+			if (tStack.empty())
+				break;
+
+			entpX4 = extpX4;
+			entpY4 = extpY4;
+			entpZ4 = extpZ4;
+
+			minT4 = maxT4;
+			
+			PacketTraversalData *s  = tStack.top();
+			node = s->mNode;
+			
+			extpX4 = s->mExitPointX4;
+			extpY4 = s->mExitPointY4;
+			extpZ4 = s->mExitPointZ4;
+
+			maxT4 = s->mMaxT4;
+
+			mask4 = s->mMask4;
+
+			tStack.pop();
+			delete s;
+		}
+	}
+
+	return hits;
+
+/*
+	const int offs[4] = {(rp.dx[0] >= 0) ? 1 : 0,  (rp.dy[0] >= 0)? 1 : 0,  (rp.dz[0] >= 0)? 1 : 0, 0};
+
+	while (!node->IsLeaf())
+	{
+		PacketTraversalData *tData = tStack.top();
+		tStack.pop();
+
+		node = tData->node;
+		VspInterior *interior = static_cast<VspInterior *>(node);
+		tn4 = tData->tn4;
+		tf4 = tData->tf4;
+		mask = tData->mask4;
+
+		position = interior->GetPosition();
+		const __m128 position4 = _mm_load_ps(&pos);
+
+		const int axis = interior->GetAxis();
+		const __m128 d4 = _mm_mul_ps(_mm_sub_ps(splitPos, origin[axis]), termination[axis]);
+
+		VspNode* ln = offs[axis] ? interior->GetFront() : interior->GetBack();
+
+		if (!_mm_movemask_ps(_mm_and_ps(_mm_cmpgt_ps(d4, tn4), mask)))
+		{ 
+			node = ln; 
+			continue; 
+		}
+
+		node = offs[axis]^1 ? interior->GetFront() : interior->GetBack();// + (offs[aidx]^1);
+
+		if (_mm_movemask_ps( _mm_and_ps( _mm_cmplt_ps(d4, tf4), mask)))
+		{
+			const __m128 mask2 = _mm_cmpgt_ps(d4, tn4);
+			const __m128 mask3 = _mm_cmplt_ps(d4, tf4);
+
+
+			tData->tf4 = tf4 = _mm_or_ps(_mm_and_ps(mask3, d4), _mm_andnot_ps( mask3, tf4));
+			tData->node = (VspNode *)ln;
+			tData->mask4 = mask;
+			tData->tn4 = _mm_or_ps( _mm_and_ps( mask2, d4 ), _mm_andnot_ps( mask2, tn4 ) );
+			mask = _mm_cmplt_ps( tn4, tf4 );
+		}
+	}*/
+}
+#endif
 
 
@@ -3057,5 +3210,5 @@
 		else
 		{
-			//cout << "o";
+			//cout << "r";
 			// store object only for one ray
 			//lastVssRay->mOriginObject = ray->mTerminationObject;
@@ -3091,5 +3244,6 @@
 
 void VspTree::Initialise(const VssRayContainer &rays,
-						 AxisAlignedBox3 *forcedBoundingBox)
+						 AxisAlignedBox3 *forcedBoundingBox,
+						 const ObjectContainer &objects)
 {
 	ComputeBoundingBox(rays, forcedBoundingBox);
@@ -3100,4 +3254,7 @@
 	VspViewCell *viewCell = new VspViewCell();
     leaf->SetViewCell(viewCell);
+
+	viewCell->SetPvsCost((float)objects.size());
+	viewCell->SetEntriesInPvs(1);
 
 	// set view cell values
@@ -3276,5 +3433,5 @@
 	// simple render cost evaluation
 	if (-- leaf->mCounter == 0)
-		return BvHierarchy::EvalAbsCost(leaf->mObjects);
+		return (float)leaf->mObjects.size();
 	else
 		return 0.0f;
@@ -3341,5 +3498,5 @@
 		leaf->Mail();
 		leaf->mCounter = 1;
-		return BvHierarchy::EvalAbsCost(leaf->mObjects);
+		return (float)leaf->mObjects.size();
 	}
 	else
@@ -3418,5 +3575,5 @@
 	{
 		leaf->Mail();
-		return BvHierarchy::EvalAbsCost(leaf->mObjects);
+		return (float)leaf->mObjects.size();
 	}
 	else
@@ -3576,5 +3733,5 @@
 	{
 		leaf->Mail();
-		return BvHierarchy::EvalAbsCost(leaf->mObjects);
+		return (float)leaf->mObjects.size();
 	}
 	else
@@ -3655,74 +3812,4 @@
 
 	return pvs;
-}
-
-
-VspNode *VspTree::SubdivideAndCopy(SplitQueue &tQueue,
-								   SubdivisionCandidate *splitCandidate)
-{
-	// todo remove dynamic cast
-	VspSubdivisionCandidate *sc = static_cast<VspSubdivisionCandidate *>(splitCandidate);
-
-	VspTraversalData &tData = sc->mParentData;
-	VspNode *newNode = tData.mNode;
-	VspNode *oldNode = (VspNode *)splitCandidate->mEvaluationHack;
-
-	if (!oldNode->IsLeaf())
-	{	
-		///////////
-		//-- continue subdivision
-
-		VspTraversalData tFrontData;
-		VspTraversalData tBackData;
-		
-		VspInterior *oldInterior = static_cast<VspInterior *>(oldNode);
-
-		// create new interior node and two leaf node
-		const AxisAlignedPlane splitPlane = oldInterior->GetPlane();
-		sc->mSplitPlane = splitPlane;
-	
-		// evaluate the changes in render cost and pvs entries
-		EvalSubdivisionCandidate(*sc, false);
-
-		newNode = SubdivideNode(*sc, tFrontData, tBackData);
-	
-		//oldNode->mRenderCostDecr += sc->GetRenderCostDecrease();
-		//oldNode->mPvsEntriesIncr += sc->GetPvsEntriesIncr();
-
-		//oldNode->mRenderCostDecr = sc->GetRenderCostDecrease();
-		//oldNode->mPvsEntriesIncr = sc->GetPvsEntriesIncr();
-
-		/////////////
-		//-- evaluate new split candidates for global greedy cost heuristics
-
-		VspSubdivisionCandidate *frontCandidate = new VspSubdivisionCandidate(tFrontData);
-		VspSubdivisionCandidate *backCandidate = new VspSubdivisionCandidate(tBackData);
-
-		frontCandidate->SetPriority((float)-oldInterior->GetFront()->mTimeStamp);
-		backCandidate->SetPriority((float)-oldInterior->GetBack()->mTimeStamp);
-
-		frontCandidate->mEvaluationHack = oldInterior->GetFront();
-		backCandidate->mEvaluationHack = oldInterior->GetBack();
-
-		// cross reference
-		tFrontData.mNode->SetSubdivisionCandidate(frontCandidate); 
-		tBackData.mNode->SetSubdivisionCandidate(backCandidate);
-
-		tQueue.Push(frontCandidate);
-		tQueue.Push(backCandidate);
-
-		// note: leaf is not destroyed because it is needed to collect 
-		// dirty candidates in hierarchy manager
-	}
-
-	if (newNode->IsLeaf()) // subdivision terminated
-	{
-		// detach subdivision candidate: this leaf is no candidate for splitting anymore
-		tData.mNode->SetSubdivisionCandidate(NULL); 
-		// detach node so it won't get deleted
-		tData.mNode = NULL;
-	}
-
-	return newNode;
 }
 
@@ -3857,129 +3944,6 @@
 }
 
-#if 0
-void VspTree::TraverseRayPacket(RayBundle &rays);
-{
-	float splitPos [3];
-	float dist[3];
-
-	const int allValid = 1xf;
-	int mask = all_valid;
-
-	int comparisonResult = 0;
-
-	while (!node->IsLeaf())
-	{
-		comparisonResult = 0;
-
-		for (int i = 0; i < 4; ++ i)
-		{
-			splitPos[i] = node->splitPos;
-			dist[i] = (splitpos[i]  rp.origin[i][axis]) / (rp.dir[i][axis]);
-
-			comparisonresult |= ((dist[i] <= tnear[i]) << i);
-		}
-		
-		comparisonresult &= mask;
-
-		if (comparisonresult == allValid)
-		{ 
-			node = node->far;
-			continue
-		}
-
-		comparisonresult = 0;
-
-		for (int i = 0; i < 4; ++ i){
-            
-			comparisonresult |= (dist[i] >= tfar[i]);
-		}
-        
-		comparisonresult &= mask;
-        
-		if (comparisonresult == allValid)
-		{
-			node = node->near;
-			continue;
-		}
-		
-		if (comparisonresult)	
-		{
-		
-			Push( node->far, dist[0...3], tfar[0...3] )
-		
-			node = node->near;
-
-			mask = 0;
-
-			for (int i = 0; i < 4; ++ i)
-			{
-				bool b = (tnear[i] < tfar[i]);
-				mask |= b;
-                
-				if (b)
-				{
-					tfar[i] = dist[i];
-				}
-
-			}
-
-		}
-}
-#endif
-
-
-
-void VspTree::TraverseRayPacket()//RayBundle &rays)
-{
-#ifdef USE_SSE
-	VspNode *node;
-
-	RayPacket rp;
-
-	__m128 mask;
-	__m128 tf4;
-	__m128 tn4;
-	//const int offs[4] = { (RP->dcell[0] >= 0)?1:0,  (RP->dcell[4] >= 0)?1:0,  (RP->dcell[8] >= 0)?1:0, 0 };
-	
-	const int offs[4] = { 0, 0, 0, 0 };
-
-	while (!node->IsLeaf())
-	{
-		VspInterior *interior = static_cast<VspInterior *>(node);
-
-		float pos = interior->GetPosition();
-		const __m128 spos = _mm_load_ps(&pos);
-		
-		const int aidx = interior->GetAxis();
-		const __m128 d4;// = _mm_mul_ps( _mm_sub_ps( spos, RP->oc4[aidx] ), RP->rdc4[aidx] );
-		
-		VspNode* ln = interior->GetBack();// + offs[aidx];
-		
-		if (!_mm_movemask_ps( _mm_and_ps( _mm_cmpgt_ps( d4, tn4 ), mask ) )) 
-		{ 
-			node = ln; 
-			continue; 
-		}
-		
-		node = interior->GetBack();// + (offs[aidx]^1);
-		
-		if (_mm_movemask_ps( _mm_and_ps( _mm_cmplt_ps( d4, tf4 ), mask ) ))
-		{
-			const __m128 mask2 = _mm_cmpgt_ps( d4, tn4 );
-			const __m128 mask3 = _mm_cmplt_ps( d4, tf4 );
-			
-			//m_Stack[stackptr].tf4 = tf4;
-
-			tf4 = _mm_or_ps( _mm_and_ps( mask3, d4 ), _mm_andnot_ps( mask3, tf4 ) );
-
-			//m_Stack[stackptr].node = (KdTreeNode*)ln;
-			//m_Stack[stackptr].mask = mask;
-			//m_Stack[stackptr++].tn4 = _mm_or_ps( _mm_and_ps( mask2, d4 ), _mm_andnot_ps( mask2, tn4 ) );
-			mask = _mm_cmplt_ps( tn4, tf4 );
-		}
-	}
-#endif
-
-}
-
-}
+
+
+
+}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h	(revision 2176)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h	(revision 2332)
@@ -422,8 +422,7 @@
 				);
 
-  int
-  CollectLeafPvs();
-
   bool ExportBinTree(const std::string &filename);
+
+  /// loads kd tree from disk. note: sorts objects by id
   bool LoadBinTree(const std::string &filename, ObjectContainer &object);
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2237)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 2332)
@@ -304,5 +304,5 @@
 
 
-void HierarchyManager::EvalSubdivisionStats()
+void HierarchyManager::PrintSubdivisionStats()
 {
 	
@@ -492,14 +492,15 @@
 
 	// create first nodes
-	mVspTree->Initialise(sampleRays, forcedViewSpace);
+	mVspTree->Initialise(sampleRays, forcedViewSpace, objects);
 	InitialiseObjectSpaceSubdivision(objects);
 
 	// hack: assume that object space can be seen from view space
-	mHierarchyStats.mTotalCost = mInitialRenderCost = (float)objects.size();
+	mHierarchyStats.mTotalCost = mInitialRenderCost = GetViewCellsManager()->ComputeRenderCost(objects.size(), 1);
+
 	// only one entry for start
 	mHierarchyStats.mPvsEntries = 1;
 	mHierarchyStats.mMemory = (float)ObjectPvs::GetEntrySizeByte();
 
-	EvalSubdivisionStats();
+	PrintSubdivisionStats();
 	Debug << "setting total cost to " << mHierarchyStats.mTotalCost << endl;
 
@@ -678,9 +679,9 @@
 	mHierarchyStats.mPvsEntries = 1;
 	mHierarchyStats.mMemory = (float)ObjectPvs::GetEntrySizeByte();
-	mHierarchyStats.mTotalCost = (float)objects.size();
+	mHierarchyStats.mTotalCost = GetViewCellsManager()->ComputeRenderCost(objects.size(), 1);
 
 	mHierarchyStats.mRenderCostDecrease = 0;
 
-	EvalSubdivisionStats();
+	PrintSubdivisionStats();
 	Debug << "setting total cost to " << mHierarchyStats.mTotalCost << endl;
 
@@ -689,5 +690,5 @@
 	
 	// create only roots
-	mVspTree->Initialise(sampleRays, forcedViewSpace);
+	mVspTree->Initialise(sampleRays, forcedViewSpace, objects);
 	InitialiseObjectSpaceSubdivision(objects);
 
@@ -745,6 +746,9 @@
 	//-- new stats
 
-	mHierarchyStats.mTotalCost = mVspTree->mTotalCost;
-	cout << "\nreseting cost for vsp, new total cost: " << mHierarchyStats.mTotalCost << endl;
+	if (0)
+	{
+		mHierarchyStats.mTotalCost = mVspTree->mTotalCost;
+		cout << "\nreseting cost for vsp construction, new total cost: " << mHierarchyStats.mTotalCost << endl;
+	}
 }
 
@@ -960,5 +964,5 @@
 
 	// output stats
-	EvalSubdivisionStats();
+	PrintSubdivisionStats();
 
 	return true;
@@ -1223,5 +1227,5 @@
 
 			// evaluate stats before first subdivision
-			EvalSubdivisionStats();
+			PrintSubdivisionStats();
 			cout << "finished bv hierarchy preparation" << endl;
 		}
@@ -1241,5 +1245,5 @@
 												 AxisAlignedBox3 *forcedViewSpace)
 {
-	ViewCellsManager *vm = mVspTree->mViewCellsManager;
+	ViewCellsManager *vm = GetViewCellsManager();
 
 	// HACK: rather not destroy vsp tree
@@ -1250,8 +1254,10 @@
 	mVspTree->mViewCellsManager = vm;
 
-	mVspTree->Initialise(sampleRays, forcedViewSpace);
+	mVspTree->Initialise(sampleRays, forcedViewSpace, objects);
+	
 	
 	//////////
 	//-- reset stats
+
     mHierarchyStats.mNodes = GetObjectSpaceSubdivisionNodes();
 		//-mVspTree->mVspStats.nodes + 1;
@@ -1266,5 +1272,5 @@
 
 	// evaluate new stats before first subdivsiion
-	EvalSubdivisionStats();
+	PrintSubdivisionStats();
 }
 
@@ -1278,5 +1284,5 @@
 	mHierarchyStats.mNodes = 2;
 	
-	mHierarchyStats.mTotalCost = (float)objects.size();
+	mHierarchyStats.mTotalCost = GetViewCellsManager()->ComputeRenderCost(objects.size(), 1);
 	Debug << "setting total cost to " << mHierarchyStats.mTotalCost << endl;
 
@@ -1285,5 +1291,5 @@
 	
 	// initialise view / object space
-	mVspTree->Initialise(sampleRays, forcedViewSpace);
+	mVspTree->Initialise(sampleRays, forcedViewSpace, objects);
 	InitialiseObjectSpaceSubdivision(objects);
 
@@ -1987,5 +1993,5 @@
 
 void HierarchyManager::ComputePvs(const ObjectPvs &pvs, 
-								  float &rc, 
+								  float &triangles, 
 								  int &pvsEntries)
 {
@@ -2026,7 +2032,7 @@
 			ObjectContainer objects;
             activeNode->CollectObjects(objects);
-			rc += mBvHierarchy->EvalAbsCost(objects);
+			triangles += (float)objects.size();
 #else
-			rc += mBvHierarchy->GetRenderCostIncrementially(activeNode);
+			triangles += mBvHierarchy->GetTriangleSizeIncrementially(activeNode);
 #endif
 			++ pvsEntries;
@@ -2232,6 +2238,5 @@
 	{
 		ViewCell *vc = *vit;
-		float rc = 0;
-        
+		
 #if STUPID_METHOD	
 		ObjectPvs pvs;
@@ -2254,25 +2259,33 @@
 		vc->Mail();
 
+		float triangles = 0;
+		int entries = 0;
+
 		if (useFilter)
 		{
 			const long startT = GetTime();
+			
 			ObjectPvs filteredPvs;
-			mVspTree->mViewCellsManager->ApplyFilter2(vc, false, 1.0f, filteredPvs);
+			GetViewCellsManager()->ApplyFilter2(vc, false, 1.0f, filteredPvs);
+
 			const long endT = GetTime();
 
 			//cout << "filter computed in " << TimeDiff(startT, endT) * 1e-3f << " secs" << endl;
-			ComputePvs(filteredPvs, rc, pvsEntries);
+			
+			ComputePvs(filteredPvs, triangles, entries);
 		}
 		else
 		{
-			ComputePvs(vc->GetPvs(), rc, pvsEntries);
-			vc->SetPvsCost(rc);
-		}
-
-		rc *= vc->GetVolume();
+			ComputePvs(vc->GetPvs(), triangles, entries);
+			vc->SetPvsCost(triangles);
+		}
+
+		const float rc = GetViewCellsManager()->ComputeRenderCost((int)triangles, entries) * vc->GetVolume();
+		
 		renderCost += rc;
-	}
-
-	renderCost /= mVspTree->mViewCellsManager->GetViewSpaceBox().GetVolume();
+		pvsEntries += entries;
+	}
+
+	renderCost /= GetViewCellsManager()->GetViewSpaceBox().GetVolume();
 	memory = pvsEntries * ObjectPvs::GetEntrySize();
 
@@ -2297,5 +2310,5 @@
 		const string filename = string(statsPrefix) + string(str);
 
-		mVspTree->mViewCellsManager->EvalViewCellHistogramForPvsSize(filename, viewCells);
+		GetViewCellsManager()->EvalViewCellHistogramForPvsSize(filename, viewCells);
 
 		histoUsed = true;
@@ -2322,181 +2335,11 @@
 
 
-void HierarchyManager::ExportStats(ofstream &stats, 
-								   SplitQueue &tQueue, 
-								   const ObjectContainer &objects)
-{
-	HierarchySubdivisionStats subStats;
-	subStats.Reset();
-
-	/////////////
-	//-- initial situation
-
-	subStats.mNumSplits = 0;
-	subStats.mTotalRenderCost = (float)objects.size();
-	subStats.mEntriesInPvs = 1;
-	subStats.mMemoryCost = (float)ObjectPvs::GetEntrySize();
-	subStats.mFullMemory = subStats.mMemoryCost;
-	subStats.mViewSpaceSplits = 0;
-	subStats.mObjectSpaceSplits = 0;
-	subStats.mRenderCostDecrease = 0;
-	subStats.Print(stats);
-
-	cout << "exporting vsposp stats ... " << endl;
-
-	//-- go through tree in the order of render cost decrease
-	//-- which is the same order as the view cells were merged
-	//-- or the reverse order of subdivision for subdivision-only 
-	//-- view cell hierarchies.
-
-	while (!tQueue.Empty())
-	{
-		SubdivisionCandidate *nextCandidate = NextSubdivisionCandidate(tQueue);
-		bool isLeaf;
-		int timeStamp;
-		//float rcDecr; 
-		//int entriesIncr; 
-
-		if (nextCandidate->Type() == SubdivisionCandidate::VIEW_SPACE)
-		{
-			timeStamp = (int)-nextCandidate->GetPriority();
-
-			VspNode *newNode = mVspTree->SubdivideAndCopy(tQueue, nextCandidate);
-			VspNode *oldNode = (VspNode *)nextCandidate->mEvaluationHack;
-
-			isLeaf = newNode->IsLeaf();
-			//subStats.mRenderCostDecrease = oldNode->mRenderCostDecr;
-			//entriesIncr = oldNode->mPvsEntriesIncr;
-		}
-		else
-		{
-			timeStamp = (int)-nextCandidate->GetPriority();
-
-			BvhNode *newNode = mBvHierarchy->SubdivideAndCopy(tQueue, nextCandidate);
-			BvhNode *oldNode = (BvhNode *)nextCandidate->mEvaluationHack;
-
-			isLeaf = newNode->IsLeaf();
-			//subStats.mRenderCostDecrease = oldNode->mRenderCostDecr;
-			//entriesIncr = oldNode->mPvsEntriesIncr;
-		}		
-
-		if (!isLeaf)
-		{
-			subStats.mTotalRenderCost -= subStats.mRenderCostDecrease;
-			//subStats.mEntriesInPvs += entriesIncr;
-
-			if (nextCandidate->Type() == SubdivisionCandidate::VIEW_SPACE)
-			{
-				++ subStats.mViewSpaceSplits;
-				//cout << "v";
-				//cout << "vsp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl;
-			}
-			else
-			{
-				++ subStats.mObjectSpaceSplits;
-				//cout << "o";
-				//"osp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl;
-			}
-
-			++ subStats.mNumSplits;
-
-			if ((subStats.mNumSplits % 500) == 499)
-				cout << subStats.mNumSplits << " steps taken" << endl;
-
-			subStats.mMemoryCost = (float)subStats.mEntriesInPvs * (float)ObjectPvs::GetEntrySize();
-			subStats.mFullMemory = subStats.mMemoryCost;
-
-			subStats.Print(stats);
-
-		}
-
-		DEL_PTR(nextCandidate);
-	}
-
-	stats.close();
-}
-
-
-void HierarchyManager::EvaluateSubdivision(const VssRayContainer &sampleRays,
-										   const ObjectContainer &objects,
-										   const string &filename)
-{
-#if 0
-	VspTree *oldVspTree = mVspTree;
-	ViewCellsManager *vm = mVspTree->mViewCellsManager;
-	BvHierarchy *oldHierarchy = mBvHierarchy;
-
-	mBvHierarchy = new BvHierarchy();
-	mBvHierarchy->mHierarchyManager = this;
-	mBvHierarchy->mViewCellsManager = vm;
-
-	mVspTree = new VspTree();
-	mVspTree->mHierarchyManager = this;
-	mVspTree->mViewCellsManager = vm;
-
-	// create first nodes
-	mVspTree->Initialise(sampleRays, &oldVspTree->mBoundingBox);
-	InitialiseObjectSpaceSubdivision(objects);
-
-	const long startTime = GetTime();
-	cout << "Constructing evaluation hierarchies ... \n";
-	
-	ofstream stats;
-	stats.open(filename.c_str());
-	SplitQueue tQueue;
-
-	BvhNode *oldBvhRoot = oldHierarchy->GetRoot();
-	VspNode *oldVspRoot = oldVspTree->GetRoot();
-
-	RayInfoContainer *viewSpaceRays = new RayInfoContainer();
-	
-	SubdivisionCandidate *firstVsp = mVspTree->PrepareConstruction(sampleRays, *viewSpaceRays);
-	tQueue.Push(firstVsp);
-
-	mBvHierarchy->PrepareConstruction(tQueue, sampleRays, objects);
-
-    firstVsp->mEvaluationHack = oldVspRoot;
-	firstBvh->mEvaluationHack = oldBvhRoot;
-
-	firstVsp->SetPriority((float)-oldVspRoot->mTimeStamp);
-	firstBvh->SetPriority((float)-oldBvhRoot->GetTimeStamp());
-	
-	ExportStats(stats, tQueue, objects);
-
-	cout << "\nfinished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl;
-	RemoveRayRefs(objects);
-
-	// view cells needed only for evaluation
-	ViewCellContainer viewCells;
-	mVspTree->CollectViewCells(viewCells, false);
-	
-	// helper trees can be destroyed
-	DEL_PTR(mVspTree);
-	DEL_PTR(mBvHierarchy);
-
-	CLEAR_CONTAINER(viewCells);
-
-	// reset hierarchies
-	mVspTree = oldVspTree;
-	mBvHierarchy = oldHierarchy;
-
-	// reinstall old bv refs
-	vector<BvhLeaf *> leaves;
-	mBvHierarchy->CollectLeaves(mBvHierarchy->GetRoot(), leaves);
-	vector<BvhLeaf *>::const_iterator bit, bit_end = leaves.end();
-
-	for (bit = leaves.begin(); bit != bit_end; ++ bit)
-	{
-		mBvHierarchy->AssociateObjectsWithLeaf(*bit);
-	}
-#endif
-}
-
-
-void HierarchyManager::EvaluateSubdivision2(ofstream &splitsStats,
-											const int splitsStepSize,
-											const bool useFilter,
-											const bool useHisto,
-											const int histoMem,
-											const int pass)
+
+void HierarchyManager::EvaluateSubdivision(ofstream &splitsStats,
+										   const int splitsStepSize,
+										   const bool useFilter,
+										   const bool useHisto,
+										   const int histoMem,
+										   const int pass)
 {
 	vector<HierarchySubdivisionStats> subStatsContainer;
@@ -2645,12 +2488,18 @@
 	if (!mTraversalTree)
 	{
-		return mVspTree->CastLineSegment(origin,termination, viewcells, useMailboxing);
+		return mVspTree->CastLineSegment(origin, termination, viewcells, useMailboxing);
 	}
 	else
 	{
-		return mTraversalTree->CastLineSegment(origin,termination, viewcells, useMailboxing);
-	}
-}
-
-
-}
+		return mTraversalTree->CastLineSegment(origin, termination, viewcells, useMailboxing);
+	}
+}
+
+
+ViewCellsManager *HierarchyManager::GetViewCellsManager() 
+{
+	return mVspTree->mViewCellsManager;
+}
+
+
+}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2176)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp	(revision 2332)
@@ -963,5 +963,5 @@
 			DEL_PTR(vc);
 
-//			(*vit).second = bspVc;
+			//(*vit).second = bspVc;
 			(*vit) = bspVc;
 		}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp	(revision 2176)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp	(revision 2332)
@@ -2356,5 +2356,4 @@
 
 	point *= 1.0f / sum;
-
 	//normal = face.GetNormal();
 
Index: /GTP/trunk/Lib/Vis/GtpVisibility.sln
===================================================================
--- /GTP/trunk/Lib/Vis/GtpVisibility.sln	(revision 2280)
+++ /GTP/trunk/Lib/Vis/GtpVisibility.sln	(revision 2332)
@@ -59,442 +59,98 @@
 	GlobalSection(SolutionConfiguration) = preSolution
 		Debug = Debug
-		Debug Static = Debug Static
-		DLL Debug = DLL Debug
-		DLL Release = DLL Release
-		DLL Unicode Debug = DLL Unicode Debug
-		DLL Unicode Release = DLL Unicode Release
-		DLL Universal Debug = DLL Universal Debug
-		DLL Universal Release = DLL Universal Release
-		DLL Universal Unicode Debug = DLL Universal Unicode Debug
-		DLL Universal Unicode Release = DLL Universal Unicode Release
-		mlrt = mlrt
 		Release = Release
 		Release Internal = Release Internal
-		Release Static = Release Static
-		Release_Internal = Release_Internal
 		release_noqt = release_noqt
 		Release_qt = Release_qt
-		Unicode Debug = Unicode Debug
-		Unicode Release = Unicode Release
-		Universal Debug = Universal Debug
-		Universal Release = Universal Release
-		Universal Unicode Debug = Universal Unicode Debug
-		Universal Unicode Release = Universal Unicode Release
 	EndGlobalSection
 	GlobalSection(ProjectConfiguration) = postSolution
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug.ActiveCfg = Debug|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug Static.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Debug Static.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Release.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Unicode Release.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Release.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.mlrt.ActiveCfg = mlrt|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.mlrt.Build.0 = mlrt|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release.ActiveCfg = Release|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release.Build.0 = Release|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release Internal.ActiveCfg = Release Internal|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release Internal.Build.0 = Release Internal|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release Static.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release Static.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release_Internal.Build.0 = Release_Internal|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.release_noqt.ActiveCfg = Release_qt|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.release_noqt.Build.0 = Release_qt|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release_qt.ActiveCfg = Release_qt|Win32
 		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Release_qt.Build.0 = Release_qt|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Unicode Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Unicode Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Unicode Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Unicode Release.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Release.Build.0 = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}.Universal Unicode Release.Build.0 = Release|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.ActiveCfg = Debug|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Debug Static.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Debug Static.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Release.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Unicode Release.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Release.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.mlrt.ActiveCfg = mlrt|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.mlrt.Build.0 = mlrt|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release.ActiveCfg = Release|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release.Build.0 = Release|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release Internal.ActiveCfg = Release Internal|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release Internal.Build.0 = Release Internal|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release Static.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release Static.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release_Internal.Build.0 = Release_Internal|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.release_noqt.ActiveCfg = Release_qt|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.release_noqt.Build.0 = Release_qt|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release_qt.ActiveCfg = Release_qt|Win32
 		{101A7691-74F3-48B4-96A3-CF35578F5900}.Release_qt.Build.0 = Release_qt|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Unicode Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Unicode Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Unicode Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Unicode Release.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Release.Build.0 = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{101A7691-74F3-48B4-96A3-CF35578F5900}.Universal Unicode Release.Build.0 = Release|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug.ActiveCfg = Debug|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug Static.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug Static.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.mlrt.ActiveCfg = mlrt|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.mlrt.Build.0 = mlrt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release.ActiveCfg = Release|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release.Build.0 = Release|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Internal.ActiveCfg = Release Internal|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Internal.Build.0 = Release Internal|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Static.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Static.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_Internal.Build.0 = Release_Internal|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.release_noqt.ActiveCfg = Release_qt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.release_noqt.Build.0 = Release_qt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_qt.ActiveCfg = Release_qt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_qt.Build.0 = Release_qt|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Release.Build.0 = Release|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.ActiveCfg = Debug|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug Static.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Debug Static.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Release.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Unicode Release.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Release.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.mlrt.ActiveCfg = mlrt|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.mlrt.Build.0 = mlrt|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.ActiveCfg = Release|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release.Build.0 = Release|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release Internal.ActiveCfg = Release Internal|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release Internal.Build.0 = Release Internal|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release Static.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release Static.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release_Internal.Build.0 = Release_Internal|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.release_noqt.ActiveCfg = Release_Internal|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.release_noqt.Build.0 = Release_Internal|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release_qt.ActiveCfg = Release_qt|Win32
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Release_qt.Build.0 = Release_qt|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Unicode Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Unicode Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Unicode Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Unicode Release.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Release.Build.0 = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436}.Universal Unicode Release.Build.0 = Release|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.ActiveCfg = Debug|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug Static.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Debug Static.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Release.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Unicode Release.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Release.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.mlrt.ActiveCfg = mlrt|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.mlrt.Build.0 = mlrt|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release.ActiveCfg = Release|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release.Build.0 = Release|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release Internal.ActiveCfg = Release Internal|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release Internal.Build.0 = Release Internal|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release Static.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release Static.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release_Internal.Build.0 = Release_Internal|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.release_noqt.ActiveCfg = release_noqt|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.release_noqt.Build.0 = release_noqt|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release_qt.ActiveCfg = Release_Qt|Win32
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Release_qt.Build.0 = Release_Qt|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Unicode Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Unicode Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Unicode Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Unicode Release.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Release.Build.0 = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA}.Universal Unicode Release.Build.0 = Release|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug.ActiveCfg = Debug|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug Static.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Debug Static.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Release.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Unicode Release.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Release.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.mlrt.ActiveCfg = mlrt|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.mlrt.Build.0 = mlrt|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release.ActiveCfg = Release|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release.Build.0 = Release|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release Internal.ActiveCfg = Release Internal|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release Internal.Build.0 = Release Internal|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release Static.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release Static.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release_Internal.ActiveCfg = Release_Qt|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release_Internal.Build.0 = Release_Qt|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.release_noqt.ActiveCfg = release_noqt|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.release_noqt.Build.0 = release_noqt|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release_qt.ActiveCfg = Release_Qt|Win32
 		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Release_qt.Build.0 = Release_Qt|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Unicode Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Unicode Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Unicode Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Unicode Release.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Release.Build.0 = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{69BC58F0-C7EB-4B43-B782-B6F047EF0528}.Universal Unicode Release.Build.0 = Release|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug.ActiveCfg = Debug|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug Static.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Debug Static.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Release.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Unicode Release.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Release.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.mlrt.ActiveCfg = mlrt|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.mlrt.Build.0 = mlrt|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.ActiveCfg = Release|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release.Build.0 = Release|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release Internal.ActiveCfg = Release Internal|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release Internal.Build.0 = Release Internal|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release Static.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release Static.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release_Internal.Build.0 = Release_Internal|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.release_noqt.ActiveCfg = Release_qt|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.release_noqt.Build.0 = Release_qt|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release_qt.ActiveCfg = Release_qt|Win32
 		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Release_qt.Build.0 = Release_qt|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Unicode Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Unicode Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Unicode Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Unicode Release.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Release.Build.0 = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{248F19A6-2FE0-4F5D-8928-E0EA10609887}.Universal Unicode Release.Build.0 = Release|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Debug.ActiveCfg = Debug|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Debug Static.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Debug Static.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Release.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Unicode Release.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Release.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.mlrt.ActiveCfg = mlrt|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.mlrt.Build.0 = mlrt|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release.ActiveCfg = Release|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release.Build.0 = Release|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release Internal.ActiveCfg = Release Internal|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release Internal.Build.0 = Release Internal|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release Static.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release Static.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release_Internal.Build.0 = Release_Internal|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.release_noqt.ActiveCfg = Release_qt|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.release_noqt.Build.0 = Release_qt|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release_qt.ActiveCfg = Release_qt|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Release_qt.Build.0 = Release_qt|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Unicode Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Unicode Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Unicode Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Unicode Release.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Release.Build.0 = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Unicode Release.Build.0 = Release|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug.ActiveCfg = Debug|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug Static.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug Static.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.mlrt.ActiveCfg = mlrt|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.mlrt.Build.0 = mlrt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release.ActiveCfg = Release|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release.Build.0 = Release|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Internal.ActiveCfg = Release Internal|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Internal.Build.0 = Release Internal|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Static.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Static.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_Internal.ActiveCfg = Release_Internal|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_Internal.Build.0 = Release_Internal|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.release_noqt.ActiveCfg = Release_qt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.release_noqt.Build.0 = Release_qt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_qt.ActiveCfg = Release_qt|Win32
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_qt.Build.0 = Release_qt|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Release.Build.0 = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Debug.ActiveCfg = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Debug.Build.0 = Debug|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Release.ActiveCfg = Release|Win32
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Release.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
