Commit ec591255 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Remove references to VTK-m header files from VTK filters

For better encapsulation (and simplification of the build), do not
expose VTK-m code itself from the vtkAcceleratorsVTKm package.
parent ea855589
......@@ -30,6 +30,7 @@
#include "vtkmlib/ArrayConverters.h"
#include "vtkmlib/DataSetConverters.h"
#include "vtkmlib/ImplicitFunctionConverter.h"
#include "vtkmlib/PolyDataConverter.h"
#include "vtkmlib/Storage.h"
#include "vtkmlib/UnstructuredGridConverter.h"
......@@ -61,7 +62,8 @@ void vtkmClip::PrintSelf(std::ostream &os, vtkIndent indent)
vtkmClip::vtkmClip()
: ClipValue(0.),
ComputeScalars(true),
ClipFunction(nullptr)
ClipFunction(nullptr),
ClipFunctionConverter(new tovtkm::ImplicitFunctionConverter)
{
// Clip active point scalars by default
this->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS,
......@@ -90,7 +92,7 @@ void vtkmClip::SetClipFunction(vtkImplicitFunction *clipFunction)
if (this->ClipFunction != clipFunction)
{
this->ClipFunction = clipFunction;
this->ClipFunctionConverter.Set(clipFunction);
this->ClipFunctionConverter->Set(clipFunction);
this->Modified();
}
}
......@@ -151,7 +153,7 @@ int vtkmClip::RequestData(vtkInformation *,
vtkmInputFilterPolicy policy;
if (this->ClipFunction)
{
auto function = this->ClipFunctionConverter.Get();
auto function = this->ClipFunctionConverter->Get();
if (function.GetValid())
{
functionFilter.SetImplicitFunction(function);
......
......@@ -27,12 +27,17 @@
#include "vtkAcceleratorsVTKmModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkmlib/ImplicitFunctionConverter.h" // For ImplicitFunctionConverter
#include <memory> // For std::shared_ptr
#include <memory> // For std::unique_ptr
class vtkImplicitFunction;
namespace tovtkm {
class ImplicitFunctionConverter;
} // namespace tovtkm
class VTKACCELERATORSVTKM_EXPORT vtkmClip : public vtkUnstructuredGridAlgorithm
{
public:
......@@ -77,7 +82,7 @@ protected:
bool ComputeScalars;
vtkImplicitFunction *ClipFunction;
tovtkm::ImplicitFunctionConverter ClipFunctionConverter;
std::unique_ptr<tovtkm::ImplicitFunctionConverter> ClipFunctionConverter;
private:
vtkmClip(const vtkmClip&) = delete;
......
......@@ -49,7 +49,6 @@
#include "vtkPolyDataAlgorithm.h"
#include "vtkAcceleratorsVTKmModule.h" //required for correct implementation
#include "vtkmConfig.h" //required for general vtkm setup
class VTKACCELERATORSVTKM_EXPORT vtkmLevelOfDetail : public vtkPolyDataAlgorithm
{
......
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