Point Cloud Library (PCL) 1.12.0
pclviewer.h
1#pragma once
2
3// Qt
4#include <QMainWindow>
5#include <QFileDialog>
6
7// Point Cloud Library
8#include <pcl/point_cloud.h>
9#include <pcl/point_types.h>
10#include <pcl/io/ply_io.h>
11#include <pcl/io/pcd_io.h>
12#include <pcl/filters/filter.h>
13#include <pcl/visualization/pcl_visualizer.h>
14
15// Boost
16#include <boost/math/special_functions/round.hpp>
17
18// Visualization Toolkit (VTK)
19#include <vtkRenderWindow.h>
20
23
24namespace Ui
25{
26 class PCLViewer;
27}
28
29class PCLViewer : public QMainWindow
30{
31 Q_OBJECT
32
33 public:
34 /** @brief Constructor */
35 explicit
36 PCLViewer (QWidget *parent = 0);
37
38 /** @brief Destructor */
40
41 public Q_SLOTS:
42 /** @brief Triggered whenever the "Save file" button is clicked */
43 void
45
46 /** @brief Triggered whenever the "Load file" button is clicked */
47 void
49
50 /** @brief Triggered whenever a button in the "Color on axis" group is clicked */
51 void
53
54 /** @brief Triggered whenever a button in the "Color mode" group is clicked */
55 void
57
58 protected:
59 /** @brief The PCL visualizer object */
61
62 /** @brief The point cloud displayed */
64
65 /** @brief 0 = x | 1 = y | 2 = z */
67
68 /** @brief Holds the color mode for @ref colorCloudDistances */
70
71 /** @brief Color point cloud on X,Y or Z axis using a Look-Up Table (LUT)
72 * Computes a LUT and color the cloud accordingly, available color palettes are :
73 *
74 * Values are on a scale from 0 to 255:
75 * 0. Blue (= 0) -> Red (= 255), this is the default value
76 * 1. Green (= 0) -> Magenta (= 255)
77 * 2. White (= 0) -> Red (= 255)
78 * 3. Grey (< 128) / Red (> 128)
79 * 4. Blue -> Green -> Red (~ rainbow)
80 *
81 * @warning If there's an outlier in the data the color may seem uniform because of this outlier!
82 * @note A boost rounding exception error will be thrown if used with a non dense point cloud
83 */
84 void
86
87 private:
88 /** @brief ui pointer */
89 Ui::PCLViewer *ui;
90};
int color_mode_
Holds the color mode for colorCloudDistances.
Definition: pclviewer.h:69
int filtering_axis_
0 = x | 1 = y | 2 = z
Definition: pclviewer.h:66
PCLViewer(QWidget *parent=0)
Constructor.
PointCloudT::Ptr cloud_
The point cloud displayed.
Definition: pclviewer.h:63
void loadFileButtonPressed()
Triggered whenever the "Load file" button is clicked.
pcl::visualization::PCLVisualizer::Ptr viewer_
The PCL visualizer object.
Definition: pclviewer.h:60
~PCLViewer()
Destructor.
void saveFileButtonPressed()
Triggered whenever the "Save file" button is clicked.
void colorCloudDistances()
Color point cloud on X,Y or Z axis using a Look-Up Table (LUT) Computes a LUT and color the cloud acc...
void axisChosen()
Triggered whenever a button in the "Color on axis" group is clicked.
void lookUpTableChosen()
Triggered whenever a button in the "Color mode" group is clicked.
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:413
shared_ptr< PCLVisualizer > Ptr
Defines all the PCL implemented PointT point type structures.
Definition: pclviewer.h:25
A point structure representing Euclidean xyz coordinates, and the RGBA color.
A point structure representing Euclidean xyz coordinates, and the RGB color.