<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Brian,
<br>The very latest vtkPanel uses no deprecated methods. In order to use
the latest version, you have to compile in the native support (usually
-DVTK_USE_JAWT) in the graphics library. This causes vtkRenderWindow
(win32 or x) to include the proper code for native rendering (look at vtkJavaAwt.h).
I don't believe this has been put into the latest system.make, and it probably
should. Since you are using the nightlies, there is no guarantee
that all this new stuff has been integrated into the build. It is
an easy enough thing to do, though. I'm sure that this is why the
render window doesn't show up, because the method RenderCreate, RenderInternal,
and SetSizeInternal are all empty unless the pre-processor directive
is defined. I am using SUN and everything works fine. This
still doesn't explain your problem with the null vtkActorCollection (with
the old vtkPanel), though.
<p>P.S. You can tell which version of the panel you are using if
you javac vtkPanel.java and don't get any deprecation warnings.
<p>-Jeff
<p>Brian Henz wrote:
<blockquote TYPE=CITE>There are only vtkActors in the Renderer, no vtkActors2D.
I have a seperate
<br>function to do removeAllActors2D. I am using Java 1.3 on SGI.
I have not
<br>tried on SUN, AIX, or Linux but I hope to soon. What flavor of
unix did you
<br>have success on besides Linux? And what version of vtkPanel.java
are you
<br>using? the most recent? The version from April 3rd works
"ok" on SGI for
<br>me but in the new one from April 16th no RenderWindow appears :-)
<br>Thanks,
<br> Brian
<p>>From: Jeff Lee <jeff@cdnorthamerica.com>
<br>>To: Brian Henz <bjhenz@hotmail.com>
<br>>CC: vtkusers@public.kitware.com
<br>>Subject: Re: [vtkusers] Java GetActors()
<br>>Date: Tue, 17 Apr 2001 15:29:54 -0400
<br>>
<br>>What types of actors are in the actorcollection? Instances of
<br>>vtkActor2D would not show up in the collection. Do you have
multiple
<br>>installations of vtk? If so, is your classpath set to the correct
<br>>location? I have the most recent version of vtk/jdk1.3 and it
works
<br>>fine for me (on unix, linux). That's all I can think of at the
moment,
<br>>unless you can whip up a small sample code that shows the problem.
<br>>-Jeff
<br>>
<br>>Brian Henz wrote:
<br>>
<br>> >
<br>> >
<br>> > Here is the stack trace I get after GetActors() fails to return
the
<br>> > actor collection...
<br>> >
<br>> > Exception occurred during event dispatching:
<br>> > java.lang.NullPointerException
<br>> > at
<br>> > mil.army.arl.octopus.OctopusVis.removeAllActors(OctopusVis.java:784)
<br>> > at mil.army.arl.octopus.ComposeGUI.<init>(ComposeGUI.java:204)
<br>> >
<br>> > at
<br>> >
<br>>mil.army.arl.octopus.OctopusGUI$ItemHandler.actionPerformed(OctopusGUI.java:334)
<br>> >
<br>> > at
<br>> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
<br>> >
<br>> > at
<br>> >
<br>>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
<br>> >
<br>> > at
<br>> >
<br>>javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
<br>> >
<br>> > at
<br>> >
<br>>javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:268)
<br>> >
<br>> > ...
<br>> >
<br>> >
<br>> > The line from mil.army.arl.octopus.OctopusVis.RemoveAllActors()
is:
<br>> >
<br>> > vtk.vtkActorCollection actorcollection =
<br>> > renPanel.GetRenderer().GetActors()
<br>> >
<br>> > actorcollection.InitTraversal(); // This is where the null pointer
<br>> > exception occurs because even if there are actors in the renderer
the
<br>> > actorcollection is null.>From: Jeff Lee
<br>> > >To: Brian Henz
<br>> > >Subject: Re: [vtkusers] Java GetActors()
<br>> > >Date: Mon, 16 Apr 2001 16:34:48 -0400
<br>> > >
<br>> > >How does it fail? A stack trace would be helpful.
<br>> > >-Jeff
<br>> > >
<br>> > >Brian Henz wrote:
<br>> > >
<br>> > > > I just downloaded the new precompiled Windows and the vtk.tar.gz
<br>> > files for
<br>> > > > Unix. After Installing and compiling I find that GetActors()
<br>> > returns null.
<br>> > > > Here's an example of what I do:
<br>> > > >
<br>> > > > vtkPanel renPanel = new vtkPanel();
<br>> > > > ...
<br>> > > > Add Some Actors
<br>> > > > ...
<br>> > > > // Now to remove actors
<br>> > > > vtk.vtkActorCollection actorcollection =
<br>> > > > renPanel.GetRenderer().GetActors();
<br>> > > >
<br>> > > > // But this next line fails because actorcollection == null.
<br>> > > > // There are actors in the renderer because I can see them
and
<br>> > > > // If i know the actor's name I can delete it. The same
<br>> > > > // code worked with the 04/04/2001 version.
<br>> > > > actorcollection.InitTraversal();
<br>> > > >
<br>> > > > Any ideas would be greatly appreciated. Also, on an SGI machine
<br>> > with JDK
<br>> > > > 1.3 the vtkPanel does not show up. (I had this a long time
ago but
<br>> > was
<br>> > > > kinda fixed recently when vtkPanel created a seperate Render
<br>> > window.)
<br>> > > >
<br>> > > > Thanks,
<br>> > > > Brian
<br>> > > > _________________________________________________________________
<br>> > > > Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a>
<br>> > > >
<br>> > > > _______________________________________________
<br>> > > > This is the private VTK discussion list.
<br>> > > > Please keep messages on-topic. Check the FAQ at:
<br>> > > > Follow this link to subscribe/unsubscribe:
<br>> > > > <a href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a>
<br>> > >
<br>> > >--
<br>> > >J.A. Lee
<br>> > >
<br>> >
<br>> > -----------------------------------------------------------------------
<br>> > Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a>
<br>> > _______________________________________________ This is the private
<br>> > VTK discussion list. Please keep messages on-topic. Check the FAQ
<br>> > at: Follow this link to subscribe/unsubscribe:
<br>> > <a href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a>
<br>>
<br>>--
<br>>J.A. Lee
<br>>
<br>>
<p>_________________________________________________________________
<br>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a></blockquote>
<pre>--
J.A. Lee
</pre>
</html>