Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

StaticOctree< OBJ, PREC > Class Template Reference

#include <octree.h>

Inheritance diagram for StaticOctree< OBJ, PREC >:

Inheritance graph
Collaboration diagram for StaticOctree< OBJ, PREC >:

Collaboration graph
List of all members.

Public Member Functions

int countChildren () const
int countObjects () const
void processCloseObjects (OctreeProcessor< OBJ, PREC > &processor, const Point3< PREC > &obsPosition, PREC boundingRadius, PREC scale) const
void processVisibleObjects (OctreeProcessor< OBJ, PREC > &processor, const Point3< PREC > &obsPosition, const Plane< float > *frustumPlanes, float limitingFactor, PREC scale) const
 StaticOctree (const Point3< PREC > &cellCenterPos, const float exclusionFactor, OBJ *_firstObject, unsigned int nObjects)
 ~StaticOctree ()

Private Attributes

StaticOctree ** _children
OBJ * _firstObject
Point3< PREC > cellCenterPos
float exclusionFactor
unsigned int nObjects

Static Private Attributes

static const PREC SQRT3 = (PREC) 1.732050807568877

Friends

class DynamicOctree<OBJ, PREC>

template<class OBJ, class PREC>
class StaticOctree< OBJ, PREC >


Constructor & Destructor Documentation

template<class OBJ, class PREC>
StaticOctree< OBJ, PREC >::StaticOctree const Point3< PREC > &  cellCenterPos,
const float  exclusionFactor,
OBJ *  _firstObject,
unsigned int  nObjects
[inline]
 

Definition at line 292 of file octree.h.

00295                                                                           :
00296     _children      (NULL),
00297     cellCenterPos  (cellCenterPos),
00298     exclusionFactor(exclusionFactor),
00299     _firstObject   (_firstObject),
00300     nObjects       (nObjects)
00301 {
00302 }

template<class OBJ, class PREC>
StaticOctree< OBJ, PREC >::~StaticOctree  )  [inline]
 

Definition at line 306 of file octree.h.

References StaticOctree< OBJ, PREC >::_children.

00307 {
00308     if (_children != NULL)
00309     {
00310         for (int i=0; i<8; ++i)
00311             delete _children[i];
00312 
00313         delete[] _children;
00314     }
00315 }


Member Function Documentation

template<class OBJ, class PREC>
int StaticOctree< OBJ, PREC >::countChildren  )  const [inline]
 

Definition at line 319 of file octree.h.

References StaticOctree< OBJ, PREC >::_children.

Referenced by StarDatabase::buildOctree(), and DSODatabase::buildOctree().

00320 {
00321     int count    = 0;
00322 
00323     for (int i=0; i<8; ++i)
00324         count    += _children != NULL ? 1 + _children[i]->countChildren() : 0;
00325 
00326     return count;
00327 }

template<class OBJ, class PREC>
int StaticOctree< OBJ, PREC >::countObjects  )  const [inline]
 

Definition at line 331 of file octree.h.

References StaticOctree< OBJ, PREC >::_children, and StaticOctree< OBJ, PREC >::nObjects.

Referenced by StarDatabase::buildOctree(), and DSODatabase::buildOctree().

00332 {
00333     int count    = nObjects;
00334 
00335     if (_children != NULL)
00336         for (int i=0; i<8; ++i)
00337             count    += _children[i]->countObjects();
00338 
00339     return count;
00340 }

template<class OBJ, class PREC>
void StaticOctree< OBJ, PREC >::processCloseObjects OctreeProcessor< OBJ, PREC > &  processor,
const Point3< PREC > &  obsPosition,
PREC  boundingRadius,
PREC  scale
const
 

Referenced by DSODatabase::findCloseDSOs(), and StarDatabase::findCloseStars().

template<class OBJ, class PREC>
void StaticOctree< OBJ, PREC >::processVisibleObjects OctreeProcessor< OBJ, PREC > &  processor,
const Point3< PREC > &  obsPosition,
const Plane< float > *  frustumPlanes,
float  limitingFactor,
PREC  scale
const
 

Referenced by DSODatabase::findVisibleDSOs(), and StarDatabase::findVisibleStars().


Friends And Related Function Documentation

template<class OBJ, class PREC>
friend class DynamicOctree<OBJ, PREC> [friend]
 

Definition at line 84 of file octree.h.


Member Data Documentation

template<class OBJ, class PREC>
StaticOctree** StaticOctree< OBJ, PREC >::_children [private]
 

Definition at line 122 of file octree.h.

Referenced by StaticOctree< OBJ, PREC >::countChildren(), StaticOctree< OBJ, PREC >::countObjects(), and StaticOctree< OBJ, PREC >::~StaticOctree().

template<class OBJ, class PREC>
OBJ* StaticOctree< OBJ, PREC >::_firstObject [private]
 

Definition at line 125 of file octree.h.

template<class OBJ, class PREC>
Point3<PREC> StaticOctree< OBJ, PREC >::cellCenterPos [private]
 

Definition at line 123 of file octree.h.

template<class OBJ, class PREC>
float StaticOctree< OBJ, PREC >::exclusionFactor [private]
 

Definition at line 124 of file octree.h.

template<class OBJ, class PREC>
unsigned int StaticOctree< OBJ, PREC >::nObjects [private]
 

Definition at line 126 of file octree.h.

Referenced by StaticOctree< OBJ, PREC >::countObjects().

template<class OBJ, class PREC>
const PREC StaticOctree< OBJ, PREC >::SQRT3 = (PREC) 1.732050807568877 [static, private]
 

Definition at line 288 of file octree.h.


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:38 2006 for Celestia by  doxygen 1.4.1