Page MenuHomePhabricator

PlanarFigureInteractor has to give priority to 'placed' PlanarFigures
Closed, ResolvedPublic

Description

In the CanHandleEvent() method, the PlanarFigureInteractor cannot increase the returnvalue.

Thus, a PlanarFigure that has not yet been placed but is already 'selected' (in bool-property) has priority to a PlanarFigure that is already placed.

In effect, you cannot select or modify an existing PlanarFigure if you would be able to create a new one.

Event Timeline

New remote branch pushed: bug-13721-planarfigure-picking

In the current version it is not clear why a "placed" figure gets a smaller relevance value than a "selected" figure. I guess the selected case should also consider whether or not the figure is "placed" and increase its relevance in that case.

In any case, the relevance values should be documented on the class level, i.e. what state gets what relevance and why?

Updating target milestone to upcoming release

[461161]: Merge branch 'bug-13721-planarfigure-picking'

Merged commits:

2013-01-16 15:01:02 Markus Engel [fa18b9]
updated documentation on the logic behind canHandleEvent of this interactor


2012-11-23 15:03:41 Markus Engel [aa8bd4]
corrected logic of event handling in PlanarFigureInteractor


2012-11-23 14:38:38 Daniel Maleike [c525da]
Re-order relevances to make things more readable


2012-11-23 13:53:13 Markus Engel [2a0af2]
improved event handling priorities of PlanarFigureInteractor

I have updated the logic of PlanarFigureInteractor::CanhandleEvent() to give priority to placed figures instead of selected (but not placed) figures. This fixes the wrong picking behaviour.

The logic is as follows:

Incoming events are NOT handled -> 0.0 is returned
if

  • the incoming event is NOT a mitk::PositionEvent
  • this statemachine has no transition for the incoming event in the current state
  • the current position (in world coordinates) of the incoming event is further away from the planarFigure geometry than the planeThickness

If the planarFigure is

  • selected but NOT placed (on click a new planarFigure will be created) -> 0.6 is returned
  • placed but NOT selected (picking of existing planarFigures) -> 0.7 is returned
  • placed AND selected (editing of selected planarFigure) -> 0.75 is returned

Thus, you rather pick existing figures than create a new one.

The same documentation has also been added to the PlanarFigureInteractor!