Index: trunk/VUT/GtpVisibility/include/HierarchyInterface.h
===================================================================
--- trunk/VUT/GtpVisibility/include/HierarchyInterface.h	(revision 155)
+++ trunk/VUT/GtpVisibility/include/HierarchyInterface.h	(revision 158)
@@ -14,5 +14,5 @@
 typedef std::pair<HierarchyNode *, OcclusionQuery *> QueryPair;
 typedef std::queue<QueryPair> QueryQueue;
-typedef std::stack<HierarchyNode *> TraversalStack;
+
 
 /**	Class which implements a hierarchy interface for a scene hierarchy.
@@ -33,5 +33,5 @@
 		@param node the hierarchy node
 	*/
-	virtual void TraverseAndRenderNode(HierarchyNode *node) = 0;
+	virtual void TraverseNode(HierarchyNode *node) = 0;
 	/** Renders current hierarchy node.
 		@param node current hierarchy node to be rendered
@@ -56,11 +56,8 @@
 	*/
 	HierarchyNode *GetHierarchyRoot() const;
-	/** Sets the scene root and initialises this hierarchy interface for a traversal.
-		@param frontToBack 
-			if traversal is initialised for front-to-back rendering or
-			simple traversal of the nodes.
+	/** Sets the scene root and initialises this hierarchy interface for a traversal.		
 		@remark also resets the statistics evaluated in the last traversal
 	*/
-	void InitTraversal(bool frontToBack = true);
+	void InitTraversal();
 	/** Returns current frame id.
 		@returns frame id
@@ -152,14 +149,9 @@
 	virtual void RenderGeometry(GtpVisibility::Mesh *geom) = 0;
 
-	/** Sets node id to specified value. 
-	*/
-	virtual void SetNodeId(HierarchyNode *node, int id) = 0;
-	/** Returns id of given node. 
-	*/
-	virtual int GetNodeId(HierarchyNode *node) = 0;
-
+	
 	/** This is an optimization when issuing the occlusion test. 
 		The test is done with actual geometry rather than the bounding 
-		box of leave nodes previously marked as visible
+		box of leave nodes previously marked as visible.
+
 		@param testGeometry if this optimization should be used
 		@remark this option is only useful for the coherent hierarchical culling algorithm
@@ -167,31 +159,26 @@
 	void TestGeometryForVisibleLeaves(bool testGeometry);
 
-	/** 
-		Traverses hierarchy and returns next node.
-		@returns next node in hierarchy.
-	*/
-	virtual HierarchyNode *GetNextNode() = 0;
+
 
 protected:
 	/// chc optimization for testing geometry of leaves instead of bounding box
 	bool mTestGeometryForVisibleLeaves;
-
+	/// the current frame number
 	unsigned int mFrameId;
-
+	/// points to the last occlusion query in the query list
 	int mCurrentTestIdx;
 	
 	/// number of traversed nodes
 	unsigned int mNumTraversedNodes;
-	/// the distance queue used for rendering of nodes in front to back order.
+
+	/// The queue is useful for rendering hierarchy nodes in front to back order.
 	DistanceQueue *mDistanceQueue;
-	/// internal structure for traversal
-	TraversalStack *mTraversalStack;
 
 	/// the root of the hierarchy
 	HierarchyNode *mHierarchyRoot;
 	
-	// buffer for a node pointer
+	/// buffer for a node pointer
 	HierarchyNode *mSavedNode;
-
+	/// list of rendered hierarchy nodes (e.g., useful for exact visibility queries)
 	std::vector<HierarchyNode *> mRenderedNodes;
 };
Index: trunk/VUT/GtpVisibility/src/FrustumCullingManager.cpp
===================================================================
--- trunk/VUT/GtpVisibility/src/FrustumCullingManager.cpp	(revision 155)
+++ trunk/VUT/GtpVisibility/src/FrustumCullingManager.cpp	(revision 158)
@@ -28,5 +28,5 @@
 		{		
 			mHierarchyInterface->SetNodeVisible(node, true);
-			mHierarchyInterface->TraverseAndRenderNode(node);
+			mHierarchyInterface->TraverseNode(node);
 		}
 	}
