26#ifndef __SHAPE_INDEX_LIST_H
27#define __SHAPE_INDEX_LIST_H
38 return aItem->Shape();
41template <
class T, const SHAPE* (ShapeFunctor) (const T) = defaultShapeFunctor<T> >
48 shape = ShapeFunctor( aParent );
83 return (*m_current).parent;
126 int aMinDistance,
bool aExact ) :
152 return (*m_current).parent;
226 if( i->parent == aItem )
241 template <
class Visitor>
242 int Query(
const SHAPE* aShape,
int aMinDistance, Visitor& aV,
bool aExact =
true )
254 if( !aExact || i->shape->Collide( aShape, aMinDistance ) )
258 if( !aV( i->parent ) )
ecoord_type Distance(const Vec &aP) const
constexpr ecoord_type SquaredDistance(const Vec &aP) const
iterator(SHAPE_VEC_ITER aCurrent)
const iterator & operator=(const iterator &aRhs)
iterator(const iterator &aB)
bool operator!=(const iterator &aRhs) const
iterator & operator++(int aDummy)
bool operator==(const iterator &aRhs) const
query_iterator(SHAPE_VEC_ITER aCurrent, SHAPE_VEC_ITER aEnd, SHAPE *aShape, int aMinDistance, bool aExact)
query_iterator & operator++()
query_iterator & operator++(int aDummy)
bool operator==(const query_iterator &aRhs) const
bool operator!=(const query_iterator &aRhs) const
query_iterator(const query_iterator &aB)
const query_iterator & operator=(const query_iterator &aRhs)
const query_iterator qend()
int Query(const SHAPE *aShape, int aMinDistance, Visitor &aV, bool aExact=true)
query_iterator qbegin(SHAPE *aShape, int aMinDistance, bool aExact)
std::vector< SHAPE_ENTRY >::iterator SHAPE_VEC_ITER
void Remove(const T aItem)
std::vector< SHAPE_ENTRY > SHAPE_VEC
An abstract shape on 2D plane.
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
VECTOR2_TRAITS< int32_t >::extended_type extended_type
const SHAPE * defaultShapeFunctor(const T aItem)