[vtkusers] Java GetActors()

Brian Henz bjhenz at hotmail.com
Tue Apr 17 16:51:44 EDT 2001


There are only vtkActors in the Renderer, no vtkActors2D.  I have a seperate 
function to do removeAllActors2D.  I am using Java 1.3 on SGI.  I have not 
tried on SUN, AIX, or Linux but I hope to soon.  What flavor of unix did you 
have success on besides Linux?  And what version of vtkPanel.java are you 
using?  the most recent?  The version from April 3rd works "ok" on SGI for 
me but in the new one from April 16th no RenderWindow appears :-)
Thanks,
     Brian


>From: Jeff Lee <jeff at cdnorthamerica.com>
>To: Brian Henz <bjhenz at hotmail.com>
>CC: vtkusers at public.kitware.com
>Subject: Re: [vtkusers] Java GetActors()
>Date: Tue, 17 Apr 2001 15:29:54 -0400
>
>What types of actors are in the actorcollection?  Instances of
>vtkActor2D would not show up in the collection.  Do you have multiple
>installations of vtk?  If so, is your classpath set to the correct
>location?  I have the most recent version of vtk/jdk1.3 and it works
>fine for me (on unix, linux).  That's all I can think of at the moment,
>unless you can whip up a small sample code that shows the problem.
>-Jeff
>
>Brian Henz wrote:
>
> >
> >
> > Here is the stack trace I get after GetActors() fails to return the
> > actor collection...
> >
> > Exception occurred during event dispatching:
> > java.lang.NullPointerException
> >         at
> > mil.army.arl.octopus.OctopusVis.removeAllActors(OctopusVis.java:784)
> >         at mil.army.arl.octopus.ComposeGUI.<init>(ComposeGUI.java:204)
> >
> >         at
> > 
>mil.army.arl.octopus.OctopusGUI$ItemHandler.actionPerformed(OctopusGUI.java:334)
> >
> >         at
> > javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
> >
> >         at
> > 
>javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
> >
> >         at
> > 
>javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
> >
> >         at
> > 
>javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:268)
> >
> > ...
> >
> >
> > The line from mil.army.arl.octopus.OctopusVis.RemoveAllActors() is:
> >
> > vtk.vtkActorCollection actorcollection =
> > renPanel.GetRenderer().GetActors()
> >
> > 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
> > >To: Brian Henz
> > >Subject: Re: [vtkusers] Java GetActors()
> > >Date: Mon, 16 Apr 2001 16:34:48 -0400
> > >
> > >How does it fail? A stack trace would be helpful.
> > >-Jeff
> > >
> > >Brian Henz wrote:
> > >
> > > > I just downloaded the new precompiled Windows and the vtk.tar.gz
> > files for
> > > > Unix. After Installing and compiling I find that GetActors()
> > returns null.
> > > > Here's an example of what I do:
> > > >
> > > > vtkPanel renPanel = new vtkPanel();
> > > > ...
> > > > Add Some Actors
> > > > ...
> > > > // Now to remove actors
> > > > vtk.vtkActorCollection actorcollection =
> > > > renPanel.GetRenderer().GetActors();
> > > >
> > > > // But this next line fails because actorcollection == null.
> > > > // There are actors in the renderer because I can see them and
> > > > // If i know the actor's name I can delete it. The same
> > > > // code worked with the 04/04/2001 version.
> > > > actorcollection.InitTraversal();
> > > >
> > > > Any ideas would be greatly appreciated. Also, on an SGI machine
> > with JDK
> > > > 1.3 the vtkPanel does not show up. (I had this a long time ago but
> > was
> > > > kinda fixed recently when vtkPanel created a seperate Render
> > window.)
> > > >
> > > > Thanks,
> > > > Brian
> > > > _________________________________________________________________
> > > > Get your FREE download of MSN Explorer at http://explorer.msn.com
> > > >
> > > > _______________________________________________
> > > > This is the private VTK discussion list.
> > > > Please keep messages on-topic. Check the FAQ at:
> > > > Follow this link to subscribe/unsubscribe:
> > > > http://public.kitware.com/mailman/listinfo/vtkusers
> > >
> > >--
> > >J.A. Lee
> > >Software Engineer
> > >Computational Dynamics North America
> > >3 Schoolhouse Lane
> > >Etna NH, 03750
> > >ph: 603-643-9993 x109, fax: 603-643-9994
> > >
> > >
> >
> > -----------------------------------------------------------------------
> > Get your FREE download of MSN Explorer at http://explorer.msn.com
> > _______________________________________________ This is the private
> > VTK discussion list. Please keep messages on-topic. Check the FAQ
> > at: Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
>
>--
>J.A. Lee
>Software Engineer
>Computational Dynamics North America
>3 Schoolhouse Lane
>Etna NH, 03750
>ph: 603-643-9993 x109, fax: 603-643-9994
>
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





More information about the vtkusers mailing list