Commit 79a811b6 authored by Dave DeMarle's avatar Dave DeMarle
Browse files

Merge branch '12994-xmlmultiblockwriter-improvements-rel' into release

parents 3299c70d 3a192370
......@@ -67,33 +67,31 @@ int vtkXMLMultiBlockDataWriter::WriteComposite(vtkCompositeDataSet* compositeDat
iter->GoToNextItem(), index++)
{
vtkDataObject* curDO = iter->GetCurrentDataObject();
const char *name = NULL;
if (iter->HasCurrentMetaData())
{
name = iter->GetCurrentMetaData()->Get(vtkCompositeDataSet::NAME());
}
if (curDO && curDO->IsA("vtkCompositeDataSet"))
// if node is a supported composite dataset
// note in structure file and recurse.
{
vtkXMLDataElement* tag = vtkXMLDataElement::New();
const char *name = iter->GetCurrentMetaData()->Get(vtkCompositeDataSet::NAME());
if (name)
{
tag->SetAttribute("name", name);
}
if (curDO->IsA("vtkMultiPieceDataSet"))
{
tag->SetName("Piece");
tag->SetIntAttribute("index", index);
if(name)
{
tag->SetAttribute("name", name);
}
}
else if (curDO->IsA("vtkMultiBlockDataSet"))
{
tag->SetName("Block");
tag->SetIntAttribute("index", index);
if(name)
{
tag->SetAttribute("name", name);
}
}
vtkCompositeDataSet* curCD
= vtkCompositeDataSet::SafeDownCast(curDO);
......@@ -112,6 +110,10 @@ int vtkXMLMultiBlockDataWriter::WriteComposite(vtkCompositeDataSet* compositeDat
vtkXMLDataElement* datasetXML = vtkXMLDataElement::New();
datasetXML->SetName("DataSet");
datasetXML->SetIntAttribute("index", index);
if (name)
{
datasetXML->SetAttribute("name", name);
}
vtkStdString fileName = this->CreatePieceFileName(writerIdx);
if (this->WriteNonCompositeData( curDO, datasetXML, writerIdx,
fileName.c_str()))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment