<html><DIV>
<P>Here is the stack trace I get after GetActors() fails to return the actor collection...</P>
<P>Exception occurred during event dispatching:<BR>java.lang.NullPointerException<BR> at mil.army.arl.octopus.OctopusVis.removeAllActors(OctopusVis.java:784)<BR> at mil.army.arl.octopus.ComposeGUI.<init>(ComposeGUI.java:204)<BR> at mil.army.arl.octopus.OctopusGUI$ItemHandler.actionPerformed(OctopusGUI.java:334)<BR> at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)<BR> at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)<BR> at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)<BR> at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:268)<BR>...</P>
<P><BR>The line from mil.army.arl.octopus.OctopusVis.RemoveAllActors() is:</P>
<P>vtk.vtkActorCollection actorcollection = renPanel.GetRenderer().GetActors()</P>
<P>actorcollection.InitTraversal(); // This is where the null pointer exception occurs because even if there are actors in the renderer the actorcollection is null. </P></DIV>
<DIV></DIV>
<DIV></DIV>>From: Jeff Lee <JEFF@CDNORTHAMERICA.COM>
<DIV></DIV>>To: Brian Henz <BJHENZ@HOTMAIL.COM>
<DIV></DIV>>Subject: Re: [vtkusers] Java GetActors()
<DIV></DIV>>Date: Mon, 16 Apr 2001 16:34:48 -0400
<DIV></DIV>>
<DIV></DIV>>How does it fail? A stack trace would be helpful.
<DIV></DIV>>-Jeff
<DIV></DIV>>
<DIV></DIV>>Brian Henz wrote:
<DIV></DIV>>
<DIV></DIV>> > I just downloaded the new precompiled Windows and the vtk.tar.gz files for
<DIV></DIV>> > Unix. After Installing and compiling I find that GetActors() returns null.
<DIV></DIV>> > Here's an example of what I do:
<DIV></DIV>> >
<DIV></DIV>> > vtkPanel renPanel = new vtkPanel();
<DIV></DIV>> > ...
<DIV></DIV>> > Add Some Actors
<DIV></DIV>> > ...
<DIV></DIV>> > // Now to remove actors
<DIV></DIV>> > vtk.vtkActorCollection actorcollection =
<DIV></DIV>> > renPanel.GetRenderer().GetActors();
<DIV></DIV>> >
<DIV></DIV>> > // But this next line fails because actorcollection == null.
<DIV></DIV>> > // There are actors in the renderer because I can see them and
<DIV></DIV>> > // If i know the actor's name I can delete it. The same
<DIV></DIV>> > // code worked with the 04/04/2001 version.
<DIV></DIV>> > actorcollection.InitTraversal();
<DIV></DIV>> >
<DIV></DIV>> > Any ideas would be greatly appreciated. Also, on an SGI machine with JDK
<DIV></DIV>> > 1.3 the vtkPanel does not show up. (I had this a long time ago but was
<DIV></DIV>> > kinda fixed recently when vtkPanel created a seperate Render window.)
<DIV></DIV>> >
<DIV></DIV>> > Thanks,
<DIV></DIV>> > Brian
<DIV></DIV>> > _________________________________________________________________
<DIV></DIV>> > Get your FREE download of MSN Explorer at http://explorer.msn.com
<DIV></DIV>> >
<DIV></DIV>> > _______________________________________________
<DIV></DIV>> > This is the private VTK discussion list.
<DIV></DIV>> > Please keep messages on-topic. Check the FAQ at:
<DIV></DIV>> > Follow this link to subscribe/unsubscribe:
<DIV></DIV>> > http://public.kitware.com/mailman/listinfo/vtkusers
<DIV></DIV>>
<DIV></DIV>>--
<DIV></DIV>>J.A. Lee
<DIV></DIV>>Software Engineer
<DIV></DIV>>Computational Dynamics North America
<DIV></DIV>>3 Schoolhouse Lane
<DIV></DIV>>Etna NH, 03750
<DIV></DIV>>ph: 603-643-9993 x109, fax: 603-643-9994
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>