|
12 | 12 | #include <vtkDataObject.h> |
13 | 13 | #include <vtkDataSet.h> |
14 | 14 | #include <vtkDelimitedTextReader.h> |
| 15 | +#include <vtkDelimitedTextWriter.h> |
15 | 16 | #include <vtkPointData.h> |
16 | 17 | #include <vtkSmartPointer.h> |
17 | 18 | #include <vtkTable.h> |
18 | | -#include <vtkXMLDataObjectWriter.h> |
19 | 19 |
|
20 | 20 | int main(int argc, char **argv) { |
21 | 21 | std::vector<std::string> inputFilePaths; |
@@ -421,15 +421,13 @@ int main(int argc, char **argv) { |
421 | 421 | // If output prefix is specified then write all output objects to disk |
422 | 422 | if(!outputPathPrefix.empty()) { |
423 | 423 | for(int i = 0; i < dimRed->GetNumberOfOutputPorts(); i++) { |
424 | | - auto output = dimRed->GetOutputDataObject(i); |
425 | | - auto writer = vtkSmartPointer<vtkXMLWriter>::Take( |
426 | | - vtkXMLDataObjectWriter::NewWriter(output->GetDataObjectType())); |
| 424 | + auto output = dimRed->GetOutputPort(i); |
| 425 | + auto writer = vtkSmartPointer<vtkDelimitedTextWriter>::New(); |
427 | 426 |
|
428 | 427 | std::string outputFileName = outputPathPrefix + "_port_" |
429 | | - + std::to_string(i) + "." |
430 | | - + writer->GetDefaultFileExtension(); |
| 428 | + + std::to_string(i) + ".csv"; |
431 | 429 | msg.printMsg("Writing output file `" + outputFileName + "'..."); |
432 | | - writer->SetInputDataObject(output); |
| 430 | + writer->SetInputConnection(output); |
433 | 431 | writer->SetFileName(outputFileName.data()); |
434 | 432 | writer->Update(); |
435 | 433 | } |
|
0 commit comments