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

Method addCube

visualization/src/pcl_visualizer.cpp:2280–2309  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2278
2279////////////////////////////////////////////////////////////////////////////////////////////
2280bool
2281pcl::visualization::PCLVisualizer::addCube (const pcl::ModelCoefficients &coefficients,
2282 const std::string &id, int viewport)
2283{
2284 // Check to see if this ID entry already exists (has it been already added to the visualizer?)
2285 auto am_it = shape_actor_map_->find (id);
2286 if (am_it != shape_actor_map_->end ())
2287 {
2288 pcl::console::print_warn (stderr, "[addCube] A shape with id <%s> already exists! Please choose a different id and retry.\n", id.c_str ());
2289 return (false);
2290 }
2291
2292 if (coefficients.values.size () != 10)
2293 {
2294 PCL_WARN ("[addCube] Coefficients size does not match expected size (expected 10).\n");
2295 return (false);
2296 }
2297
2298 vtkSmartPointer<vtkDataSet> data = createCube (coefficients);
2299
2300 // Create an Actor
2301 vtkSmartPointer<vtkLODActor> actor;
2302 createActorFromVTKDataSet (data, actor);
2303 actor->GetProperty ()->SetRepresentationToSurface ();
2304 addActorToRenderer (actor, viewport);
2305
2306 // Save the pointer/ID pair to the global actor map
2307 (*shape_actor_map_)[id] = actor;
2308 return (true);
2309}
2310
2311////////////////////////////////////////////////////////////////////////////////////////////
2312bool

Callers 11

updateFunction · 0.80
visualizeFunction · 0.80
updateViewerFunction · 0.80
updateFunction · 0.80
toggleCubeMethod · 0.80
toggleCubeMethod · 0.80
toggleCubeFunction · 0.80
toggleCubeMethod · 0.80
pp_callbackMethod · 0.80
drawTBoundingBoxMethod · 0.80
mainFunction · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected