Public Member Functions | List of all members
beluga::BaseDenseGrid2< Derived > Class Template Reference

Dense 2D grid base type. More...

#include <dense_grid.hpp>

Inheritance diagram for beluga::BaseDenseGrid2< Derived >:
Inheritance graph
[legend]

Public Member Functions

bool contains (const Eigen::Vector2i &pi) const
 Checks if a cell is included in the grid. More...
 
bool contains (int xi, int yi) const
 Checks if a cell is included in the grid. More...
 
auto data_at (const Eigen::Vector2i &pi) const
 Gets cell data, if included. More...
 
auto data_at (int xi, int yi) const
 Gets cell data, if included. More...
 
auto data_near (const Eigen::Vector2d &p) const
 Gets nearest cell data, if included. More...
 
auto data_near (double x, double y) const
 Gets nearest cell data, if included. More...
 
auto neighborhood4 (const Eigen::Vector2i &pi) const
 Computes 4-connected neighborhood for cell. More...
 
auto neighborhood4 (int xi, int yi) 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::BaseDenseGrid2< Derived >

Dense 2D grid base type.

When instantiated, it satisfies Beluga named requirements: DenseGrid2.

Template Parameters
DerivedConcrete dense grid type. It must define Derived::width(), Derived::height(), Derived::resolution(), Derived::data_at(index), and Derived::index_at(int, int) as described in Beluga named requirements: DenseGrid2.

Definition at line 83 of file dense_grid.hpp.

Member Function Documentation

◆ contains() [1/2]

template<typename Derived >
bool beluga::BaseDenseGrid2< Derived >::contains ( const Eigen::Vector2i &  pi) const
inline

Checks if a cell is included in the grid.

Parameters
piGrid cell coordinates.

Definition at line 100 of file dense_grid.hpp.

◆ contains() [2/2]

template<typename Derived >
bool beluga::BaseDenseGrid2< Derived >::contains ( int  xi,
int  yi 
) const
inline

Checks if a cell is included in the grid.

Parameters
xiGrid cell x-axis coordinate.
yiGrid cell y-axis coordinate.

Definition at line 90 of file dense_grid.hpp.

◆ data_at() [1/2]

template<typename Derived >
auto beluga::BaseDenseGrid2< Derived >::data_at ( const Eigen::Vector2i &  pi) const
inline

Gets cell data, if included.

Parameters
piGrid cell coordinates.
Returns
Cell data if included, std::nullopt otherwise.

Definition at line 118 of file dense_grid.hpp.

◆ data_at() [2/2]

template<typename Derived >
auto beluga::BaseDenseGrid2< Derived >::data_at ( int  xi,
int  yi 
) const
inline

Gets cell data, if included.

Parameters
xiGrid cell x-axis coordinate.
yiGrid cell y-axis coordinate.
Returns
Cell data if included, std::nullopt otherwise.

Definition at line 108 of file dense_grid.hpp.

◆ data_near() [1/2]

template<typename Derived >
auto beluga::BaseDenseGrid2< Derived >::data_near ( const Eigen::Vector2d p) const
inline

Gets nearest cell data, if included.

Parameters
pPlane coordinates.
Returns
Cell data if included, std::nullopt otherwise.

Definition at line 135 of file dense_grid.hpp.

◆ data_near() [2/2]

template<typename Derived >
auto beluga::BaseDenseGrid2< Derived >::data_near ( double  x,
double  y 
) const
inline

Gets nearest cell data, if included.

Parameters
xPlane x-axis coordinate.
yPlane y-axis coordinate.
Returns
Cell data if included, std::nullopt otherwise.

Definition at line 126 of file dense_grid.hpp.

◆ neighborhood4() [1/2]

template<typename Derived >
auto beluga::BaseDenseGrid2< Derived >::neighborhood4 ( const Eigen::Vector2i &  pi) const
inline

Computes 4-connected neighborhood for cell.

Parameters
piGrid cell coordinates.
Returns
range of neighbor cells.

Definition at line 165 of file dense_grid.hpp.

◆ neighborhood4() [2/2]

template<typename Derived >
auto beluga::BaseDenseGrid2< Derived >::neighborhood4 ( int  xi,
int  yi 
) const
inline

Computes 4-connected neighborhood for cell.

Parameters
xiGrid cell x-axis coordinate.
yiGrid cell y-axis coordinate.
Returns
range of neighbor cells.

Definition at line 143 of file dense_grid.hpp.


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


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54