Commit ddc25c1d authored by Cory Quammen's avatar Cory Quammen Committed by Kitware Robot

Merge topic 'stream-tracer-field-data-fix' into paraview/release

2afa9dd8 Pass field data from input to output
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !6912
parents 222c5b6b 2afa9dd8
......@@ -70,10 +70,16 @@ int TestFieldNames(int, char*[])
}
image1->GetPointData()->AddArray(arr1);
vtkNew<vtkIntArray> fieldArray;
fieldArray->SetNumberOfTuples(1);
fieldArray->SetName("GlobalData");
fieldArray->SetValue(0, 3);
vtkNew<vtkMultiBlockDataSet> dataSets;
dataSets->SetNumberOfBlocks(2);
dataSets->SetBlock(0, image0);
dataSets->SetBlock(1, image1);
dataSets->GetFieldData()->AddArray(fieldArray);
// create one seed
vtkNew<vtkPolyData> seeds;
......@@ -94,7 +100,8 @@ int TestFieldNames(int, char*[])
vtkPolyData* trace = vtkPolyData::SafeDownCast(tracer->GetOutputDataObject(0));
if (trace->GetPointData()->GetArray("array 0") != nullptr ||
trace->GetPointData()->GetArray("array 1") != nullptr ||
trace->GetPointData()->GetArray("RTData") == nullptr || trace->GetNumberOfPoints() == 0)
trace->GetPointData()->GetArray("RTData") == nullptr || trace->GetNumberOfPoints() == 0 ||
trace->GetFieldData()->GetArray("GlobalData") == nullptr)
{
return EXIT_FAILURE;
}
......
......@@ -415,6 +415,10 @@ int vtkStreamTracer::SetupOutput(vtkInformation* inInfo, vtkInformation* outInfo
int numPieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
vtkDataObject* output = outInfo->Get(vtkDataObject::DATA_OBJECT());
// Pass through field data
output->GetFieldData()->PassData(input->GetFieldData());
vtkCompositeDataSet* hdInput = vtkCompositeDataSet::SafeDownCast(input);
vtkDataSet* dsInput = vtkDataSet::SafeDownCast(input);
......
......@@ -69,6 +69,11 @@
* a source object, traces will be generated from each point in the source
* that is inside the dataset.
*
* @note Field data is shallow copied to the output. When the input is a
* composite data set, field data associated with the root block is shallow-
* copied to the output vtkPolyData.
*
*
* @sa
* vtkRibbonFilter vtkRuledSurfaceFilter vtkInitialValueProblemSolver
* vtkRungeKutta2 vtkRungeKutta4 vtkRungeKutta45 vtkParticleTracerBase
......
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