----------------------------------------------------------------------------
| 140 | |
| 141 | //---------------------------------------------------------------------------- |
| 142 | bool 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 | //---------------------------------------------------------------------------- |
| 183 | void vtkXMLPartitionedDataSetWriter::PrintSelf(ostream& os, vtkIndent indent) |
no test coverage detected