35 #ifndef _vpPclViewer_h_
36 #define _vpPclViewer_h_
38 #include <visp3/core/vpConfig.h>
40 #if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_VISUALIZATION) && defined(VISP_HAVE_THREADS)
46 #include <visp3/core/vpColVector.h>
49 #include <pcl/visualization/pcl_visualizer.h>
100 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);
132 unsigned int addSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const std::string &name =
"",
const std::vector<unsigned char> &v_color = std::vector<unsigned char>());
144 unsigned int addSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const vpColVector &weights,
const std::string &name =
"",
const std::vector<unsigned char> &v_color = std::vector<unsigned char>());
153 void updateSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id,
const bool &hasToKeepColor =
false);
163 void updateSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id,
const vpColVector &weights,
const bool &hasToKeepColor =
false);
176 void refresh(
const int &timeout = 100,
const bool &waitForDrawing =
true);
243 static pcl::visualization::PCLVisualizer::Ptr
sp_viewer;
Implementation of column vector and the associated operations.
unsigned int addSurface(const pclPointCloudPointXYZRGB::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...
static void runThread(vpPclViewer *p_viewer)
Internal method that is called by vpPclViewer::launchThread to launch the drawing thread.
void updateSurface(const pclPointCloudPointXYZRGB::Ptr &surface, const unsigned int &id, const vpColVector &weights, const bool &hasToKeepColor=false)
Update the surface known by id by the viewer.
void display()
Blocking-mode display of the viewer.
void threadUpdateSurfaceOriginalColor(const pclPointCloudPointXYZRGB::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....
pcl::PointCloud< pclPointXYZRGB > pclPointCloudPointXYZRGB
static pcl::visualization::PCLVisualizer::Ptr sp_viewer
void loopThread()
The internal loop of the non-blocking drawing thread.
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.
static double s_ignoreThresh
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
pcl::PointXYZRGB pclPointXYZRGB
void refresh(const int &timeout=100, const bool &waitForDrawing=true)
Refresh the display.
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.
static std::vector< std::vector< double > > s_vhandler
pclPointCloudPointXYZRGB::Ptr pclPointCloudPointXYZRGBPtr
void updateSurface(const pclPointCloudPointXYZRGB::Ptr &surface, const unsigned int &id, const bool &hasToKeepColor=false)
Update the surface known by id by the viewer.
void threadUpdateSurface(const pclPointCloudPointXYZRGB::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....
unsigned int addSurface(const pclPointCloudPointXYZRGB::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.
std::vector< legendParams > m_vlegends
void threadUpdateSurfaceOriginalColor(const pclPointCloudPointXYZRGB::Ptr &surface, const unsigned int &id)
Method to update a point cloud known by the viewer when the drawing thread is running....
void stopThread()
Stop the drawing thread that permits to have a non-blocking display.
void threadUpdateSurface(const pclPointCloudPointXYZRGB::Ptr &surface, const unsigned int &id)
Method to update a point cloud known by the viewer when the drawing thread is running....
std::vector< pclPointCloudPointXYZRGB::Ptr > m_vPointClouds
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.