argos::CPositionalIndex< ENTITY > Class Template Referenceabstract

A data structure that contains positional entities. More...

#include <positional_index.h>

Inheritance diagram for argos::CPositionalIndex< ENTITY >:
Collaboration diagram for argos::CPositionalIndex< ENTITY >:

Classes

class  COperation
 The operation to perform on each entity found in range. More...
 

Public Member Functions

 CPositionalIndex ()
 
virtual ~CPositionalIndex ()
 
virtual void Init (TConfigurationNode &t_tree)=0
 Initializes the resource. More...
 
virtual void Reset ()=0
 Resets the resource. More...
 
virtual void Destroy ()=0
 Undoes whatever was done by Init(). More...
 
virtual void AddEntity (ENTITY &c_entity)=0
 Adds an entity to this index. More...
 
virtual void RemoveEntity (ENTITY &c_entity)=0
 Removes an entity from this index. More...
 
virtual void Update ()=0
 Updates this positional index. More...
 
virtual void GetEntitiesAt (CSet< ENTITY *, SEntityComparator > &c_entities, const CVector3 &c_position) const =0
 Puts the entities located at the given point in the passed buffer. More...
 
virtual void ForAllEntities (COperation &c_operation)=0
 Executes an operation on all the indexed entities. More...
 
virtual void ForEntitiesInSphereRange (const CVector3 &c_center, Real f_radius, COperation &c_operation)=0
 Executes an operation on all entities within the specified sphere range. More...
 
virtual void ForEntitiesInBoxRange (const CVector3 &c_center, const CVector3 &c_half_size, COperation &c_operation)=0
 Executes an operation on all entities within the specified box range. More...
 
virtual void ForEntitiesInCircleRange (const CVector3 &c_center, Real f_radius, COperation &c_operation)=0
 Executes an operation on all entities within the specified circle range. More...
 
virtual void ForEntitiesInRectangleRange (const CVector3 &c_center, const CVector2 &c_half_size, COperation &c_operation)=0
 Executes an operation on all entities within the specified rectangle range. More...
 
virtual void ForEntitiesAlongRay (const CRay3 &c_ray, COperation &c_operation, bool b_stop_at_closest_match=false)=0
 Executes an operation on all entities that intersect the given ray. More...
 

Detailed Description

template<class ENTITY>
class argos::CPositionalIndex< ENTITY >

A data structure that contains positional entities.

This interface defines the basic operations a data structure can do on positional entities. It is meant to provide methods to perform operations on entities within given ranges.

See also
CPositionalEntity
CEmbodiedEntity

Definition at line 30 of file positional_index.h.

Constructor & Destructor Documentation

◆ CPositionalIndex()

template<class ENTITY >
argos::CPositionalIndex< ENTITY >::CPositionalIndex ( )
inline

Definition at line 68 of file positional_index.h.

◆ ~CPositionalIndex()

template<class ENTITY >
virtual argos::CPositionalIndex< ENTITY >::~CPositionalIndex ( )
inlinevirtual

Definition at line 69 of file positional_index.h.

Member Function Documentation

◆ AddEntity()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::AddEntity ( ENTITY &  c_entity)
pure virtual

Adds an entity to this index.

Parameters
c_entityThe entity to add.

Implemented in argos::CAbstractSpaceHash< ENTITY >, and argos::CGrid< ENTITY >.

◆ Destroy()

◆ ForAllEntities()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::ForAllEntities ( COperation c_operation)
pure virtual

Executes an operation on all the indexed entities.

Parameters
c_operationThe operation to perform.
See also
COperation

Implemented in argos::CGrid< ENTITY >.

◆ ForEntitiesAlongRay()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::ForEntitiesAlongRay ( const CRay3 c_ray,
COperation c_operation,
bool  b_stop_at_closest_match = false 
)
pure virtual

Executes an operation on all entities that intersect the given ray.

When the parameter b_stop_at_closest_matches is set to true, this method stops at the closest match. Depending on the actual index implementation, there may be multiple closest matches. In this case, the operation is executed on all of them.

Parameters
c_rayThe ray.
c_operationThe operation to perform.
b_stop_at_closest_matchesStop the computation as soon as the first match is found.
See also
CRay
COperation

Implemented in argos::CGrid< ENTITY >.

◆ ForEntitiesInBoxRange()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::ForEntitiesInBoxRange ( const CVector3 c_center,
const CVector3 c_half_size,
COperation c_operation 
)
pure virtual

Executes an operation on all entities within the specified box range.

The box is axis-aligned.

Parameters
c_centerThe box center.
c_half_sizeThe box half-size.
c_operationThe operation to perform.
See also
COperation

Implemented in argos::CGrid< ENTITY >.

◆ ForEntitiesInCircleRange()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::ForEntitiesInCircleRange ( const CVector3 c_center,
Real  f_radius,
COperation c_operation 
)
pure virtual

Executes an operation on all entities within the specified circle range.

The circle is parallel to the XY plane.

Parameters
c_centerThe circle center.
f_radiusThe circle radius.
c_operationThe operation to perform.
See also
COperation

Implemented in argos::CGrid< ENTITY >.

◆ ForEntitiesInRectangleRange()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::ForEntitiesInRectangleRange ( const CVector3 c_center,
const CVector2 c_half_size,
COperation c_operation 
)
pure virtual

Executes an operation on all entities within the specified rectangle range.

The rectangle is axis-aligned and parallel to the XY plane.

Parameters
c_centerThe rectangle center.
c_half_sizeThe rectangle half-size.
c_operationThe operation to perform.
See also
COperation

Implemented in argos::CGrid< ENTITY >.

◆ ForEntitiesInSphereRange()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::ForEntitiesInSphereRange ( const CVector3 c_center,
Real  f_radius,
COperation c_operation 
)
pure virtual

Executes an operation on all entities within the specified sphere range.

Parameters
c_centerThe sphere center.
f_radiusThe sphere radius.
c_operationThe operation to perform.
See also
COperation

Implemented in argos::CGrid< ENTITY >.

◆ GetEntitiesAt()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::GetEntitiesAt ( CSet< ENTITY *, SEntityComparator > &  c_entities,
const CVector3 c_position 
) const
pure virtual

Puts the entities located at the given point in the passed buffer.

Parameters
c_entitiesThe entity set to use as buffer.
c_positionThe wanted point in the space.

Implemented in argos::CGrid< ENTITY >.

◆ Init()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::Init ( TConfigurationNode t_tree)
pure virtual

◆ RemoveEntity()

template<class ENTITY >
virtual void argos::CPositionalIndex< ENTITY >::RemoveEntity ( ENTITY &  c_entity)
pure virtual

Removes an entity from this index.

Parameters
c_entityThe entity to remove.

Implemented in argos::CAbstractSpaceHash< ENTITY >, and argos::CGrid< ENTITY >.

◆ Reset()

◆ Update()