Index: trunk/VUT/Ogre/include/OgreOcclusionQueriesQueryManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreOcclusionQueriesQueryManager.h	(revision 154)
+++ trunk/VUT/Ogre/include/OgreOcclusionQueriesQueryManager.h	(revision 154)
@@ -0,0 +1,38 @@
+#ifndef _OcclusionQueriesQueryManager_H__
+#define _OcclusionQueriesQueryManager_H__
+
+#include "OgrePlatformQueryManager.h"
+
+namespace Ogre {
+  
+/**
+	Class which implements the QueryManager for Ogre scene queries.
+*/
+class __declspec(dllexport) OcclusionQueriesQueryManager: public PlatformQueryManager
+{
+public:
+    /** Constructor taking a hierarchy interface as an argument. This allows to operate
+	onm different hierarchy types, while reusing the implementation of the query methods.
+    */
+	OcclusionQueriesQueryManager(PlatformHierarchyInterface *hierarchyInterface, Viewport *vp);
+    
+    void ComputeCameraVisibility(const Camera &camera,
+			    InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
+			    InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
+			    bool relativeVisibility = false);
+    
+    /** 
+	Uses the specified point to execute the visibility query in all directions. 
+	@sa ComputeCameraVisibility()
+    */
+    void ComputeFromPointVisibility(const Vector3 &point,
+			       InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
+			       InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
+			       bool relativeVisibility = false);
+    
+	bool ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine = false);  
+};
+
+} // namespace Ogre
+
+#endif // OcclusionQueriesQueryManager
Index: trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 130)
+++ trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 154)
@@ -49,4 +49,8 @@
 					 GtpVisibility::GeometryList *geometryList, 
 					 bool includeChildren);
+
+	void SetNodeId(GtpVisibility::HierarchyNode *node, int id);
+	
+	int GetNodeId(GtpVisibility::HierarchyNode *node);
 };
 
Index: trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 130)
+++ trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 154)
@@ -25,7 +25,6 @@
 		See setOption
 	*/
-	//bool getOption( const String &, void * );
-	//bool getOptionKeys( StringVector &refKeys );
 	void PullUpVisibility(GtpVisibility::HierarchyNode *node);
+	
 	/** Traverses given node.
 		@param node current node
@@ -50,7 +49,12 @@
 							InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, 
 							bool includeChildren = false);*/
+
 	void GetGeometry(GtpVisibility::HierarchyNode *node,
 					 GtpVisibility::GeometryList *geometryList, 
 					 bool includeChildren);
+
+	void SetNodeId(GtpVisibility::HierarchyNode *node, int id);
+	
+	int GetNodeId(GtpVisibility::HierarchyNode *node);
 
 protected:
@@ -65,6 +69,4 @@
 	*/
 	Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
-	/** number of octree hierarchy nodes */
-	unsigned int mNumOctreeNodes;
 };
 } // namespace Ogre
Index: trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 87)
+++ trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 154)
@@ -43,6 +43,4 @@
 	*/
 	AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
-	
-	unsigned int mNumOctreeNodes;
 };
 } // namespace Ogre
Index: trunk/VUT/Ogre/include/OgrePlatformQueryManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgrePlatformQueryManager.h	(revision 144)
+++ trunk/VUT/Ogre/include/OgrePlatformQueryManager.h	(revision 154)
@@ -20,38 +20,11 @@
     
     /** 
-	Computes restricted visibility from point by using an explicit camera to execute
-	the visibility query.
-	@param camera The camera to be used
-
-	@param visibleNodes Pointer to the container where visible nodes should be added.
-	This set is formed of visible leafs or fully visible interior nodes.
-	If NULL no visible nodes are not evaluated.
-
-	@param visibleGeometry Pointer to the container where visible meshes should be added.
-	If NULL no visible meshes are not evaluated.
-
-	@param projectedPixels If true the visibility member for
-	NodeInfo and MeshInfo represent relative visibility; i.e. the number of visible
-	pixels divided by the the number of projected pixels.
-
-	@return true if the corresponding PVS exists.
-    */
-    virtual void
-    ComputeCameraVisibility(const Camera &camera,
-			    InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
-			    InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
-			    bool relativeVisibility = false
-			    );
-    
-    /** 
 	Uses the specified point to execute the visibility query in all directions. 
 	@sa ComputeCameraVisibility()
     */
-    virtual void
-    ComputeFromPointVisibility(const Vector3 &point,
+    void ComputeFromPointVisibility(const Vector3 &point,
 			       InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
 			       InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
-			       bool relativeVisibility = false
-			       );
+			       bool relativeVisibility = false);
     
   /** 
@@ -79,4 +52,5 @@
 protected:
 	Viewport *mViewport;
+	bool mWasInitialised;
 };
 
Index: trunk/VUT/Ogre/include/OgreItemBufferQueryManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreItemBufferQueryManager.h	(revision 153)
+++ trunk/VUT/Ogre/include/OgreItemBufferQueryManager.h	(revision 154)
@@ -22,13 +22,4 @@
 			    bool relativeVisibility = false);
     
-    /** 
-	Uses the specified point to execute the visibility query in all directions. 
-	@sa ComputeCameraVisibility()
-    */
-    void ComputeFromPointVisibility(const Vector3 &point,
-			       InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
-			       InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry,
-			       bool relativeVisibility = false);
-    
 	bool ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine = false);  
 	
@@ -36,5 +27,5 @@
 	void InitItemBuffer( InfoContainer<GtpVisibility::NodeInfo> *visibleNodes,
 			    InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry);
-	bool mWasInitialised;
+	
 };
 
