[vtkusers] Importing 3DS and VRML files.

Berk Geveci berk.geveci at kitware.com
Tue Apr 23 11:17:38 EDT 2002


You should be able to iterate over the items and inquire the 
class/superclass of each with the virtual IsA and IsTypeOf 
methods.

-Berk

On Tue, 2002-04-23 at 11:04, Allan Reinhold Jensen wrote:
> 
> Hi Rob.
> 
> I did try the GetNumberOfItems() function, however this only tells me how
> many items the list contains, and not their type. The item list contains
> geometrical objects as well as lights, cameras etc. If I enable the
> debugger with importer->DebugOn(), I can see it loads a set of polygons, a
> camera, and some lightsources. This is all printed out in the debug window.
> 
> Best regards,
> 
> Allan Reinhold
> 
> * Allan Reinhold - mailto:arj at tm-net.dk
> * Theilgaard Mortensen A/S
> * Niels Hemmingsens Gade 9, 4.
> * 1153 København K
> * Pho/Mob: +45 33448555 / 26818969
> * http://www.tm-net.dk
> 
> "We collaboratively negotiate progressive deliverables such that we may
> continue to proactively revolutionize scalable content"  - Dilbert, 2001
> 
> 
>                                                                                                                                               
>                     Robert                                                                                                                    
>                     Belleman             To:     Allan Reinhold Jensen <arj at tm-net.dk>                                                        
>                     <robbel at scienc       cc:     vtkusers at public.kitware.com                                                                  
>                     e.uva.nl>            Subject:     Re: [vtkusers] Importing 3DS and VRML files.                                            
>                                                                                                                                               
>                     23-04-2002                                                                                                                
>                     16:39                                                                                                                     
>                                                                                                                                               
>                                                                                                                                               
> 
> 
> 
> 
> Allan,
> 
> On Tue, Apr 23, 2002 at 03:09:16PM +0200, Allan Reinhold Jensen wrote:
> > Is there any way to get the number og geometric objects from the
> > vtkRenderer class when importing from 3DS or VRML files?
> 
> I would expect the following to give you the number of objects (i.e.
> actors) only:
> 
>   vtkVRMLImporter *importer = vtkVRMLImporter::New();
>   // or vtk3DSImporter *importer = vtk3DSImporter::New();
>   importer->SetRenderWindow(your_render_window);
>   importer->SetFileName(filename);
>   importer->Read();
> 
>   int nactors = importer->GetRenderer()->GetActors()->GetNumberOfItems();
> 
> (this is from memory; so there might be a typo in there)
> Did you try that?
> 
> Of course, this all relies on the fact that the different objects
> were in fact saved as different objects by the application that
> generated the VRML/3DS file in the first place.
> 
> -- Rob
> 
> --
> [] Robert Belleman         X  Section Computational Science            []
> [] robbel at science.uva.nl  |X| University of Amsterdam, the Netherlands []
> [] tel: (+31) 20 525 7510  X  http://www.science.uva.nl/~robbel/       []
> 
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list