Commit 89f0618c authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'xml_piece_progress'

ccf8a76e

 add getNumberOfPieces to XML Reader, fix progress
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !1217
parents f0094694 ccf8a76e
......@@ -339,6 +339,12 @@ vtkIdType vtkXMLUnstructuredDataReader::GetNumberOfCells()
return this->TotalNumberOfCells;
}
//----------------------------------------------------------------------------
vtkIdType vtkXMLUnstructuredDataReader::GetNumberOfPieces()
{
return this->NumberOfPieces;
}
//----------------------------------------------------------------------------
vtkIdType vtkXMLUnstructuredDataReader::GetNumberOfPointsInPiece(int piece)
{
......
......@@ -45,6 +45,10 @@ public:
// Get the number of cells in the output.
virtual vtkIdType GetNumberOfCells();
// Description:
// Get the number of pieces in the file
virtual vtkIdType GetNumberOfPieces();
// Description:
// Setup the reader as if the given update extent were requested by
// its output. This can be used after an UpdateInformation to
......
......@@ -130,9 +130,8 @@ int vtkXMLUnstructuredDataWriter::ProcessRequest(vtkInformation* request,
}
else
{
float progressRange[2] = {0,0};
this->GetProgressRange(progressRange);
this->SetProgressRange(progressRange, this->CurrentPiece, this->NumberOfPieces);
float wholeProgressRange[2] = {0,1};
this->SetProgressRange(wholeProgressRange, this->CurrentPiece, this->NumberOfPieces);
}
int result = 1;
......@@ -144,8 +143,11 @@ int vtkXMLUnstructuredDataWriter::ProcessRequest(vtkInformation* request,
this->UpdateProgress(0);
// Initialize progress range to entire 0..1 range.
float wholeProgressRange[2] = {0,1};
this->SetProgressRange(wholeProgressRange, 0, 1);
if (this->WritePiece >= 0)
{
float wholeProgressRange[2] = {0,1};
this->SetProgressRange(wholeProgressRange, 0, 1);
}
if (!this->OpenStream())
{
......@@ -230,8 +232,8 @@ int vtkXMLUnstructuredDataWriter::ProcessRequest(vtkInformation* request,
}
this->NumberOfPieces = numPieces;
// We have finished writing.
this->UpdateProgressDiscrete(1);
// We have finished writing (at least this piece)
this->SetProgressPartial(1);
return result;
}
return this->Superclass::ProcessRequest(request, inputVector, outputVector);
......
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