99 vpDisplayPCL(
int posx = 0,
int posy = 0,
const std::string &window_name =
"");
100 vpDisplayPCL(
unsigned int width,
unsigned int height,
int posx = 0,
int posy = 0,
const std::string &window_name =
"");
104 void display(
const bool &blocking =
false);
106 void startThread(std::mutex &mutex, pcl::PointCloud<pcl::PointXYZ>::Ptr pointcloud,
const std::string &name =
"",
const vpColor &color =
vpColor::red);
107 void startThread(std::mutex &mutex, pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointcloud);
109 void addPointCloud(std::mutex &mutex, pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointcloud);
117 void insertLegend(
const size_t &
id);
119#ifndef DOXYGEN_SHOULD_SKIP_THIS
123 typedef struct PointCloudHandling
127 static unsigned int s_nb;
134 std::string createName()
136 std::stringstream ss;
137 ss <<
"Point cloud " << s_nb;
147 void init(
const std::string &name)
150 m_name = createName();
182 PointCloudHandling(
const std::string &name)
186 } PointCloudHandling;
188 typedef struct XYZPointCloudHandling :
public PointCloudHandling
190 pcl::PointCloud<pcl::PointXYZ>::Ptr m_pcl;
199 XYZPointCloudHandling(pcl::PointCloud<pcl::PointXYZ>::Ptr pcl,
const vpColor &color)
200 : PointCloudHandling()
212 XYZPointCloudHandling(pcl::PointCloud<pcl::PointXYZ>::Ptr pcl,
const std::string &name,
const vpColor &color)
213 : PointCloudHandling(name)
217 } XYZPointCloudHandling;
222 typedef struct ColoredPointCloudHandling :
public PointCloudHandling
224 pcl::PointCloud<pcl::PointXYZRGB>::Ptr m_pcl;
231 ColoredPointCloudHandling(pcl::PointCloud<pcl::PointXYZRGB>::Ptr pcl)
232 : PointCloudHandling()
242 ColoredPointCloudHandling(pcl::PointCloud<pcl::PointXYZRGB>::Ptr pcl,
const std::string &name)
243 : PointCloudHandling(name)
246 } ColoredPointCloudHandling;
250 bool m_thread_running;
252 std::thread m_thread;
253 std::mutex m_mutex_vector;
254 std::vector<std::pair<std::mutex &, XYZPointCloudHandling>> mv_xyz_pcl;
255 std::vector<pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZ>> mv_xyz_handlers;
256 std::vector<std::pair<std::mutex &, ColoredPointCloudHandling>> mv_colored_pcl;
257 std::vector<pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>> mv_color_handlers;
258 unsigned int m_width;
259 unsigned int m_height;
262 std::string m_window_name;
263 pcl::visualization::PCLVisualizer::Ptr m_viewer;
void addPointCloud(std::mutex &mutex, pcl::PointCloud< pcl::PointXYZ >::Ptr pointcloud, const std::string &name="", const vpColor &color=vpColor::red)
Insert a point cloud to display.