Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1211)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h	(revision 1220)
@@ -478,6 +478,8 @@
 			KDRM_GTP_VFC,
 			KDRM_GTP_SWC,
-			KDRM_GTP_CHC
-
+			KDRM_GTP_CHC,
+			// invalid modes, just for convenience
+			KDRM_SIZE,
+			KDRM_NOTSET
 		};
 
@@ -485,6 +487,10 @@
 		{
 			KDBM_RECURSIVE,
-			KDBM_PRIORITYQUEUE
-		};
+			KDBM_PRIORITYQUEUE,
+			// invalid modes, just for convenience
+			KDBM_SIZE,
+			KDBM_NOTSET
+		};
+
 
 		const static int HILITE_OFF  = -1;
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 1193)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 1220)
@@ -454,5 +454,5 @@
 
 	getRenderQueue()->clear(); // finally clear render queue
-	if (0) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ...
+	if (1) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ...
 	if (0) WriteLog(); // write out stats
 }
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1214)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp	(revision 1220)
@@ -51,11 +51,11 @@
 mIsHierarchicalCulling(false)
 {
-// Replace root node with my node
-OGRE_DELETE(mSceneRoot);
-
-mSceneRoot = new KdTreeSceneNode(this, "root node");
-mSceneRoot->_notifyRootNode();
-
-mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem);
+	// Replace root node with my node
+	OGRE_DELETE(mSceneRoot);
+	mSceneRoot = new KdTreeSceneNode(this, "root node");
+	mSceneRoot->_notifyRootNode();
+
+	// init heirarchy interface
+	mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem);
 }
 
@@ -80,12 +80,4 @@
 	return mShowBoxes;
 }
