ARGoS  3
A parallel, multi-engine simulator for swarm robotics
argos::CPositionalIndex< ENTITY > Class Template Reference

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

#include <positional_index.h>

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

List of all members.

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.
virtual void Reset ()=0
 Resets the resource.
virtual void Destroy ()=0
 Undoes whatever was done by Init().
virtual void AddEntity (ENTITY &c_entity)=0
 Adds an entity to this index.
virtual void RemoveEntity (ENTITY &c_entity)=0
 Removes an entity from this index.
virtual void Update ()=0
 Updates this positional index.
virtual void GetEntitiesAt (CSet< ENTITY * > &c_entities, const CVector3 &c_position) const =0
 Puts the entities located at the given point in the passed buffer.
virtual void ForAllEntities (COperation &c_operation)=0
 Executes an operation on all the indexed entities.
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.
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.
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.
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.
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.

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 29 of file positional_index.h.


Constructor & Destructor Documentation

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

Definition at line 67 of file positional_index.h.

template<class ENTITY>
virtual argos::CPositionalIndex< ENTITY >::~CPositionalIndex ( ) [inline, virtual]

Definition at line 68 of file positional_index.h.


Member Function Documentation

template<class ENTITY>
virtual void argos::CPositionalIndex< ENTITY >::AddEntity ( ENTITY &  c_entity) [pure virtual]
template<class ENTITY>
virtual void argos::CPositionalIndex< ENTITY >::Destroy ( ) [pure virtual]
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 >.

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 >.

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 >.

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 >.

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 >.

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 >.

template<class ENTITY>
virtual void argos::CPositionalIndex< ENTITY >::GetEntitiesAt ( CSet< ENTITY * > &  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 >, argos::CGrid< CRABEquippedEntity >, argos::CGrid< CLEDEntity >, and argos::CGrid< CEmbodiedEntity >.

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

Initializes the resource.

Parameters:
t_treethe base of the XML configuration tree to parse
Exceptions:
CARGoSExceptionif an error occurs

Implements argos::CBaseConfigurableResource.

Implemented in argos::CGrid< ENTITY >, argos::CGrid< CRABEquippedEntity >, argos::CGrid< CLEDEntity >, and argos::CGrid< CEmbodiedEntity >.

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

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