Public Member Functions | Private Attributes | List of all members
beluga::ValueGrid2< T > Class Template Reference

Generic 2D linear value grid. More...

#include <value_grid.hpp>

Inheritance diagram for beluga::ValueGrid2< T >:
Inheritance graph
[legend]

Public Member Functions

const std::vector< T > & data () const
 Gets grid data. More...
 
std::size_t height () const
 Gets grid height. More...
 
double resolution () const
 Gets grid resolution. More...
 
std::size_t size () const
 Gets grid size (ie. number of grid cells). More...
 
 ValueGrid2 (std::vector< T > data, std::size_t width, double resolution=1.)
 Constructs the grid. More...
 
std::size_t width () const
 Gets grid width. More...
 
- Public Member Functions inherited from beluga::BaseLinearGrid2< ValueGrid2< T > >
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...
 
std::size_t index_at (const Eigen::Vector2i &pi) const
 Computes index for given grid cell coordinates. More...
 
std::size_t index_at (int xi, int yi) const
 Computes index for given grid cell coordinates. More...
 
auto neighborhood4 (std::size_t index) const
 Computes 4-connected neighborhood for cell. More...
 
- Public Member Functions inherited from beluga::BaseDenseGrid2< ValueGrid2< T > >
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...
 

Private Attributes

std::vector< T > data_
 
std::size_t height_
 
double resolution_
 
std::size_t width_
 

Detailed Description

template<typename T>
class beluga::ValueGrid2< T >

Generic 2D linear value grid.

Template Parameters
TAny copyable type.

Definition at line 36 of file value_grid.hpp.

Constructor & Destructor Documentation

◆ ValueGrid2()

template<typename T >
beluga::ValueGrid2< T >::ValueGrid2 ( std::vector< T >  data,
std::size_t  width,
double  resolution = 1. 
)
inlineexplicit

Constructs the grid.

Parameters
dataGrid data.
widthGrid width. Must evenly divide data size.
resolutionGrid resolution.

Definition at line 44 of file value_grid.hpp.

Member Function Documentation

◆ data()

template<typename T >
const std::vector<T>& beluga::ValueGrid2< T >::data ( ) const
inline

Gets grid data.

Definition at line 62 of file value_grid.hpp.

◆ height()

template<typename T >
std::size_t beluga::ValueGrid2< T >::height ( ) const
inline

Gets grid height.

Definition at line 53 of file value_grid.hpp.

◆ resolution()

template<typename T >
double beluga::ValueGrid2< T >::resolution ( ) const
inline

Gets grid resolution.

Definition at line 56 of file value_grid.hpp.

◆ size()

template<typename T >
std::size_t beluga::ValueGrid2< T >::size ( ) const
inline

Gets grid size (ie. number of grid cells).

Definition at line 59 of file value_grid.hpp.

◆ width()

template<typename T >
std::size_t beluga::ValueGrid2< T >::width ( ) const
inline

Gets grid width.

Definition at line 50 of file value_grid.hpp.

Member Data Documentation

◆ data_

template<typename T >
std::vector<T> beluga::ValueGrid2< T >::data_
private

Definition at line 65 of file value_grid.hpp.

◆ height_

template<typename T >
std::size_t beluga::ValueGrid2< T >::height_
private

Definition at line 67 of file value_grid.hpp.

◆ resolution_

template<typename T >
double beluga::ValueGrid2< T >::resolution_
private

Definition at line 68 of file value_grid.hpp.

◆ width_

template<typename T >
std::size_t beluga::ValueGrid2< T >::width_
private

Definition at line 66 of file value_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