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_ */
lvr2::PointCloudAttribute
Definition: MultiPointCloud.hpp:51
lvr2::MultiPointCloud::model
virtual ModelPtr model()
Definition: MultiPointCloud.cpp:120
lvr2::MultiPointCloud::last
pc_attr_it last()
Definition: MultiPointCloud.hpp:85
lvr2::MultiPointCloud::MultiPointCloud
MultiPointCloud(ModelPtr model, string name="<unnamed point cloud>")
Definition: MultiPointCloud.cpp:40
lvr2::MultiPointCloud::removeCloud
void removeCloud(PointCloud *pc)
Definition: MultiPointCloud.cpp:115
lvr2::PointBufferPtr
std::shared_ptr< PointBuffer > PointBufferPtr
Definition: PointBuffer.hpp:130
lvr2::pc_attr_map
map< PointCloud *, PointCloudAttribute * > pc_attr_map
Definition: MultiPointCloud.hpp:59
lvr2::MultiPointCloud::first
pc_attr_it first()
Definition: MultiPointCloud.hpp:84
p
SharedPointer p
Definition: ConvertShared.hpp:42
lvr2::MultiPointCloud::render
virtual void render()
Definition: MultiPointCloud.hpp:97
lvr2::pc_attr_it
map< PointCloud *, PointCloudAttribute * >::iterator pc_attr_it
Definition: MultiPointCloud.hpp:60
lvr2::MultiPointCloud::m_clouds
map< PointCloud *, PointCloudAttribute * > m_clouds
Definition: MultiPointCloud.hpp:94
lvr2::map
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.
lvr2::MultiPointCloud
Definition: MultiPointCloud.hpp:62
lvr2::MultiPointCloud::~MultiPointCloud
virtual ~MultiPointCloud()
Definition: MultiPointCloud.hpp:70
lvr2::Renderable
Definition: Renderable.hpp:65
lvr2::Renderable::m_active
bool m_active
Definition: Renderable.hpp:144
lvr2::PointCloud
Definition: PointCloud.hpp:59
lvr2::MultiPointCloud::init
void init(PointBufferPtr buffer)
Definition: MultiPointCloud.cpp:54
lvr2::MultiPointCloud::addCloud
void addCloud(PointCloud *pc)
Definition: MultiPointCloud.cpp:107
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::ModelPtr
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80
lvr2::PointCloudAttribute::active
bool active
Definition: MultiPointCloud.hpp:56
lvr2::PointCloudAttribute::PointCloudAttribute
PointCloudAttribute()
Definition: MultiPointCloud.hpp:53
lvr2::ColorVertex
A color vertex.
Definition: ColorVertex.hpp:50
lvr2::PointCloudAttribute::marked
bool marked
Definition: MultiPointCloud.hpp:55
lvr2::PointCloudAttribute::cloud
PointCloud * cloud
Definition: MultiPointCloud.hpp:54
PointCloud.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:24