Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2160)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2161)
@@ -1817,19 +1817,12 @@
 	return false;
 }
-
-
-#if 0
+//-----------------------------------------------------------------------
 void OcclusionCullingSceneManager::RenderDepthPass()
 {
+	// create material for depth pass
+	InitDepthPass();
+
 	////////////////////
 	//-- hierarchical culling
-
-	// exclude these queues from hierarchical rendering
-	clearSpecialCaseRenderQueues();
-	addSpecialCaseRenderQueue(RENDER_QUEUE_BACKGROUND);
-	addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_EARLY);
-	addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_LATE);
-	addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);
-	setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);
 
 	// set all necessary parameters for 
@@ -1850,55 +1843,4 @@
 	// all which are not in mLeavePassesInQueue)
 	_deleteRenderedQueueGroups(mLeavePassesInQueue);
-
-	/////////////
-	//-- reset parameters needed for special rendering
-		
-	mIsDepthPassPhase = false;
-	mIsItemBufferPhase = false;
-	mSkipTransparents = false;
-	mIsHierarchicalCulling = false;
-		
-	mLeavePassesInQueue = 0;
-		
-	/////////////
-	//-- now we can render all remaining queue objects
-	//-- used for depth pass, transparents, overlay
-    clearSpecialCaseRenderQueues();
-
-	// the shaded geometry is rendered in a second pass
-	// add visible nodes found by the visibility culling algorithm
-	NodeList::const_iterator it, it_end = mVisible.end();
-
-	if(1) 
-	for (it = mVisible.begin(); it != it_end; ++ it)
-	{
-		(*it)->_addToRenderQueue(mCameraInProgress, getRenderQueue(), false);
-	}
-}
-#endif
-void OcclusionCullingSceneManager::RenderDepthPass()
-{
-	InitDepthPass(); // create material for depth pass
-
-	////////////////////
-	//-- hierarchical culling
-
-	// set all necessary parameters for 
-	// hierarchical visibility culling and rendering
-	InitVisibilityCulling(mCameraInProgress);
-
-
-	/** 
-	* the hierarchical culling algorithm
-	* for depth pass: we just find objects and update depth buffer
-	* for "delayed" rendering: we render some passes afterwards
-	* e.g., transparents, because they need front-to-back sorting
-	**/
-		
-	mVisibilityManager->ApplyVisibilityCulling();
-
-	// delete remaining renderables from queue
-	//_deleteRenderedQueueGroups();
-	getRenderQueue()->clear();
 
 	/////////////
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2146)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2161)
@@ -20,5 +20,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost"
+				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\src\sparsehash\src\"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NO_QT"
 				MinimalRebuild="TRUE"
@@ -198,5 +198,5 @@
 				OptimizeForProcessor="3"
 				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"
+				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\;$(NOINHERIT)"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PVS"
 				ExceptionHandling="TRUE"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h	(revision 2077)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h	(revision 2161)
