Hi Christian,
I have tried, but I could not change the display interaction configuration
from our application. I added the code to the Activated and Deactivated
function of our tool. Although it loaded my configuration, in one of the
two cases (don't remember if it was the activation or deactivation) it was
then overwritten by the mitk::ToolManager::ActivateTool() function.
In my point, the interaction configuration xml file in MITK is also MITK
source code, since I can change it in our MITK fork, not in our app. We
would like to diverge from the upstream as little as possible.
I meant the RESOURCE_FILES section of the files.cmake, which are not Qt
resources.
I'm not sure what would be the ideal solution for this problem.
Regards,
Miklos
On Sun, Mar 31, 2013 at 3:32 PM, Weber, Christian(1) <
[email protected]> wrote:
> Hi Miklos,
>
> yes, this would work. But you can modify the one in the resources, as this
> file was introduced to allow you to modify the behavior without chaning the
> source code.
> But your version works as well.
> Just as a note, I'm unsure what you mean by Qt resources, to include the
> OurCustomDisplayConfigMITKTools.xml you have to add it winthin the
> files.cmake into the very last section.
>
> Regards,
> Christian
> ________________________________________
> From: Miklos Espak [[email protected]]
> Sent: Thursday, March 28, 2013 11:52 PM
> To: Weber, Christian(1)
> Cc: mitk-users
> Subject: Re: [mitk-users] GlobalInteraction::INFORM_ONE
>
> Thank you so much Christian, this works very well!
>
> Am I right that if I want to disable the middle button move with the tools
> through the MITK API instead of modifying the xml in the MITK sources, then
> I have to put the following code fragment after (or instead) setting the
> notification policy to INFORM_ONE?
>
> std::list<mitk::ServiceReference> listEventObserver;
> ServiceTracker<InteractionEventObserver*>* eventObserverTracker=
> new ServiceTracker<InteractionEventObserver*>(GetModuleContext());
> eventObserverTracker->Open();
> eventObserverTracker->GetServiceReferences(listEventObserver);
> for (std::list<mitk::ServiceReference>::iterator it =
> listEventObserver.begin(); it != listEventObserver.end(); ++it)
> {
> InteractionEventObserver* interactionEventObserver =
> eventObserverTracker->GetService(*it);
> if (interactionEventObserver != NULL) {
> DisplayInteractor* displayInteractor =
> dynamic_cast<DisplayInteractor*>(interactionEventObserver);
> if (displayInteractor != NULL) {
> // here the regular configuration is loaded again
>
> displayInteractor->LoadEventConfig("OurCustomDisplayConfigMITKTools.xml","Mitk");
> }
> }
> }
> eventObserverTracker->Close();
> delete eventObserverTracker;
>
>
> ... and add our custom display config to the Qt resources?
>
> Thanks,
> Miklos
>
>
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users