[vtkusers] How to manage a large VRML file
Sebastien Jourdain
sebastien.jourdain at kitware.com
Wed Oct 27 12:21:09 EDT 2010
Hi Hugo,
The first thing that I don't know about, is the number of actors that
the importer do produce.
Moreover, if you attach your renderer to the importer before the
update, then the importer should put all of them into it.
I know, it is not what you try to do right now, but give a try.
For the progress you are suppose to be able to attach call back method
on the importer when progress events occurs.
Seb
On Wed, Oct 27, 2010 at 9:24 AM, Hugo Valdebenito <hugo at maptek.cl> wrote:
> Hi Sebastien,
>
> Yes, I did try to load with paraView in my PC, with 250 MB is ok, but 500MB
> the program crash in my computer. But my program with 250MB not works.
>
> My question is, how to load a file with those sizes?. how to show the
> progress for example?
>
> Hugo
>
>
> 2010/10/27 Sebastien Jourdain <sebastien.jourdain at kitware.com>
>>
>> Hi Hugo,
>>
>> Did you try to load that big VRML inside ParaView. So you would know
>> if VTK is able to handle your file...
>> If so, then it must be in the way you wrote your code otherwise it
>> will be a limitation in VTK. But once, I did load a 600MB VRML file
>> with VTK and it was ok.
>>
>> Seb
>>
>> On Tue, Oct 26, 2010 at 8:12 PM, Hugo Valdebenito <hugo at maptek.cl> wrote:
>> > Thanks for your response!!,
>> >
>> > I tried to load another file (smaller) and it's works.
>> >
>> > Hugo.
>> >
>> >
>> > 2010/10/26 Sebastien Jourdain <sebastien.jourdain at kitware.com>
>> >>
>> >> Hi Hugo,
>> >>
>> >> I don't know much about C#, but just in case...
>> >> It seems that you only pick the first actor. Are you sure that there
>> >> is only one ?
>> >> I guess, if you don't provide your renderer to the importer is because
>> >> you have other actors into it ?
>> >> Have you tried, at least to see if the file can be successfully loaded
>> >> by VTK when the importer is fully set ?
>> >>
>> >> Seb
>> >>
>> >> On Tue, Oct 26, 2010 at 9:18 AM, Hugo Valdebenito <hugo at maptek.cl>
>> >> wrote:
>> >> > Hi all,
>> >> >
>> >> >
>> >> > I need to load a large data set, for example a VRML file (500MB), I'm
>> >> > using
>> >> > the following code (C#), may not be the best way, with my data set
>> >> > it's
>> >> > not
>> >> > work, not show anything :
>> >> >
>> >> > // VRML Import
>> >> > vtkVRMLImporter importer = vtkVRMLImporter.New();
>> >> >
>> >> > OpenFileDialog dialog = new OpenFileDialog();
>> >> > dialog.Filter =
>> >> > "VRML files (*.wrl)|*.wrl|All files (*.*)|*.*";
>> >> > dialog.InitialDirectory = "\\Desktop";
>> >> >
>> >> > dialog.Title = "Select a text file";
>> >> > dialog.Multiselect = false;
>> >> > if (dialog.ShowDialog() != DialogResult.OK)
>> >> > {
>> >> > return;
>> >> > }
>> >> >
>> >> > importer.SetFileName(dialog.FileName);
>> >> > importer.Read();
>> >> > importer.Update();
>> >> >
>> >> > //Convert to vtkDataSet
>> >> > vtkDataSet pDataset;
>> >> > vtkActorCollection actors =
>> >> > importer.GetRenderer().GetActors();
>> >> > actors.InitTraversal();
>> >> > pDataset = actors.GetNextActor().GetMapper().GetInput();
>> >> >
>> >> > //Convert to vtkPolyData
>> >> > vtkPolyData polyData = vtkPolyData.SafeDownCast ( pDataset
>> >> > );
>> >> > polyData.Update();
>> >> >
>> >> > // Mapper
>> >> > vtkPolyDataMapper solidMapper = vtkPolyDataMapper.New();
>> >> > solidMapper.SetInput ( polyData );
>> >> > solidMapper.ScalarVisibilityOff();
>> >> >
>> >> > // Actor
>> >> > vtkActor solidActor = vtkActor.New();
>> >> > solidActor.SetMapper ( solidMapper );
>> >> >
>> >> > //Add the actors to the scene
>> >> > _renderer.AddActor(solidActor);
>> >> > _renderer.SetBackground(1, 1, 1); // Background color dark
>> >> > blue
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > Powered by www.kitware.com
>> >> >
>> >> > Visit other Kitware open-source projects at
>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >
>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >
>> >> > Follow this link to subscribe/unsubscribe:
>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >
>> >> >
>> >
>> >
>
>
More information about the vtkusers
mailing list