Index: trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
===================================================================
--- trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp	(revision 155)
+++ trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp	(revision 158)
@@ -40,5 +40,5 @@
 			{
 				mHierarchyInterface->PullUpVisibility(node);
-				mHierarchyInterface->TraverseAndRenderNode(node);
+				mHierarchyInterface->TraverseNode(node);
 			}
 			else
@@ -111,5 +111,5 @@
 				if (wasVisible)
 				{
-					mHierarchyInterface->TraverseAndRenderNode(node);
+					mHierarchyInterface->TraverseNode(node);
 				}
 			}
@@ -145,5 +145,5 @@
 
 	mHierarchyInterface->PullUpVisibility(node);			
-	mHierarchyInterface->TraverseAndRenderNode(node);
+	mHierarchyInterface->TraverseNode(node);
 }
 
Index: trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp
===================================================================
--- trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp	(revision 155)
+++ trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp	(revision 158)
@@ -11,5 +11,4 @@
 {	
 	mDistanceQueue = new DistanceQueue(GreaterDistance<HierarchyNode *>(this));
-	mTraversalStack = new std::stack<HierarchyNode *>;
 }
 //-----------------------------------------------------------------------
@@ -17,5 +16,4 @@
 {		
 	delete mDistanceQueue;
-	delete mTraversalStack;
 }
 //-----------------------------------------------------------------------
@@ -25,20 +23,14 @@
 }
 //-----------------------------------------------------------------------
-void HierarchyInterface::InitTraversal(bool frontToBack)
+void HierarchyInterface::InitTraversal()
 {
 	// initialise for front-to-back rendering
-	if (frontToBack)
-	{
-		++ mFrameId;
-		mCurrentTestIdx = 0;
-		mNumTraversedNodes = 0;
-		mRenderedNodes.clear();
 
-		mDistanceQueue->push(mHierarchyRoot);
-	}
- 	else
-	{	// initialise for simple node traversal
-		mTraversalStack->push(mHierarchyRoot);
-	}
+	++ mFrameId;
+	mCurrentTestIdx = 0;
+	mNumTraversedNodes = 0;
+	mRenderedNodes.clear();
+
+	mDistanceQueue->push(mHierarchyRoot);
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp
===================================================================
--- trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp	(revision 155)
+++ trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp	(revision 158)
@@ -31,5 +31,5 @@
 		{
 			mHierarchyInterface->SetNodeVisible(node, true);
-			mHierarchyInterface->TraverseAndRenderNode(node);
+			mHierarchyInterface->TraverseNode(node);
 		}
 		else
@@ -45,5 +45,5 @@
 			if (visiblePixels > mVisibilityThreshold)
 			{
-				mHierarchyInterface->TraverseAndRenderNode(node);
+				mHierarchyInterface->TraverseNode(node);
 			}
 			else
Index: trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 156)
+++ trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 158)
@@ -453,6 +453,5 @@
 			++nodesSize;
 
-			int id = sm->GetHierarchyInterface()->GetNodeId((*nodesIt).GetNode());
-			std::stringstream d; d << "Node " << id << " visibility: " << vis;
+			std::stringstream d; d << "Node visibility: " << vis;
 			LogManager::getSingleton().logMessage(d.str());
 		}	
Index: trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderable.h
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderable.h	(revision 153)
+++ trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderable.h	(revision 158)
@@ -227,5 +227,9 @@
             }
         }
+		/** Sets an id for this renderable.
+		*/
 		void setId(int id) {mId = id;}
+		/** see set 
+		*/
 		int getId() {return mId;}
 
Index: trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneNode.h
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneNode.h	(revision 154)
+++ trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneNode.h	(revision 158)
@@ -444,11 +444,4 @@
 		void setLastRendered(int frameid);
 
-		/** Sets scene node id 
-		@param the id
-		*/
-		void setId(int id);
-		/** see set */
-		int getId(void);
-
 	protected:
 		int mLastVisited;
