Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2359)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2455)
@@ -135,4 +135,5 @@
 mUseDepthPass(false),
 mTestGeometryForVisibleLeaves(false),
+mTestGeometryBounds(false),
 mShowVisualization(false),
 mCullCamera(false),
@@ -165,5 +166,4 @@
 mUseViewCells(false),
 mViewCellsLoaded(false),
-mUseVisibilityFilter(false),
 mFloorDist(2),
 mFlushQueue(false),
@@ -171,7 +171,4 @@
 m_iBoundingBoxLevel(0)
 {
-	//mInputDevice = PlatformManager::getSingleton().createInputReader();
-	//mInputDevice->initialise(win, true, true);
-
 	mEventProcessor = new EventProcessor();
 	
@@ -242,17 +239,25 @@
 	// the scale factor for the visualized bounding boxes
 	mSceneMgr->setOption("NodeVizScale", &mVizScale);
-	
-	/////////
-	//-- set the current culling algorithm type
-	//setAlgorithm(mApplication->mAlgorithm);
+
+	int assumedIncr;
+	mSceneMgr->getOption("AssumedVisibility", &assumedIncr);
+	changeAssumedVisibility(assumedIncr);
+
+	/////
+	// test geometry boundaries instead bounding box
+	mSceneMgr->getOption("TestGeometryBounds", &mTestGeometryBounds);
+	setTestGeometryBounds(mTestGeometryBounds);
+
+	/////////////////////////////////
+	// culling algorithm
 
 	bool isNormalExecution;
 		
 	mSceneMgr->getOption("NormalExecution", &isNormalExecution);
+	
 	if (isNormalExecution)
 	{
 		// no algorithm
-		mCurrentAlgorithm = 
-			GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS;
+		mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS;
 	}
 	else
@@ -261,12 +266,16 @@
 	}
 	
+	// apply the chosen culling algorithm
 	applyCurrentAlgorithm();
 	
+
 	///////////////////////////////
-
 	// set scene manager options
+	
+	//////////
+	mSceneMgr->getOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves);
 	setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves);
 
-	//mSceneMgr->setOption("UseDepthPass", &mUseDepthPass);
+	/////////////
 	mSceneMgr->getOption("UseDepthPass", &mUseDepthPass);
 
@@ -278,4 +287,5 @@
 	mSceneMgr->getOption("FlushQueue", &mFlushQueue);
 	
+	//////////
 	if (mFlushQueue)
 		LogManager::getSingleton().logMessage("initial setting: flushing queue");
@@ -283,4 +293,5 @@
 		LogManager::getSingleton().logMessage("initial setting: not flushing queue");
 
+	/////////////
 	mSceneMgr->setOption("ShowOctree", &mShowOctree);
 	mSceneMgr->setOption("ShowViewCells", &mShowViewCells);
@@ -290,11 +301,11 @@
 	applyObjectType();
 
-	// initialise timer
+
+	///////////////
+	// initialize timer
+
 	mTimer = Root::getSingleton().getTimer();
 	mTimeFrameEnded = mTimeFrameStarted = mTimer->getMilliseconds();
 	
-	// init view cell parameters
-	mSceneMgr->setOption("UseVisibilityFilter", &mUseVisibilityFilter);
-
 	// reset statistics
 	mWalkthroughStats.Reset();
@@ -863,6 +874,4 @@
 		mFrameInfo.push_back(info);
 		
-		// std::stringstream d; d << StringConverter::toString(info.position) << " " << StringConverter::toString(info.orientation);
-		// LogManager::getSingleton().logMessage(d.str());
 		++ i;
 	}
@@ -892,5 +901,5 @@
 		// we produced precomputed fps during the last replay =>
 		// save them to file
-		if (mSavePrecomputedFps) //!mPrecomputedFpsFrameInfo.empty())
+		if (mSavePrecomputedFps)
 		{
 			std::string filename = msApprevAlgorithmCaptions[mCurrentAlgorithm] + "_frames.out";
@@ -997,7 +1006,5 @@
 
 	if (mAssumedVisibility < 0) 
-	{	
 		mAssumedVisibility = 0;
-	}
 
 	char str[100]; sprintf(str,": %d", mAssumedVisibility);
@@ -1229,21 +1236,22 @@
 	mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves);
 	
-	/* disable optimization which tests geometry instead of aabb
-	 * for "delayed" rendering of transparents (i.e., render transparents after all the solids)
-	 * because otherwise visible transparents could be skipped
-	 */
-	bool delayedRendering = !mTestGeometryForVisibleLeaves;
-
-	mSceneMgr->setOption("DelayRenderTransparents", &delayedRendering);
-
+	// disable optimization for transparent objects, becaue otherwise visible 
+	// transparents could be skipped
 	if (mTestGeometryForVisibleLeaves)
-	{
 		mTestGeometryForVisibleLeavesInfo->setCaption(": true");
-	}
 	else
-	{
 		mTestGeometryForVisibleLeavesInfo->setCaption(": false");
-	}
-}
+}
+//-----------------------------------------------------------------------
+void TerrainFrameListener::setTestGeometryBounds(bool testGeometryBounds)
+{
+	mSceneMgr->setOption("TestGeometryBounds", &mTestGeometryBounds);
+	
+	if (mTestGeometryBounds)
+		LogManager::getSingleton().logMessage("Testing geometry boundaries");
+	else
+		LogManager::getSingleton().logMessage("Testing bounding box of hierarchy node");
+}
+
 //-----------------------------------------------------------------------
 void TerrainFrameListener::toggleShowOctree()
@@ -1293,10 +1301,4 @@
 }
 //-----------------------------------------------------------------------
-void TerrainFrameListener::toggleUseVisibilityFilter()
-{
-	mUseVisibilityFilter = !mUseVisibilityFilter;
-	mSceneMgr->setOption("UseVisibilityFilter", &mUseVisibilityFilter);
-}
-//-----------------------------------------------------------------------
 void TerrainFrameListener::toggleUseDepthPass()
 {
@@ -1485,5 +1487,6 @@
 		break;
 	case KC_Q:
-		toggleUseVisibilityFilter();
+		mTestGeometryBounds = !mTestGeometryBounds;
+		setTestGeometryBounds(mTestGeometryBounds);
 		break;
 	case KC_R:
