MCPcopy Create free account
hub / github.com/Kitware/VTK / WriteInternal

Method WriteInternal

IO/ParallelXML/vtkXMLPDataSetWriter.cxx:42–121  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

40
41//------------------------------------------------------------------------------
42int vtkXMLPDataSetWriter::WriteInternal()
43{
44 vtkAlgorithmOutput* input = this->GetInputConnection(0, 0);
45 vtkXMLPDataWriter* writer = nullptr;
46
47 // Create a writer based on the data set type.
48 switch (this->GetInput()->GetDataObjectType())
49 {
50 case VTK_UNIFORM_GRID:
51 case VTK_IMAGE_DATA:
52 case VTK_STRUCTURED_POINTS:
53 {
54 vtkXMLPImageDataWriter* w = vtkXMLPImageDataWriter::New();
55 w->SetInputConnection(input);
56 writer = w;
57 }
58 break;
59 case VTK_STRUCTURED_GRID:
60 {
61 vtkXMLPStructuredGridWriter* w = vtkXMLPStructuredGridWriter::New();
62 w->SetInputConnection(input);
63 writer = w;
64 }
65 break;
66 case VTK_RECTILINEAR_GRID:
67 {
68 vtkXMLPRectilinearGridWriter* w = vtkXMLPRectilinearGridWriter::New();
69 w->SetInputConnection(input);
70 writer = w;
71 }
72 break;
73 case VTK_UNSTRUCTURED_GRID:
74 {
75 vtkXMLPUnstructuredGridWriter* w = vtkXMLPUnstructuredGridWriter::New();
76 w->SetInputConnection(input);
77 writer = w;
78 }
79 break;
80 case VTK_POLY_DATA:
81 {
82 vtkXMLPPolyDataWriter* w = vtkXMLPPolyDataWriter::New();
83 w->SetInputConnection(input);
84 writer = w;
85 }
86 break;
87 }
88
89 // Make sure we got a valid writer for the data set.
90 if (!writer)
91 {
92 vtkErrorMacro("Cannot write dataset type: " << this->GetInput()->GetDataObjectType());
93 return 0;
94 }
95
96 // Copy the settings to the writer.
97 writer->SetDebug(this->GetDebug());
98 writer->SetFileName(this->GetFileName());
99 writer->SetByteOrder(this->GetByteOrder());

Callers

nothing calls this directly

Calls 15

GetInputMethod · 0.95
GetDataObjectTypeMethod · 0.80
GetDebugMethod · 0.80
SetByteOrderMethod · 0.80
GetBlockSizeMethod · 0.80
SetHeaderTypeMethod · 0.80
SetIdTypeMethod · 0.80
SetWriteSummaryFileMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetInputConnectionMethod · 0.45
SetInputConnectionMethod · 0.45

Tested by

no test coverage detected