Index: trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneNode.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneNode.cpp	(revision 154)
+++ trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneNode.cpp	(revision 158)
@@ -42,5 +42,5 @@
 	mYawFixed(false), mAutoTrackTarget(0), mIsInSceneGraph(false)
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	, mLastVisited(0), mVisible(false), mLastRendered(-1), mId(-1)
+	, mLastVisited(0), mVisible(false), mLastRendered(-1)
 #endif //GTP_VISIBILITY_MODIFIED_OGRE
     {
@@ -53,5 +53,5 @@
 	mAutoTrackTarget(0), mIsInSceneGraph(false)
 	#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	, mLastVisited(0), mVisible(false), mId(-1)
+	, mLastVisited(0), mVisible(false)
 	#endif //GTP_VISIBILITY_MODIFIED_OGRE
     {
@@ -641,14 +641,4 @@
 		mLastRendered = frameid;
 	}
-	//-----------------------------------------------------------------------
-	void SceneNode::setId(int id)
-	{
-		mId = id;
-	}
-	//-----------------------------------------------------------------------
-	int SceneNode::getId(void)
-	{
-		return mId;
-	}
 	#endif //GTP_VISIBILITY_MODIFIED_OGRE
 }
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h	(revision 154)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h	(revision 158)
@@ -192,12 +192,4 @@
 	void _updateBounds();
 
-	/** Sets scene node id 
-	@param the id
-	*/
-	void setId(int id);
-	
-	/** see set */
-	int getId(void);
-
 protected:
 	
@@ -209,5 +201,5 @@
 	bool mVisible;
 	int mDepth;
-	int mId;
+	
 
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp	(revision 154)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp	(revision 158)
@@ -88,5 +88,5 @@
       mHalfSize( 0, 0, 0 )
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	, mLastVisited(0), mVisible(false), mLastRendered(-1), mId(-1)
+	, mLastVisited(0), mVisible(false), mLastRendered(-1)
 #endif //GTP_VISIBILITY_MODIFIED_OGRE
 {
@@ -271,14 +271,5 @@
 	}
  }
-//-----------------------------------------------------------------------
-void Octree::setId(int id)
-{
-	mId = id;
-}
-//-----------------------------------------------------------------------
-int Octree::getId()
-{
-	return mId;
-}
+
 #endif //GTP_VISIBILITY_MODIFIED_OGRE
 }
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp	(revision 154)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp	(revision 158)
@@ -316,8 +316,9 @@
 
     mOctree = new Octree( 0 );
+
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	mNumOctreeNodes = 1;
-	mOctree->setId(mNumOctreeNodes);
+	mNumOctreeNodes = 1; // count number of octants
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
+
     mMaxDepth = depth;
     mBox = box;
@@ -469,5 +470,5 @@
             octant -> mChildren[ x ][ y ][ z ] = new Octree( octant );
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	mOctree->setId(++ mNumOctreeNodes);
+	++ mNumOctreeNodes;
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
 
@@ -1031,8 +1032,9 @@
 
     mOctree = new Octree( 0 );
+
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
 	mNumOctreeNodes = 1;
-	mOctree->setId(mNumOctreeNodes);
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
+
     mOctree->mBox = box;
 
Index: trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 155)
+++ trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 158)
@@ -24,5 +24,5 @@
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
 	
-	void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
+	void TraverseNode(GtpVisibility::HierarchyNode *node);
 	void RenderNode(GtpVisibility::HierarchyNode *node);
 	void PullUpVisibility(GtpVisibility::HierarchyNode *node);
@@ -41,8 +41,4 @@
 	void VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 
 							GtpVisibility::CullingType type);
-
-	/*bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,	
-							InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, 
-							bool includeChildren = false);*/
 	
 	void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,	
@@ -50,9 +46,4 @@
 					 bool includeChildren);
 
-	void SetNodeId(GtpVisibility::HierarchyNode *node, int id);
-	
-	int GetNodeId(GtpVisibility::HierarchyNode *node);
-
-	GtpVisibility::HierarchyNode *GetNextNode();
 };
 
Index: trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h	(revision 156)
+++ trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h	(revision 158)
@@ -11,5 +11,4 @@
 #include "OgrePlatformQueryManager.h"
 #include "VisibilityManager.h"
-#include <OgreSolidBoundingBox.h>
 
 
@@ -97,35 +96,50 @@
 	*/
 	void PrepareVisualization(Camera *cam);
-	
+	/** Initialises necessary parameters for hierarchical visibility culling.
+	*/
 	void InitVisibilityCulling(Camera *cam);
 
