iridescence
Loading...
Searching...
No Matches
glk::ElevationMapBuilder Struct Reference

Builder for an elevation map. More...

#include <elevation_map.hpp>

Public Member Functions

 ElevationMapBuilder (double resolution, const Eigen::Vector2i &size, const Eigen::Vector2f &origin)
 Constructor.
 ~ElevationMapBuilder ()
 Destructor.
template<typename Vector>
std::vector< std::uint64_t > calc_cell_indices (const std::vector< Vector > &cells) const
 Calculate the cell indices for a given set of cells.
template<typename Vector>
void set_elevation (const std::vector< Vector > &cells, int elevation_index, const std::vector< std::uint64_t > &cell_indices, bool average=false)
 Set the elevation values for the given cells in the elevation map.
template<typename Vector>
void set_cmap (const std::vector< Vector > &cells, int cmap_index, const std::vector< std::uint64_t > &cell_indices, bool average=false)
 Set the color values for the given cells in the elevation map.
template<int WindowSize = 3>
void filter_elevation_map (bool process_valid_cells=true)
 Apply local averaging filter to the elevation (and color) map.
template<int WindowSize = 3>
void calc_cmap_gradient ()
 Replace the color map with its gradient magnitude.

Public Attributes

double resolution
double inv_resolution
Eigen::Vector2i size
Eigen::Vector2f origin
Eigen::Array< float, -1, -1, Eigen::RowMajor > count_map
Eigen::Array< float, -1, -1, Eigen::RowMajor > elevation_map
Eigen::Array< float, -1, -1, Eigen::RowMajor > color_map

Detailed Description

Builder for an elevation map.

Constructor & Destructor Documentation

◆ ElevationMapBuilder()

glk::ElevationMapBuilder::ElevationMapBuilder ( double resolution,
const Eigen::Vector2i & size,
const Eigen::Vector2f & origin )

Constructor.

Parameters
resolutionResolution of the map (size of each cell)
sizeSize of the map in number of cells (width, height)
originTop-left corner of the map in world coordinates

◆ ~ElevationMapBuilder()

glk::ElevationMapBuilder::~ElevationMapBuilder ( )

Destructor.

Member Function Documentation

◆ calc_cell_indices()

template<typename Vector>
std::vector< std::uint64_t > glk::ElevationMapBuilder::calc_cell_indices ( const std::vector< Vector > & cells) const

Calculate the cell indices for a given set of cells.

Parameters
cellsCells for which to calculate the indices. cell[0] and cell[1] are the x and y coordinates of the cell in world coordinates.
Returns
Indices of the cells in the elevation map.

◆ calc_cmap_gradient()

template<int WindowSize = 3>
void glk::ElevationMapBuilder::calc_cmap_gradient ( )

Replace the color map with its gradient magnitude.

◆ filter_elevation_map()

template<int WindowSize = 3>
void glk::ElevationMapBuilder::filter_elevation_map ( bool process_valid_cells = true)

Apply local averaging filter to the elevation (and color) map.

Template Parameters
WindowSizeSize of the filter window (must be odd).
Parameters
process_valid_cellsIf true, all cells will be processed (smoothed). If false, only invalid cells (NaN) will be processed.

◆ set_cmap()

template<typename Vector>
void glk::ElevationMapBuilder::set_cmap ( const std::vector< Vector > & cells,
int cmap_index,
const std::vector< std::uint64_t > & cell_indices,
bool average = false )

Set the color values for the given cells in the elevation map.

Parameters
cellsCells
cmap_indexIndex of the color value in the cell vector (i.e., cells[i][cmap_index] is the color value of i-th cell).
cell_indicesIndices of the cells in the elevation map.
averageIf false, the color values will be set directly. Otherwise, the color values of each cell will be averaged.

◆ set_elevation()

template<typename Vector>
void glk::ElevationMapBuilder::set_elevation ( const std::vector< Vector > & cells,
int elevation_index,
const std::vector< std::uint64_t > & cell_indices,
bool average = false )

Set the elevation values for the given cells in the elevation map.

Parameters
cellsCells
elevation_indexIndex of the elevation value in the cell vector (i.e., cells[i][elevation_index] is the elevation value of i-th cell).
cell_indicesIndices of the cells in the elevation map.
averageIf false, the elevation values will be set directly. Otherwise, the elevation values of each cell will be averaged.

Member Data Documentation

◆ color_map

Eigen::Array<float, -1, -1, Eigen::RowMajor> glk::ElevationMapBuilder::color_map

◆ count_map

Eigen::Array<float, -1, -1, Eigen::RowMajor> glk::ElevationMapBuilder::count_map

◆ elevation_map

Eigen::Array<float, -1, -1, Eigen::RowMajor> glk::ElevationMapBuilder::elevation_map

◆ inv_resolution

double glk::ElevationMapBuilder::inv_resolution

◆ origin

Eigen::Vector2f glk::ElevationMapBuilder::origin

◆ resolution

double glk::ElevationMapBuilder::resolution

◆ size

Eigen::Vector2i glk::ElevationMapBuilder::size

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