[vtkusers] Re: file format conversion (XML <-> simple legacy format)

Martin Baumann mailsgetlost at web.de
Thu May 25 13:20:54 EDT 2006


Is it generally possible to save more than one scalar / vector into one 
file using vtk's writers?
It seems to me as if one could only save ONE scalar / vector.

Regards, M.B.


Martin Baumann schrieb:

>Hi,
>
>I just realized, that I have the same problem using vtkUnstructuredGridReader and vtkUnstructuredGridWriter:
>
>  // read orginal file
>  vtkUnstructuredGridReader*    _grid_reader      = vtkUnstructuredGridReader::New();
>  _grid_reader->SetFileName(in_file.c_str());
>  _grid_reader->Update();
>  cout << "#Points : " << _grid_reader->GetOutput()->GetNumberOfPoints() << endl;
>  cout << "#Scalars: " << _grid_reader->GetNumberOfScalarsInFile() << endl;
>
>  // writer new file
>  vtkUnstructuredGridWriter* _grid_writer  = vtkUnstructuredGridWriter::New();
>  _grid_writer->SetFileName("camembert.new.hvs");
>  _grid_writer->SetInput(_grid_reader->GetOutput());
>  _grid_writer->Write();
>
>  // read new file
>  _grid_reader->SetFileName("camembert.new.hvs");
>  _grid_reader->Update();
>  cout << "#Points : " << _grid_reader->GetOutput()->GetNumberOfPoints() << endl;
>  cout << "#Scalars: " << _grid_reader->GetNumberOfScalarsInFile() << endl;
>
>
>This makes the following output:
>
>  #Points : 400
>  #Scalars: 3
>  #Points : 400
>  #Scalars: 1
>
>Hmmm....
>
>Regards, M.B.
>_______________________________________________________________
>SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
>kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the 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