InteractivePointCloud.cpp
Go to the documentation of this file.
1 
28 /*
29  * InteractivePointCloud.cpp
30  *
31  * Created on: 02.04.2012
32  * Author: Thomas Wiemann
33  */
34 
36 
37 namespace lvr2
38 {
39 
41 {
43  Vec(-8, -8, -8),
44  Vec(8, 8, 8)
45  );
46 
48 }
49 
51 {
53  Vec(-8, -8, -8),
54  Vec(8, 8, 8)
55  );
56 
57  updateBuffer(buffer);
58 }
59 
60 
62 {
63 
64 }
65 
67 {
68  if(m_buffer)
69  {
70  glColor3f(1.0, 0.0, 0.0);
71  glDrawArrays(GL_POINTS, 0, m_buffer->numPoints());
72  }
73 }
74 
76 {
77  if(buffer)
78  {
79  if(!m_boundingBox)
80  {
82  m_boundingBox->expand(Vec(8000, 8000, 8000));
83  }
84 
85  size_t num_vertices = buffer->numPoints();
86  float* vertices = buffer->getPointArray().get();
87 
88 // m_boundingBox = new BoundingBox<Vertex<float> >;
89 // for (int i = 0; i < int(num_vertices); i++)
90 // {
91 // int index = 3 * i;
92 // m_boundingBox->expand(vertices[index], vertices[index + 1], vertices[index + 2]);
93 // }
94 
95  glVertexPointer(3, GL_FLOAT, 0, vertices);
96  m_buffer = buffer;
97  }
98 }
99 
100 } /* namespace lvr2 */
void updateBuffer(PointBufferPtr buffer)
BaseVector< float > Vec
Definition: Renderable.hpp:69
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
BoundingBox< Vec > * m_boundingBox
Definition: Renderable.hpp:165


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