[vtkusers] Importing 3DS and VRML files.
Allan Reinhold Jensen
arj at tm-net.dk
Tue Apr 23 11:04:14 EDT 2002
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/ []
More information about the vtkusers
mailing list