<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
What types of actors are in the actorcollection?&nbsp; Instances of vtkActor2D
would not show up in the collection.&nbsp; Do you have multiple installations
of vtk?&nbsp; If so, is your classpath set to the correct location?&nbsp;
I have the most recent version of vtk/jdk1.3 and it works fine for me (on
unix, linux).&nbsp; That's all I can think of at the moment, unless you
can whip up a small sample code that shows the problem.
<br>-Jeff
<p>Brian Henz wrote:
<blockquote TYPE=CITE>&nbsp;
<p>Here is the stack trace I get after GetActors() fails to return the
actor collection...
<p>Exception occurred during event dispatching:
<br>java.lang.NullPointerException
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at mil.army.arl.octopus.OctopusVis.removeAllActors(OctopusVis.java:784)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at mil.army.arl.octopus.ComposeGUI.&lt;init>(ComposeGUI.java:204)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at mil.army.arl.octopus.OctopusGUI$ItemHandler.actionPerformed(OctopusGUI.java:334)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:268)
<br>...
<br>&nbsp;
<p>The line from mil.army.arl.octopus.OctopusVis.RemoveAllActors() is:
<p>vtk.vtkActorCollection actorcollection = renPanel.GetRenderer().GetActors()
<p>actorcollection.InitTraversal(); // This is where the null pointer exception
occurs because even if there are actors in the renderer the actorcollection
is null.>From: Jeff Lee&nbsp;<JEFF@CDNORTHAMERICA.COM>
<br>>To: Brian Henz&nbsp;<BJHENZ@HOTMAIL.COM>
<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
files for
<br>> > Unix. After Installing and compiling I find that GetActors() 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
with JDK
<br>> > 1.3 the vtkPanel does not show up. (I had this a long time ago
but was
<br>> > kinda fixed recently when vtkPanel created a seperate Render 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>>Software Engineer
<br>>Computational Dynamics North America
<br>>3 Schoolhouse Lane
<br>>Etna NH, 03750
<br>>ph: 603-643-9993 x109, fax: 603-643-9994
<br>>
<br>>
<p>
<hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a>
<br>_______________________________________________ This is the private
VTK discussion list. Please keep messages on-topic. Check the FAQ at:&nbsp;<http://public.kitware.com/cgi-bin/vtkfaq>Follow
this link to subscribe/unsubscribe: <A HREF="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</A></blockquote>

<pre>--&nbsp;
J.A. Lee
Software Engineer
Computational Dynamics North America
3 Schoolhouse Lane
Etna NH, 03750
ph: 603-643-9993 x109, fax: 603-643-9994</pre>
&nbsp;</html>