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

Method removeShape

visualization/src/pcl_visualizer.cpp:867–914  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

865
866/////////////////////////////////////////////////////////////////////////////////////////////
867bool
868pcl::visualization::PCLVisualizer::removeShape (const std::string &id, int viewport)
869{
870 // Check to see if the given ID entry exists
871 auto am_it = shape_actor_map_->find (id);
872 // Extra step: check if there is a cloud with the same ID
873 auto ca_it = cloud_actor_map_->find (id);
874
875 bool shape = true;
876 // Try to find a shape first
877 if (am_it == shape_actor_map_->end ())
878 {
879 // There is no cloud or shape with this ID, so just exit
880 if (ca_it == cloud_actor_map_->end ())
881 return (false);
882 // Cloud found, set shape to false
883 shape = false;
884 }
885
886 // Remove the pointer/ID pair to the global actor map
887 if (shape)
888 {
889 if (removeActorFromRenderer (am_it->second, viewport))
890 {
891 bool update_LUT (true);
892 if (!style_->lut_actor_id_.empty() && am_it->first != style_->lut_actor_id_)
893 update_LUT = false;
894 shape_actor_map_->erase (am_it);
895 if (update_LUT)
896 style_->updateLookUpTableDisplay (false);
897 return (true);
898 }
899 }
900 else
901 {
902 if (removeActorFromRenderer (ca_it->second.actor, viewport))
903 {
904 bool update_LUT (true);
905 if (!style_->lut_actor_id_.empty() && ca_it->first != style_->lut_actor_id_)
906 update_LUT = false;
907 cloud_actor_map_->erase (ca_it);
908 if (update_LUT)
909 style_->updateLookUpTableDisplay (false);
910 return (true);
911 }
912 }
913 return (false);
914}
915
916/////////////////////////////////////////////////////////////////////////////////////////////
917bool

Callers 15

showLegendMethod · 0.80
updateFunction · 0.80
runDisplayMethod · 0.80
toggleCubeMethod · 0.80
toggleCubeMethod · 0.80
removeCameraFunction · 0.80
toggleCubeFunction · 0.80
toggleCubeMethod · 0.80
runMethod · 0.80
viz_cbMethod · 0.80

Calls 5

eraseMethod · 0.80
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected