Commit 3a192370 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

BUG #12994. vtkXMLMultiBlockDataWriter not writing names for leaf nodes.

vtkXMLMultiBlockDataWriter was not saving out names for leaf nodes the the
mulitblock dataset. Names were only being saved for non-leaf nodes. Fixed that.

Change-Id: If68a32d64ad5eab2c5f107a236cba6dfecfe125d
parent 5e3c5393
......@@ -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