Public Member Functions | Private Attributes | List of all members
lvr2::Materializer< BaseVecT > Class Template Reference

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...
 

Detailed Description

template<typename BaseVecT>
class lvr2::Materializer< BaseVecT >

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.

Constructor & Destructor Documentation

◆ Materializer()

template<typename BaseVecT >
lvr2::Materializer< BaseVecT >::Materializer ( const BaseMesh< BaseVecT > &  mesh,
const ClusterBiMap< FaceHandle > &  cluster,
const FaceMap< Normal< typename BaseVecT::CoordType >> &  normals,
const PointsetSurface< BaseVecT > &  surface 
)

Constructor.

Parameters
meshThe mesh
clusterThe cluster map
normalsThe normals map
surfaceThe point cloud

Member Function Documentation

◆ generateMaterials()

template<typename BaseVecT >
MaterializerResult<BaseVecT> lvr2::Materializer< BaseVecT >::generateMaterials ( )

Generates materials.

For each cluster, check whether a texture should be generated:

  • If no texturizer is provided, no textures will be generated.
  • If a texturizer is provided, count the number of faces in that cluster and generate a texture if the number of faces is within the defined interval (which is stored in the texturizer).

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.

Returns
The materializer result, that contains materials and optional texture data

◆ saveTextures()

template<typename BaseVecT >
void lvr2::Materializer< BaseVecT >::saveTextures ( )

Saves the textures by calling the saveTextures() method of the texturizer.

◆ setTexturizer()

template<typename BaseVecT >
void lvr2::Materializer< BaseVecT >::setTexturizer ( Texturizer< BaseVecT > &  texturizer)

Sets the texturizer.

Parameters
texturizerThe texturizer

Member Data Documentation

◆ m_cluster

template<typename BaseVecT >
const ClusterBiMap<FaceHandle>& lvr2::Materializer< BaseVecT >::m_cluster
private

Clusters.

Definition at line 186 of file Materializer.hpp.

◆ m_mesh

template<typename BaseVecT >
const BaseMesh<BaseVecT>& lvr2::Materializer< BaseVecT >::m_mesh
private

Mesh.

Definition at line 184 of file Materializer.hpp.

◆ m_normals

template<typename BaseVecT >
const FaceMap<Normal<typename BaseVecT::CoordType> >& lvr2::Materializer< BaseVecT >::m_normals
private

Normals.

Definition at line 188 of file Materializer.hpp.

◆ m_surface

template<typename BaseVecT >
const PointsetSurface<BaseVecT>& lvr2::Materializer< BaseVecT >::m_surface
private

Point cloud.

Definition at line 190 of file Materializer.hpp.

◆ m_texturizer

template<typename BaseVecT >
boost::optional<Texturizer<BaseVecT>&> lvr2::Materializer< BaseVecT >::m_texturizer
private

Texturizer.

Definition at line 193 of file Materializer.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27