Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h	(revision 1205)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h	(revision 1211)
@@ -72,4 +72,12 @@
 	};
 
+	enum ShowTree
+	{
+		SHOWTREE_OFF,
+		SHOWTREE_HILITE,
+		SHOWTREE_ALL,
+		SHOWTREE_MODES_NUM
+	};
+
 	enum AppState
 	{
@@ -113,16 +121,24 @@
 		bool useBufferedInputKeys = false, bool useBufferedInputMouse = false);
 
-    virtual ~KdTreeAppListener();
+    virtual ~KdTreeAppListener(void);
 
 	void initOverlayElement(OverlayElement **elInfo, String ext, 
 		String name, int top, String caption);
 
-	void initStatsOverlay();
-
-	void initKdTreeOverlay();
+	void initStatsOverlay(void);
+
+	void initKdTreeOverlay(void);
 
 	void showDebugOverlay(bool show);
 
-	void toggleVizCamera();
+	void toggleVizCamera(void);
+
+	void toggleShowBoxes(void);
+
+	void toggleEnhancedVisibility(void);
+
+	void toggleBuildMethod(void);
+
+	void toggleRenderMethod(void);
 
     virtual bool processUnbufferedKeyInput(const FrameEvent& evt);
@@ -130,5 +146,5 @@
     bool processUnbufferedMouseInput(const FrameEvent& evt);
 
-	void moveCamera();
+	void moveCamera(void);
 
     // Override frameStarted event to process that (don't care about frameEnded)
@@ -137,7 +153,7 @@
     bool frameEnded(const FrameEvent& evt);
 
-	void switchMouseMode();
-
-	void switchKeyMode();
+	void switchMouseMode(void);
+
+	void switchKeyMode(void);
 
 	void keyClicked(KeyEvent* e);
@@ -146,5 +162,5 @@
 	void keyReleased(KeyEvent* e) {};
 
-
+	const static String NA;
 protected:
 	// basic
@@ -163,7 +179,8 @@
 
 	bool mVizCamera;
-	bool mShowTree;
 	bool mFreeMove;
 	bool mTopCamFollow;
+
+	int mShowTree;
 
 	// counters
@@ -187,10 +204,12 @@
 	OverlayElement *mDemoStatus;
 
+
+	OverlayElement *mRenderMethodInfo;
+	OverlayElement *mEnhancedVisInfo;
+	OverlayElement *mBuildMethodInfo;
 	OverlayElement *mKdTreeMaxDepthInfo;
+	OverlayElement *mHighlightLevelInfo;
 	OverlayElement *mKTInfo;
 	OverlayElement *mKIInfo;
-	OverlayElement *mHighlightLevelInfo;
-	OverlayElement *mBuildMethodInfo;
-	OverlayElement *mRenderMethodInfo;
 	OverlayElement *mMovementInfo;
 	OverlayElement *mTopCamInfo;
Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp	(revision 1205)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp	(revision 1211)
@@ -5,4 +5,6 @@
 #include "TestKdTreeAppListener.h"
 #include <windows.h>
+
+const String KdTreeAppListener::NA = ": N/A";
 
 void KdTreeAppListener::updateStats(void)
@@ -86,7 +88,7 @@
 mStatsOn(true),
 mVizCamera(false),
-mShowTree(false),
 mFreeMove(false),
 mTopCamFollow(true),
+mShowTree(SHOWTREE_OFF),
 //counters
 mSeqNum(0),
@@ -217,6 +219,5 @@
 	const int border_height = 10;
 	const int vert_space = 15;
-	const String na = ": N/A";
-	String sMD, sKT, sKI, sHL, sBM, sRM, sFM, sTC;
+	String sMD, sKT, sKI, sHL, sBM, sRM, sFM, sTC, sEV;
 
 	int top = border_height;
@@ -228,5 +229,5 @@
 		sMD = ": " + StringConverter::toString(maxd);
 	else
-		sMD = na;
+		sMD = NA;
 
 	Real kt;
@@ -234,5 +235,5 @@
 		sKT = ": " + StringConverter::toString(kt);
 	else
-		sKT = na;
+		sKT = NA;
 
 	Real ki;
