Template Class base_grid_view_entity

Inheritance Relationships

Base Type

  • public rpdecorator::decorator< TGridViewType >

Derived Types

Class Documentation

template<typename TGridType, typename TGridViewType>
class base_grid_view_entity : public rpdecorator::decorator<TGridViewType>

Representation of an cads::arena_grid::view or cads::arena_grid::const_view object (or something similar) as an entity in the arena. This representation makes it much easier to pass abstract, mult-cell objects that are not entities per-se as entities for various operations such as block distribution in foraging.

It has the following characteristics:

  • Spans multiple cells in the arena.

  • Does not “exist” in the sense that it is not detectable by robots.

  • Has no concept of movability/immovability (again, it is abstract).

Subclassed by cosm::repr::grid2D_view_entity< cads::arena_grid, cads::arena_grid::const_view >, cosm::repr::grid2D_view_entity< TGridType, TGridViewType >, cosm::repr::grid3D_view_entity< TGridType, TGridViewType >, cosm::repr::gridQ3D_view_entity< TGridType, TGridViewType >

Public Types

using cell_type = typename grid_type::value_type
using coord_type = typename grid_type::coord_type
using grid_type = TGridType
using grid_view_type = TGridViewType

Public Functions

inline base_grid_view_entity(const grid_view_type &view, const rtypes::discretize_ratio &resolution)
virtual ~base_grid_view_entity(void) = default
virtual const cell_type &access(const coord_type &c) const = 0

Get the cell associated with a particular grid location within the view. Asserts that both coordinates are within the bounds of the grid underlying the view.

Parameters:

c – The RELATIVE coord within the view.

Returns:

A reference to the cell.

virtual bool contains_abs(const coord_type &cell) const = 0

Determine if the specified ABSOLUTE coordinates lie within the view entity (i.e., the coordinates are specified relative to the origin of the parent grid this entity is built from.)

virtual bool contains_rel(const coord_type &cell) const = 0

Determine if the specified RELATIVE coordinates lie within the view entity (i.e., the coordinates are specified relative to the origin of the view entity, which is not necessarily the same as the origin of the parent grid).

inline const rtypes::discretize_ratio &resolution(void) const

Protected Functions

inline const grid_view_type &view(void) const