Hi Frederico,

if I understand you correctly, your main problem here is that the rendering is 
updated too often, basically after each interaction with the mousehweel.

I believe that your problem is a result of the behaviour described in Bug #9432 
(http://bugs.mitk.org/show_bug.cgi?id=9432). In 2D renderwindows the 
interaction requests a rendering-update. This update is not executed right away 
but is appended to a queue and is executed when the eventloop is executed again 
sometime later.

In QmitkRenderWindow::wheelEvent() the event is also forwarded to the 
VTK-Interaction pipeline via QVTKWidget::wheelEvent(we); which forces an 
immediate update of the rendering.
This means, that the event causes the renderwindow in which the interaction has 
taken place to be updated immediately via VTK. That is what causes your 
problem. The rendering-update request that the MITK Interaction-Framework 
triggers is (in this case) unnecessary.

Just try to comment the line QVTKWidget::wheelEvent(we); in the method 
QmitkRenderWindow::wheelEvent and check if the rendering is still updated too 
often. I think with this change you should be able to scroll a couple of slices 
without the rendering being updated with each step.

Note, that this change only works for 2D renderwindows and 'destroys' 
interaction in 3D renderwindows.

Greets,
Markus



Von: Federico Milano [mailto:[email protected]]
Gesendet: Donnerstag, 27. Juni 2013 21:10
An: [email protected]
Betreff: [mitk-users] Mouse wheel interaction

Hi,

I have very large surfaces and I would like to skip rendering some slices when 
the mouse wheel delta is large enough (over a certain threshold) or when I have 
received many mouse wheel events in a short time window (this is related to 
this issue: http://bugs.mitk.org/show_bug.cgi?id=13948; I've implemented a 
vtkCutter specialized for triangular meshes, and I've parallelized it using 
OpenMP...the performance is much better, but the rendering is still not flowing 
as I would like it to).

I have been reading MITK's code and experimenting a lot, trying at least to 
traverse two slices every time the mouse wheel is moved (even forgetting about 
calculating the wheel speed). The only place I've found I can do this is on 
DisplayInteractor::ScrollOneUp/Down. How complex do you think is would be to 
create a "ScrollNUp/Down" to be able to jump N slices and call it the mouse 
wheel delta is large or when we are receiving many mouse wheel events?

I would really appreciate any hint.

Thanks in advance,

Federico
------------------------------------------------------------------------------
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

Reply via email to