Point Cloud Library (PCL)  1.9.1-dev
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
44  saveFileButtonPressed ();
45 
46  /** @brief Triggered whenever the "Load file" button is clicked */
47  void
48  loadFileButtonPressed ();
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
56  lookUpTableChosen ();
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
85  colorCloudDistances ();
86 
87  private:
88  /** @brief ui pointer */
89  Ui::PCLViewer *ui;
90 };
Definition: pclviewer.h:24
PointCloudT::Ptr cloud_
The point cloud displayed.
Definition: pclviewer.h:63
A point structure representing Euclidean xyz coordinates, and the RGBA color.
Defines all the PCL implemented PointT point type structures.
int filtering_axis_
0 = x | 1 = y | 2 = z
Definition: pclviewer.h:66
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:411
pcl::visualization::PCLVisualizer::Ptr viewer_
The PCL visualizer object.
Definition: pclviewer.h:60
PointCloud represents the base class in PCL for storing collections of 3D points. ...
boost::shared_ptr< PCLVisualizer > Ptr
A point structure representing Euclidean xyz coordinates, and the RGB color.
int color_mode_
Holds the color mode for colorCloudDistances.
Definition: pclviewer.h:69