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 
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_ */
Handles.hpp
lvr2::Materializer::m_normals
const FaceMap< Normal< typename BaseVecT::CoordType > > & m_normals
Normals.
Definition: Materializer.hpp:188
lvr2::Materializer::saveTextures
void saveTextures()
Saves the textures by calling the saveTextures() method of the texturizer.
BaseVector.hpp
lvr2::Materializer::m_surface
const PointsetSurface< BaseVecT > & m_surface
Point cloud.
Definition: Materializer.hpp:190
PointsetSurface.hpp
lvr2::HashMap
Definition: HashMap.hpp:47
Texturizer.hpp
lvr2::MaterializerResult::MaterializerResult
MaterializerResult(DenseClusterMap< Material > clusterMaterials, StableVector< TextureHandle, Texture > textures, SparseVertexMap< ClusterTexCoordMapping > vertexTexCoords, std::unordered_map< BaseVecT, std::vector< float >> keypoints)
Constructor.
Definition: Materializer.hpp:107
lvr2::AttributeMap
Interface for attribute maps.
Definition: AttributeMap.hpp:75
BaseMesh.hpp
ClusterTexCoordMapping.hpp
lvr2::MaterializerResult::MaterializerResult
MaterializerResult(DenseClusterMap< Material > clusterMaterials)
Constructor.
Definition: Materializer.hpp:92
lvr2::MaterializerResult
Result struct for the materializer.
Definition: FinalizeAlgorithms.hpp:61
lvr2::MaterializerResult::m_clusterMaterials
DenseClusterMap< Material > m_clusterMaterials
Materials for each cluster.
Definition: Materializer.hpp:76
lvr2::Materializer::m_texturizer
boost::optional< Texturizer< BaseVecT > & > m_texturizer
Texturizer.
Definition: Materializer.hpp:193
lvr2::VectorMap
A map with constant lookup overhead using small-ish integer-keys.
Definition: VectorMap.hpp:60
lvr2::Normal< typename BaseVecT::CoordType >
lvr2::Texturizer
Class that performs texture-related tasks.
Definition: Texturizer.hpp:63
Texture.hpp
ClusterBiMap.hpp
lvr2::StableVector
A vector which guarantees stable indices and features O(1) deletion.
Definition: StableVector.hpp:104
lvr2::MaterializerResult::m_vertexTexCoords
boost::optional< SparseVertexMap< ClusterTexCoordMapping > > m_vertexTexCoords
Cluster texture coordinates for each vertex.
Definition: Materializer.hpp:82
lvr2::PointsetSurface
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
Definition: PointsetSurface.hpp:61
Progress.hpp
lvr2::MaterializerResult::m_textures
boost::optional< StableVector< TextureHandle, Texture > > m_textures
A stable vector of textures. each texture is identified by a tex.-handle.
Definition: Materializer.hpp:79
lvr2::Materializer::setTexturizer
void setTexturizer(Texturizer< BaseVecT > &texturizer)
Sets the texturizer.
lvr2::Materializer::m_mesh
const BaseMesh< BaseVecT > & m_mesh
Mesh.
Definition: Materializer.hpp:184
lvr2::Materializer::generateMaterials
MaterializerResult< BaseVecT > generateMaterials()
Generates materials.
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Materializer::Materializer
Materializer(const BaseMesh< BaseVecT > &mesh, const ClusterBiMap< FaceHandle > &cluster, const FaceMap< Normal< typename BaseVecT::CoordType >> &normals, const PointsetSurface< BaseVecT > &surface)
Constructor.
Timestamp.hpp
Material.hpp
lvr2::BaseMesh
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
BoundingRectangle.hpp
lvr2::Materializer::m_cluster
const ClusterBiMap< FaceHandle > & m_cluster
Clusters.
Definition: Materializer.hpp:186
mesh
HalfEdgeMesh< Vec > mesh
Definition: src/tools/lvr2_gs_reconstruction/Main.cpp:26
lvr2::ClusterBiMap
A map of clusters, which also saves a back-reference from handle to cluster.
Definition: ClusterBiMap.hpp:72
lvr2::Materializer
Class for calculating materials for each cluster of a given mesh.
Definition: Materializer.hpp:131
Normal.hpp
ColorAlgorithms.hpp
lvr2::MaterializerResult::m_keypoints
boost::optional< std::unordered_map< BaseVecT, std::vector< float > > > m_keypoints
Keypoints.
Definition: Materializer.hpp:85


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:24