TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator Class Reference

#include <PointHashGrid.h>

Public Member Functions

bool operator!= (const SphereIterator &other) const
 
bool operator== (const SphereIterator &other) const
 
SphereIteratoroperator++ ()
 
SphereIterator operator++ (int)
 
const Valueoperator* () const
 
const Valueoperator-> () const
 
 operator Value * () const
 
bool G3D_DEPRECATED hasMore () const
 
bool isValid () const
 

Private Member Functions

 SphereIterator ()
 
void advance ()
 
 SphereIterator (const ThisType *grid, const Sphere &sphere)
 
const Valuevalue () const
 
SphereIteratoroperator= (const SphereIterator &)
 

Static Private Member Functions

static AABox getBoundingBox (const Sphere &s)
 

Private Attributes

bool m_isEnd
 
Sphere m_sphere
 
BoxIterator m_boxIterator
 

Friends

class ThisType
 

Constructor & Destructor Documentation

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::SphereIterator ( )
inlineprivate
725 : m_isEnd(true) {}
bool m_isEnd
Definition: PointHashGrid.h:721
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::SphereIterator ( const ThisType grid,
const Sphere sphere 
)
inlineprivate
749  :
750  m_isEnd(false),
751  m_sphere(sphere),
752  m_boxIterator(grid, false, getBoundingBox(sphere)) {
753 
754  // Find the first element that is actually in the sphere,
755  // not just the box.
756  advance();
757  }
bool m_isEnd
Definition: PointHashGrid.h:721
static AABox getBoundingBox(const Sphere &s)
Definition: PointHashGrid.h:743
Sphere m_sphere
Definition: PointHashGrid.h:722
BoxIterator m_boxIterator
Definition: PointHashGrid.h:723
void advance()
Definition: PointHashGrid.h:727

+ Here is the call graph for this function:

Member Function Documentation

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
void G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::advance ( )
inlineprivate
727  {
728  if (! m_boxIterator.isValid()) {
729  m_isEnd = true;
730  return;
731  }
732 
733  while (! m_sphere.contains(m_boxIterator.position())) {
734  ++m_boxIterator;
735 
736  if (! m_boxIterator.isValid()) {
737  m_isEnd = true;
738  return;
739  }
740  }
741  }
bool m_isEnd
Definition: PointHashGrid.h:721
Sphere m_sphere
Definition: PointHashGrid.h:722
BoxIterator m_boxIterator
Definition: PointHashGrid.h:723
const Vector3 & position() const
Definition: PointHashGrid.h:639
bool contains(const Point3 &point) const
Definition: Sphere.cpp:79
bool isValid() const
Definition: PointHashGrid.h:691

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
static AABox G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::getBoundingBox ( const Sphere s)
inlinestaticprivate
743  {
744  AABox box;
745  s.getBounds(box);
746  return box;
747  }

+ Here is the call graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
bool G3D_DEPRECATED G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::hasMore ( ) const
inline
Deprecated:
use isValid
809  {
810  return ! m_isEnd;
811  }
bool m_isEnd
Definition: PointHashGrid.h:721
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
bool G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::isValid ( ) const
inline
813  {
814  return ! m_isEnd;
815  }
bool m_isEnd
Definition: PointHashGrid.h:721

+ Here is the caller graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator Value * ( ) const
inline
806 { return &value(); }
const Value & value() const
Definition: PointHashGrid.h:759

+ Here is the call graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
bool G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator!= ( const SphereIterator other) const
inline
772  {
773  if (other.m_isEnd && m_isEnd) {
774  return false;
775  } else {
776  return
777  (m_isEnd != other.m_isEnd) ||
778  (m_sphere != other.m_sphere) ||
779  (m_boxIterator != other.m_boxIterator);
780  }
781  }
bool m_isEnd
Definition: PointHashGrid.h:721
Sphere m_sphere
Definition: PointHashGrid.h:722
BoxIterator m_boxIterator
Definition: PointHashGrid.h:723
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
const Value& G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator* ( ) const
inline
804 { return value(); }
const Value & value() const
Definition: PointHashGrid.h:759

+ Here is the call graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
SphereIterator& G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator++ ( )
inline

Preincrement

788  {
789  debugAssert(! m_isEnd);
790 
791  ++m_boxIterator;
792  advance();
793 
794  return *this;
795  }
bool m_isEnd
Definition: PointHashGrid.h:721
#define debugAssert(exp)
Definition: debugAssert.h:160
BoxIterator m_boxIterator
Definition: PointHashGrid.h:723
void advance()
Definition: PointHashGrid.h:727

+ Here is the call graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
SphereIterator G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator++ ( int  )
inline

Post increment (slower)

798  {
799  Iterator old = *this;
800  ++(*this);
801  return old;
802  }
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
const Value* G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator-> ( ) const
inline
805 { return &value(); }
const Value & value() const
Definition: PointHashGrid.h:759

+ Here is the call graph for this function:

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
SphereIterator& G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator= ( const SphereIterator )
private
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
bool G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::operator== ( const SphereIterator other) const
inline
783  {
784  return !(*this != other);
785  }
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
const Value& G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::value ( ) const
inlineprivate
759  {
760  return *m_boxIterator;
761  }
BoxIterator m_boxIterator
Definition: PointHashGrid.h:723

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
friend class ThisType
friend

Member Data Documentation

template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
BoxIterator G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::m_boxIterator
private
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
bool G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::m_isEnd
private
template<class Value, class PosFunc = PositionTrait<Value>, class EqualsFunc = EqualsTrait<Value>>
Sphere G3D::PointHashGrid< Value, PosFunc, EqualsFunc >::SphereIterator::m_sphere
private

The documentation for this class was generated from the following file: