MultiPointCloud.hpp
Go to the documentation of this file.
1 
35 #ifndef MULTIPOINTCLOUD_H_
36 #define MULTIPOINTCLOUD_H_
37 
39 
40 #include <map>
41 #include <string>
42 #include <sstream>
43 
44 using std::stringstream;
45 using std::map;
46 using std::string;
47 
48 namespace lvr2
49 {
50 
52 {
53  PointCloudAttribute() : cloud(0), marked(false), active(true) {}
55  bool marked;
56  bool active;
57 };
58 
59 typedef map<PointCloud*, PointCloudAttribute*> pc_attr_map;
60 typedef map<PointCloud*, PointCloudAttribute*>::iterator pc_attr_it;
61 
63 {
64 
66 public:
67  MultiPointCloud(ModelPtr model, string name = "<unnamed point cloud>");
68  MultiPointCloud(PointBufferPtr buffer, string name = "<unnamed point cloud>");
69 
70  virtual ~MultiPointCloud()
71  {
72  for (auto p : m_clouds)
73  {
74  delete p.second->cloud;
75  delete p.second;
76  }
77  }
78 
79  virtual inline void render();
80 
81  void addCloud(PointCloud* pc);
82  void removeCloud(PointCloud* pc);
83 
84  pc_attr_it first() { return m_clouds.begin();}
85  pc_attr_it last() { return m_clouds.end();}
86 
87  //void exportAllPoints(string filename);
88 
89  virtual ModelPtr model();
90 private:
91 
92  void init(PointBufferPtr buffer);
93 
94  map<PointCloud*, PointCloudAttribute*> m_clouds;
95 };
96 
98 {
99  if(!m_active) return;
100  map<PointCloud*, PointCloudAttribute*>::iterator it;
101  for(it = m_clouds.begin(); it != m_clouds.end(); it++)
102  {
103  it->second->cloud->render();
104  }
105 }
106 
107 } // namespace lvr2
108 
109 #endif /* MULTIPOINTCLOUD_H_ */
map< PointCloud *, PointCloudAttribute * > pc_attr_map
map< PointCloud *, PointCloudAttribute * >::iterator pc_attr_it
void render()
map< PointCloud *, PointCloudAttribute * > m_clouds
std::shared_ptr< PointBuffer > PointBufferPtr
OutMapT< typename InMapT::HandleType, std::result_of_t< MapF(typename InMapT::ValueType)> > map(const InMapT &mapIn, MapF func)
Calls func for each value of the given map and save the result in the output map. ...
A color vertex.
Definition: ColorVertex.hpp:50
SharedPointer p
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80


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