Point Cloud Library (PCL)  1.10.1
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 
24 namespace Ui
25 {
26  class PCLViewer;
27 }
28 
29 class PCLViewer : public QMainWindow
30 {
31  Q_OBJECT
32 
33  public:
34  /** @brief Constructor */
35  explicit
36  PCLViewer (QWidget *parent = 0);
37 
38  /** @brief Destructor */
39  ~PCLViewer ();
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
52  axisChosen ();
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 };
point_types.h
PCLViewer::color_mode_
int color_mode_
Holds the color mode for colorCloudDistances.
Definition: pclviewer.h:69
PCLViewer::cloud_
PointCloudT::Ptr cloud_
The point cloud displayed.
Definition: pclviewer.h:63
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: projection_matrix.h:52
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition: point_types.hpp:620
PCLViewer::saveFileButtonPressed
void saveFileButtonPressed()
Triggered whenever the "Save file" button is clicked.
pcl::PointXYZRGBA
A point structure representing Euclidean xyz coordinates, and the RGBA color.
Definition: point_types.hpp:545
pcl::visualization::PCLVisualizer::Ptr
shared_ptr< PCLVisualizer > Ptr
Definition: pcl_visualizer.h:89
PCLViewer::colorCloudDistances
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...
Ui
Definition: ui_help_window.h:233
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:415
PCLViewer::lookUpTableChosen
void lookUpTableChosen()
Triggered whenever a button in the "Color mode" group is clicked.
PCLViewer
Definition: pclviewer.h:29
PCLViewer::loadFileButtonPressed
void loadFileButtonPressed()
Triggered whenever the "Load file" button is clicked.
PCLViewer::axisChosen
void axisChosen()
Triggered whenever a button in the "Color on axis" group is clicked.
PCLViewer::PCLViewer
PCLViewer(QWidget *parent=0)
Constructor.
PCLViewer::viewer_
pcl::visualization::PCLVisualizer::Ptr viewer_
The PCL visualizer object.
Definition: pclviewer.h:60
PCLViewer::filtering_axis_
int filtering_axis_
0 = x | 1 = y | 2 = z
Definition: pclviewer.h:66
PCLViewer::~PCLViewer
~PCLViewer()
Destructor.