-
+	/// the interface to the scene hierarchy.
 	OctreeHierarchyInterface *mHierarchyInterface;
+	/// manages all visibility options
 	GtpVisibility::VisibilityManager *mVisibilityManager;
 
+	/// if a visualization of the hierarchical culling is shown
 	bool mShowVisualization;
+
+	/// if the culled nodes are indicated in the visualization
 	bool mVisualizeCulledNodes;
 
+	/// if symbols for the nodes are shown in the visualization
 	bool mRenderNodesForViz;
+	/// if content of the nodes is shown in the visualization
 	bool mRenderNodesContentForViz;
+
+	/// if we render transparents after the hierarchical traversal
 	bool mDelayRenderTransparents;
+
+	/// if we use a depth pass (i.e., fill only the depth buffer in the first pass)
 	bool mUseDepthPass;
+	/// if we currently render the depth pass
 	bool mRenderDepthPass;
+	
+	/// if we use an item buffer for rendering (i.e., object ids as color codes
+	bool mUseItemBuffer;
+	/// if we currently render the item buffer 
 	bool mRenderItemBuffer;
-	bool mUseItemBuffer;
+
+	/// if depth write should be enabled
 	bool mEnableDepthWrite;
+	/// if transparents are skipped during rendering
 	bool mSkipTransparents;
 
+	/// the depth pass (no lighting, just filling the depth buffer)
 	Pass *mDepthPass;
 	Pass *mItemBufferPass;
 
 	int mCurrentEntityId;
-
+	/// flag for passes which should not be deleted from queue during first traversal
 	int mLeavePassesInQueue;
 	ShadowTechnique mSavedShadowTechnique;
-
-	bool mRenderHierarchyNodes;
-
-	std::vector<SolidBoundingBox *> mSolidBoxes;
 };
 
Index: trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 155)
+++ trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 158)
@@ -27,9 +27,10 @@
 	void PullUpVisibility(GtpVisibility::HierarchyNode *node);
 	
-	/** Traverses given node.
+	/** Traverses and renders the given node.
 		@param node current node
 		@remark pushes children on a distance queue.
 	*/
-	void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
+	void TraverseNode(GtpVisibility::HierarchyNode *node);
+	/** @copydoc HierarchyInterface::RenderNode */
 	void RenderNode(GtpVisibility::HierarchyNode *node);
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
@@ -50,10 +51,4 @@
 					 bool includeChildren);
 
-	void SetNodeId(GtpVisibility::HierarchyNode *node, int id);
-	
-	int GetNodeId(GtpVisibility::HierarchyNode *node);
-
-	GtpVisibility::HierarchyNode *GetNextNode();
-
 protected:
 	/** Returns pointer to the bounding box of the node.
@@ -67,6 +62,4 @@
 	*/
 	Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
-
-	int mCurrentOctreePosition;
 };
 } // namespace Ogre
Index: trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 155)
+++ trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 158)
@@ -24,5 +24,5 @@
 		@remark pushes children on the distance queue
 	*/
-	void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
+	void TraverseNode(GtpVisibility::HierarchyNode *node);
 	void RenderNode(GtpVisibility::HierarchyNode *node);
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
Index: trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp	(revision 155)
+++ trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp	(revision 158)
@@ -17,5 +17,5 @@
 }
 //-----------------------------------------------------------------------
-void SceneNodeHierarchyInterface::TraverseAndRenderNode(GtpVisibility::HierarchyNode *node)
+void SceneNodeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
 {
 	++ mNumTraversedNodes;
@@ -157,32 +157,4 @@
     }
 }
-//-----------------------------------------------------------------------
-void SceneNodeHierarchyInterface::SetNodeId(GtpVisibility::HierarchyNode *node, int id)
-{
-	static_cast<SceneNode *>(node)->setId(id);
-}
-//-----------------------------------------------------------------------
-int SceneNodeHierarchyInterface::GetNodeId(GtpVisibility::HierarchyNode *node)
-{
-	return static_cast<SceneNode *>(node)->getId();
-}
-//-----------------------------------------------------------------------
-GtpVisibility::HierarchyNode *SceneNodeHierarchyInterface::GetNextNode()
-{
-	if (mTraversalStack->empty())
-		return NULL;
-	
-	SceneNode *node = static_cast<SceneNode *>(mTraversalStack->top());
-	mTraversalStack->pop();
 
-	// internal node: add children to priority queue for further processing
-	Node::ChildNodeIterator it = node->getChildIterator();
-				
-	while (it.hasMoreElements())			
-	{ 
-		mTraversalStack->push(it.getNext());
-	}
-
-	return node;
-} 
 } // namespace Ogre	
