00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef VRS_CONTAINER_OCTREE_H_
00039 #define VRS_CONTAINER_OCTREE_H_
00040
00041 #include "spacetree.h"
00042 #include <vrs/bounds.h>
00043
00044 namespace VRS {
00045
00053 template<typename CONTENT> class DynamicOctree : public DynamicSpaceTree<CONTENT, 3> {
00054
00055
00056 public:
00057
00058 typedef SpaceTreePath<3> Path;
00059 typedef typename DynamicSpaceTree<CONTENT, 3>::NodePointer NodePointer;
00060
00061 DynamicOctree(const Bounds& bounds);
00062 SpaceTreePath<3> findContainingNode(const Vector& point,
00063 UINT level,
00064 bool mustExist = true);
00065 Iterator<SpaceTreePath<3> >* findBoundsIntersectingNodes(
00066 const Bounds& bounds,
00067 UINT level,
00068 bool mustExist = true);
00069 SpaceTreePath<3> findSmallestBoundsEnclosingNode(const Bounds& bounds,
00070 UINT maxLevel = 16,
00071 bool mustExist = true);
00072 };
00073
00074 template<typename CONTENT> class StaticOctree : public StaticSpaceTree<CONTENT, 3> {
00075
00076 public:
00077
00078 typedef SpaceTreePath<3> Path;
00079 typedef typename StaticSpaceTree<CONTENT, 3>::NodePointer NodePointer;
00080
00081 StaticOctree(const Bounds& bounds, unsigned int depth);
00082 SpaceTreePath<3> findContainingNode(const Vector& point,
00083 UINT level = 16,
00084 bool mustExist = true);
00085
00086 Iterator<SpaceTreePath<3> >* findBoundsIntersectingNodes(
00087 const Bounds& bounds,
00088 UINT level,
00089 bool mustExist = true);
00090
00091 SpaceTreePath<3> findSmallestBoundsEnclosingNode(const Bounds& bounds,
00092 UINT maxLevel = 16,
00093 bool mustExist = true);
00094 };
00095
00096 #include "octree.tli"
00097
00098 }
00099
00100 #endif // VRS_CONTAINER_OCTREE_H_
00101