33#ifndef VP_PCL_VIEWER_H
34#define VP_PCL_VIEWER_H
36#include <visp3/core/vpConfig.h>
38#if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_VISUALIZATION) && defined(VISP_HAVE_PCL_IO) && defined(VISP_HAVE_THREADS)
44#include <visp3/core/vpColVector.h>
47#include <pcl/visualization/pcl_visualizer.h>
94 vpPclViewer(
const std::string &title,
const int &width = 640,
const int &height = 480,
const int &posU = 720,
const int &posV = 560,
const std::string &outFolder = std::string(),
const double &ignoreThreshold = 0.95);
126 unsigned int addSurface(
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &surface,
const std::string &name =
"",
127 const std::vector<unsigned char> &v_color = std::vector<unsigned char>());
140 const std::string &name =
"",
141 const std::vector<unsigned char> &v_color = std::vector<unsigned char>());
150 void updateSurface(
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &surface,
const unsigned int &
id,
151 const bool &hasToKeepColor =
false);
161 void updateSurface(
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &surface,
const unsigned int &
id,
162 const vpColVector &weights,
const bool &hasToKeepColor =
false);
Implementation of column vector and the associated operations.
static void runThread(vpPclViewer *p_viewer)
Internal method that is called by vpPclViewer::launchThread to launch the drawing thread.
void threadUpdateSurfaceOriginalColor(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const vpColVector &weights)
Method to update a point cloud known by the viewer when the drawing thread is running....
void display(const bool &blocking=false)
Blocking-mode display of the viewer.
void loopThread()
The internal loop of the non-blocking drawing thread.
void updateSurface(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const bool &hasToKeepColor=false)
Update the surface known by id by the viewer.
vpPclViewer(const std::string &title, const int &width=640, const int &height=480, const int &posU=720, const int &posV=560, const std::string &outFolder=std::string(), const double &ignoreThreshold=0.95)
Construct a new vpPclViewer object.
void updateSurface(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const vpColVector &weights, const bool &hasToKeepColor=false)
Update the surface known by id by the viewer.
std::thread m_threadDisplay
void setOutFolder(const std::string &outputFolder)
Set the path to the output folder. If different from the empty string, the point clouds will be saved...
std::vector< std::mutex * > m_vpmutex
std::vector< std::string > m_vmeshid
std::vector< vpColVector > m_vweights
void threadUpdateSurface(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const vpColVector &weights)
Method to update a point cloud known by the viewer when the drawing thread is running....
void launchThread()
Start the drawing thread that permits to have a non-blocking display.
void setNameWindow(const std::string &nameWindow)
Set the name of the PCL viewer window.
void threadUpdateSurfaceOriginalColor(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id)
Method to update a point cloud known by the viewer when the drawing thread is running....
void threadUpdateSurface(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id)
Method to update a point cloud known by the viewer when the drawing thread is running....
std::vector< std::vector< double > > m_vhandler
unsigned int addSurface(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const std::string &name="", const std::vector< unsigned char > &v_color=std::vector< unsigned char >())
Add a surface to the list of point clouds known by the viewer.
unsigned int addSurface(const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const vpColVector &weights, const std::string &name="", const std::vector< unsigned char > &v_color=std::vector< unsigned char >())
Add a surface to the list of point clouds known by the viewer. The points whose weights are below the...
std::vector< pcl::PointCloud< pcl::PointXYZRGB >::Ptr > m_vPointClouds
std::vector< legendParams > m_vlegends
void stopThread()
Stop the drawing thread that permits to have a non-blocking display.
pcl::visualization::PCLVisualizer::Ptr mp_viewer
void setIgnoreThreshold(const double &thresh)
Set the threshold below which a point must be displayed in black.
Structure that contains all the required parameters to display a legend on the viewer.