Commit 45f72b3b authored by Patricio Sandaña's avatar Patricio Sandaña

Changing default FindCell algorithm.

parent dd3627bb
......@@ -14,6 +14,7 @@
=========================================================================*/
#include "vtkProbeFilter.h"
#include "vtkAbstractCellLocator.h"
#include "vtkBoundingBox.h"
#include "vtkCell.h"
#include "vtkCellData.h"
......@@ -30,7 +31,6 @@
#include "vtkSmartPointer.h"
#include "vtkSMPTools.h"
#include "vtkSMPThreadLocal.h"
#include "vtkStaticCellLocator.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include <algorithm>
......@@ -404,13 +404,12 @@ void vtkProbeFilter::ProbeEmptyPoints(vtkDataSet *input,
// vtkPointSet based datasets do not have an implicit structure to their
// points. A cell locator performs better here than using the dataset's
// FindCell function.
// FindCell function. Using its own FindCell method by default.
vtkSmartPointer<vtkAbstractCellLocator> cellLocator;
if (vtkPointSet::SafeDownCast(source) != nullptr)
if ( (vtkPointSet::SafeDownCast(source) != nullptr) &&
(this->CellLocatorPrototype != nullptr) )
{
cellLocator.TakeReference(this->CellLocatorPrototype ?
this->CellLocatorPrototype->NewInstance() :
vtkStaticCellLocator::New());
cellLocator.TakeReference(this->CellLocatorPrototype->NewInstance());
cellLocator->SetDataSet(source);
cellLocator->Update();
}
......
......@@ -175,7 +175,7 @@ public:
//@{
/**
* Set/Get the prototype cell locator to use for probing the source dataset.
* By default, vtkStaticCellLocator will be used.
* By default, vtkDataSet::FindCell is called.
*/
virtual void SetCellLocatorPrototype(vtkAbstractCellLocator*);
vtkGetObjectMacro(CellLocatorPrototype, vtkAbstractCellLocator);
......
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