<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Amy,<br>
<br>
as I read legacy files and write xml files this is good news.<br>
I still cannot see a function that lets me append data on a xml file.<br>
<br>
<font face="Courier New, Courier, monospace">
vtkXMLUnstructuredGridWriter* _xml_grid_writer =
vtkXMLUnstructuredGridWriter::New();<br>
<br>
_grid_reader->SetScalarsName("Data1");<br>
_grid_reader->Update();<br>
<br>
_xml_grid_writer->SetFileName("camenbert.hvs.xml");<br>
_xml_grid_writer->SetInput(_grid_reader->GetOutput());<br>
_xml_grid_writer->SetDataModeToAscii();<br>
_xml_grid_writer->Write();<br>
<br>
_grid_reader->SetScalarsName("Data2");<br>
_grid_reader->Update();<br>
<br>
_xml_grid_writer->Write(); // WRONG<br>
</font><br>
By the last command the file is overwritten and only contains Data2. <br>
How can the data be appended to the file?<br>
<br>
Regards, M.B.<br>
<br>
<br>
Amy Squillacote schrieb:
<blockquote cite="mid6.2.5.6.2.20060525135356.075d8eb0@kitware.com"
type="cite">Hi M.B.,
<br>
<br>
Using the legacy VTK writers (e.g., vtkPolyDataWriter,
vtkUnstructuredGridWriter, etc.), if you want to have more than one
scalar, vector, etc. array, arrays beyond the first one must be stored
in field data. Try calling GetNumberOfFieldDataInFile(); it should
account for your "missing" arrays.
<br>
<br>
(At the time these writers were written, this mirrored the structure of
vtkPointData / vtkCellData.) Using the VTK XML writers, you can
certainly store more than one of any given type of array.
<br>
<br>
- Amy
<br>
<br>
At 01:20 PM 5/25/2006, Martin Baumann wrote:
<br>
<blockquote type="cite">Is it generally possible to save more than
one scalar / vector into one file using vtk's writers?
<br>
It seems to me as if one could only save ONE scalar / vector.
<br>
<br>
Regards, M.B.
<br>
<br>
<br>
Martin Baumann schrieb:
<br>
<br>
<blockquote type="cite">Hi,
<br>
<br>
I just realized, that I have the same problem using
vtkUnstructuredGridReader and vtkUnstructuredGridWriter:
<br>
<br>
// read orginal file
<br>
vtkUnstructuredGridReader* _grid_reader =
vtkUnstructuredGridReader::New();
<br>
_grid_reader->SetFileName(in_file.c_str());
<br>
_grid_reader->Update();
<br>
cout << "#Points : " <<
_grid_reader->GetOutput()->GetNumberOfPoints() << endl;
<br>
cout << "#Scalars: " <<
_grid_reader->GetNumberOfScalarsInFile() << endl;
<br>
<br>
// writer new file
<br>
vtkUnstructuredGridWriter* _grid_writer =
vtkUnstructuredGridWriter::New();
<br>
_grid_writer->SetFileName("camembert.new.hvs");
<br>
_grid_writer->SetInput(_grid_reader->GetOutput());
<br>
_grid_writer->Write();
<br>
<br>
// read new file
<br>
_grid_reader->SetFileName("camembert.new.hvs");
<br>
_grid_reader->Update();
<br>
cout << "#Points : " <<
_grid_reader->GetOutput()->GetNumberOfPoints() << endl;
<br>
cout << "#Scalars: " <<
_grid_reader->GetNumberOfScalarsInFile() << endl;
<br>
<br>
<br>
This makes the following output:
<br>
<br>
#Points : 400
<br>
#Scalars: 3
<br>
#Points : 400
<br>
#Scalars: 1
<br>
<br>
Hmmm....
<br>
<br>
Regards, M.B.
<br>
_______________________________________________________________
<br>
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
<br>
kostenguenstig. Jetzt gleich testen! <a class="moz-txt-link-freetext" href="http://f.web.de/?mc=021192">http://f.web.de/?mc=021192</a>
<br>
<br>
_______________________________________________
<br>
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
<br>
Follow this link to subscribe/unsubscribe:
<br>
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
<br>
<br>
<br>
</blockquote>
_______________________________________________
<br>
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>
<br>
Follow this link to subscribe/unsubscribe:
<br>
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
</body>
</html>