Commit e5dceb0a authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri 💬
Browse files

FIX: Initialized multiblockdataset in vtkExtractSelection.cxx

Added data structure to maintain shallow copies of input data as a map from (port index, connection index) to (input data port, shallow copy port).

Change-Id: I815b63fa2f50a4b412b2de14f25e3ad582eaeef4
parent ee901dee
...@@ -214,6 +214,7 @@ int vtkExtractSelection::RequestDataObject( ...@@ -214,6 +214,7 @@ int vtkExtractSelection::RequestDataObject(
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::GetData(outInfo); vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::GetData(outInfo);
if (!output) if (!output)
{ {
output = vtkMultiBlockDataSet::New();
outInfo->Set(vtkDataObject::DATA_OBJECT(), output); outInfo->Set(vtkDataObject::DATA_OBJECT(), output);
output->Delete(); output->Delete();
} }
......
...@@ -169,15 +169,14 @@ vtkAlgorithmOutput* vtkDataRepresentation::GetInternalOutputPort(int port, int c ...@@ -169,15 +169,14 @@ vtkAlgorithmOutput* vtkDataRepresentation::GetInternalOutputPort(int port, int c
vtkAlgorithmOutput* input = this->GetInputConnection(port, conn); vtkAlgorithmOutput* input = this->GetInputConnection(port, conn);
if (this->Implementation->InputInternal.find(p) == if (this->Implementation->InputInternal.find(p) ==
this->Implementation->InputInternal.end() || this->Implementation->InputInternal.end() ||
this->Implementation->InputInternal[p].first != input || this->Implementation->InputInternal[p].first != input)
this->Implementation->InputInternal[p].second->GetMTime() < input->GetMTime())
{ {
this->Implementation->InputInternal[p].first = input; this->Implementation->InputInternal[p].first = input;
vtkDataObject* input = this->GetInputDataObject(port, conn); vtkDataObject* input = this->GetInputDataObject(port, conn);
vtkDataObject* copy = input->NewInstance(); vtkDataObject* copy = input->NewInstance();
copy->ShallowCopy(input); // copy->ShallowCopy(input);
vtkTrivialProducer* tp = vtkTrivialProducer::New(); vtkTrivialProducer* tp = vtkTrivialProducer::New();
tp->SetOutput(copy); tp->SetOutput(input);
this->Implementation->InputInternal[p].second = tp; this->Implementation->InputInternal[p].second = tp;
tp->Delete(); tp->Delete();
} }
......
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