ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
point_painter.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <QtCore>
11 #include <QtOpenGL>
12 
13 namespace colmap {
14 
15 class PointPainter {
16 public:
17  PointPainter();
18  ~PointPainter();
19 
20  struct Data {
21  Data() : x(0), y(0), z(0), r(0), g(0), b(0), a(0) {}
22  Data(const float x_,
23  const float y_,
24  const float z_,
25  const float r_,
26  const float g_,
27  const float b_,
28  const float a_)
29  : x(x_), y(y_), z(z_), r(r_), g(g_), b(b_), a(a_) {}
30 
31  float x, y, z;
32  float r, g, b, a;
33  };
34 
35  void Setup();
36  void Upload(const std::vector<PointPainter::Data>& data);
37  void Render(const QMatrix4x4& pmv_matrix, const float point_size);
38 
39 private:
40  QOpenGLShaderProgram shader_program_;
41  QOpenGLVertexArrayObject vao_;
42  QOpenGLBuffer vbo_;
43 
44  size_t num_geoms_;
45 };
46 
47 } // namespace colmap
void Upload(const std::vector< PointPainter::Data > &data)
void Render(const QMatrix4x4 &pmv_matrix, const float point_size)
GraphType data
Definition: graph_cut.cc:138
Data(const float x_, const float y_, const float z_, const float r_, const float g_, const float b_, const float a_)
Definition: point_painter.h:22