本文整理汇总了C++中pcl::visualization::PCLVisualizer::getRenderWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ PCLVisualizer::getRenderWindow方法的具体用法?C++ PCLVisualizer::getRenderWindow怎么用?C++ PCLVisualizer::getRenderWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pcl::visualization::PCLVisualizer
的用法示例。
在下文中一共展示了PCLVisualizer::getRenderWindow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearView
/* \brief remove dynamic objects from the viewer
*
*/
void clearView()
{
//remove cubes if any
vtkRenderer *renderer = viz.getRenderWindow()->GetRenderers()->GetFirstRenderer();
while (renderer->GetActors()->GetNumberOfItems() > 0)
renderer->RemoveActor(renderer->GetActors()->GetLastActor());
//remove point clouds if any
viz.removePointCloud("cloud");
}
示例2: showCubes
/* \brief display octree cubes via vtk-functions
*
*/
void showCubes(double voxelSideLen)
{
//get the renderer of the visualizer object
vtkRenderer *renderer = viz.getRenderWindow()->GetRenderers()->GetFirstRenderer();
vtkSmartPointer<vtkAppendPolyData> treeWireframe = vtkSmartPointer<vtkAppendPolyData>::New();
size_t i;
double s = voxelSideLen / 2.0;
for (i = 0; i < displayCloud->points.size(); i++)
{
double x = displayCloud->points[i].x;
double y = displayCloud->points[i].y;
double z = displayCloud->points[i].z;
#if VTK_MAJOR_VERSION < 6
treeWireframe->AddInput(GetCuboid(x - s, x + s, y - s, y + s, z - s, z + s));
#else
treeWireframe->AddInputData (GetCuboid (x - s, x + s, y - s, y + s, z - s, z + s));
#endif
}
vtkSmartPointer<vtkActor> treeActor = vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
#if VTK_MAJOR_VERSION < 6
mapper->SetInput(treeWireframe->GetOutput());
#else
mapper->SetInputData (treeWireframe->GetOutput ());
#endif
treeActor->SetMapper(mapper);
treeActor->GetProperty()->SetColor(1.0, 1.0, 1.0);
treeActor->GetProperty()->SetLineWidth(2);
if(wireframe)
{
treeActor->GetProperty()->SetRepresentationToWireframe();
treeActor->GetProperty()->SetOpacity(0.35);
}
else
treeActor->GetProperty()->SetRepresentationToSurface();
renderer->AddActor(treeActor);
}