Index: trunk/VUT/OcclusionCullingSceneManager/include/OgreSolidHalfBoundingBox.h
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/include/OgreSolidHalfBoundingBox.h	(revision 26)
+++ trunk/VUT/OcclusionCullingSceneManager/include/OgreSolidHalfBoundingBox.h	(revision 26)
@@ -0,0 +1,34 @@
+#ifndef _SolidHalfBoundingBox_H__
+#define _SolidHalfBoundingBox_H__
+
+#include "OgrePrerequisites.h"
+
+#include "OgreWireBoundingBox.h"
+
+namespace Ogre {
+
+    /** Allows the rendering of one half of a solid bounding box.
+        @remarks
+            This class builds a wireframe renderable from a given aabb. A pointer to this class can be
+			added to a render queue to display the bounding box of an object.
+    */
+	class SolidHalfBoundingBox : public WireBoundingBox
+	{
+    protected:
+       
+        /** Builds the wireframe line list.
+        */
+		void setupBoundingBoxVertices(const AxisAlignedBox& aab);
+		
+	public:
+		
+		bool mIsFirstHalf;
+		void setupBoundingBox(const AxisAlignedBox& aabb);
+		SolidHalfBoundingBox(bool isFirstHalf);
+	};
+
+}// namespace
+
+#endif
+
+
Index: trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h	(revision 23)
+++ trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h	(revision 26)
@@ -5,4 +5,5 @@
 #include "OgreSceneManager.h"
 #include "OgrePrerequisites.h"
+#include "OgreSolidHalfBoundingBox.h"
 #include <queue>
 
@@ -27,6 +28,7 @@
 	};
 
+	typedef pair<SceneNode *, HardwareOcclusionQuery *> query_pair;
 	typedef priority_queue<SceneNode *, vector<SceneNode *>, myless<vector<SceneNode *>::value_type> > PriorityQueue;
-	typedef queue<SceneNode *> QueryQueue;
+	typedef queue<query_pair> QueryQueue;
 	/**
 		Class which implements a scene mangager which uses occlusion queries for culling occluded objects
@@ -35,10 +37,17 @@
 	{
 	public:
-		enum {RENDER_CULL_FRUSTUM, RENDER_STOP_AND_WAIT, RENDER_COHERENT, NUM_RENDERMODES};
-		
 		OcclusionCullingSceneManager();
 		~OcclusionCullingSceneManager();
 	
-		/** Overriden from SceneManager. */
+
+		enum {RENDER_CULL_FRUSTUM, RENDER_STOP_AND_WAIT, RENDER_COHERENT, NUM_RENDERMODES};
+		
+		/** Overriden from SceneManager. Renders the scene with the specified algorithm
+		/**
+			The algorithm is one of
+			RENDER_CULL_FRUSTUM: renders the scene with view frustum culling only
+			RENDER_STOP_AND_WAIT: renders the scene with the hierarchical stop and wait algorithm
+			RENDER_COHERENT: renders the scene with the coherent hierarchical algorithm
+		*/
 		void _renderVisibleObjects(void);
 		void _findVisibleObjects(Camera* cam, bool onlyShadowCasters);
@@ -64,13 +73,27 @@
 		void renderCoherentWithQueue();
 		/** Issue a occlusion query for this node. */
-		void issueOcclusionQuery(SceneNode *node, bool wasVisible);
+		HardwareOcclusionQuery *issueOcclusionQuery(SceneNode *node, bool wasVisible);
 		/** Pulls up the visibility from the child nodes. */
 		void pullUpVisibility(SceneNode *node);
+		/** delete all previously defined occlusion queries */
+		void deleteQueries();
+		/** Renders bounding box of specified node.
+		@param the node which bounding box is to be rendered
+		*/
+		void renderBoundingBox(SceneNode *node);
+		/** Returns one half of the bounding box.
+		@param the half of the bouding box
+		*/
+		SolidHalfBoundingBox *getSolidHalfBoundingBox(int half);
+		/** sets the type of the algorithm
+		@param algorithm type
+		*/
+		void setAlgorithmType(int type);
+	
+		int getAlgorithmType();
 
-		void deleteQueries();
-
-		/** we use a priority queue rather than a renderstack */
+		// we use a priority queue rather than a renderstack
 		PriorityQueue *mDistanceQueue; 
-
+		
 		unsigned int mFrameId;
 		unsigned int mVisibilityThreshold;
@@ -80,4 +103,7 @@
 		
 		std::vector<HardwareOcclusionQuery *> mOcclusionQueries;
+		// two halfes of a aabb
+		SolidHalfBoundingBox *mHalfBoundingBox[2];	
+		int mAlgorithmType;
 	};
 
Index: trunk/VUT/OcclusionCullingSceneManager/include/OgreSolidBoundingBox.h
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/include/OgreSolidBoundingBox.h	(revision 25)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#ifndef _SolidBoundingBox_H__
-#define _SolidBoundingBox_H__
-
-#include "OgrePrerequisites.h"
-
-#include "OgreWireBoundingBox.h"
-
-namespace Ogre {
-
-    /** Allows the rendering of a solid bounding box.
-        @remarks
-            This class builds a wireframe renderable from a given aabb. A pointer to this class can be
-			added to a render queue to display the bounding box of an object.
-    */
-	class SolidBoundingBox : public WireBoundingBox
-	{
-    protected:
-       
-        /** Builds the wireframe line list.
-        */
-		void setupBoundingBoxVertices(const AxisAlignedBox& aab);
-		
-	public:
-		
-		bool mIsFirstHalf;
-		void setupBoundingBox(const AxisAlignedBox& aabb);
-		SolidBoundingBox();
-	};
-
-}// namespace
-
-#endif
-
-
