Commit a1dee02e authored by Ken Martin's avatar Ken Martin

fix progress reporting on writing XMLMultiBlockDataSets

The progress range needed to be set outside the loop
that calls WriteNonCompositData.  The old code was
reporting 0 to 1.0 progress for each block.
parent 5d7b8d01
......@@ -254,6 +254,9 @@ int vtkXMLCompositeDataWriter::WriteNonCompositeData(
}
// FIXME
// Ken's note, I do not think you can fix this, the
// setprogress range has to be done in the loop that calls
// this function.
// this->SetProgressRange(progressRange, myWriterIndex,
// GetNumberOfInputConnections(0)+writeCollection);
......
......@@ -60,6 +60,15 @@ int vtkXMLMultiBlockDataWriter::WriteComposite(vtkCompositeDataSet* compositeDat
iter->VisitOnlyLeavesOff();
iter->TraverseSubTreeOff();
iter->SkipEmptyNodesOff();
int toBeWritten = 0;
for (iter->InitTraversal(); !iter->IsDoneWithTraversal();
iter->GoToNextItem())
{
toBeWritten++;
}
float progressRange[2] = { 0.f, 0.f };
this->GetProgressRange(progressRange);
int index = 0;
int RetVal = 0;
......@@ -115,6 +124,8 @@ int vtkXMLMultiBlockDataWriter::WriteComposite(vtkCompositeDataSet* compositeDat
datasetXML->SetAttribute("name", name);
}
vtkStdString fileName = this->CreatePieceFileName(writerIdx);
this->SetProgressRange(progressRange, writerIdx, toBeWritten);
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