enh(viz): improve interaction with distance measurement tool
Description
SAddDistances
initializes the distance at image corners, this would be better to click the button, then click on the first point, then drag on the second point (like in every software...).
The service SAddDistances
adds the distances to the image fields and this addition is notified via a signal(s_DISTANCES_ADDED) emission.
Distances are defined as a vector of data::PointList
.
SAddDistances
, initially populates a data::pointList
with two data::Point
, one at the origin of the image and the other one at the opposite extremity of the image.
The distances are then displayed and made interactive in the scene via SImageMultiDistances
, an adaptor that connects s_DISTANCES_ADDED
signal with a slot SImageMultiDistances::addDistances()
.
Proposal
One suggestion would be to get rid of SAddDistances
and modify the SImageMultiDistances
adaptor to be able to click a point in the scene and drag.
Faster solution:
ModifySAddDistances
to allow clicking points instead of having 2 points at the corner of the image.- Modify
SImageMultiDistances
to add the distance dynamically.
Functional specifications
Simply be able to click and drag from the first point to the second point and draw a line between the 2 points. The distance should be displayed on the line (a text label that gets updated dynamically).
In other words, we should be able to click a point, then drag. The second point will only be created at the release of the left click.
- Remove
modifytheSAddDistance
and modifySImageMultiDistances
service.
Technical specifications:
-
SImageMultiDistances
- Edit
buttonPressEvent()
accordingly - Adapt
mouseMoveEvent()
accordingly - Adapt
buttonReleaseEvent()
accordingly
- Edit
Test plan
Tryout the modifications in Sightviewer