Horizon
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
SHAPE_INDEX< T > Class Template Reference

Classes

class  Iterator
 

Public Member Functions

void Add (T aShape)
 Add a SHAPE to the index.
 
void Add (T aShape, const BOX2I &aBbox)
 Add a shape with alternate BBox.
 
void Remove (T aShape)
 Remove a SHAPE from the index.
 
void RemoveAll ()
 Remove all the contents of the index.
 
template<class V >
void Accept (V aVisitor)
 Accept a visitor for every SHAPE object contained in this INDEX.
 
void Reindex ()
 Rebuild the index.
 
template<class V >
int Query (const SHAPE *aShape, int aMinDistance, V &aVisitor) const
 Run a callback on every SHAPE object contained in the bounding box of (shape).
 
Iterator Begin ()
 Create an iterator for the current index object.
 

Member Function Documentation

◆ Accept()

template<class T = SHAPE*>
template<class V >
void SHAPE_INDEX< T >::Accept ( aVisitor)
inline

Accept a visitor for every SHAPE object contained in this INDEX.

Parameters
aVisitoris the visitor object to be run.

◆ Add() [1/2]

template<class T >
void SHAPE_INDEX< T >::Add ( aShape)

Add a SHAPE to the index.

Parameters
aShapeis the new SHAPE.

◆ Add() [2/2]

template<class T >
void SHAPE_INDEX< T >::Add ( aShape,
const BOX2I aBbox 
)

Add a shape with alternate BBox.

Parameters
aShapeShape (Item) to add.
aBboxalternate bounding box. This should be a subset of the item's bbox

◆ Begin()

template<class T >
SHAPE_INDEX< T >::Iterator SHAPE_INDEX< T >::Begin ( )

Create an iterator for the current index object.

Returns
iterator to the first object.

◆ Query()

template<class T = SHAPE*>
template<class V >
int SHAPE_INDEX< T >::Query ( const SHAPE aShape,
int  aMinDistance,
V &  aVisitor 
) const
inline

Run a callback on every SHAPE object contained in the bounding box of (shape).

Parameters
aShapeis the shape to search against.
aMinDistanceis the distance threshold.
aVisitoris the object to be invoked on every object contained in the search area.

◆ Reindex()

template<class T >
void SHAPE_INDEX< T >::Reindex ( )

Rebuild the index.

This should be used if the geometry of the objects contained by the index has changed.

◆ Remove()

template<class T >
void SHAPE_INDEX< T >::Remove ( aShape)

Remove a SHAPE from the index.

Parameters
aShapeis the SHAPE to remove.

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