BaseLinearGrid2< Derived > Class Template Reference

BaseLinearGrid2&lt; Derived &gt; Class Template Reference#

Beluga: beluga::BaseLinearGrid2< Derived > Class Template Reference
Beluga
beluga::BaseLinearGrid2< Derived > Class Template Reference

Linear 2D grid base type. More...

#include <linear_grid.hpp>

Inheritance diagram for beluga::BaseLinearGrid2< Derived >:
[legend]
Collaboration diagram for beluga::BaseLinearGrid2< Derived >:
[legend]

Public Member Functions

std::size_t index_at (int xi, int yi) const
 Computes index for given grid cell coordinates.
 
std::size_t index_at (const Eigen::Vector2i &pi) const
 Computes index for given grid cell coordinates. More...
 
Eigen::Vector2d coordinates_at (std::size_t index) const
 Compute plane coordinates given a grid cell index. More...
 
auto data_at (std::size_t index) const
 Gets cell data, if included. More...
 
auto neighborhood4 (std::size_t index) const
 Computes 4-connected neighborhood for cell. More...
 
- Public Member Functions inherited from beluga::BaseDenseGrid2< Derived >
bool contains (int xi, int yi) const
 Checks if a cell is included in the grid. More...
 
bool contains (const Eigen::Vector2i &pi) const
 Checks if a cell is included in the grid. More...
 
auto data_at (int xi, int yi) const
 Gets cell data, if included. More...
 
auto data_at (const Eigen::Vector2i &pi) const
 Gets cell data, if included. More...
 
auto data_near (double x, double y) const
 Gets nearest cell data, if included. More...
 
auto data_near (const Eigen::Vector2d &p) const
 Gets nearest cell data, if included. More...
 
auto neighborhood4 (int xi, int yi) const
 Computes 4-connected neighborhood for cell. More...
 
auto neighborhood4 (const Eigen::Vector2i &pi) const
 Computes 4-connected neighborhood for cell. More...
 
- Public Member Functions inherited from beluga::BaseRegularGrid< Derived, NDim >
Eigen::Vector< int, NDim > cell_near (const Eigen::Vector< double, NDim > &p) const
 Compute nearest grid cell coordinates given plane coordinates. More...
 
Eigen::Vector< double, NDim > coordinates_at (const Eigen::Vector< int, NDim > &pi) const
 Compute plane coordinates given grid cell coordinates. More...
 
template<class Range >
auto coordinates_for (Range &&cells) const
 Compute plane coordinates given a range of cell coordinates. More...
 

Detailed Description

template<typename Derived>
class beluga::BaseLinearGrid2< Derived >

Linear 2D grid base type.

When instantiated, it satisfies Beluga named requirements: LinearGrid2.

Template Parameters
DerivedConcrete linear grid type. It must define Derived::width(), Derived::height(), Derived::resolution(), Derived::data_at(std::size_t), Derived::index_at(int, int), and Derived::data() as described in Beluga named requirements: LinearGrid2.

Member Function Documentation

◆ coordinates_at()

template<typename Derived >
Eigen::Vector2d beluga::BaseLinearGrid2< Derived >::coordinates_at ( std::size_t  index) const
inline

Compute plane coordinates given a grid cell index.

Parameters
indexGrid cell index.
Returns
Plane coordinates of the cell centroid.

◆ data_at()

template<typename Derived >
auto beluga::BaseLinearGrid2< Derived >::data_at ( std::size_t  index) const
inline

Gets cell data, if included.

Parameters
indexGrid cell index.
Returns
Cell data if included, std::nullopt otherwise.

◆ index_at()

template<typename Derived >
std::size_t beluga::BaseLinearGrid2< Derived >::index_at ( const Eigen::Vector2i &  pi) const
inline

Computes index for given grid cell coordinates.

Parameters
piGrid cell coordinates.

◆ neighborhood4()

template<typename Derived >
auto beluga::BaseLinearGrid2< Derived >::neighborhood4 ( std::size_t  index) const
inline

Computes 4-connected neighborhood for cell.

Parameters
indexGrid cell index.
Returns
range of neighbor cells' indices.

The documentation for this class was generated from the following file:
  • /home/runner/work/beluga/beluga/beluga/include/beluga/sensor/data/linear_grid.hpp