Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h	(revision 1593)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h	(revision 1602)
@@ -140,5 +140,5 @@
 	*/
 	void CreateViewCellsGeometry();
-
+	void VisualizeViewCells(const bool visualize);
 
 	//////////////////////////////////////////
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp	(revision 1593)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp	(revision 1602)
@@ -54,4 +54,5 @@
 		const GtpVisibilityPreprocessor::Vector3 vtx = *vit;
 		manual->position(vtx.x, vtx.y, vtx.z);
+		manual->colour(1.0f, 0.0f, 0.0f);
 	}
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 1597)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 1602)
@@ -147,5 +147,4 @@
     
     setupTerrainMaterial();
-
     setupTerrainPages();
 
@@ -179,8 +178,29 @@
     if (mCurrentViewCell && mCurrentViewCell->GetMesh())
 	{
-		const int id = mCurrentViewCell->GetId();
-		mViewCellsGeometry[id]->_updateRenderQueue(getRenderQueue());
-	}
-
+		const bool showSingleViewCell = true;
+		if (showSingleViewCell)
+		{
+			const int id = mCurrentViewCell->GetId();
+			mViewCellsGeometry[id]->_updateRenderQueue(getRenderQueue());
+
+			GtpVisibilityPreprocessor::ObjectPvsMap::const_iterator oit, oit_end = mCurrentViewCell->GetPvs().mEntries.end();
+			
+			for (oit = mCurrentViewCell->GetPvs().mEntries.begin(); oit != oit_end; ++ oit)
+			{
+				OgreMeshInstance *obj = static_cast<OgreMeshInstance *>((*oit).first);
+                obj->GetEntity()->_updateRenderQueue(getRenderQueue());
+			}	
+		}
+		else
+		{
+			MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end();
+			
+			for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit)
+			{
+				(*mit).second->_updateRenderQueue(getRenderQueue());
+			}	
+		}
+	}
+/*
     if (mRenderNodesForViz || mRenderNodesContentForViz)
 	{
@@ -206,14 +226,15 @@
 
 				// add bounding boxes instead of node itself
-				//(*it)->_addBoundingBoxToQueue(getRenderQueue());
+				if (0)
+					(*it)->_addBoundingBoxToQueue(getRenderQueue());
 			}
 
 			// add renderables itself
-			if (0 && mRenderNodesContentForViz) 
+			if (mRenderNodesContentForViz) 
 			{
 				(*it)->_addToRenderQueue(cam, getRenderQueue(), false);
 			}
 		}
-	}	
+	}*/
 }
 //-----------------------------------------------------------------------
@@ -297,20 +318,8 @@
 														bool onlyShadowCasters)
 {
-	///////////
-	//-- set visibility according to pvs of current view cell
-
-	UpdatePvs(cam);
-
-	if (mNormalExecution)
-	{
-		OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);
-		return;
-	}
-
 	if (mShowVisualization)
     {
 		//////////////
 		//-- show visible scene nodes and octree bounding boxes from last frame
-
 		PrepareVisualization(cam);
 	}
@@ -330,4 +339,15 @@
 		// only shadow casters will be rendered in shadow texture pass
 		if (0) mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters);
+
+		///////////
+		//-- set visibility according to pvs of current view cell
+
+		UpdatePvs(cam);
+
+		if (mNormalExecution)
+		{
+			OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);
+			//return;
+		}
 	}
 		
@@ -339,8 +359,9 @@
 void OcclusionCullingSceneManager::_renderVisibleObjects()
 {
+	
 	if (mNormalExecution)
 	{
 		// the standard octree rendering mode
-		OctreeSceneManager::_renderVisibleObjects();
+		TerrainSceneManager::_renderVisibleObjects();
 		return;
 	}
@@ -455,15 +476,5 @@
 			}
 		}
-		/*const bool mVisualizeViewCells = true;
-		if (mVisualizeViewCells)
-		{
-			MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end();
-			
-			for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit)
-			{
-				(*mit).second->_updateRenderQueue(getRenderQueue());
-			}	
-		}*/
-
+		
 		/////////////
 		//-- now we can render all remaining queue objects
@@ -600,4 +611,5 @@
 	if (key == "UseViewCells")
 	{ 
+		// only use this option if view cells are available
 		if (mViewCellsLoaded)
 		{
@@ -611,9 +623,23 @@
 				mCurrentViewCell = mViewCellsManager->GenerateViewCell();
 			}
-
+			// view cell corresponding to leaf in the view cell hierarchy
 			mElementaryViewCell = NULL;
 
-			// if we use view cells, all objects are set to false initially
+			// if we decide use view cells
+			// all objects are set to invisible per default
 			SetObjectsVisible(!mUseViewCells);
+		}
+
+		return true;
+	}
+	if (key == "ShowViewCells")
+	{ 
+		// only use this option if view cells are available
+		if (mViewCellsLoaded)
+		{
+			bool showViewCells = *static_cast<const bool *>(val);
+			// if we decide use view cells
+			// all objects are set to invisible per default
+			VisualizeViewCells(showViewCells);
 		}
 
@@ -1192,9 +1218,19 @@
 		getRootSceneNode()->createChildSceneNode()->attachObject(manual);
 		manual->setQueryFlags(0); // returned by no query
+	
 		// initialy set to invisible
-		//manual->setVisible(false);
-	}
-}
-
+		manual->setVisible(false);
+	}
+}
+//-------------------------------------------------------------------------
+void OcclusionCullingSceneManager::VisualizeViewCells(const bool visualize)
+{
+	MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end();
+			
+	for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit)
+	{
+		(*mit).second->setVisible(visualize);
+	}	
+}
 #if 0
 //-------------------------------------------------------------------------
@@ -1203,5 +1239,7 @@
 	// first test for scene node, then for octant (part of the hierarchy)
 	if (!node->mVisibleChildren)
+	{
 		node->setVisible(false);
+	}
 
 	node->getOctant()->mVisibleChildren --;
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 931)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 1602)
@@ -33,4 +33,5 @@
 	bool overlayEnabled = mViewport->getOverlaysEnabled();
 
+	///////////
 	//-- render scene with item buffer (i.e., objects with their id as color codes)
 //mItemBufferMode = 0;
