feat(ui): add possibility to remove fiducial distances from the current slice
Description
We should add the possibility to remove all added fiducial distances from the current slice.
Currently we have methods to remove all distances from all slice and on a selected distance.
For delete all distance, remove_all method will delete them from fiducial_sets then send a signal for remove_distances. It will remove distances from interface by calling destroy_distance.
For delete a selected distance, destroy_distance will delete him from the interface. Then remove_distance remove him from fiducial_sets. But the last step will send a signal for a third method remove_distances that will do nothing.
Proposal
Maybe it will be easier to make remove_distance not only remove from fiducials_sets but additionally call destroy_distance in it.
Then we can:
call remove_distance in remove_all on each distance.call remove_distance in remove_from_current_slice on each distance from slice.call remove_distance in the lambda function ofm_bin_button
, on the selected distance.
Functional specifications
When the user click on a remove distances button, it remove all the distances from the current slice.
Technical specifications
In the ruler.cpp:
-
Fix restrict_to_current_slice method to make it functional. -
Methods remove_all, remove_distances, remove_distance can be refactored (delete old code and avoid duplicated code).remove_distance should delete distance from fiducials_sets and call destroy_distance for delete from interface.
-
Add a remove_distances_from_current_slice method that call remove_distance.
Test plan
Manual testing and debug data to verify if the relevant fiducial data is being correctly deleted.