Skip to content
Snippets Groups Projects
Commit e4c6f5c5 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

BUG #15155: Fix issues with temporal interpolator.

vtkTemporalInterpolator changed the output dataobject to be same ptr as
the internally cached dataobject. That meant that when the output was
reset for a subsequent execution, the cached dataobject would get
reset/reinitialized too! That was causing the report bug. Fixed by not
changing the output data object ptr, instead shallow copying the cached
value to it (as is the norm in VTK filters).
parent 02e0778f
No related branches found
No related tags found
No related merge requests found
......@@ -216,8 +216,7 @@ int vtkTemporalInterpolator::RequestData(
{
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkDataObject *outData = NULL;
vtkDataObject *outData = vtkDataObject::GetData(outInfo);
// get the requested update times
double upTime = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
......@@ -229,8 +228,7 @@ int vtkTemporalInterpolator::RequestData(
if (numTimeSteps==1)
{
// pass the lowest data
outData = inData->GetBlock(0);
outInfo->Set(vtkDataObject::DATA_OBJECT(),outData);
outData->ShallowCopy(inData->GetBlock(0));
}
else
{
......@@ -245,11 +243,9 @@ int vtkTemporalInterpolator::RequestData(
double t0 = data0->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
double t1 = data1->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
this->Ratio = (upTime-t0)/(t1 - t0);
outData = this->InterpolateDataObject(data0,data1,this->Ratio);
// stamp this new dataset with a time key
outData->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(),upTime);
outInfo->Set(vtkDataObject::DATA_OBJECT(),outData);
outData->Delete();
vtkSmartPointer<vtkDataObject> newOutput;
newOutput.TakeReference(this->InterpolateDataObject(data0, data1, this->Ratio));
outData->ShallowCopy(newOutput);
}
// @TODO remove this when we move to new time framework
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment