DistanceQueue.h

Go to the documentation of this file.
00001 #ifndef _DistanceQueue_H__
00002 #define _DistanceQueue_H__
00003 
00004 #include "OcclusionQuery.h"
00005 
00006 #include <queue>
00007 
00008 namespace GtpVisibility {
00009 
00010 /*  We define HierarchyNode as void * because
00011         there is no common ancestor for hierarchy nodes in Ogre
00012 */
00013 typedef void HierarchyNode;
00014 
00015 class HierarchyInterface;
00019 template <typename T> class GreaterDistance
00020 {
00021 public:
00022         GreaterDistance(HierarchyInterface *hierarchyInterface): mHierarchyInterface(hierarchyInterface)
00023         {}
00024         
00025         bool operator() (T v1, T v2) const
00026         {
00027                 return mHierarchyInterface->HasGreaterDistance(v1, v2);
00028         }
00029                 
00030 private:
00031         HierarchyInterface *mHierarchyInterface;
00032 };
00033 
00036 typedef std::priority_queue<HierarchyNode *, std::vector<HierarchyNode *>, GreaterDistance<std::vector<HierarchyNode *>::value_type> > DistanceQueue;
00037 
00038 } // namespace GtpVisibility
00039 
00040 #endif // DistanceQueue_H

Generated on Fri Apr 29 19:47:56 2005 for GameTools Visibility Modules by  doxygen 1.4.2