@@ -240,5 +241,5 @@
 		sKI = ": " + StringConverter::toString(ki);
 	else
-		sKI = na;
+		sKI = NA;
 
 	int hl;
@@ -246,6 +247,6 @@
 		sHL = ": " + StringConverter::toString(hl);
 	else
-		sHL = na;
-	if (!mShowTree)
+		sHL = NA;
+	if (mShowTree == SHOWTREE_OFF)
 		sHL = ": off";
 
@@ -254,5 +255,5 @@
 		sBM = ": " + bm;
 	else
-		sBM = na;
+		sBM = NA;
 
 	String rm;
@@ -268,10 +269,23 @@
 			sRM = ": Coherent Hierarchical Culling";
 		else
-			sRM = na;
-	}
-	else
-		sRM = na;
-
-	sFM = na;
+			sRM = NA;
+	}
+	else
+		sRM = NA;
+
+	bool enh;
+	if (mSceneMgr->getOption("EnhancedVisibility", &enh))
+	{
+		if (enh)
+			sEV = ": Enhanced";
+		else
+			sEV = ": Simple";
+	}
+	else
+	{
+		sEV = NA;
+	}
+
+	sFM = NA;
 	if (mFreeMove)
 		sFM = ": Free";
@@ -279,5 +293,5 @@
 		sFM = ": Ground";
 
-	sTC = na;
+	sTC = NA;
 	if (mTopCamFollow)
 		sTC = ": Follow";
@@ -286,4 +300,5 @@
 
 	initOverlayElement(&mRenderMethodInfo, ext, "RenderMethod", top, sRM); top += vert_space;
+	initOverlayElement(&mEnhancedVisInfo, ext, "EnhancedVis", top, sEV); top += vert_space;
 	initOverlayElement(&mBuildMethodInfo, ext, "BuildMethod", top, sBM); top += vert_space;
 	initOverlayElement(&mKdTreeMaxDepthInfo, ext, "KdTreeMaxDepth", top, sMD); top += vert_space;
@@ -353,4 +368,115 @@
 }
 
+void KdTreeAppListener::toggleShowBoxes()
+{
+	mShowTree = (mShowTree + 1) % SHOWTREE_MODES_NUM;
+	bool show = false, all = false;
+
+	switch (mShowTree)
+	{
+	case SHOWTREE_OFF:
+		break;
+	case SHOWTREE_HILITE:
+		show = true;
+		break;
+	case SHOWTREE_ALL:
+		show = all = true;
+		break;
+	}
+
+	// set display
+
+	if (mSceneMgr->getTypeName() == "OctreeSceneManager")
+		mSceneMgr->setOption("ShowOctree", &show);
+	else if (mSceneMgr->getTypeName() == "KdTreeSceneManager")
+		mSceneMgr->setOption("ShowKdTree", &show);
+
+	// set showall
+	mSceneMgr->setOption("ShowAllBoxes", &all);
+
+	if (!show)
+		mHighlightLevelInfo->setCaption(": off");
+	else
+	{
+		int hl;
+		if (mSceneMgr->getOption("HiLiteLevel", &hl))
+			mHighlightLevelInfo->setCaption(": " + StringConverter::toString(hl));
+		else
+			mHighlightLevelInfo->setCaption(NA);
+	}
+}
+
+void KdTreeAppListener::toggleEnhancedVisibility()
+{
+	bool mode;
+	if (mSceneMgr->getOption("EnhancedVisibility", &mode))
+	{
+		mode = !mode;
+		if (mSceneMgr->setOption("EnhancedVisibility", &mode))
+		{
+			if (mode)
+				mEnhancedVisInfo->setCaption(": Enhanced");
+			else
+				mEnhancedVisInfo->setCaption(": Simple");
+		}
+	}
+	else
+	{
+		mEnhancedVisInfo->setCaption(NA);
+	}
+}
+
+void KdTreeAppListener::toggleBuildMethod()
+{
+	static String bmOptions[] = { "Recursive", "PriorityQueue" };
+	static String bmOptionCaptions[] = { ": Recursive", ": PriorityQueue" };
+	static int bmOptionsSize = sizeof(bmOptions) / sizeof(String);
+	static int bmCurrent = 0;
+
+	String bm;
+	if (mSceneMgr->getOption("BuildMethod", &bm))
+	{
+		for (int idx = 0; idx < bmOptionsSize; idx++)
+			if (bmOptions[idx] == bm)
+				bmCurrent = idx;
+		bmCurrent = (bmCurrent + 1) % bmOptionsSize;
+		if (mSceneMgr->setOption("BuildMethod", &bmOptions[bmCurrent]))
+			mBuildMethodInfo->setCaption(bmOptionCaptions[bmCurrent]);
+	}
+	else
+	{
+		mBuildMethodInfo->setCaption(NA);
+	}
+}
+
+void KdTreeAppListener::toggleRenderMethod()
+{
+	static String rmOptions[] = { "INT", "VFC", "SWC", "CHC" };
+	static String rmOptionCaptions[] =
+	{
+		": Internal Frustum Culling",
+		": View Frustum Culling", 
+		": Stop and Wait Culling",
+		": Coherent Hierarchical Culling"
+	};
+	static int rmOptionsSize = sizeof(rmOptions) / sizeof (String);
+	static int rmCurrent = 0;
+
+	String rm;
+	if (mSceneMgr->getOption("RenderMethod", &rm))
+	{
+		for (int idx = 0; idx < rmOptionsSize; idx++)
+			if (rmOptions[idx] == rm)
+				rmCurrent = idx;
+		rmCurrent = (rmCurrent + 1) % rmOptionsSize;
+		if (mSceneMgr->setOption("RenderMethod", &rmOptions[rmCurrent]))
+			mRenderMethodInfo->setCaption(rmOptionCaptions[rmCurrent]);
+	}
+	else
+	{
+		mRenderMethodInfo->setCaption(NA);
+	}
+}
+
 bool KdTreeAppListener::processUnbufferedKeyInput(const FrameEvent& evt)
 {
@@ -364,4 +490,32 @@
 	}
 
