Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
doc
tutorials
content
sources
qt_colorize_cloud
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
typedef
pcl::PointXYZRGBA
PointT;
19
typedef
pcl::PointCloud<PointT>
PointCloudT;
20
21
namespace
Ui
22
{
23
class
PCLViewer
;
24
}
25
26
class
PCLViewer
:
public
QMainWindow
27
{
28
Q_OBJECT
29
30
public
:
31
/** @brief Constructor */
32
explicit
33
PCLViewer
(QWidget *parent = 0);
34
35
/** @brief Destructor */
36
~PCLViewer
();
37
38
public
Q_SLOTS:
39
/** @brief Triggered whenever the "Save file" button is clicked */
40
void
41
saveFileButtonPressed
();
42
43
/** @brief Triggered whenever the "Load file" button is clicked */
44
void
45
loadFileButtonPressed
();
46
47
/** @brief Triggered whenever a button in the "Color on axis" group is clicked */
48
void
49
axisChosen
();
50
51
/** @brief Triggered whenever a button in the "Color mode" group is clicked */
52
void
53
lookUpTableChosen
();
54
55
protected
:
56
/** @brief Rerender the view */
57
void
58
refreshView
();
59
60
/** @brief The PCL visualizer object */
61
pcl::visualization::PCLVisualizer::Ptr
viewer_
;
62
63
/** @brief The point cloud displayed */
64
PointCloudT::Ptr
cloud_
;
65
66
/** @brief 0 = x | 1 = y | 2 = z */
67
int
filtering_axis_
;
68
69
/** @brief Holds the color mode for @ref colorCloudDistances */
70
int
color_mode_
;
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
};
PCLViewer
Definition
pclviewer.h:27
PCLViewer::refreshView
void refreshView()
Rerender the view.
PCLViewer::color_mode_
int color_mode_
Holds the color mode for colorCloudDistances.
Definition
pclviewer.h:70
PCLViewer::filtering_axis_
int filtering_axis_
0 = x | 1 = y | 2 = z
Definition
pclviewer.h:67
PCLViewer::PCLViewer
PCLViewer(QWidget *parent=0)
Constructor.
PCLViewer::cloud_
PointCloudT::Ptr cloud_
The point cloud displayed.
Definition
pclviewer.h:64
PCLViewer::loadFileButtonPressed
void loadFileButtonPressed()
Triggered whenever the "Load file" button is clicked.
PCLViewer::viewer_
pcl::visualization::PCLVisualizer::Ptr viewer_
The PCL visualizer object.
Definition
pclviewer.h:61
PCLViewer::~PCLViewer
~PCLViewer()
Destructor.
PCLViewer::saveFileButtonPressed
void saveFileButtonPressed()
Triggered whenever the "Save file" button is clicked.
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...
PCLViewer::axisChosen
void axisChosen()
Triggered whenever a button in the "Color on axis" group is clicked.
PCLViewer::lookUpTableChosen
void lookUpTableChosen()
Triggered whenever a button in the "Color mode" group is clicked.
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition
point_cloud.h:414
pcl::visualization::PCLVisualizer::Ptr
shared_ptr< PCLVisualizer > Ptr
Definition
pcl_visualizer.h:96
point_types.h
Defines all the PCL implemented PointT point type structures.
Ui
Definition
pclviewer.h:22
pcl::PointXYZRGBA
A point structure representing Euclidean xyz coordinates, and the RGBA color.
Definition
point_types.hpp:528