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

Method WriteSummaryXML

IO/ParallelXML/vtkXMLPartitionedDataSetWriter.cxx:142–180  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

140
141//----------------------------------------------------------------------------
142bool vtkXMLPartitionedDataSetWriter::WriteSummaryXML(
143 vtkPartitionedDataSet* input, const std::vector<std::string>& allFilenames)
144{
145 vtkNew<vtkXMLDataWriterHelper> helper;
146 helper->SetWriter(this);
147 helper->SetDataSetVersion(this->GetDataSetMajorVersion(), this->GetDataSetMinorVersion());
148 helper->SetDataSetName(input->GetClassName());
149 if (!helper->OpenFile())
150 {
151 return false;
152 }
153 this->AddArtifact(this->FileName);
154
155 if (!helper->BeginWriting())
156 {
157 return false;
158 }
159
160 // build and serialize the DOM.
161 vtkNew<vtkXMLDataElement> root;
162 root->SetName(input->GetClassName());
163 int index = 0;
164 for (auto& fname : allFilenames)
165 {
166 if (!fname.empty()) // fname will be empty for null nodes in the input.
167 {
168 vtkNew<vtkXMLDataElement> child;
169 child->SetName("DataSet");
170 child->SetIntAttribute("index", index);
171 child->SetAttribute("file", fname.c_str());
172 root->AddNestedElement(child);
173 }
174 ++index;
175 }
176
177 helper->AddXML(root);
178 helper->AddGlobalFieldData(input);
179 return helper->EndWriting() != 0;
180}
181
182//----------------------------------------------------------------------------
183void vtkXMLPartitionedDataSetWriter::PrintSelf(ostream& os, vtkIndent indent)

Callers 1

RequestDataMethod · 0.95

Calls 15

AddArtifactMethod · 0.80
BeginWritingMethod · 0.80
SetIntAttributeMethod · 0.80
AddNestedElementMethod · 0.80
AddXMLMethod · 0.80
AddGlobalFieldDataMethod · 0.80
GetClassNameMethod · 0.45
OpenFileMethod · 0.45
SetNameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected