[vtkusers] deleting frame in vtk java frame

Sebastien Jourdain sebastien.jourdain at kitware.com
Fri May 25 11:18:45 EDT 2012


I'm just saying that once the vtkRenderWindow is instantiate, this
might be to late after that to do anything...

On Fri, May 25, 2012 at 10:20 AM, Elhassan Abdou <hassan.abdou at yahoo.com> wrote:
> can you check the code that I added in which i am changing the rendering
> window and renderer to the one in the canvas and tell if there is something
> wrong in it.
> After this code I begin to load the data and enable the widget interaction
>
> magestyle=new vtkInteractorStyleImage();
>>> iren = sagitallCanvas.GetRenderWindow().GetInteractor();
>>> iren.SetInteractorStyle(imagestyle);
>>> sagittalViewer.SetRenderWindow(sagitallCanvas.GetRenderWindow());
>>> sagittalViewer.SetRenderer(sagitallCanvas.GetRenderer());
>>>
>>>
>>> //sagitallCanvas.GetRenderWindow().AddRenderer(sagittalViewer.GetRenderer());
>>> sagittalViewer.SetupInteractor(iren);
>>> //sagitallCanvas.GetRenderer().ResetCamera();
>>> imagestyle=new vtkInteractorStyleImage();
>>> iren = cronalCanvas.GetRenderWindow().GetInteractor();
>>> iren.SetInteractorStyle(imagestyle);
>>> cronalViewer.SetRenderWindow(cronalCanvas.GetRenderWindow());
>>> cronalViewer.SetRenderer(cronalCanvas.GetRenderer());
>>> //cronalCanvas.GetRenderWindow().AddRenderer(cronalViewer.GetRenderer());
>>> cronalViewer.SetupInteractor(iren);
>>> //cronalCanvas.GetRenderer().ResetCamera();
>>>
>>> imagestyle=new vtkInteractorStyleImage();
>>> iren = axialCanvas.GetRenderWindow().GetInteractor();
>>> iren.SetInteractorStyle(imagestyle);
>>> axialViewer.SetRenderWindow(axialCanvas.GetRenderWindow());
>>> axialViewer.SetRenderer(axialCanvas.GetRenderer());
>>> axialViewer.SetupInteractor(iren);
>
>
> El-Hassan Mohamed
> Biomedical engineering
> ________________________________
> From: Sebastien Jourdain <sebastien.jourdain at kitware.com>
> To: Elhassan Abdou <hassan.abdou at yahoo.com>
> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Sent: Friday, May 25, 2012 3:02 PM
> Subject: Re: [vtkusers] deleting frame in vtk java frame
>
> Hum, you should change the code of vtkRelsiceImageViewer to use
> vtkCanvas instead of Renderer + RenderWindow...
>
> On Fri, May 25, 2012 at 8:42 AM, Elhassan Abdou <hassan.abdou at yahoo.com>
> wrote:
>> Hi Sebastien,
>>
>> There is a window created by vtkResliceImageViewer and I moved the
>> renderwindow to be in vtkCanvas.
>> So I want to delete this window produced vtkRelsiceImageViewer.
>> I can say that this window is produced from openglframe work because it
>> has
>> a title Cocoa#1 on my mac and on other linux pc has a title
>> openglWindow#1.
>>
>> I have not tried what Clemens said in previous reply on this e-mail yet,
>> but
>> I may try it soon.
>>
>> Any help will be more than useful
>>
>> Best
>>
>> El-Hassan Mohamed
>> Biomedical engineering
>> ________________________________
>> From: Sebastien Jourdain <sebastien.jourdain at kitware.com>
>> To: Elhassan Abdou <hassan.abdou at yahoo.com>
>> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
>> Sent: Friday, May 25, 2012 2:21 PM
>> Subject: Re: [vtkusers] deleting frame in vtk java frame
>>
>> Sorry I don't get what you mean by delete and what you try to delete.
>> If that helps, you can look at the vtk/java code in the sample package
>> of the vtk.jar.
>>
>> On Thu, May 24, 2012 at 4:41 PM, Elhassan Abdou <hassan.abdou at yahoo.com>
>> wrote:
>>> Hi all
>>>
>>> I am using vtkresliceimageviewer which is inherited from vtkImageViewer2
>>> to
>>> produce MPR. I succeeded to create the three vtkCanvas and render on
>>> them.
>>> The PROBLEM is there are another three old frames produced from the
>>> vtkResliceImageViewer and they are empty as the renderer of viewer now is
>>> directed to vtkcanvas. How i can delete them.
>>>
>>> Below is the snippet of adding the viewers to the canvases;
>>> imagestyle=new vtkInteractorStyleImage();
>>> iren = sagitallCanvas.GetRenderWindow().GetInteractor();
>>> iren.SetInteractorStyle(imagestyle);
>>> sagittalViewer.SetRenderWindow(sagitallCanvas.GetRenderWindow());
>>> sagittalViewer.SetRenderer(sagitallCanvas.GetRenderer());
>>>
>>>
>>> //sagitallCanvas.GetRenderWindow().AddRenderer(sagittalViewer.GetRenderer());
>>> sagittalViewer.SetupInteractor(iren);
>>> //sagitallCanvas.GetRenderer().ResetCamera();
>>> imagestyle=new vtkInteractorStyleImage();
>>> iren = cronalCanvas.GetRenderWindow().GetInteractor();
>>> iren.SetInteractorStyle(imagestyle);
>>> cronalViewer.SetRenderWindow(cronalCanvas.GetRenderWindow());
>>> cronalViewer.SetRenderer(cronalCanvas.GetRenderer());
>>> //cronalCanvas.GetRenderWindow().AddRenderer(cronalViewer.GetRenderer());
>>> cronalViewer.SetupInteractor(iren);
>>> //cronalCanvas.GetRenderer().ResetCamera();
>>>
>>> imagestyle=new vtkInteractorStyleImage();
>>> iren = axialCanvas.GetRenderWindow().GetInteractor();
>>> iren.SetInteractorStyle(imagestyle);
>>> axialViewer.SetRenderWindow(axialCanvas.GetRenderWindow());
>>> axialViewer.SetRenderer(axialCanvas.GetRenderer());
>>> axialViewer.SetupInteractor(iren);
>>>
>>> Best Regards
>>>
>>> El-Hassan Mohamed
>>> Biomedical engineering
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>
>



More information about the vtkusers mailing list