armarx::viz::grid Namespace Reference

Functions

template<class T >
std::vector< Tflatten (const std::vector< std::vector< T >> &vector)
 Flattens a 2D vector of nested vectors to a 1D vector. More...
 
std::vector< std::vector< viz::data::Color > > makeGrid2DColors (const std::vector< std::vector< Eigen::Vector3f >> &vertices, std::function< viz::Color(size_t x, size_t y, const Eigen::Vector3f &p)> colorFunc)
 Build colors of a 2D grid. More...
 
std::vector< viz::data::Face > makeGrid2DFaces (size_t num_x, size_t num_y)
 Builds faces of a 2D grid. More...
 
std::vector< std::vector< Eigen::Vector3f > > makeGrid2DVertices (Eigen::Vector2f extents, Eigen::Vector2i numPoints, float height=0)
 Builds vertices of a regular 2D grid in the xy-plane. More...
 

Function Documentation

◆ flatten()

std::vector<T> armarx::viz::grid::flatten ( const std::vector< std::vector< T >> &  vector)

Flattens a 2D vector of nested vectors to a 1D vector.

Definition at line 168 of file Mesh.h.

+ Here is the call graph for this function:

◆ makeGrid2DColors()

std::vector<std::vector<viz::data::Color> > armarx::viz::grid::makeGrid2DColors ( const std::vector< std::vector< Eigen::Vector3f >> &  vertices,
std::function< viz::Color(size_t x, size_t y, const Eigen::Vector3f &p)>  colorFunc 
)

Build colors of a 2D grid.

Parameters
verticesThe vertices.
colorFuncA function determining the color of each vertex.
Returns
The colors.
See also
makeGrid2DVertices()

◆ makeGrid2DFaces()

std::vector< viz::data::Face > makeGrid2DFaces ( size_t  num_x,
size_t  num_y 
)

Builds faces of a 2D grid.

The built indexes refer to flattened arrays of vertices and colors, such as produced by flatten() applied to the result of makeGrid2DVertices().

Parameters
num_xThe number of vertices in x-axis.
num_yThe number of vertices in y-axis.
Returns
The faces.

Definition at line 108 of file Mesh.cpp.

◆ makeGrid2DVertices()

std::vector< std::vector< Eigen::Vector3f > > makeGrid2DVertices ( Eigen::Vector2f  extents,
Eigen::Vector2i  numPoints,
float  height = 0 
)

Builds vertices of a regular 2D grid in the xy-plane.

If the result is indexed as result[i][j], the i index represents the x-axis, the j index represents the y-axis.

Parameters
extentsThe full extents per axis.
numPointsThe number of points per axis.
heightThe height (z-value).
Returns
The vertices.

Definition at line 56 of file Mesh.cpp.