+	if (mInputDevice->isKeyDown(KC_F1) && mTimeUntilNextToggle <= 0)
+	{
+		// TODO show help overlay
+	}
+
+	// show/hide vis viewport
+	if (mInputDevice->isKeyDown(KC_F2) && mTimeUntilNextToggle <= 0)
+	{
+		toggleVizCamera();
+		mTimeUntilNextToggle = 0.5;
+	}
+
+	// show/hide kdtree boxes
+	if (mInputDevice->isKeyDown(KC_F3) && mTimeUntilNextToggle <= 0)
+	{
+		toggleShowBoxes();
+		mTimeUntilNextToggle = 0.5;
+	}
+
+	if (mInputDevice->isKeyDown(KC_F4) && mTimeUntilNextToggle <= 0)
+	{
+		bool toggleShow;
+		mSceneMgr->getOption("ShowNodes", &toggleShow);
+		toggleShow = !toggleShow;
+		mSceneMgr->setOption("ShowNodes", &toggleShow);
+		mTimeUntilNextToggle = 0.5;
+	}
+
 	// demo recording stuff
 	if (mInputDevice->isKeyDown(KC_F5) && mTimeUntilNextToggle <= 0)
@@ -384,4 +538,28 @@
 	}
 
+	if (mInputDevice->isKeyDown(KC_F11) && mTimeUntilNextToggle <= 0)
+	{
+		toggleBuildMethod();
+		mTimeUntilNextToggle = 0.5;
+	}
+
+	if (mInputDevice->isKeyDown(KC_SPACE) && mTimeUntilNextToggle <= 0)
+	{
+		toggleRenderMethod();
+		mTimeUntilNextToggle = 0.5;
+	}
+
+	if (mInputDevice->isKeyDown(KC_V) && mTimeUntilNextToggle <= 0)
+	{
+		toggleEnhancedVisibility();
+		mTimeUntilNextToggle = 0.5;
+	}
+
+	if (mInputDevice->isKeyDown(KC_B) && mTimeUntilNextToggle <= 0)
+	{
+		mSceneMgr->showBoundingBoxes( ! mSceneMgr->getShowBoundingBoxes() );
+		mTimeUntilNextToggle = 0.5;
+	}
+
 	const static int vizCamSpeedup = 12;
 	// moving the cull camera
