Point Cloud Library (PCL) 1.12.1
Loading...
Searching...
No Matches
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
20
21namespace Ui
22{
23 class PCLViewer;
24}
25
26class PCLViewer : public QMainWindow
27{
28 Q_OBJECT
29
30 public:
31 /** @brief Constructor */
32 explicit
33 PCLViewer (QWidget *parent = 0);
34
35 /** @brief Destructor */
37
38 public Q_SLOTS:
39 /** @brief Triggered whenever the "Save file" button is clicked */
40 void
42
43 /** @brief Triggered whenever the "Load file" button is clicked */
44 void
46
47 /** @brief Triggered whenever a button in the "Color on axis" group is clicked */
48 void
50
51 /** @brief Triggered whenever a button in the "Color mode" group is clicked */
52 void
54
55 protected:
56 /** @brief Rerender the view */
57 void
59
60 /** @brief The PCL visualizer object */
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
87
88 private:
89 /** @brief ui pointer */
90 Ui::PCLViewer *ui;
91};
void refreshView()
Rerender the view.
int color_mode_
Holds the color mode for colorCloudDistances.
Definition pclviewer.h:70
int filtering_axis_
0 = x | 1 = y | 2 = z
Definition pclviewer.h:67
PCLViewer(QWidget *parent=0)
Constructor.
PointCloudT::Ptr cloud_
The point cloud displayed.
Definition pclviewer.h:64
void loadFileButtonPressed()
Triggered whenever the "Load file" button is clicked.
pcl::visualization::PCLVisualizer::Ptr viewer_
The PCL visualizer object.
Definition pclviewer.h:61
~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.
Iterator class for point clouds with or without given indices.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< PCLVisualizer > Ptr
Defines all the PCL implemented PointT point type structures.
Definition pclviewer.h:22
A point structure representing Euclidean xyz coordinates, and the RGBA color.
A point structure representing Euclidean xyz coordinates, and the RGB color.