Materializer.hpp
Go to the documentation of this file.
1 
28 /*
29 * Materializer.hpp
30 *
31 * @date 17.07.2017
32 * @author Jan Philipp Vogtherr <jvogtherr@uni-osnabrueck.de>
33 * @author Kristin Schmidt <krschmidt@uni-osnabrueck.de>
34 */
35 
36 #ifndef LVR2_ALGORITHM_MATERIALIZER_H_
37 #define LVR2_ALGORITHM_MATERIALIZER_H_
38 
39 #include <boost/shared_ptr.hpp>
40 #include <boost/smart_ptr/make_shared.hpp>
41 #include <boost/optional.hpp>
42 
46 #include "lvr2/geometry/Normal.hpp"
49 #include "lvr2/texture/Texture.hpp"
55 
56 
57 #include "lvr2/io/Progress.hpp"
58 #include "lvr2/io/Timestamp.hpp"
59 #include <unordered_map>
60 #include <unordered_set>
61 
62 namespace lvr2
63 {
64 
72 template<typename BaseVecT>
73 struct MaterializerResult
74 {
77 
79  boost::optional<StableVector<TextureHandle, Texture>> m_textures;
80 
82  boost::optional<SparseVertexMap<ClusterTexCoordMapping>> m_vertexTexCoords;
83 
85  boost::optional<std::unordered_map<BaseVecT, std::vector<float>>> m_keypoints;
86 
93  DenseClusterMap<Material> clusterMaterials
94  ) :
95  m_clusterMaterials(clusterMaterials)
96  {
97  }
98 
108  DenseClusterMap<Material> clusterMaterials,
111  std::unordered_map<BaseVecT, std::vector<float>> keypoints
112  ) :
113  m_clusterMaterials(clusterMaterials),
114  m_textures(textures),
115  m_vertexTexCoords(vertexTexCoords),
116  m_keypoints(keypoints)
117  {
118  }
119 
120 };
121 
130 template<typename BaseVecT>
132 {
133 
134 public:
135 
144  Materializer(
145  const BaseMesh<BaseVecT>& mesh,
146  const ClusterBiMap<FaceHandle>& cluster,
148  const PointsetSurface<BaseVecT>& surface
149  );
150 
155  void setTexturizer(Texturizer<BaseVecT>& texturizer);
156 
174  MaterializerResult<BaseVecT> generateMaterials();
175 
179  void saveTextures();
180 
181 private:
182 
191 
193  boost::optional<Texturizer<BaseVecT>&> m_texturizer;
194 
195 };
196 
197 } // namespace lvr2
198 
199 #include "lvr2/algorithm/Materializer.tcc"
200 
201 #endif /* LVR2_ALGORITHM_MATERIALIZER_H_ */
const PointsetSurface< BaseVecT > & m_surface
Point cloud.
void saveTextures(std::vector< int32_t > *textureValue, textureArr textures, size_t numTextures)
pushes the given textures in a int32_t vector to store it in the draco structure
A vector which guarantees stable indices and features O(1) deletion.
const ClusterBiMap< FaceHandle > & m_cluster
Clusters.
HalfEdgeMesh< Vec > mesh
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
Class for calculating materials for each cluster of a given mesh.
boost::optional< SparseVertexMap< ClusterTexCoordMapping > > m_vertexTexCoords
Cluster texture coordinates for each vertex.
A map of clusters, which also saves a back-reference from handle to cluster.
const BaseMesh< BaseVecT > & m_mesh
Mesh.
boost::optional< Texturizer< BaseVecT > & > m_texturizer
Texturizer.
MaterializerResult(DenseClusterMap< Material > clusterMaterials, StableVector< TextureHandle, Texture > textures, SparseVertexMap< ClusterTexCoordMapping > vertexTexCoords, std::unordered_map< BaseVecT, std::vector< float >> keypoints)
Constructor.
Interface for attribute maps.
Class that performs texture-related tasks.
Definition: Texturizer.hpp:63
boost::optional< std::unordered_map< BaseVecT, std::vector< float > > > m_keypoints
Keypoints.
const FaceMap< Normal< typename BaseVecT::CoordType > > & m_normals
Normals.
Result struct for the materializer.
DenseClusterMap< Material > m_clusterMaterials
Materials for each cluster.
boost::optional< StableVector< TextureHandle, Texture > > m_textures
A stable vector of textures. each texture is identified by a tex.-handle.
A map with constant lookup overhead using small-ish integer-keys.
Definition: VectorMap.hpp:60
MaterializerResult(DenseClusterMap< Material > clusterMaterials)
Constructor.


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 Mon Feb 28 2022 22:46:08