MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / addSphere

Method addSphere

visualization/src/pcl_visualizer.cpp:2398–2427  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2396
2397////////////////////////////////////////////////////////////////////////////////////////////
2398bool
2399pcl::visualization::PCLVisualizer::addSphere (const pcl::ModelCoefficients &coefficients,
2400 const std::string &id, int viewport)
2401{
2402 // Check to see if this ID entry already exists (has it been already added to the visualizer?)
2403 auto am_it = shape_actor_map_->find (id);
2404 if (am_it != shape_actor_map_->end ())
2405 {
2406 pcl::console::print_warn (stderr, "[addSphere] A shape with id <%s> already exists! Please choose a different id and retry.\n", id.c_str ());
2407 return (false);
2408 }
2409
2410 if (coefficients.values.size () != 4)
2411 {
2412 PCL_WARN ("[addSphere] Coefficients size does not match expected size (expected 4).\n");
2413 return (false);
2414 }
2415
2416 vtkSmartPointer<vtkDataSet> data = createSphere (coefficients);
2417
2418 // Create an Actor
2419 vtkSmartPointer<vtkLODActor> actor;
2420 createActorFromVTKDataSet (data, actor);
2421 actor->GetProperty ()->SetRepresentationToSurface ();
2422 addActorToRenderer (actor, viewport);
2423
2424 // Save the pointer/ID pair to the global actor map
2425 (*shape_actor_map_)[id] = actor;
2426 return (true);
2427}
2428
2429////////////////////////////////////////////////////////////////////////////////////////////
2430bool

Callers 10

runFunction · 0.45
updateViewerFunction · 0.45
pp_callbackMethod · 0.45
pp_callbackMethod · 0.45
runFunction · 0.45
displayHeadsFunction · 0.45
viewerOneOffFunction · 0.45
shapesVisFunction · 0.45

Calls 3

findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected