Page MenuHomePhabricator

Adapt PlanarFigureInteractor to new interaction framework
Closed, ResolvedPublic

Description

The existing PlanarFigureInteractor has to be adapted to the new MITK interaction framework.

The interactor has to be adapted, as currently all actions are implemented in one large method ::ExecuteAction(). This shall be split into many small methods, one for each action.

The statemachine needs to be adapted as well, we can now use more fitting names for the states, events and actions as we are not bound to the event- /action- definitions in InteractionConsts.h

A new interaction config needs to be created that represents the current default interaction with the new PlanarFigureInteraction statemachine.

Event Timeline

New remote branch pushed: bug-15546-adapt-planarfigureinteractor

I have pushed a first version of the adapted PlanarFigureInteractor with branch 'bug-15546-adapt-planarfigureinteractor'.

I had to create a new class of InteractionEvent, the 'ExtendedInternalEvent'. In the PlanarFigureInteractor, we use InternalEvents quite often to switch between states depending on an internal state (e.g. is figure selected, minimal number of control-points reached, etc.).
This could usually be done by using the mitkInternalEvent. However, the actions that follow these InternalEvents need the original InteractionEvent to get the cursor-position. To fix this, I have added the 'ExtendedInternalEvent' that is basically an InternalEvent but also references an InteractionEvent*.

Thus the Interactor can use internal events and still have the position-information of the original InteractionEvent.

Furthermore I had to change the logic on when the actual state is changed during a transition.
So far, the state has been changed after the actions have been executed and only when this was successful.
Basically, the change of states should not be dependend on the 'success' of a transition. At some points in the PlanarFigureInteractor stateMachine we want other Interactors to get the same event although we have used the event and want to switch states.

an example:
There is a transition that checks if the cursor is currently hovering above the figure. Depending on the result, an internal event 'Yes' or 'No' is queued that lead to different states.
In order to switch into the 'no-State' we have to return the success 'true' because we have used the event. This means that no other interactor will be given the event, although this other interactor might be a second PlanarFigureInteractor of a figure above which we are actually hovering.

Thus it would only be possible to interact with the basedata that has the highest layer.

By switching the state independend on the 'success' we switch into the 'no-state' and still give the event along to other interactors.

New remote branch pushed: bug-15546-adapt-planarfigureinteractor-new

[995096]: Merge branch 'bug-15546-adapt-planarfigureinteractor-new'

Merged commits:

2013-08-06 13:23:48 Markus Engel [d5186a]
using new PlanarFigureInteractor at all places in open source


2013-08-06 12:47:47 Markus Engel [6a60c2]
not overwriting previously defined outputs


2013-08-06 12:47:28 Markus Engel [c33398]
only adding sub-dir 'testing' if build_testing is on


2013-08-06 12:46:43 Markus Engel [adb78f]
using new PlanarFigureInteractor in MeasurementView


2013-08-06 12:46:22 Markus Engel [d4ae8c]
adapted PlanarFigureInteractor to new framework


2013-08-06 12:45:58 Markus Engel [6c8457]
added new XML files to resources of PlanarFigure-module

The PlanarFigureInteractor has been completely ported to the new interaction framework.

I have used the new mechanism of conditions to increase readability of the statemachine pattern in the XML.

Everything works now...

[b09d87]: Merge branch 'bug-15546-adapt-planarfigureinteractor-new'

Merged commits:

2013-08-07 17:19:09 Markus Engel [84fdcd]
COMP: fixed dynamic casting for PlanarFigureInteractors

The PlaanrFigureInteractor has been completely ported to the new interaction framework. Everything works fine now..