@@ -79,14 +79,16 @@
   // pool of vss rays to be used in one pass of the sampling
   struct VssRayPool {
-	VssRayPool():mRays(NULL), mIndex(0), mNumber(0) {}
-	~VssRayPool() {
-	  if (mRays)
-		delete mRays;
+	VssRayPool(): mRays(NULL), mIndex(0), mNumber(0) 
+	{}
+
+	~VssRayPool() 
+	{
+		DEL_PTR(mRays);
 	}
 	
 	void Reserve(const int number) {
-	  if (mRays)
-		delete mRays;
-	
+		cout<<"here3"<<endl;
+	//DEL_PTR(mRays);
+	cout<<"here44"<<endl;
 	  mRays = new VssRay[number];
 	  mNumber = number;
@@ -102,5 +104,5 @@
 	  return mRays + mIndex ++;
 	}
-
+  protected:
 	VssRay *mRays;
 	int mIndex;
@@ -154,6 +156,6 @@
 
   /** Checks if ray is valid.
-  I.e., the ray is in valid view space.
-  @note: clamps the ray to valid view space.
+	  I.e., the ray is in valid view space.
+	  @note: clamps the ray to valid view space.
   */
   bool ValidateRay(const Vector3 &origin,
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h	(revision 2146)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h	(revision 2161)
@@ -2,9 +2,10 @@
 #define __HASHPVS_H
 
-//#include <hash_map>
+
 #include <hash_set>
 #include "common.h"
 #include <math.h>
 #include "PvsBase.h"
+#include "google/dense_hash_set"
 
 
@@ -25,8 +26,5 @@
    size_t operator()(T a) const
    {
-      size_t h = (size_t)(a->GetId());// % 2000;
-      //for (; *s; ++s)
-      //   h = 5 * h + *s;
-      return h;
+	   return (size_t)(a->GetId());
    }
 
@@ -37,16 +35,9 @@
 };
 
-/*
-template<typename T>
-struct gt
-{
-	bool operator() (T s1, T s2) const
-	{
-		return s1 > s2;
-	}
-};
-*/
-//#define HASH_SET stdext::hash_set<T, stdext::hash_compare<T, gt<T> > >
-#define HASH_SET stdext::hash_set<T, my_hash_compare<T> >
+
+#define HASH_SET google::dense_hash_set<T, my_hash_compare<T> >
+//#define HASH_SET stdext::hash_set<T, my_hash_compare<T> >
+#define HASH_ITERATOR HASH_SET::iterator
+#define CONST_HASH_ITERATOR HASH_SET::const_iterator
 
 /** Iterator over a hash pvs.
@@ -59,6 +50,6 @@
 	HashPvsIterator<T, S>() {}
 
-	HashPvsIterator<T, S>(const typename HASH_SET::const_iterator &itCurrent,
-						  const typename HASH_SET::const_iterator &itEnd):
+	HashPvsIterator<T, S>(const typename CONST_HASH_ITERATOR &itCurrent,
+						  const typename CONST_HASH_ITERATOR &itEnd):
 	mItCurrent(itCurrent), mItEnd(itEnd)
 	{
@@ -72,17 +63,21 @@
 	T Next(S &pdf)
 	{
-		// hack: create new pvs entry
-		return *(mItCurrent) ++;
+		T sample = *mItCurrent;
+		++ mItCurrent;
+
+		return sample;
 	}
 
 	T Next()
 	{
-		// hack: create new pvs entry
-		return *(mItCurrent) ++;
+		T sample = *mItCurrent;
+		++ mItCurrent;
+
+		return sample;
 	}
 	
 private:
-	typename HASH_SET::const_iterator mItCurrent;
-	typename HASH_SET::const_iterator mItEnd;
+	typename CONST_HASH_ITERATOR mItCurrent;
+	typename CONST_HASH_ITERATOR mItEnd;
 };
 
@@ -139,5 +134,5 @@
 		it would be added in the sorted vector.
 	*/
-	bool Find(T sample, typename HASH_SET::iterator &it);
+	inline bool Find(T sample, typename HASH_ITERATOR &it);
 
 	typename HashPvsIterator<T, S> GetIterator() const;
@@ -210,5 +205,5 @@
 
 template <typename T, typename S>
-bool HashPvs<T, S>::Find(T sample, typename HASH_SET::iterator &it)
+bool HashPvs<T, S>::Find(T sample, typename HASH_ITERATOR &it)
 {
 	it = mEntries.find(sample);
@@ -216,4 +211,5 @@
 	// already in map
 	return (it != mEntries.end());
+	return false;
 }
 
@@ -236,5 +232,5 @@
 float HashPvs<T, S>::AddSample(T sample, const float pdf)
 {
-	static HASH_SET::iterator it;
+	static HASH_ITERATOR it;
 
 	if (Find(sample, it))
@@ -256,5 +252,5 @@
 void HashPvs<T, S>::AddSampleDirty(T sample, const float pdf)
 {
-	static HASH_SET::iterator it;
+	static HASH_ITERATOR it;
 
 	// not yet in map
@@ -272,10 +268,10 @@
 										const float pdf)
 {
-	/*pair<HASH_SET::iterator, bool> p = mEntries.insert(sample);
+	/*pair<HASH_ITERATOR, bool> p = mEntries.insert(sample);
 
 	// already in map
 	return p.second;
 */
-	static HASH_SET::iterator it;
+	static HASH_ITERATOR it;
 
 	// already in map
@@ -375,5 +371,5 @@
 						  const HashPvs<T, S> &b)
 {
-	HASH_SET::const_iterator ait, ait_end = a.mEntries.end();
+	CONST_HASH_ITERATOR ait, ait_end = a.mEntries.end();
 
 	for (ait = a.mEntries.begin(); ait != ait_end; ++ ait)
@@ -382,5 +378,5 @@
 	}
 
-	HASH_SET::const_iterator bit, bit_end = b.mEntries.end();
+	CONST_HASH_ITERATOR bit, bit_end = b.mEntries.end();
 
 	for (bit = b.mEntries.begin(); bit != bit_end; ++ bit)
@@ -389,5 +385,4 @@
 	}
 
-	//cerr << "not implemented" << endl; 
 }
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2160)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2161)
@@ -20,6 +20,6 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer"
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer;..\src\sparsehash\src;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src\google\sparsehash"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_QT"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -221,5 +221,5 @@
 				OptimizeForProcessor="3"
 				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"