@@ -410,24 +588,4 @@
 		mVizCamTransVect.z = -mMoveScale * vizCamSpeedup;
 	}
-
-	// stuff for the overlay
-	const static String sNA = ": N/A";
-
-	static String bmOptions[] = { "Recursive", "PriorityQueue" };
-	static String bmOptionCaptions[] = { ": Recursive", ": PriorityQueue" };
-	static int bmOptionsSize = sizeof(bmOptions) / sizeof(String);
-	static int bmCurrent = 0;
-
-	//static String rmOptions[] = { "Recursive", "Stack", "StopAndWait", "CHC" };
-	static String rmOptions[] = { "INT", "VFC", "SWC", "CHC" };
-	static String rmOptionCaptions[] =
-	{
-		": Internal Frustum Culling",
-			": View Frustum Culling", 
-			": Stop and Wait Culling",
-			": Coherent Hierarchical Culling"
-	};
-	static int rmOptionsSize = sizeof(rmOptions) / sizeof (String);
-	static int rmCurrent = 0;
 
 	if ((mInputDevice->isKeyDown(KC_1) || mInputDevice->isKeyDown(KC_2)) && mTimeUntilNextToggle <= 0)
@@ -448,14 +606,14 @@
 					mHighlightLevelInfo->setCaption(": " + StringConverter::toString(hl));
 				else
-					mHighlightLevelInfo->setCaption(sNA);
+					mHighlightLevelInfo->setCaption(NA);
 			}
 		}
 		else
 		{
-			mKdTreeMaxDepthInfo->setCaption(sNA);
-			mHighlightLevelInfo->setCaption(sNA);
-		}
-
-		if (!mShowTree)
+			mKdTreeMaxDepthInfo->setCaption(NA);
+			mHighlightLevelInfo->setCaption(NA);
+		}
+
+		if (mShowTree == SHOWTREE_OFF)
 			mHighlightLevelInfo->setCaption(": off");
 
@@ -478,8 +636,8 @@
 		else
 		{
-			mHighlightLevelInfo->setCaption(sNA);
-		}
-
-		if (!mShowTree)
+			mHighlightLevelInfo->setCaption(NA);
+		}
+
+		if (mShowTree == SHOWTREE_OFF)
 			mHighlightLevelInfo->setCaption(": off");
 
@@ -506,5 +664,5 @@
 		else
 		{
-			mKTInfo->setCaption(sNA);
+			mKTInfo->setCaption(NA);
 		}
 
@@ -530,48 +688,8 @@
 		else
 		{
-			mKIInfo->setCaption(sNA);
+			mKIInfo->setCaption(NA);
 		}
 
 		mTimeUntilNextToggle = 0.2;
-	}
-
-	if (mInputDevice->isKeyDown(KC_X) && mTimeUntilNextToggle <= 0)
-	{
-		String bm;
-		if (mSceneMgr->getOption("BuildMethod", &bm))
-		{
-			for (int idx = 0; idx < bmOptionsSize; idx++)
-				if (bmOptions[idx] == bm)
-					bmCurrent = idx;
-			bmCurrent = (bmCurrent + 1) % bmOptionsSize;
-			if (mSceneMgr->setOption("BuildMethod", &bmOptions[bmCurrent]))
-				mBuildMethodInfo->setCaption(bmOptionCaptions[bmCurrent]);
-		}
-		else
-		{
-			mBuildMethodInfo->setCaption(sNA);
-		}
-
-		mTimeUntilNextToggle = 0.5;
-	}
-
-	if (mInputDevice->isKeyDown(KC_SPACE) && mTimeUntilNextToggle <= 0)
-	{
-		String rm;
-		if (mSceneMgr->getOption("RenderMethod", &rm))
-		{
-			for (int idx = 0; idx < rmOptionsSize; idx++)
-				if (rmOptions[idx] == rm)
-					rmCurrent = idx;
-			rmCurrent = (rmCurrent + 1) % rmOptionsSize;
-			if (mSceneMgr->setOption("RenderMethod", &rmOptions[rmCurrent]))
-				mRenderMethodInfo->setCaption(rmOptionCaptions[rmCurrent]);
-		}
-		else
-		{
-			mRenderMethodInfo->setCaption(sNA);
-		}
-
-		mTimeUntilNextToggle = 0.5;
 	}
 