Index: trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 157)
+++ trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 158)
@@ -31,7 +31,5 @@
 mEnableDepthWrite(true),
 mSkipTransparents(false),
-mSavedShadowTechnique(SHADOWTYPE_NONE),
-mRenderHierarchyNodes(false)
-//mRenderHierarchyNodes(true)
+mSavedShadowTechnique(SHADOWTYPE_NONE)
 {
 	mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem);
@@ -210,10 +208,4 @@
 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters)
 {
-	// clear list of solid boxes (used for item buffer hierarchy node rendering)
-	/*for (int i=0; i<(int)mSolidBoxes.size(); ++i)
-		delete mSolidBoxes[i];
-
-	mSolidBoxes.clear();*/
-
 	//-- show visible scene nodes and octree bounding boxes from last frame
 	if (mShowVisualization)
@@ -221,29 +213,4 @@
 		PrepareVisualization(cam);
 	}
-	else if (mRenderHierarchyNodes)
-	{
-		AxisAlignedBox aab;
-		
-
-		// get rendered hierarchy nodes from last frame
-		GtpVisibility::HierarchyNodeList *nodeList = mHierarchyInterface->GetRenderedNodes();
-		GtpVisibility::HierarchyNodeList::iterator nodeIt, nodeIt_end = nodeList->end();
-
-		for (nodeIt = nodeList->begin(); nodeIt != nodeIt_end; ++nodeIt)		
-		{
-			SolidBoundingBox *solidBox = new SolidBoundingBox();
-			solidBox->SetupBoundingBox(aab);
-
-			Octree *octree = static_cast<Octree *>(*nodeIt);
-			solidBox->setId(octree->getId());
-			mSolidBoxes.push_back(solidBox);
-
-			aab = octree->_getWorldAABB();
-			std::stringstream d; d << "bounding box with id: " << octree->getId() << ", " << aab << "\n";
-			LogManager::getSingleton().logMessage(d.str());
-
-			getRenderQueue()->addRenderable(solidBox);	
-		}
-	}
 	else 
 	{	
@@ -273,8 +240,7 @@
 	ColourValue savedAmbient = mAmbientLight;
 
-	// --- apply standard rendering for some cases 
-    // e.g., visualization, shadow pass
-
-	if (mShowVisualization || mRenderHierarchyNodes ||
+	// --- apply standard rendering for some cases (e.g., visualization, shadow pass)
+
+	if (mShowVisualization ||
 	   (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 
 	    mIlluminationStage == IRS_RENDER_TO_TEXTURE))
@@ -282,6 +248,6 @@
 		IlluminationRenderStage savedStage = mIlluminationStage; 
 	
-		if (mShowVisualization || mRenderHierarchyNodes) 
-			// disable illumination stage because we want no shadows
+		if (mShowVisualization) 
+			// disable illumination stage to prevent rendering shadows
 			mIlluminationStage = IRS_NONE;
 
@@ -448,8 +414,5 @@
 		return true;
 	}
-	if (key == "RenderHierarchyNodes")
-	{
-		mRenderHierarchyNodes = (*static_cast<const bool *>(val));
-	}
+	
 	return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface).
 		setOption(key, val) || TerrainSceneManager::setOption(key, val);
Index: trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp	(revision 155)
+++ trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp	(revision 158)
@@ -10,9 +10,9 @@
 //-----------------------------------------------------------------------
 OctreeHierarchyInterface::OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys): 
-SceneNodeHierarchyInterface(sm, rsys), mCurrentOctreePosition(0)
+SceneNodeHierarchyInterface(sm, rsys)
 {
 }
 //-----------------------------------------------------------------------
-void OctreeHierarchyInterface::TraverseAndRenderNode(GtpVisibility::HierarchyNode *node)
+void OctreeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
 {
 	++ mNumTraversedNodes;
@@ -168,36 +168,3 @@
 	}
 }
