Skip to content
Snippets Groups Projects
Commit 7cf68457 authored by Mickael PHILIT's avatar Mickael PHILIT
Browse files

Fix UPDATE_EXTENT information to append multiple vtkStructuredGrids

vtkAppendFilter do not propagate upstream a valid UPDATE_EXTENT for connection >= 1
The fix lets downstream request a subset of connection 0, for connections >= 1
their WHOLE_EXTENT is sent as UPDATE_EXTENT.
parent 93d18828
Branches
Tags
No related merge requests found
......@@ -28,6 +28,7 @@
#include "vtkPointData.h"
#include "vtkSmartPointer.h"
#include "vtkUnstructuredGrid.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include <set>
#include <string>
......@@ -641,6 +642,29 @@ void vtkAppendFilter::AppendArrays(int attributesType,
}
}
//----------------------------------------------------------------------------
int vtkAppendFilter::RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *vtkNotUsed(outputVector))
{
int numInputConnections = this->GetNumberOfInputConnections(0);
// Let downstream request a subset of connection 0, for connections >= 1
// send their WHOLE_EXTENT as UPDATE_EXTENT.
for (int idx = 1; idx < numInputConnections; ++idx)
{
vtkInformation * inputInfo = inputVector[0]->GetInformationObject(idx);
if (inputInfo->Has(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()))
{
int ext[6];
inputInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), ext);
inputInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), ext, 6);
}
}
return 1;
}
//----------------------------------------------------------------------------
int vtkAppendFilter::FillInputPortInformation(int, vtkInformation *info)
{
......
......@@ -85,7 +85,8 @@ protected:
// Usual data generation method
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
virtual int RequestUpdateExtent(vtkInformation *,
vtkInformationVector **, vtkInformationVector *);
virtual int FillInputPortInformation(int port, vtkInformation *info);
// list of data sets to append together.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment