Loading...
Searching...
No Matches
pclviewer.h
#pragma once
// Qt
#include <QMainWindow>
#include <QFileDialog>
// Point Cloud Library
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/ply_io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/filter.h>
#include <pcl/visualization/pcl_visualizer.h>
// Boost
#include <boost/math/special_functions/round.hpp>
typedef pcl::PointXYZRGBA PointT;
typedef pcl::PointCloud<PointT> PointCloudT;
namespace Ui
{
class PCLViewer;
}
class PCLViewer : public QMainWindow
{
Q_OBJECT
public:
/** @brief Constructor */
explicit
PCLViewer (QWidget *parent = 0);
/** @brief Destructor */
~PCLViewer ();
public Q_SLOTS:
/** @brief Triggered whenever the "Save file" button is clicked */
void
saveFileButtonPressed ();
/** @brief Triggered whenever the "Load file" button is clicked */
void
loadFileButtonPressed ();
/** @brief Triggered whenever a button in the "Color on axis" group is clicked */
void
axisChosen ();
/** @brief Triggered whenever a button in the "Color mode" group is clicked */
void
lookUpTableChosen ();
protected:
/** @brief Rerender the view */
void
refreshView();
/** @brief The PCL visualizer object */
pcl::visualization::PCLVisualizer::Ptr viewer_;
/** @brief The point cloud displayed */
PointCloudT::Ptr cloud_;
/** @brief 0 = x | 1 = y | 2 = z */
int filtering_axis_;
/** @brief Holds the color mode for @ref colorCloudDistances */
int color_mode_;
/** @brief Color point cloud on X,Y or Z axis using a Look-Up Table (LUT)
* Computes a LUT and color the cloud accordingly, available color palettes are :
*
* Values are on a scale from 0 to 255:
* 0. Blue (= 0) -> Red (= 255), this is the default value
* 1. Green (= 0) -> Magenta (= 255)
* 2. White (= 0) -> Red (= 255)
* 3. Grey (< 128) / Red (> 128)
* 4. Blue -> Green -> Red (~ rainbow)
*
* @warning If there's an outlier in the data the color may seem uniform because of this outlier!
* @note A boost rounding exception error will be thrown if used with a non dense point cloud
*/
void
colorCloudDistances ();
private:
/** @brief ui pointer */
Ui::PCLViewer *ui;
};
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:173
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition point_cloud.h:413
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:557
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition point_types.hpp:623