Class for calculating materials for each cluster of a given mesh. More...
#include <Materializer.hpp>
Public Member Functions | |
| MaterializerResult< BaseVecT > | generateMaterials () |
| Generates materials. More... | |
| Materializer (const BaseMesh< BaseVecT > &mesh, const ClusterBiMap< FaceHandle > &cluster, const FaceMap< Normal< typename BaseVecT::CoordType >> &normals, const PointsetSurface< BaseVecT > &surface) | |
| Constructor. More... | |
| void | saveTextures () |
Saves the textures by calling the saveTextures() method of the texturizer. More... | |
| void | setTexturizer (Texturizer< BaseVecT > &texturizer) |
| Sets the texturizer. More... | |
Private Attributes | |
| const ClusterBiMap< FaceHandle > & | m_cluster |
| Clusters. More... | |
| const BaseMesh< BaseVecT > & | m_mesh |
| Mesh. More... | |
| const FaceMap< Normal< typename BaseVecT::CoordType > > & | m_normals |
| Normals. More... | |
| const PointsetSurface< BaseVecT > & | m_surface |
| Point cloud. More... | |
| boost::optional< Texturizer< BaseVecT > & > | m_texturizer |
| Texturizer. More... | |
Class for calculating materials for each cluster of a given mesh.
For each cluster of a given mesh, this class generates a material. Based on the original pointcloud, it calculates a color for each cluster. If a Texturizer is provided, it generates a texture for the material instead. In that case it will also calculate texture coordinates and keypoints.
Definition at line 131 of file Materializer.hpp.
| lvr2::Materializer< BaseVecT >::Materializer | ( | const BaseMesh< BaseVecT > & | mesh, |
| const ClusterBiMap< FaceHandle > & | cluster, | ||
| const FaceMap< Normal< typename BaseVecT::CoordType >> & | normals, | ||
| const PointsetSurface< BaseVecT > & | surface | ||
| ) |
Constructor.
| mesh | The mesh |
| cluster | The cluster map |
| normals | The normals map |
| surface | The point cloud |
| MaterializerResult<BaseVecT> lvr2::Materializer< BaseVecT >::generateMaterials | ( | ) |
Generates materials.
For each cluster, check whether a texture should be generated:
If no texture should be generated, calculate the median color of the faces in the cluster. Then create a material using this color if it doesn't already exist.
If textures should be generated, calculate the contour vertices of the cluster and a bounding rectangle and let the texturizer generate a texture using the bounding rectangle. Then calculate AKAZE keypoints for the texture image and texture coordinates for each vertex in the cluster.
| void lvr2::Materializer< BaseVecT >::saveTextures | ( | ) |
Saves the textures by calling the saveTextures() method of the texturizer.
| void lvr2::Materializer< BaseVecT >::setTexturizer | ( | Texturizer< BaseVecT > & | texturizer | ) |
Sets the texturizer.
| texturizer | The texturizer |
|
private |
Clusters.
Definition at line 186 of file Materializer.hpp.
|
private |
Mesh.
Definition at line 184 of file Materializer.hpp.
|
private |
Normals.
Definition at line 188 of file Materializer.hpp.
|
private |
Point cloud.
Definition at line 190 of file Materializer.hpp.
|
private |
Definition at line 193 of file Materializer.hpp.