#include <grid.h>
Classes | |
class | CCellOperation |
struct | SCell |
Public Types | |
typedef CPositionalIndex< ENTITY >::COperation | CEntityOperation |
Public Member Functions | |
CGrid (const CVector3 &c_area_min_corner, const CVector3 &c_area_max_corner, SInt32 n_size_i, SInt32 n_size_j, SInt32 n_size_k) | |
virtual | ~CGrid () |
virtual void | Init (TConfigurationNode &t_tree) |
Initializes the resource. More... | |
virtual void | Reset () |
Resets the resource. More... | |
virtual void | Destroy () |
Undoes whatever was done by Init(). More... | |
virtual void | AddEntity (ENTITY &c_entity) |
Adds an entity to this index. More... | |
virtual void | RemoveEntity (ENTITY &c_entity) |
Removes an entity from this index. More... | |
virtual void | Update () |
Updates this positional index. More... | |
virtual void | GetEntitiesAt (CSet< ENTITY *, SEntityComparator > &c_entities, const CVector3 &c_position) const |
Puts the entities located at the given point in the passed buffer. More... | |
virtual void | ForAllEntities (CEntityOperation &c_operation) |
Executes an operation on all the indexed entities. More... | |
virtual void | ForEntitiesInSphereRange (const CVector3 &c_center, Real f_radius, CEntityOperation &c_operation) |
Executes an operation on all entities within the specified sphere range. More... | |
virtual void | ForEntitiesInBoxRange (const CVector3 &c_center, const CVector3 &c_half_size, CEntityOperation &c_operation) |
Executes an operation on all entities within the specified box range. More... | |
virtual void | ForEntitiesInCircleRange (const CVector3 &c_center, Real f_radius, CEntityOperation &c_operation) |
Executes an operation on all entities within the specified circle range. More... | |
virtual void | ForEntitiesInRectangleRange (const CVector3 &c_center, const CVector2 &c_half_size, CEntityOperation &c_operation) |
Executes an operation on all entities within the specified rectangle range. More... | |
virtual void | ForEntitiesAlongRay (const CRay3 &c_ray, CEntityOperation &c_operation, bool b_stop_at_closest_match=false) |
Executes an operation on all entities that intersect the given ray. More... | |
virtual void | ForAllCells (CCellOperation &c_operation) |
virtual void | ForCellsInSphereRange (const CVector3 &c_center, Real f_radius, CCellOperation &c_operation) |
virtual void | ForCellsInBoxRange (const CVector3 &c_center, const CVector3 &c_half_size, CCellOperation &c_operation) |
virtual void | ForCellsInCircleRange (const CVector3 &c_center, Real f_radius, CCellOperation &c_operation) |
virtual void | ForCellsInRectangleRange (const CVector3 &c_center, const CVector2 &c_half_size, CCellOperation &c_operation) |
virtual void | ForCellsAlongRay (const CRay3 &c_ray, CCellOperation &c_operation) |
SInt32 | GetSizeI () const |
SInt32 | GetSizeJ () const |
SInt32 | GetSizeK () const |
void | SetUpdateEntityOperation (CEntityOperation *pc_operation) |
void | UpdateCell (SInt32 n_i, SInt32 n_j, SInt32 n_k, ENTITY &c_entity) |
void | PositionToCell (SInt32 &n_i, SInt32 &n_j, SInt32 &n_k, const CVector3 &c_position) const |
void | PositionToCellUnsafe (SInt32 &n_i, SInt32 &n_j, SInt32 &n_k, const CVector3 &c_position) const |
void | ClampCoordinates (SInt32 &n_i, SInt32 &n_j, SInt32 &n_k) const |
void | ClampCoordinates (CVector3 &c_pos) const |
SCell & | GetCellAt (SInt32 n_i, SInt32 n_j, SInt32 n_k) |
const SCell & | GetCellAt (SInt32 n_i, SInt32 n_j, SInt32 n_k) const |
Public Member Functions inherited from argos::CPositionalIndex< ENTITY > | |
CPositionalIndex () | |
virtual | ~CPositionalIndex () |
Protected Attributes | |
CVector3 | m_cAreaMinCorner |
CVector3 | m_cAreaMaxCorner |
SInt32 | m_nSizeI |
SInt32 | m_nSizeJ |
SInt32 | m_nSizeK |
CRange< Real > | m_cRangeX |
CRange< Real > | m_cRangeY |
CRange< Real > | m_cRangeZ |
CVector3 | m_cCellSize |
CVector3 | m_cInvCellSize |
SCell * | m_psCells |
size_t | m_unCurTimestamp |
CSet< ENTITY *, SEntityComparator > | m_cEntities |
CEntityOperation * | m_pcUpdateEntityOperation |
typedef CPositionalIndex<ENTITY>::COperation argos::CGrid< ENTITY >::CEntityOperation |
argos::CGrid< ENTITY >::CGrid | ( | const CVector3 & | c_area_min_corner, |
const CVector3 & | c_area_max_corner, | ||
SInt32 | n_size_i, | ||
SInt32 | n_size_j, | ||
SInt32 | n_size_k | ||
) |
Definition at line 48 of file grid_impl.h.
|
virtual |
Definition at line 76 of file grid_impl.h.
|
virtual |
Adds an entity to this index.
c_entity | The entity to add. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 114 of file grid_impl.h.
|
inline |
Definition at line 963 of file grid_impl.h.
|
inline |
Definition at line 948 of file grid_impl.h.
|
virtual |
Undoes whatever was done by Init().
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 107 of file grid_impl.h.
|
virtual |
Definition at line 521 of file grid_impl.h.
|
virtual |
Executes an operation on all the indexed entities.
c_operation | The operation to perform. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 161 of file grid_impl.h.
|
virtual |
Definition at line 706 of file grid_impl.h.
|
virtual |
Definition at line 624 of file grid_impl.h.
|
virtual |
Definition at line 647 of file grid_impl.h.
|
virtual |
Definition at line 685 of file grid_impl.h.
|
virtual |
Definition at line 535 of file grid_impl.h.
|
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.
c_ray | The ray. |
c_operation | The operation to perform. |
b_stop_at_closest_matches | Stop the computation as soon as the first match is found. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 342 of file grid_impl.h.
|
virtual |
Executes an operation on all entities within the specified box range.
The box is axis-aligned.
c_center | The box center. |
c_half_size | The box half-size. |
c_operation | The operation to perform. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 260 of file grid_impl.h.
|
virtual |
Executes an operation on all entities within the specified circle range.
The circle is parallel to the XY plane.
c_center | The circle center. |
f_radius | The circle radius. |
c_operation | The operation to perform. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 283 of file grid_impl.h.
|
virtual |
Executes an operation on all entities within the specified rectangle range.
The rectangle is axis-aligned and parallel to the XY plane.
c_center | The rectangle center. |
c_half_size | The rectangle half-size. |
c_operation | The operation to perform. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 321 of file grid_impl.h.
|
virtual |
Executes an operation on all entities within the specified sphere range.
c_center | The sphere center. |
f_radius | The sphere radius. |
c_operation | The operation to perform. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 171 of file grid_impl.h.
|
inline |
Definition at line 976 of file grid_impl.h.
|
inline |
Definition at line 988 of file grid_impl.h.
|
virtual |
Puts the entities located at the given point in the passed buffer.
c_entities | The entity set to use as buffer. |
c_position | The wanted point in the space. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 139 of file grid_impl.h.
|
inline |
|
inline |
|
inline |
|
virtual |
Initializes the resource.
t_tree | the base of the XML configuration tree to parse |
CARGoSException | if an error occurs |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 84 of file grid_impl.h.
|
inline |
Definition at line 915 of file grid_impl.h.
|
inline |
Definition at line 935 of file grid_impl.h.
|
virtual |
Removes an entity from this index.
c_entity | The entity to remove. |
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 122 of file grid_impl.h.
|
virtual |
Resets the resource.
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 91 of file grid_impl.h.
|
inline |
Definition at line 907 of file grid_impl.h.
|
virtual |
Updates this positional index.
Implements argos::CPositionalIndex< ENTITY >.
Definition at line 130 of file grid_impl.h.
void argos::CGrid< ENTITY >::UpdateCell | ( | SInt32 | n_i, |
SInt32 | n_j, | ||
SInt32 | n_k, | ||
ENTITY & | c_entity | ||
) |
Definition at line 884 of file grid_impl.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |