[vtkusers] Multiple render window interaction/synchronization

Félix C. Morency felix.morency at gmail.com
Wed Aug 1 11:52:04 EDT 2012


Hi,

I found a solution and I am sharing for the sake of posterity.

>From the VTK documentation: "That is, if vtkImagePlaneWidget does not
handle an event, then all other registered observers (including the
interactor style) have an opportunity to process the event. Otherwise,
the vtkImagePlaneWidget will terminate the processing of the event
that it handles."

In other words, the 'MouseMoveEvent' is processed and terminated
directly by the vtkImagePlaneWidget, never reaching any observer
connected to the interactor.

Also from the VTK documentation: "To support interactive manipulation
of objects, this class invokes the events StartInteractionEvent,
InteractionEvent, and EndInteractionEvent as well as
StartWindowLevelEvent, WindowLevelEvent, EndWindowLevelEvent and
ResetWindowLevelEvent."

One simply needs to add an observer to the
vtkImagePlaneWidget.InteractionEvent and do further processing from
there (like emitting an update signal to another rendering window). I
should've read the documentation more carefully.

Regards,
-F

On Mon, Jul 30, 2012 at 1:46 PM, Félix C. Morency
<felix.morency at gmail.com> wrote:
> Hi,
>
> Newbie problem here. Similar questions have been asked multiple time
> in the past but I couldn't find a proper answer to this issue.
>
> I am trying to implement the 4 panes view thing (axial, coronal,
> sagittal and 3D) using four vtkRenderWindow. I want the axial view to
> update itself each time I move the vtkImagePlaneWidget in the 3D view.
> The same applies for each axis.
>
> Right now, I am using three vtkImagePlaneWidget in the 3D view and
> each planar views (axial, etc) has a vtkImageActor. The input of each
> vtkImageActor is vtkImagePlaneWidget.GetResliceOutput(). As you might
> already know, if I move one vtkImagePlaneWidget in the 3D view, its
> corresponding planar view doesn't refresh until I pass the mouse
> cursor over the vtkRenderWindow. I tried to add a mouse event observer
> to the 3D view rendering window but my callback is not called when I
> drag one of the vtkImagePlaneWidget.
>
> Now the questions:
>
> 1) Is this a correct (VTK) way of solving the 4-panes view?
> 2) Why is my MouseMoveEvent callback always get called but not while
> dragging my vtkImagePlaneWidget?
> 3) What is the VTK-way of keeping multiple vtkRenderWindow synched if
> one of them changes? I came across vtkSynchronizedRenderWindows and
> vtkParallelRenderManager, but it is not clear to me that I need this.
>
> Regards,
> --
> Félix C. Morency, M.Sc.
> Plateforme d’analyse et de visualisation d’images
> Centre Hospitalier Universitaire de Sherbrooke
> Centre de recherche clinique Étienne-Le Bel
> Local Z5-3031 | 819.346.1110 ext 16634



-- 
--
Félix C. Morency, M.Sc.
Plateforme d’analyse et de visualisation d’images
Centre Hospitalier Universitaire de Sherbrooke
Centre de recherche clinique Étienne-Le Bel
Local Z5-3031 | 819.346.1110 ext 16634



More information about the vtkusers mailing list