Hi all,<br><br><br>I need to load a large data set, for example a VRML file (500MB), I'm using the following code (C#), <span id="result_box" class="short_text" lang="en"><span style="" title="">may not be the best way</span></span>, with my data set it's not work, not show anything : <br>
<br> // VRML Import<br> vtkVRMLImporter importer = vtkVRMLImporter.New();<br><br> OpenFileDialog dialog = new OpenFileDialog();<br> dialog.Filter =<br> "VRML files (*.wrl)|*.wrl|All files (*.*)|*.*";<br>
dialog.InitialDirectory = "\\Desktop";<br><br> dialog.Title = "Select a text file";<br> dialog.Multiselect = false;<br> if (dialog.ShowDialog() != DialogResult.OK)<br>
{<br> return;<br> }<br><br> importer.SetFileName(dialog.FileName);<br> importer.Read();<br> importer.Update();<br> <br> //Convert to vtkDataSet<br>
vtkDataSet pDataset;<br> vtkActorCollection actors = importer.GetRenderer().GetActors();<br> actors.InitTraversal();<br> pDataset = actors.GetNextActor().GetMapper().GetInput();<br>
<br> //Convert to vtkPolyData<br> vtkPolyData polyData = vtkPolyData.SafeDownCast ( pDataset );<br> polyData.Update();<br> <br> // Mapper<br> vtkPolyDataMapper solidMapper = vtkPolyDataMapper.New();<br>
solidMapper.SetInput ( polyData );<br> solidMapper.ScalarVisibilityOff();<br> <br> // Actor<br> vtkActor solidActor = vtkActor.New();<br> solidActor.SetMapper ( solidMapper );<br>
<br> //Add the actors to the scene<br> _renderer.AddActor(solidActor);<br> _renderer.SetBackground(1, 1, 1); // Background color dark blue<br><br>