I believe the functionality is missing. I have looked for it for many years.
I just put together a quick hack, which seems to work fine for me. No
exhaustive testing was done. It works for my test data, which are multi-blocks
of multi-blocks. It could be generalized to multi-pieces too. I'll let a
Kitware guru do that. :-)
I modified VTK/IO/vtkXMLMultiBlockDataReader.cxx to get the attribute "name"
// child is a leaf node, read and insert.
const char* tagName = childXML->GetName();
if (strcmp(tagName, "DataSet") == 0)
{
vtkSmartPointer<vtkDataSet> childDS;
const char* name;
if (this->ShouldReadDataSet(dataSetIndex))
{
// Read
childDS.TakeReference(this->ReadDataset(childXML, filePath));
name = childXML->GetAttribute("name");
}
// insert
if (mblock)
{
mblock->SetBlock(index, childDS);
mblock->GetMetaData(index)->Set(vtkCompositeDataSet::NAME(), name);
}
else if (mpiece)
{
mpiece->SetPiece(index, childDS);
}
dataSetIndex++;
}
// Child is a multiblock dataset itself. Create it.
else if (mblock != 0
&& strcmp(tagName, "Block") == 0)
{
vtkMultiBlockDataSet* childDS = vtkMultiBlockDataSet::New();;
this->ReadComposite(childXML, childDS, filePath, dataSetIndex);
const char* name = childXML->GetAttribute("name");
if (mblock)
{
mblock->SetBlock(index, childDS);
mblock->GetMetaData(index)->Set(vtkCompositeDataSet::NAME(), name);
}
else if (mpiece)
{
vtkErrorMacro("Multipiece data can't have composite children.");
return;
}
childDS->Delete();
}
-----------------
Jean M. Favre
Swiss National Supercomputing Center
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview