Hi Sascha, thanks for the reply!

I finally managed to get that working. apparently one of my tries was 
almost there, but apparently I was comparing wrong renderwindows pointers...


Best,
Miguel


On 30.04.2014 15:38, Sascha Zelzer wrote:
> Hi Miguel,
>
> I don't fully understand your set-up, especially why all of your 
> interactors are getting the events from one render window. Do you 
> maybe try to synchronize them in case of zooming/scrolling etc.?
>
> If I understood your original mail right, each of your render windows 
> has its own interactor instances. Can't you just remember the render 
> window in the interactor instance and compare the sender argument with 
> the remembered render window pointer associated with the interactor?
>
> Best,
> Sascha
>
> On 04/28/2014 01:46 PM, Miguel Nunes wrote:
>> Hello list,
>>
>> I still haven't figured how to identify which window gets the
>> interaction (key or mouse) and be able to ignore the interaction case
>> the signal was emitted from a different window.
>>
>> thanks,
>> Miguel
>>
>> On 17.03.2014 14:00, Miguel Nunes wrote:
>>> Hi Christian, thank you for your input.
>>>
>>> BaseRenderer* sender = interactionEvent->GetSender(); is what I am
>>> aiming for. I want to know how to compare the sender (which can be any
>>> of my render windows) to the current one receiving the signal.
>>>
>>> I am looking for something that represents the following test:
>>> if ( sender->getRenderWindow () == this->renderwindow ) then ok!
>>> else ignore!
>>>
>>> Best,
>>> Miguel
>>>
>>> On 17.03.2014 10:38, Weber, Christian(1) wrote:
>>>> Following last email ... just realized you might be interested in:
>>>>
>>>> mitkDisplayInteractor implements the Scrolling etc for the standard 
>>>> views, you can have a look at it
>>>> (It is implemented as an EventObserver , sth that gets ALL events 
>>>> and as a statemachine)
>>>>
>>>> It also queries the renderer like this:
>>>>
>>>> bool mitk::DisplayInteractor::Init(StateMachineAction*, 
>>>> InteractionEvent* interactionEvent)
>>>> {
>>>>      BaseRenderer* sender = interactionEvent->GetSender();
>>>>
>>>>
>>>> You might do it similar, by registering only one instance (then 
>>>> also only receiving one event) and then checking in which window to 
>>>> act.
>>>>
>>>> But if you are displaying different data nodes in your render 
>>>> windows there are more elegant ways to discriminate between the 
>>>> events.
>>>>
>>>> Best
>>>> Christian
>>>>
>>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Weber, Christian(1) [mailto:[email protected]]
>>>> Gesendet: Montag, 17. März 2014 10:28
>>>> An: [email protected]
>>>> Betreff: Re: [mitk-users] Interaction being fired in all windows
>>>>
>>>> Hi Miguel,
>>>>
>>>> could you elaborate a bit on the setup of your interactors.
>>>> Are you using Interactor (old) or DataInteractors (new)?
>>>> By default there is one DataInteractor for one DataNode, 
>>>> independent of the number of render windows.
>>>> If your render windows have one interactor each, do they share one 
>>>> DataNode or are they referring to different nodes ?
>>>>
>>>> Generally, for differentiation you could use the Sender* argument 
>>>> passed along each event to determine which render window it 
>>>> originates from.
>>>> For DataInteractors event cancelling is usually done automatically 
>>>> after the first DataInteractor successfully has processed the event.
>>>>
>>>> Best,
>>>> Christian
>>>>
>>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Miguel Nunes [mailto:[email protected]]
>>>> Gesendet: Dienstag, 4. März 2014 14:55
>>>> An: [email protected]
>>>> Betreff: [mitk-users] Interaction being fired in all windows
>>>>
>>>> Hi MITK List,
>>>>
>>>> Following the conversation from
>>>> https://www.mail-archive.com/mitk-users%40lists.sourceforge.net/msg04426.html
>>>>  
>>>>
>>>> , I have now multiple rendering windows in my plugin.
>>>>
>>>> The case now, is that each render window has it's own interactor, 
>>>> but whenever I interact with one window (let's say zooming) the 
>>>> same event is passed to the other windows, and then executed when 
>>>> any of these windows gets a Render() call.
>>>>
>>>>
>>>> Is there a way to differentiate the windows, detach/cancel events 
>>>> after these are processed or a way to compare if the 
>>>> interactionEvent sender is originated from another window?
>>>>
>>>> thank you!
>>>> Miguel
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>  
>>>>
>>>> Subversion Kills Productivity. Get off Subversion & Make the Move 
>>>> to Perforce.
>>>> With Perforce, you get hassle-free workflows. Merge that actually 
>>>> works.
>>>> Faster operations. Version large binaries.  Built-in WAN 
>>>> optimization and the freedom to use Git, Perforce or both. Make the 
>>>> move to Perforce.
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>>>>  
>>>>
>>>> _______________________________________________
>>>> mitk-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>>>
>>>> ------------------------------------------------------------------------------
>>>>  
>>>>
>>>> Learn Graph Databases - Download FREE O'Reilly Book "Graph 
>>>> Databases" is the definitive new guide to graph databases and their 
>>>> applications. Written by three acclaimed leaders in the field, this 
>>>> first edition is now available. Download your free book today!
>>>> http://p.sf.net/sfu/13534_NeoTech
>>>> _______________________________________________
>>>> mitk-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>>>
>>>> ------------------------------------------------------------------------------
>>>>  
>>>>
>>>> Learn Graph Databases - Download FREE O'Reilly Book
>>>> "Graph Databases" is the definitive new guide to graph databases 
>>>> and their
>>>> applications. Written by three acclaimed leaders in the field,
>>>> this first edition is now available. Download your free book today!
>>>> http://p.sf.net/sfu/13534_NeoTech
>>>> _______________________________________________
>>>> mitk-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>>
>>> ------------------------------------------------------------------------------
>>>  
>>>
>>> Learn Graph Databases - Download FREE O'Reilly Book
>>> "Graph Databases" is the definitive new guide to graph databases and 
>>> their
>>> applications. Written by three acclaimed leaders in the field,
>>> this first edition is now available. Download your free book today!
>>> http://p.sf.net/sfu/13534_NeoTech
>>> _______________________________________________
>>> mitk-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>
>> ------------------------------------------------------------------------------
>>  
>>
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
>> unparalleled scalability from the best Selenium testing platform 
>> available.
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>> _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to