Hi again!
I found the problem myself. I defined
itkEventMacro( InteractionEvent, itk::AnyEvent );
to use for callbacks via itk::Observers. Unfortunately there is a new class
mitk::InteractionEvent so there was a name collision.
Worst error-message ever...
Thanks anyway!
Greets,
Markus
Von: Markus Engel [mailto:[email protected]]
Gesendet: Donnerstag, 27. Juni 2013 09:35
An: [email protected]
Betreff: [mitk-users] Implementing a custom interactor with the new
Interaction-Framework
Hi everyone!
I'm trying to extend the new mitkDisplayInteractor with some additional actions
that are executed when an additional modifier-key is pressed.
To do this, I created a new class that inherits from mitkDisplayInteractor and
uses the methods 'Move', 'Zoom'; 'Scroll', etc. of the baseclass.
My derived method ConnectActionsAndFunctions looks like this:
void mitk::FancyInteractor::ConnectActionsAndFunctions()
{
DisplayInteractor::ConnectActionsAndFunctions();
CONNECT_FUNCTION("setmodifier", SetModifier);
CONNECT_FUNCTION("unsetmodifier", UnSetModifier);
}
I have implemented the two methods and everything works like a charm.
However, I had implemented the class in MITKCore (where it does not belong) and
moved the class to my own module.
Although the class has not been modified I get compile errors now:
ExtendedDisplayInteractor.cpp(26) : error C2664:
'mitk::EventStateMachine::AddActionFunction' : cannot convert parameter 2 from
'mitk::MessageDelegate2<R,T,U,A>' to 'const
mitk::EventStateMachine::ActionFunctionDelegate &'
1> with
1> [
1> R=mitk::ExtendedDisplayInteractor::Self,
1> T=mitk::StateMachineAction *,
1> U=mitk::ExtendedDisplayInteractor::InteractionEvent *,
1> A=bool
1> ]
1> Reason: cannot convert from 'mitk::MessageDelegate2<R,T,U,A>' to
'const mitk::EventStateMachine::ActionFunctionDelegate'
1> with
1> [
1> R=mitk::ExtendedDisplayInteractor::Self,
1> T=mitk::StateMachineAction *,
1> U=mitk::ExtendedDisplayInteractor::InteractionEvent *,
1> A=bool
1> ]
1> No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
Has anyone stumbled across a similar problem or knows what I could try to fix
this?
Thanks in advance!
Markus
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users