@@ -610,33 +728,33 @@
 	}
 
-	if (mInputDevice->isKeyDown(KC_N) && mTimeUntilNextToggle <= 0)
-	{
-		//Entity * ent = mSceneMgr->createEntity("randominsert" + StringConverter::toString(mSeqNum), "robot.mesh");
-		Entity * ent = mSceneMgr->createEntity("randominsert" + StringConverter::toString(mSeqNum), "razor.mesh");
-		//Vector3 position(Math::RangeRandom(100, 1125), -0, Math::RangeRandom(-1125, 1125));
-		Vector3 position(Math::RangeRandom(-5000, 5000), Math::RangeRandom(-5000, 5000), Math::RangeRandom(-5000, 5000));
-		//Quaternion orientation(Radian(Math::RangeRandom(-Math::PI, Math::PI)), Vector3::UNIT_Y);
-		Vector3 axis(Math::RangeRandom(-1,1),Math::RangeRandom(-1,1),Math::RangeRandom(-1,1));
-		axis.normalise();
-		Quaternion orientation(Radian(Math::RangeRandom(-Math::PI, Math::PI)), axis);
-		Vector3 scale(Math::RangeRandom(0.5, 5),Math::RangeRandom(0.5, 5),Math::RangeRandom(0.5, 5));
-		SceneNode * anchor = mSceneMgr->getSceneNode("AnchorNode");
-		SceneNode *sn = anchor->createChildSceneNode("RandomInsertNode" + StringConverter::toString(mSeqNum), position, orientation);
-		sn->attachObject(ent);
-		sn->setScale(scale);
-		mTimeUntilNextToggle = 0.5;
-		mSeqNum++;
-	}
-
-	if (mInputDevice->isKeyDown(KC_J) && mTimeUntilNextToggle <= 0)
-	{
-		if (mSeqNum > 0)
-		{
-			mSeqNum--;
-			mSceneMgr->destroySceneNode("RandomInsertNode" + StringConverter::toString(mSeqNum));
-			mSceneMgr->destroyEntity("randominsert" + StringConverter::toString(mSeqNum));
-			mTimeUntilNextToggle = 0.5;
-		}
-	}
+	//if (mInputDevice->isKeyDown(KC_N) && mTimeUntilNextToggle <= 0)
+	//{
+	//	//Entity * ent = mSceneMgr->createEntity("randominsert" + StringConverter::toString(mSeqNum), "robot.mesh");
+	//	Entity * ent = mSceneMgr->createEntity("randominsert" + StringConverter::toString(mSeqNum), "razor.mesh");
+	//	//Vector3 position(Math::RangeRandom(100, 1125), -0, Math::RangeRandom(-1125, 1125));
+	//	Vector3 position(Math::RangeRandom(-5000, 5000), Math::RangeRandom(-5000, 5000), Math::RangeRandom(-5000, 5000));
+	//	//Quaternion orientation(Radian(Math::RangeRandom(-Math::PI, Math::PI)), Vector3::UNIT_Y);
+	//	Vector3 axis(Math::RangeRandom(-1,1),Math::RangeRandom(-1,1),Math::RangeRandom(-1,1));
+	//	axis.normalise();
+	//	Quaternion orientation(Radian(Math::RangeRandom(-Math::PI, Math::PI)), axis);
+	//	Vector3 scale(Math::RangeRandom(0.5, 5),Math::RangeRandom(0.5, 5),Math::RangeRandom(0.5, 5));
+	//	SceneNode * anchor = mSceneMgr->getSceneNode("AnchorNode");
+	//	SceneNode *sn = anchor->createChildSceneNode("RandomInsertNode" + StringConverter::toString(mSeqNum), position, orientation);
+	//	sn->attachObject(ent);
+	//	sn->setScale(scale);
+	//	mTimeUntilNextToggle = 0.5;
+	//	mSeqNum++;
+	//}
+
+	//if (mInputDevice->isKeyDown(KC_J) && mTimeUntilNextToggle <= 0)
+	//{
+	//	if (mSeqNum > 0)
+	//	{
+	//		mSeqNum--;
+	//		mSceneMgr->destroySceneNode("RandomInsertNode" + StringConverter::toString(mSeqNum));
+	//		mSceneMgr->destroyEntity("randominsert" + StringConverter::toString(mSeqNum));
+	//		mTimeUntilNextToggle = 0.5;
+	//	}
+	//}
 
 	//if (mInputDevice->isKeyDown(KC_P) && mTimeUntilNextToggle <= 0)
