ClusterPainter.hpp
Go to the documentation of this file.
1 
28 /*
29  * ClusterPainter.hpp
30  *
31  * @date 18.06.2017
32  * @author Johan M. von Behren <johan@vonbehren.eu>
33  */
34 
35 #ifndef LVR2_ALGORITHM_CLUSTERPAINTER_H_
36 #define LVR2_ALGORITHM_CLUSTERPAINTER_H_
37 
38 #include <cstdint>
39 #include <array>
40 
41 using std::array;
42 
48 
49 namespace lvr2
50 {
51 
56 {
57 public:
58  ClusterPainter(const ClusterBiMap<FaceHandle>& clusterBiMap) : m_clusterBiMap(clusterBiMap) {};
59 
65  template<typename BaseVecT>
67 
68 private:
70  inline Rgb8Color getSimpsonColorForIdx(size_t idx) const
71  {
72  return {
73  static_cast<uint8_t>(fabs(cos(idx)) * 255),
74  static_cast<uint8_t>(fabs(sin(idx * 30)) * 255),
75  static_cast<uint8_t>(fabs(sin(idx * 2)) * 255)
76  };
77  }
78 };
79 
80 } // namespace lvr2
81 
82 #include "lvr2/algorithm/ClusterPainter.tcc"
83 
84 #endif /* LVR2_ALGORITHM_CLUSTERPAINTER_H_ */
Handles.hpp
PointsetSurface.hpp
lvr2::ClusterPainter
Algorithm which generates the same color for all vertices, which are in the same cluster.
Definition: ClusterPainter.hpp:55
AttrMaps.hpp
lvr2::ClusterPainter::getSimpsonColorForIdx
Rgb8Color getSimpsonColorForIdx(size_t idx) const
Definition: ClusterPainter.hpp:70
lvr2::Rgb8Color
std::array< uint8_t, 3 > Rgb8Color
Definition: ColorAlgorithms.hpp:54
lvr2::ClusterPainter::m_clusterBiMap
ClusterBiMap< FaceHandle > m_clusterBiMap
Definition: ClusterPainter.hpp:69
lvr2::VectorMap
A map with constant lookup overhead using small-ish integer-keys.
Definition: VectorMap.hpp:60
ClusterBiMap.hpp
lvr2::ClusterPainter::ClusterPainter
ClusterPainter(const ClusterBiMap< FaceHandle > &clusterBiMap)
Definition: ClusterPainter.hpp:58
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::BaseMesh
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
lvr2::ClusterPainter::simpsons
DenseClusterMap< Rgb8Color > simpsons(const BaseMesh< BaseVecT > &mesh) const
Assign a pseudo-color to each cluster.
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
ColorAlgorithms.hpp


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