-
-//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)
@@ -156,45 +148,40 @@
 	else if (strKey == "BuildMethod")
 	{
-		String bm = *static_cast<const String *>(pValue);
-		if (bm == "PriorityQueue")
-		{
-			mBuildMethod = KdTree::KDBM_PRIORITYQUEUE;
+		KdTree::BuildMethod bm = *static_cast<const KdTree::BuildMethod *>(pValue);
+		if (bm == KdTree::KDBM_RECURSIVE || bm == KdTree::KDBM_PRIORITYQUEUE)
+		{
+			mBuildMethod = bm;
 			return true;
 		}
-		else if (bm == "Recursive")
-		{
-			mBuildMethod = KdTree::KDBM_RECURSIVE;
+		else
+		{
+			return false;
+		}
+	}
+	else if (strKey == "RenderMethod")
+	{
+		KdTree::RenderMethod rm = *static_cast<const KdTree::RenderMethod *>(pValue);
+		if (rm == KdTree::KDRM_INTERNAL)
+		{
+			mRenderMethod = rm;
 			return true;
 		}
-		else
-		{
-			return false;
-		}
-	}
-	else if (strKey == "RenderMethod")
-	{
-		String rm = *static_cast<const String *>(pValue);
-		if (rm == "INT")
-		{
-			mRenderMethod = KdTree::KDRM_INTERNAL;
-			return true;
-		}
-		else if (rm == "VFC")
-		{
-			mRenderMethod = KdTree::KDRM_GTP_VFC;
+		else if (rm == KdTree::KDRM_GTP_VFC)
+		{
+			mRenderMethod = rm;
 			int cmt = GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING;
 			return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
 				.setOption("Algorithm", &cmt);
 		}
-		else if (rm == "SWC")
-		{
-			mRenderMethod = KdTree::KDRM_GTP_SWC;
+		else if (rm == KdTree::KDRM_GTP_SWC)
+		{
+			mRenderMethod = rm;
 			int cmt = GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING;
 			return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
 				.setOption("Algorithm", &cmt);
 		}
-		else if (rm == "CHC")
-		{
-			mRenderMethod = KdTree::KDRM_GTP_CHC;
+		else if (rm == KdTree::KDRM_GTP_CHC)
+		{
+			mRenderMethod = rm;
 			int cmt = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING;
 			return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
@@ -205,4 +192,35 @@
 			return false;
 		}
+		//String rm = *static_cast<const String *>(pValue);
+		//if (rm == "INT")
+		//{
+		//	mRenderMethod = KdTree::KDRM_INTERNAL;
+		//	return true;
+		//}
+		//else if (rm == "VFC")
+		//{
+		//	mRenderMethod = KdTree::KDRM_GTP_VFC;
+		//	int cmt = GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING;
+		//	return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
+		//		.setOption("Algorithm", &cmt);
+		//}
+		//else if (rm == "SWC")
+		//{
+		//	mRenderMethod = KdTree::KDRM_GTP_SWC;
+		//	int cmt = GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING;
+		//	return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
+		//		.setOption("Algorithm", &cmt);
+		//}
+		//else if (rm == "CHC")
+		//{
+		//	mRenderMethod = KdTree::KDRM_GTP_CHC;
+		//	int cmt = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING;
+		//	return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
+		//		.setOption("Algorithm", &cmt);
+		//}
+		//else
+		//{
+		//	return false;
+		//}
 	}
 	// little hack in case someone uses "Algorithm" option from VisOptMan directly
@@ -362,5 +380,4 @@
 		if (mKdTree)
 			*static_cast<bool *>(pDestValue) = mKdTree->getEnhancedVis();
-			//KDCAMPTR_CAST(mCameras.begin()->second)->getEnhancedVisMode();
 		else
 			*static_cast<bool *>(pDestValue) = mEnhancedVisiblity;
@@ -369,36 +386,38 @@
 	else if (strKey == "BuildMethod")
 	{
-		if (mBuildMethod == KdTree::KDBM_PRIORITYQUEUE)
-		{
-			*static_cast<String *>(pDestValue) = "PriorityQueue";
-		}
-		else if (mBuildMethod == KdTree::KDBM_RECURSIVE)
-		{
-			*static_cast<String *>(pDestValue) = "Recursive";
-		}
+		//if (mBuildMethod == KdTree::KDBM_PRIORITYQUEUE)
+		//{
+		//	*static_cast<String *>(pDestValue) = "PriorityQueue";
+		//}
+		//else if (mBuildMethod == KdTree::KDBM_RECURSIVE)
+		//{
+		//	*static_cast<String *>(pDestValue) = "Recursive";
+		//}
+		*static_cast<KdTree::BuildMethod *>(pDestValue) = mBuildMethod;
 		return true;
 	}
 	else if (strKey == "RenderMethod")
 	{
-		if (mRenderMethod == KdTree::KDRM_INTERNAL)
-		{
-			*static_cast<String *>(pDestValue) = "INT";
-		}
-		else if (mRenderMethod == KdTree::KDRM_GTP_VFC)
-		{
-				*static_cast<String *>(pDestValue) = "VFC";
-		}
-		else if (mRenderMethod == KdTree::KDRM_GTP_SWC)
-		{
-				*static_cast<String *>(pDestValue) = "SWC";
-		}
-		else if (mRenderMethod == KdTree::KDRM_GTP_CHC)
-		{
-				*static_cast<String *>(pDestValue) = "CHC";
-		}
-		else
-		{
-			return false;
-		}
+		//if (mRenderMethod == KdTree::KDRM_INTERNAL)
+		//{
+		//	*static_cast<String *>(pDestValue) = "INT";
+		//}
+		//else if (mRenderMethod == KdTree::KDRM_GTP_VFC)
+		//{
+		//		*static_cast<String *>(pDestValue) = "VFC";
+		//}
+		//else if (mRenderMethod == KdTree::KDRM_GTP_SWC)
+		//{
+		//		*static_cast<String *>(pDestValue) = "SWC";
+		//}
+		//else if (mRenderMethod == KdTree::KDRM_GTP_CHC)
+		//{
+		//		*static_cast<String *>(pDestValue) = "CHC";
+		//}
+		//else
+		//{
+		//	return false;
+		//}
+		*static_cast<KdTree::RenderMethod *>(pDestValue) = mRenderMethod;
 		return true;
 	}