-//-----------------------------------------------------------------------
-void OctreeHierarchyInterface::SetNodeId(GtpVisibility::HierarchyNode *node, int id)
-{
-	static_cast<Octree *>(node)->setId(id);
-}
-//-----------------------------------------------------------------------
-int OctreeHierarchyInterface::GetNodeId(GtpVisibility::HierarchyNode *node)
-{
-	return static_cast<Octree *>(node)->getId();
-}
-//-----------------------------------------------------------------------
-GtpVisibility::HierarchyNode *OctreeHierarchyInterface::GetNextNode()
-{
-	if (mTraversalStack->empty())
-		return NULL;
-	
-	Octree *octree = static_cast<Octree *>(mTraversalStack->top());
-	mTraversalStack->pop();
-		
-	for(int i=0; i<8; ++i)
-	{
-		Octree *nextChild = 
-			octree->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1];
-
-		if (nextChild)
-		{
-			mTraversalStack->push(nextChild);
-		}
-	}
-
-	return octree;
-} 
-		
 } // namespace Ogre
Index: trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp	(revision 155)
+++ trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp	(revision 158)
@@ -12,5 +12,5 @@
 }
 //-----------------------------------------------------------------------
-void BspHierarchyInterface::TraverseAndRenderNode(GtpVisibility::HierarchyNode *node)
+void BspHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
 {
 }
Index: trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp	(revision 155)
+++ trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp	(revision 158)
@@ -130,5 +130,6 @@
 }
 //-----------------------------------------------------------------------
-void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam, int leavePassesInQueue)
+void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam, 
+											   int leavePassesInQueue)
 {
 	GtpVisibility::HierarchyInterface::InitTraversal();
Index: trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp	(revision 156)
+++ trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp	(revision 158)
@@ -77,49 +77,17 @@
 	}
 
-	delete [] buf;
-
-	// ---- render visible nodes and collect node visibility
-	bool renderBoxes = true;
-	sm->setOption("RenderHierarchyNodes", &renderBoxes);
-
-
-	// --- render item buffer for visible nodes only
-	pfHierarchyInterface->GetSceneManager()->_renderScene(pCam, mViewport, false);
-
-
-	// get frame buffer for node visibility
-	buf = mViewport->getTarget()->getBufferContents(dimx, dimy);
-
-	
-	// loop through frame buffer & collect visible pixels
-	for (int idx = 0; idx < dimy * dimx * 3; idx += 3)
-	{
-		// -- decode color code to receive id
-		int id = buf[idx] << 16;
-		id += buf[idx + 1] << 8;
-		id += buf[idx + 2];
-
-		// if valid id <= add visibility (id values start at 1
-		if ((id > 0) && (id < (int)visibleNodes->size()))
-		{
-			((*visibleNodes)[id]).AddVisibility(1, 1);
-		}
-	}
+	//-- reset options
 
 	// don't need item buffer anymore
 	useItemBuffer = false;
-	//sm->setOption("UseItemBuffer", &useItemBuffer);
-
-	renderBoxes = false;
-	//sm->setOption("RenderHierarchyNodes", &renderBoxes);
-
+	sm->setOption("UseItemBuffer", &useItemBuffer);
 	// reset initialised - flag
 	mWasInitialised = false;
-
 	// reset old overlay status
 	mViewport->setOverlaysEnabled(overlayEnabled);
-	
+	// reset background color
 	mViewport->setBackgroundColour(bg);
 
+	// delete array storing the frame buffer
 	delete [] buf;
 }
@@ -146,17 +114,4 @@
 		visibleGeometry->push_back(GtpVisibility::MeshInfo(it.getNext(), 0, 0));
 	}
-
-	// -- initialise hierarchy interface for simple node traversal
-	mHierarchyInterface->InitTraversal(false);
-
-	GtpVisibility::HierarchyNode *node = NULL;
-	
-	int i = 1;
-
-	while (node = mHierarchyInterface->GetNextNode())
-	{
-		mHierarchyInterface->SetNodeId(node, i++);
-		visibleNodes->push_back(GtpVisibility::NodeInfo(node, 0, 0));
-	}
 }
 
