[vtkusers] Importing 3DS and VRML files.

Robert Belleman robbel at science.uva.nl
Tue Apr 23 10:39:10 EDT 2002


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/       []



More information about the vtkusers mailing list