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