[vtkusers] vtkCanvas and "Visualization Toolkit" window

TINGAUD Frederic Frederic.TINGAUD at murex.com
Fri May 10 10:31:44 EDT 2013


Hi,

 

As said by Sebastien, you can just add a test on isShowing() before calling Render() on your panel, to be sure the parent component is connected.

 

Fred

 

De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part de Sebastien Jourdain
Envoyé : vendredi 10 mai 2013 15:01
À : Marco Sambin
Cc : vtkusers at vtk.org
Objet : Re: [vtkusers] vtkCanvas and "Visualization Toolkit" window

 

That Render() call should not be made before the canvas is connected into a Swing parent component. That component can be non visible, but if it is just by itself, this is normal to see the behavior that you noticed.

 

Seb

 

On Fri, May 10, 2013 at 5:08 AM, Marco Sambin <m.sambin at gmail.com> wrote:

Hi Seb,

 

thanks for your reply.

The short answer is: yes, I am building and adding my vtkCanvas to my application GUI in the EDT.

 

Let me explain a bit more how my application is working: this is a Swing-based Java application, managing medical images. When I press a button on the GUI of this application, the VTK-based reslicing feature (based on vtkImagePlaneWidget's functionality) is invoked.

 

In particular, the three vtkImagePlaneWidgets are initialized, are connected with a Reader loading the volume (which was initialized in a separate thread), and they are placed in the vtkCanvas. This vtkCanvas is then added to a JPanel inside my application's GUI.

 

Debugging my application, I have noticed that the separate "Visualization Toolkit" window appears upon calling the Render() method on my vtkCanvas in a moment when the vtkCanvas hasn't been added to the parent JPanel yet.

 

Shall I absolutely avoid calling Render() on a vtkCanvas which is not visible yet?

 

Thanks and best regards,

 

Marco

 

On Thu, May 9, 2013 at 6:58 PM, Sebastien Jourdain <sebastien.jourdain at kitware.com> wrote:

How do you do the vtkCanvas binding within your frame ?

Does that piece of code get executed inside the EDT ?

 

Since you are using vtk 6, you should probably use the new rendering class for Java which should give you more freedom. To learn more about them, you can look at our sample applications inside the Wrapping/Java directory within the source tree.

 

Seb

 

On Thu, May 9, 2013 at 12:44 PM, Marco Sambin <m.sambin at gmail.com> wrote:

Hi all.

 

In my Java application, I am using a vtkCanvas where three vtkImagePlaneWidgets are displayed, each one cutting a specific section of my volume (deriving from a medical data set).

 

At application startup, when the GUI of my Java application is built, I see for a few moments a pop-up window titled "Visualization Toolkit", containing my three vtkImagePlaneWidgets. After a second or so,  this window disappears, and its content is then displayed inside my vtkCanvas, embedded in the GUI of my application, as expected.

 

Is the appearance of this window normal? Is there a way to prevent that separate "Visualization Toolkit" window from appearing, and have the content displayed directly inside my vtkCanvas?

 

I am running VTK 6.0 (from GIT) and Java 7 64-bit on a Windows 7 64-bit PC.

 

Thanks in advance for all your comments.

Best regards,

 

Marco

 


_______________________________________________
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

 

 


_______________________________________________
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

 

*******************************

This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130510/c577e167/attachment.htm>


More information about the vtkusers mailing list