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_ */
ClusterBiMap< FaceHandle > m_clusterBiMap
HalfEdgeMesh< Vec > mesh
Algorithm which generates the same color for all vertices, which are in the same cluster.
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
A map of clusters, which also saves a back-reference from handle to cluster.
ClusterPainter(const ClusterBiMap< FaceHandle > &clusterBiMap)
DenseClusterMap< Rgb8Color > simpsons(const BaseMesh< BaseVecT > &mesh) const
Assign a pseudo-color to each cluster.
std::array< uint8_t, 3 > Rgb8Color
Rgb8Color getSimpsonColorForIdx(size_t idx) const
A map with constant lookup overhead using small-ish integer-keys.
Definition: VectorMap.hpp:60


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