////////////////////////////////////////////////////////////////////////////////////////
| 865 | |
| 866 | ///////////////////////////////////////////////////////////////////////////////////////////// |
| 867 | bool |
| 868 | pcl::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 | ///////////////////////////////////////////////////////////////////////////////////////////// |
| 917 | bool |
no test coverage detected