|
Functions | |
template<class T > | |
std::vector< T > | flatten (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... | |
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.
vertices | The vertices. |
colorFunc | A function determining the color of each vertex. |
makeGrid2DVertices()
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()
.
num_x | The number of vertices in x-axis. |
num_y | The number of vertices in y-axis. |
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.
extents | The full extents per axis. |
numPoints | The number of points per axis. |
height | The height (z-value). |