26 #ifndef __SHAPE_INDEX_H 27 #define __SHAPE_INDEX_H 46 return aItem->Shape();
73 template <
class T,
class V>
90 template <
class T,
class U>
91 bool collide( T aObject, U aAnotherObject,
int aMinDistance )
96 template <
class T,
class V>
99 V* visitor = (V*) aContext;
101 acceptVisitor<T, V>( aShape, *visitor );
106 template <
class T = SHAPE*>
177 return iterator.IsNull();
188 return iterator.IsNotNull();
217 void Add( T aShape );
270 int Query(
const SHAPE *aShape,
int aMinDistance, V& aVisitor,
bool aExact )
349 newTree->
Insert( min, max, shape );
static const SHAPE * shapeFunctor(T aItem)
shapeFunctor template function
void RemoveAll()
Function RemoveAll()
bool collide(T aObject, U aAnotherObject, int aMinDistance)
collide template method
void Init(RTree< T, int, 2, float > *aTree)
Function Init()
coord_type GetRight() const
RTree< T, int, 2, float >::Iterator RTreeIterator
void RemoveAll()
Remove all entries from tree.
virtual const BOX2I BBox(int aClearance=0) const =0
Function BBox()
void Add(T aShape)
Function Add()
BOX2I boundingBox(T aObject)
boundingBox template method
RTree< T, int, 2, float > * m_tree
void Reindex()
Function Reindex()
bool queryCallback(T aShape, void *aContext)
void Remove(T aShape)
Function Remove()
coord_type GetBottom() const
Iterator Begin()
Function Begin()
bool operator++(int)
Operator ++ (postfix)
void acceptVisitor(T aObject, V aVisitor)
acceptVisitor template method
void Insert(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE &a_dataId)
Insert entry.
Implementation of RTree, a multidimensional bounding rectangle tree.
void GetFirst(Iterator &a_it)
Get 'first' for iteration.
void Accept(V aVisitor)
Function Accept()
virtual bool Collide(const VECTOR2I &aP, int aClearance=0) const
Function Collide()
bool IsNull(Iterator &a_it)
Is iterator NULL, or at end?
Iterator(SHAPE_INDEX *aIndex)
Iterator constructor.
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
bool IsNull()
Function IsNull()
void Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE &a_dataId)
Remove entry.
int Query(const SHAPE *aShape, int aMinDistance, V &aVisitor, bool aExact)
Function Query()
int Search(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], bool a_resultCallback(DATATYPE a_data, void *a_context), void *a_context)
Find all within search rectangle.
bool operator++()
Operator ++ (prefix)
bool IsNotNull()
Function IsNotNull()
T operator*()
Operator * (prefix)