+				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\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\;..\src\ootl\src\include\ootl;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PVS"
 				ExceptionHandling="TRUE"
@@ -489,4 +489,7 @@
 			<File
 				RelativePath=".\HashPvs.h">
+			</File>
+			<File
+				RelativePath=".\HashPvs2.h">
 			</File>
 			<File
@@ -1040,4 +1043,130 @@
 			</File>
 		</Filter>
+		<Filter
+			Name="ootl"
+			Filter="">
+			<Filter
+				Name="include"
+				Filter="">
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_adapters.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_benchmark.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_bool_stack.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_dictionary.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_fft.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_fft_test.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_functions.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_generators.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_hash.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_iterable.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_iterators.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_list.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_map.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_misc.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_console.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_gdi.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_simple_win.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_object.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_output.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_polar.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_predicate.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_procedure.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_ptr.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_stack.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_string.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_string_utils.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_tester.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_timer.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\sandbox\ootl_valarray.hpp">
+				</File>
+				<File
+					RelativePath=".\ootl\src\include\ootl\ootl_vlist.hpp">
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="google"
+			Filter="">
+			<File
+				RelativePath=".\sparsehash\src\google\sparsehash\config.h">
+			</File>
+			<File
+				RelativePath=".\sparsehash\src\google\sparsehash\densehashtable.h">
+			</File>
+			<File
+				RelativePath=".\sparsehash\src\windows\hash_fun.h">
+			</File>
+			<File
+				RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">
+			</File>
+			<File
+				RelativePath=".\sparsehash\src\windows\hash_map.h">
+			</File>
+			<File
+				RelativePath=".\sparsehash\src\google\sparsehash\sparsehashtable.h">
+			</File>
+			<File
+				RelativePath=".\sparsehash\src\windows\stl_hash_fun.h">
+			</File>
+		</Filter>
 		<File
 			RelativePath=".\VTune\Preprocessor.vpj">
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2130)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2161)
@@ -26,5 +26,4 @@
 
 #include "PerfTimer.h"
-
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2117)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2161)
@@ -20,5 +20,5 @@
 #include "SceneGraph.h"
 #include "GlobalLinesRenderer.h"
-#include "PvsDefinitions.h"
+//#include "PvsDefinitions.h"
 
 #include "ViewCellsManager.h"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2117)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2161)
@@ -621,9 +621,9 @@
 
 	// HACK
-	if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass)
+	/*if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass)
 	{
 		cout << "warning: new samples: " << castSamples << " " << "queue: "  << (int)mRayQueue.size() << endl;
 		Debug << "warning: new samples: " << castSamples << " " << "queue: "  << (int)mRayQueue.size() << endl;
-	}
+	}*/
 
 	return castSamples;
