Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingPlusPlusManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingPlusPlusManager.h	(revision 2553)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingPlusPlusManager.h	(revision 2553)
@@ -0,0 +1,37 @@
+#ifndef _BatchedQueriesCullingManager_H__
+#define _BatchedQueriesCullingManager_H__
+
+#include "CoherentHierarchicalCullingManager.h"
+#include "HierarchyInterface.h"
+
+
+namespace GtpVisibility
+{
+
+/** Renders the scene with the coherent hierarchical culling algorithm. 
+*/
+class BatchedQueriesCullingManager : public CoherentHierarchicalCullingManager
+{
+public:
+	BatchedQueriesCullingManager();
+	/** Constructor taking the assumed visibility into account, i.e., the estimation
+		for how many frames the current visibility is considered to be valid
+	*/
+	BatchedQueriesCullingManager(const unsigned int assumedVisibility);
+
+	void RenderScene();
+	
+	void SetMaxPending(int maxPending);
+
+protected:
+
+	void IssueMultipleQueries(PendingQueue &pendingQueue, QueryQueue &queryQueue);
+
+	/** maximal pending nodes.
+	*/
+	int mMaxPending;
+};
+
+} // namespace GtpVisibility
+
+#endif // BatchedQueriesCullingManager_H
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/BatchedQueriesCullingManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/include/BatchedQueriesCullingManager.h	(revision 373)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#ifndef _BatchedQueriesCullingManager_H__
-#define _BatchedQueriesCullingManager_H__
-
-#include "CoherentHierarchicalCullingManager.h"
-#include "HierarchyInterface.h"
-
-
-namespace GtpVisibility
-{
-
-/** Renders the scene with the coherent hierarchical culling algorithm. 
-*/
-class BatchedQueriesCullingManager : public CoherentHierarchicalCullingManager
-{
-public:
-	BatchedQueriesCullingManager();
-	/** Constructor taking the assumed visibility into account, i.e., the estimation
-		for how many frames the current visibility is considered to be valid
-	*/
-	BatchedQueriesCullingManager(const unsigned int assumedVisibility);
-
-	void RenderScene();
-	
-	void SetMaxPending(int maxPending);
-
-protected:
-
-	void IssueMultipleQueries(PendingQueue &pendingQueue, QueryQueue &queryQueue);
-
-	/** maximal pending nodes.
-	*/
-	int mMaxPending;
-};
-
-} // namespace GtpVisibility
-
-#endif // BatchedQueriesCullingManager_H
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager2.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager2.h	(revision 2455)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#ifndef _CoherentHierarchicalCullingManager2_H__
-#define _CoherentHierarchicalCullingManager2_H__
-
-#include "CullingManager.h"
-#include "HierarchyInterface.h"
-
-
-namespace GtpVisibility
-{
-
-/** Renders the scene with the coherent hierarchical culling algorithm with
-	some additional features
-*/
-class CoherentHierarchicalCullingManager2: public CullingManager
-{
-public:
-	CoherentHierarchicalCullingManager2();
-
-	/** Constructor taking the assumed visibility into account, i.e., the estimation
-		for how many frames the current visibility is considered to be valid
-	*/
-	CoherentHierarchicalCullingManager2(const unsigned int assumedVisibility);
-
-	/** The main render routine.
-	*/
-	void RenderScene();
-
-	/** Sets assumed visibility (i.e., an estimation for 
-		how many frames the visibility is considered to be valid).
-		@param assumedVisibility indicates for how many frames the 
-		same visibility is be assumed.
-		if 0, the visibility is tested deterministically for each frame.
-	*/
-	void SetAssumedVisibility(const unsigned int assumedVisibility);
-
-protected:
-
-	/** Decides if node is considered to be visible depeding on the 
-		assumed visibility factor.
-		@returns if node is considered to be visible
-	*/
-	bool DecideVisible(HierarchyNode *node) const;
-
-	/** Skip query for this node.
-	*/
-	void SkipQuery(HierarchyNode *node) const;
-
-	/** number of steps the visibility is assumed to be valid.
-	*/
-	unsigned int mAssumedVisibility;
-
-	/** Threshold for rand function to return positive result with respect to
-		mAssumedVisibility.
-	*/
-	int mThreshold;
-};
-
-} // namespace GtpVisibility
-
-#endif // CoherentHierarchicalCullingManager2_H
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingPlusPlusManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingPlusPlusManager.cpp	(revision 2553)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingPlusPlusManager.cpp	(revision 2553)
@@ -0,0 +1,153 @@
+#include "BatchedQueriesCullingManager.h"
+
+
+namespace GtpVisibility {
+
+//-----------------------------------------------------------------------
+BatchedQueriesCullingManager::BatchedQueriesCullingManager():
+mMaxPending(5)
+{
+}
+//-----------------------------------------------------------------------
+BatchedQueriesCullingManager::BatchedQueriesCullingManager(const unsigned int 
+														   assumedVisibility):
+CoherentHierarchicalCullingManager(assumedVisibility), mMaxPending(5)
+{
+}
+
+//-----------------------------------------------------------------------
+void BatchedQueriesCullingManager::RenderScene()
+{
+	QueryQueue queryQueue;
+	unsigned int visiblePixels = 0;
+
+	PendingQueue pendingQueue;
+
+	//-- PART 1: process finished occlusion queries
+	while (!mHierarchyInterface->GetQueue()->empty() || !queryQueue.empty() ||!pendingQueue.empty())
+	{
+		while (!queryQueue.empty() && 
+			   queryQueue.front().second->GetQueryResult(visiblePixels, 
+									mHierarchyInterface->GetQueue()->empty()))
+		{
+           	HierarchyNode *node = queryQueue.front().first;
+			
+			queryQueue.pop();
+
+			if (visiblePixels > mVisibilityThreshold)
+			{
+				// ensure that we only traverse once if geometry in node
+				if (!mHierarchyInterface->IsNodeVisible(node))
+					mHierarchyInterface->TraverseNode(node);
+
+				mHierarchyInterface->PullUpVisibility(node);
+			}
+			else
+			{	
+				mHierarchyInterface->SetNodeVisible(node, false);
+
+				++ mNumQueryCulledNodes;
+				
+				if (mVisualizeCulledNodes)
+				{
+					mHierarchyInterface->VisualizeCulledNode(node, QUERY_CULLED);
+				}
+			}
+		}
+		
+		//-- PART 2: hierarchical traversal
+		if (!mHierarchyInterface->GetQueue()->empty())
+		{
+			HierarchyNode *node = mHierarchyInterface->GetQueue()->top();
+			mHierarchyInterface->GetQueue()->pop();
+				
+			bool intersects = false;
+
+			if (!mHierarchyInterface->CheckFrustumVisible(node, intersects))
+			{
+				++ mNumFrustumCulledNodes;
+				
+				if (mVisualizeCulledNodes)
+				{
+					mHierarchyInterface->VisualizeCulledNode(node, FRUSTUM_CULLED);
+				}
+			}
+			// -- if node intersects near plane, skip query because wrong results possible
+			else if (intersects)
+			{
+				SkipQuery(node);
+			}
+			else
+			{
+				// identify previously visible nodes
+				bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 
+					(mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1);
+				
+				// if we assume node to be visible in this frame => skip query 
+				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
+				bool issueQuery = !wasVisible || mHierarchyInterface->HasGeometry(node);
+							
+				// reset node's visibility classification
+				// set visible if geometry in node so we only traverse once
+				mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery);
+
+				// update node's visited flag
+				mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId());
+
+				// skip testing previously visible nodes without geometry
+				if (issueQuery)
+				{
+					++ mNumQueriesIssued;
+					// add to the pending queue instead of immediate query
+					if ((int)pendingQueue.size() < mMaxPending)
+						pendingQueue.push(PendingQuery(node, wasVisible));
+					else
+					{
+						IssueMultipleQueries(pendingQueue, queryQueue);	
+					}
+				}
+				
+				// always traverse a node if it was visible
+				if (wasVisible)
+				{
+					mHierarchyInterface->TraverseNode(node);
+				}
+			}
+		}
+
+		// issue rest of queries
+		IssueMultipleQueries(pendingQueue, queryQueue);
+	}
+}
+
+void BatchedQueriesCullingManager::IssueMultipleQueries(PendingQueue &pendingQueue, 
+														QueryQueue &queryQueue)
+{
+	while (!pendingQueue.empty())
+	{
+		HierarchyNode *node = pendingQueue.front().first;
+		const bool wasVisible = pendingQueue.front().second;
+
+		pendingQueue.pop();
+
+		queryQueue.push(QueryPair(node, mHierarchyInterface->
+					IssueNodeOcclusionQuery(node, wasVisible)));
+	}
+}
+
+void BatchedQueriesCullingManager::SetMaxPending(int maxPending)
+{
+	mMaxPending = maxPending;
+}
+
+} // namespace GtpVisibility
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp	(revision 2552)
+++ 	(revision )
@@ -1,153 +1,0 @@
-#include "BatchedQueriesCullingManager.h"
-
-
-namespace GtpVisibility {
-
-//-----------------------------------------------------------------------
-BatchedQueriesCullingManager::BatchedQueriesCullingManager():
-mMaxPending(5)
-{
-}
-//-----------------------------------------------------------------------
-BatchedQueriesCullingManager::BatchedQueriesCullingManager(const unsigned int 
-														   assumedVisibility):
-CoherentHierarchicalCullingManager(assumedVisibility), mMaxPending(5)
-{
-}
-
-//-----------------------------------------------------------------------
-void BatchedQueriesCullingManager::RenderScene()
-{
-	QueryQueue queryQueue;
-	unsigned int visiblePixels = 0;
-
-	PendingQueue pendingQueue;
-
-	//-- PART 1: process finished occlusion queries
-	while (!mHierarchyInterface->GetQueue()->empty() || !queryQueue.empty() ||!pendingQueue.empty())
-	{
-		while (!queryQueue.empty() && 
-			   queryQueue.front().second->GetQueryResult(visiblePixels, 
-									mHierarchyInterface->GetQueue()->empty()))
-		{
-           	HierarchyNode *node = queryQueue.front().first;
-			
-			queryQueue.pop();
-
-			if (visiblePixels > mVisibilityThreshold)
-			{
-				// ensure that we only traverse once if geometry in node
-				if (!mHierarchyInterface->IsNodeVisible(node))
-					mHierarchyInterface->TraverseNode(node);
-
-				mHierarchyInterface->PullUpVisibility(node);
-			}
-			else
-			{	
-				mHierarchyInterface->SetNodeVisible(node, false);
-
-				++ mNumQueryCulledNodes;
-				
-				if (mVisualizeCulledNodes)
-				{
-					mHierarchyInterface->VisualizeCulledNode(node, QUERY_CULLED);
-				}
-			}
-		}
-		
-		//-- PART 2: hierarchical traversal
-		if (!mHierarchyInterface->GetQueue()->empty())
-		{
-			HierarchyNode *node = mHierarchyInterface->GetQueue()->top();
-			mHierarchyInterface->GetQueue()->pop();
-				
-			bool intersects = false;
-
-			if (!mHierarchyInterface->CheckFrustumVisible(node, intersects))
-			{
-				++ mNumFrustumCulledNodes;
-				
-				if (mVisualizeCulledNodes)
-				{
-					mHierarchyInterface->VisualizeCulledNode(node, FRUSTUM_CULLED);
-				}
-			}
-			// -- if node intersects near plane, skip query because wrong results possible
-			else if (intersects)
-			{
-				SkipQuery(node);
-			}
-			else
-			{
-				// identify previously visible nodes
-				bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 
-					(mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1);
-				
-				// if we assume node to be visible in this frame => skip query 
-				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
-				bool issueQuery = !wasVisible || mHierarchyInterface->HasGeometry(node);
-							
-				// reset node's visibility classification
-				// set visible if geometry in node so we only traverse once
-				mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery);
-
-				// update node's visited flag
-				mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId());
-
-				// skip testing previously visible nodes without geometry
-				if (issueQuery)
-				{
-					++ mNumQueriesIssued;
-					// add to the pending queue instead of immediate query
-					if ((int)pendingQueue.size() < mMaxPending)
-						pendingQueue.push(PendingQuery(node, wasVisible));
-					else
-					{
-						IssueMultipleQueries(pendingQueue, queryQueue);	
-					}
-				}
-				
-				// always traverse a node if it was visible
-				if (wasVisible)
-				{
-					mHierarchyInterface->TraverseNode(node);
-				}
-			}
-		}
-
-		// issue rest of queries
-		IssueMultipleQueries(pendingQueue, queryQueue);
-	}
-}
-
-void BatchedQueriesCullingManager::IssueMultipleQueries(PendingQueue &pendingQueue, 
-														QueryQueue &queryQueue)
-{
-	while (!pendingQueue.empty())
-	{
-		HierarchyNode *node = pendingQueue.front().first;
-		const bool wasVisible = pendingQueue.front().second;
-
-		pendingQueue.pop();
-
-		queryQueue.push(QueryPair(node, mHierarchyInterface->
-					IssueNodeOcclusionQuery(node, wasVisible)));
-	}
-}
-
-void BatchedQueriesCullingManager::SetMaxPending(int maxPending)
-{
-	mMaxPending = maxPending;
-}
-
-} // namespace GtpVisibility
