Commit fc7272ce authored by David Gobbi's avatar David Gobbi Committed by David Partyka
Browse files

BUG: Stencil source UpdateExtent request wasn't propagating.

parent cb0ba4c4
......@@ -865,23 +865,25 @@ int vtkStreamingDemandDrivenPipeline
updateExtent[2] <= updateExtent[3] &&
updateExtent[4] <= updateExtent[5]))
{
if (!outInfo->Has(UPDATE_RESOLUTION()) &&
!outInfo->Has(UNRESTRICTED_UPDATE_EXTENT()))
if (!outInfo->Has(UNRESTRICTED_UPDATE_EXTENT()))
{
// Update extent is outside the whole extent and is not empty.
vtkErrorMacro("The update extent specified in the "
"information for output port " << outputPort
<< " on algorithm " << this->Algorithm->GetClassName()
<< "(" << this->Algorithm << ") is "
<< updateExtent[0] << " " << updateExtent[1] << " "
<< updateExtent[2] << " " << updateExtent[3] << " "
<< updateExtent[4] << " " << updateExtent[5]
<< ", which is outside the whole extent "
<< wholeExtent[0] << " " << wholeExtent[1] << " "
<< wholeExtent[2] << " " << wholeExtent[3] << " "
<< wholeExtent[4] << " " << wholeExtent[5] << ".");
if (!outInfo->Has(UPDATE_RESOLUTION()))
{
// Update extent is outside the whole extent and is not empty.
vtkErrorMacro("The update extent specified in the "
"information for output port " << outputPort
<< " on algorithm " << this->Algorithm->GetClassName()
<< "(" << this->Algorithm << ") is "
<< updateExtent[0] << " " << updateExtent[1] << " "
<< updateExtent[2] << " " << updateExtent[3] << " "
<< updateExtent[4] << " " << updateExtent[5]
<< ", which is outside the whole extent "
<< wholeExtent[0] << " " << wholeExtent[1] << " "
<< wholeExtent[2] << " " << wholeExtent[3] << " "
<< wholeExtent[4] << " " << wholeExtent[5] << ".");
}
return 0;
}
return 0;
}
}
if(dataInfo->Get(vtkDataObject::DATA_EXTENT_TYPE()) == VTK_TIME_EXTENT)
......
......@@ -211,6 +211,9 @@ int vtkImageToImageStencil::RequestInformation(
outInfo->Set(vtkDataObject::SPACING(), spacing, 3);
outInfo->Set(vtkDataObject::ORIGIN(), origin, 3);
outInfo->Set(
vtkStreamingDemandDrivenPipeline::UNRESTRICTED_UPDATE_EXTENT(), 1);
return 1;
}
......@@ -226,11 +229,37 @@ int vtkImageToImageStencil::FillInputPortInformation(int,
int vtkImageToImageStencil::RequestUpdateExtent(
vtkInformation *,
vtkInformationVector **inputVector,
vtkInformationVector *)
vtkInformationVector *outputVector)
{
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()),
6);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
int extent[6], wholeExtent[6];
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), extent);
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
// clip UpdateExtent with WholeExtent
extent[0] = (extent[0] > wholeExtent[0] ? extent[0] : wholeExtent[0]);
extent[1] = (extent[1] < wholeExtent[1] ? extent[1] : wholeExtent[1]);
extent[2] = (extent[2] > wholeExtent[2] ? extent[2] : wholeExtent[2]);
extent[3] = (extent[3] < wholeExtent[3] ? extent[3] : wholeExtent[3]);
extent[4] = (extent[4] > wholeExtent[4] ? extent[4] : wholeExtent[4]);
extent[5] = (extent[5] < wholeExtent[5] ? extent[5] : wholeExtent[5]);
// if invalid, use the current data extent if allocated
if (extent[0] > extent[1] || extent[2] > extent[3] || extent[4] > extent[5])
{
for (int j = 0; j < 6; j += 2)
{
extent[j] = extent[j+1] = wholeExtent[j];
}
vtkImageData *inData = vtkImageData::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
if (inData)
{
inData->GetExtent(extent);
}
}
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), extent, 6);
return 1;
}
Supports Markdown
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