@@ -650,70 +768,4 @@
 	//	mTimeUntilNextToggle = 1.0;
 	//}
-
-	if (mInputDevice->isKeyDown(KC_B) && mTimeUntilNextToggle <= 0)
-	{
-		mSceneMgr->showBoundingBoxes( ! mSceneMgr->getShowBoundingBoxes() );
-		mTimeUntilNextToggle = 0.5;
-	}
-
-	if (mInputDevice->isKeyDown(KC_C) && mTimeUntilNextToggle <= 0)
-	{
-		toggleVizCamera();
-		mTimeUntilNextToggle = 0.5;
-	}
-
-	if (mInputDevice->isKeyDown(KC_V) && mTimeUntilNextToggle <= 0)
-	{
-		mShowTree = !mShowTree;
-
-		if (mSceneMgr->getTypeName() == "OctreeSceneManager")
-		{
-			//(static_cast<OctreeSceneManager *>(mSceneMgr))->setShowBoxes(mShowTree);
-			mSceneMgr->setOption("ShowOctree", &mShowTree);
-		}
-		else if (mSceneMgr->getTypeName() == "KdTreeSceneManager")
-		{
-			mSceneMgr->setOption("ShowKdTree", &mShowTree);
-			//KdTreeSceneManager *sm = static_cast<KdTreeSceneManager *>(mSceneMgr);
-			//sm->setShowBoxes(!sm->getShowBoxes());
-			//(static_cast<KdTreeSceneManager *>(mSceneMgr))->setShowBoxes(mShowTree);
-		}
-
-		if (!mShowTree)
-			mHighlightLevelInfo->setCaption(": off");
-		else
-		{
-			int hl;
-			if (mSceneMgr->getOption("HiLiteLevel", &hl))
-				mHighlightLevelInfo->setCaption(": " + StringConverter::toString(hl));
-			else
-				mHighlightLevelInfo->setCaption(sNA);
-		}
-
-		mTimeUntilNextToggle = 0.5;
-	}
-
-	if (mInputDevice->isKeyDown(KC_G) && mTimeUntilNextToggle <= 0)
-	{
-		bool toggleShowAllBoxes;
-		mSceneMgr->getOption("ShowAllBoxes", &toggleShowAllBoxes);
-		toggleShowAllBoxes = !toggleShowAllBoxes;
-		mSceneMgr->setOption("ShowAllBoxes", &toggleShowAllBoxes);
-		mTimeUntilNextToggle = 0.2;
-	}
-
-	if (mInputDevice->isKeyDown(KC_H) && mTimeUntilNextToggle <= 0)
-	{
-		bool toggleShow;
-		mSceneMgr->getOption("ShowNodes", &toggleShow);
-		toggleShow = !toggleShow;
-		mSceneMgr->setOption("ShowNodes", &toggleShow);
-		mTimeUntilNextToggle = 0.2;
-	}
-
-	if (mInputDevice->isKeyDown(KC_O))
-	{
-		mWindow->writeContentsToTimestampedFile("Screenshot",".jpg");
-	}
 
 	if (mInputDevice->isKeyDown(KC_A))
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1206)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1211)
@@ -29,4 +29,5 @@
 #include <stack>
 
+#include "OgreKdTreeCamera.h"
 #include "HierarchyInterface.h"
 
@@ -510,4 +511,8 @@
 		inline bool getShowNodes(void) { return mShowNodes; };
 
