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

Method WriteData

IO/Legacy/vtkCompositeDataWriter.cxx:58–150  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

56
57//------------------------------------------------------------------------------
58void vtkCompositeDataWriter::WriteData()
59{
60 ostream* fp;
61 vtkCompositeDataSet* input = this->GetInput();
62
63 vtkDebugMacro(<< "Writing vtk composite data...");
64 if (!(fp = this->OpenVTKFile()) || !this->WriteHeader(fp))
65 {
66 if (fp)
67 {
68 if (this->FileName)
69 {
70 vtkErrorMacro("Ran out of disk space; deleting file: " << this->FileName);
71 this->CloseVTKFile(fp);
72 unlink(this->FileName);
73 }
74 else
75 {
76 this->CloseVTKFile(fp);
77 vtkErrorMacro("Could not read memory header. ");
78 }
79 }
80 return;
81 }
82
83 vtkMultiBlockDataSet* mb = vtkMultiBlockDataSet::SafeDownCast(input);
84 vtkOverlappingAMR* oamr = vtkOverlappingAMR::SafeDownCast(input);
85 vtkNonOverlappingAMR* noamr = vtkNonOverlappingAMR::SafeDownCast(input);
86 vtkMultiPieceDataSet* mp = vtkMultiPieceDataSet::SafeDownCast(input);
87 vtkPartitionedDataSet* pd = vtkPartitionedDataSet::SafeDownCast(input);
88 vtkPartitionedDataSetCollection* pdc = vtkPartitionedDataSetCollection::SafeDownCast(input);
89 if (mb)
90 {
91 *fp << "DATASET MULTIBLOCK\n";
92 if (!this->WriteCompositeData(fp, mb))
93 {
94 vtkErrorMacro("Error writing multiblock dataset.");
95 }
96 }
97 else if (oamr)
98 {
99 *fp << "DATASET OVERLAPPING_AMR\n";
100 if (!this->WriteCompositeData(fp, oamr))
101 {
102 vtkErrorMacro("Error writing overlapping amr dataset.");
103 }
104 }
105 else if (noamr)
106 {
107 *fp << "DATASET NON_OVERLAPPING_AMR\n";
108 if (!this->WriteCompositeData(fp, noamr))
109 {
110 vtkErrorMacro("Error writing non-overlapping amr dataset.");
111 }
112 }
113 else if (mp)
114 {
115 *fp << "DATASET MULTIPIECE\n";

Callers

nothing calls this directly

Calls 8

GetInputMethod · 0.95
WriteCompositeDataMethod · 0.95
OpenVTKFileMethod · 0.45
WriteHeaderMethod · 0.45
CloseVTKFileMethod · 0.45
GetClassNameMethod · 0.45
GetFieldDataMethod · 0.45
WriteFieldDataMethod · 0.45

Tested by

no test coverage detected