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>
67 class VISP_EXPORT vpPclViewer
70 typedef typename pcl::PointXYZRGB pclPointXYZRGB;
71 typedef typename pcl::PointCloud<pclPointXYZRGB> pclPointCloudPointXYZRGB;
72 typedef typename pclPointCloudPointXYZRGB::Ptr pclPointCloudPointXYZRGBPtr;
77 typedef struct legendParams
99 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);
107 void setNameWindow(
const std::string &nameWindow);
114 void setOutFolder(
const std::string &outputFolder);
121 void setIgnoreThreshold(
const double &thresh);
131 unsigned int addSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const std::string &name =
"",
const std::vector<unsigned char> &v_color = std::vector<unsigned char>());
143 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>());
152 void updateSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id,
const bool &hasToKeepColor =
false);
162 void updateSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id,
const vpColVector &weights,
const bool &hasToKeepColor =
false);
175 void refresh(
const int &timeout = 100,
const bool &waitForDrawing =
true);
195 void threadUpdateSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id);
204 void threadUpdateSurfaceOriginalColor(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id);
214 void threadUpdateSurface(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id,
const vpColVector &weights);
224 void threadUpdateSurfaceOriginalColor(
const pclPointCloudPointXYZRGB::Ptr &surface,
const unsigned int &
id,
const vpColVector &weights);
233 static void runThread(vpPclViewer *p_viewer);
241 std::vector<pclPointCloudPointXYZRGB::Ptr> m_vPointClouds;
242 static pcl::visualization::PCLVisualizer::Ptr sp_viewer;
243 static std::vector<std::vector<double>> s_vhandler;
248 static double s_ignoreThresh;
249 std::vector<std::string> m_vmeshid;
250 std::vector<legendParams> m_vlegends;
251 std::vector<std::mutex *> m_vpmutex;
252 std::vector<vpColVector> m_vweights;
253 std::thread m_threadDisplay;
256 bool m_hasToSavePCDs;
257 std::string m_outFolder;
Implementation of column vector and the associated operations.
void display(vpImage< unsigned char > &I, const std::string &title)
Display a gray-scale image.