+		// changes vis mode (simple/enhanced with NONE/PART/FULL vis)
+		void setEnhancedVis(bool enh);
+		bool getEnhancedVis(void);
+
 		NodePtr getRoot(void) const { return mKdRoot; };
 
@@ -585,4 +590,6 @@
 		bool mShowNodes;
 
+		// pointer zur getVisibility function (simple oder enhanced)
+		KdTreeCamera::NodeVisibility (KdTreeCamera::*getVisibility)(const AxisAlignedBox& box) const;
 
 		// DEBUG
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h	(revision 1206)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h	(revision 1211)
@@ -179,5 +179,5 @@
 	/** Switches between simple & enhanced visibility
 	*/
-	void setEnhancedVis(bool enhanced);
+	//void setEnhancedVis(bool enhanced);
 
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1206)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1211)
@@ -80,11 +80,11 @@
 }
 
-void KdTreeSceneManager::setEnhancedVis(bool enhanced)
-{
-	for (CameraList::iterator it = mCameras.begin(); it != mCameras.end(); it ++)
-	{
-		KDCAMPTR_CAST(it->second)->setEnhancedVisMode(enhanced);
-	}
-}
+//void KdTreeSceneManager::setEnhancedVis(bool enhanced)
+//{
+//	for (CameraList::iterator it = mCameras.begin(); it != mCameras.end(); it ++)
+//	{
+//		KDCAMPTR_CAST(it->second)->setEnhancedVisMode(enhanced);
+//	}
+//}
 
 bool KdTreeSceneManager::setOption(const String& strKey, const void* pValue)
@@ -146,5 +146,7 @@
 	{
 		bool enh = *static_cast<const bool *>(pValue);
-		setEnhancedVis(enh);
+		if (mKdTree)
+			mKdTree->setEnhancedVis(enh);
+		//setEnhancedVis(enh);
 		return true;
 	}
@@ -355,6 +357,10 @@
 	else if (strKey == "EnhancedVisibility")
 	{
-		*static_cast<bool *>(pDestValue) = 
-			KDCAMPTR_CAST(mCameras.begin()->second)->getEnhancedVisMode();
+		if (mKdTree)
+			*static_cast<bool *>(pDestValue) = mKdTree->getEnhancedVis();
+			//KDCAMPTR_CAST(mCameras.begin()->second)->getEnhancedVisMode();
+		else
+			*static_cast<bool *>(pDestValue) = true;
+		return true;
 	}
 	else if (strKey == "BuildMethod")
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1206)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp	(revision 1211)
@@ -12,5 +12,4 @@
 #include "OgreKdTreeSceneNode.h"
 #include "OgreKdTreeSceneManager.h"
-#include "OgreKdTreeCamera.h"
 
 #include <OgreStringConverter.h>
@@ -371,4 +370,6 @@
 			mBuildLog = LogManager::getSingleton().createLog(KDTREE_LOGNAME);
 		}
+
+		setEnhancedVis(false);
 	}
 
@@ -1201,5 +1202,5 @@
 		//if (cam->isVisible(node->mAABB))
 		if (fullVis || 
-			((vis = cam->getVisibilityEnhanced(node->mAABB)) != KdTreeCamera::KDNV_NONE))
+			((vis = (cam->*getVisibility)(node->mAABB)) != KdTreeCamera::KDNV_NONE))
 			//((vis = (cam->*getVisibility)(node->mAABB)) != KdTreeCamera::KDNV_NONE))
 		{
@@ -1219,5 +1220,20 @@
 	}
 
-	////-------------------------------------------------------------------------
+	//-------------------------------------------------------------------------
+	void KdTree::setEnhancedVis(bool enh)
+	{
+		if (enh)
+			getVisibility = &KdTreeCamera::getVisibilityEnhanced;
+		else
+			getVisibility = &KdTreeCamera::getVisibilitySimple;
+	}
+
+	//-------------------------------------------------------------------------
+	bool KdTree::getEnhancedVis()
+	{
+		return getVisibility == &KdTreeCamera::getVisibilityEnhanced;
+	}
+
+	//-------------------------------------------------------------------------
 	//void KdTree::findVisibleNodes(NodeList& visibleNodes, Camera * cam)
 	//{
