Commit 9276e084 authored by Dan Lipsa's avatar Dan Lipsa Committed by Kitware Robot
Browse files

Merge topic 'resample-mesh-multiblock-15397'

f9053470

 BUG: vtkProbeFilter stored state which did not work for multi-block data.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !405
parents 867757ca f9053470
......@@ -40,8 +40,7 @@ vtkProbeFilter::vtkProbeFilter()
{
this->SpatialMatch = 0;
this->ValidPoints = vtkIdTypeArray::New();
this->MaskPoints = vtkCharArray::New();
this->MaskPoints->SetNumberOfComponents(1);
this->MaskPoints = NULL;
this->SetNumberOfInputPorts(2);
this->ValidPointMaskArrayName = 0;
this->SetValidPointMaskArrayName("vtkValidPointMask");
......@@ -63,8 +62,11 @@ vtkProbeFilter::vtkProbeFilter()
//----------------------------------------------------------------------------
vtkProbeFilter::~vtkProbeFilter()
{
if (this->MaskPoints)
{
this->MaskPoints->Delete();
this->MaskPoints = 0;
}
this->ValidPoints->Delete();
this->ValidPoints = NULL;
this->SetValidPointMaskArrayName(0);
......@@ -192,6 +194,15 @@ void vtkProbeFilter::InitializeForProbing(vtkDataSet* input,
// Initialize valid points/mask points arrays.
this->NumberOfValidPoints = 0;
this->ValidPoints->Allocate(numPts);
// if this is repeatedly called by the pipeline for a composite mesh,
// you need a new array for each block
// (that is you need to reinitialize the object)
if (this->MaskPoints)
{
this->MaskPoints->Delete();
}
this->MaskPoints = vtkCharArray::New();
this->MaskPoints->SetNumberOfComponents(1);
this->MaskPoints->SetNumberOfTuples(numPts);
this->MaskPoints->FillComponent(0, 0);
this->MaskPoints->SetName(this->ValidPointMaskArrayName?
......
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