本文整理汇总了C++中pcl::visualization::PCLVisualizer::setShapeRenderingProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ PCLVisualizer::setShapeRenderingProperties方法的具体用法?C++ PCLVisualizer::setShapeRenderingProperties怎么用?C++ PCLVisualizer::setShapeRenderingProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pcl::visualization::PCLVisualizer
的用法示例。
在下文中一共展示了PCLVisualizer::setShapeRenderingProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void pcl::people::PersonCluster<PointT>::drawTBoundingBox (pcl::visualization::PCLVisualizer& viewer, int person_number)
{
// draw theoretical person bounding box in the PCL viewer:
pcl::ModelCoefficients coeffs;
// translation
coeffs.values.push_back (tcenter_[0]);
coeffs.values.push_back (tcenter_[1]);
coeffs.values.push_back (tcenter_[2]);
// rotation
coeffs.values.push_back (0.0);
coeffs.values.push_back (0.0);
coeffs.values.push_back (0.0);
coeffs.values.push_back (1.0);
// size
if (vertical_)
{
coeffs.values.push_back (height_);
coeffs.values.push_back (0.5);
coeffs.values.push_back (0.5);
}
else
{
coeffs.values.push_back (0.5);
coeffs.values.push_back (height_);
coeffs.values.push_back (0.5);
}
std::stringstream bbox_name;
bbox_name << "bbox_person_" << person_number;
viewer.removeShape (bbox_name.str());
viewer.addCube (coeffs, bbox_name.str());
viewer.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, bbox_name.str());
viewer.setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 2, bbox_name.str());
// std::stringstream confid;
// confid << person_confidence_;
// PointT position;
// position.x = tcenter_[0]- 0.2;
// position.y = ttop_[1];
// position.z = tcenter_[2];
// viewer.addText3D(confid.str().substr(0, 4), position, 0.1);
}
示例2: updateVisualizer
void updateVisualizer(pcl::visualization::PCLVisualizer& visualizer)
{
if(pairs_.empty()) return;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
for(list::iterator it = pairs_.begin(); it != pairs_.end(); ++it)
{
cloud->points.push_back(it->second);
}
for(list::reverse_iterator it = pairs_.rbegin(); it != pairs_.rend(); ++it)
{
cloud->points.push_back(it->second);
}
visualizer.removeShape(name());
visualizer.addPolygon<pcl::PointXYZ>(cloud, name());
visualizer.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, color().r, color().g, color().b, name());
visualizer.setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_LINE_WIDTH, 4, name());
}