Commit 4faf1bf0 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'build_filter_lib'

8520d70e Compile most frequently used VTK-m filters into a library
d1d61b9e vtkm::filter::Filter passes filter policies by value
4ff021b0 Improve VTK-m compilation times by compiling more keys<T> types
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1836
parents 42e89a33 8520d70e
......@@ -142,7 +142,6 @@ using UnstructuredCellList =
using AllCellList = vtkm::ListTagJoin<StructuredCellList, UnstructuredCellList>;
using CoordinateList = vtkm::ListTagBase<vtkm::Vec3f_32, vtkm::Vec3f_64>;
class BenchmarkFilterPolicy : public vtkm::filter::PolicyBase<BenchmarkFilterPolicy>
{
......@@ -152,8 +151,6 @@ public:
using StructuredCellSetList = StructuredCellList;
using UnstructuredCellSetList = UnstructuredCellList;
using AllCellSetList = AllCellList;
using CoordinateTypeList = CoordinateList;
};
// Class implementing all filter benchmarks:
......@@ -307,7 +304,7 @@ class BenchmarkFilters
{
Timer timer{ DeviceAdapter() };
timer.Start();
auto result = this->Filter.Execute(InputDataSet, BenchmarkFilterPolicy());
auto result = this->Filter.Execute(InputDataSet);
(void)result;
return timer.GetElapsedTime();
}
......@@ -374,7 +371,7 @@ class BenchmarkFilters
{
Timer timer{ DeviceAdapter() };
timer.Start();
auto result = this->Filter.Execute(InputDataSet, BenchmarkFilterPolicy());
auto result = this->Filter.Execute(InputDataSet);
(void)result;
return timer.GetElapsedTime();
}
......@@ -400,7 +397,7 @@ class BenchmarkFilters
{
Timer timer{ DeviceAdapter() };
timer.Start();
auto result = this->Filter.Execute(InputDataSet, BenchmarkFilterPolicy());
auto result = this->Filter.Execute(InputDataSet);
(void)result;
return timer.GetElapsedTime();
}
......@@ -501,7 +498,7 @@ class BenchmarkFilters
{
Timer timer{ DeviceAdapter() };
timer.Start();
auto result = this->Filter.Execute(InputDataSet, BenchmarkFilterPolicy());
auto result = this->Filter.Execute(InputDataSet);
(void)result;
return timer.GetElapsedTime();
}
......@@ -547,7 +544,7 @@ class BenchmarkFilters
{
Timer timer{ DeviceAdapter() };
timer.Start();
auto result = this->Filter.Execute(InputDataSet, BenchmarkFilterPolicy());
auto result = this->Filter.Execute(InputDataSet);
(void)result;
return timer.GetElapsedTime();
}
......@@ -954,7 +951,7 @@ void CreateFields(bool needPointScalars, bool needCellScalars, bool needPointVec
vtkm::filter::PointAverage avg;
avg.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::CELL_SET);
avg.SetOutputFieldName("GeneratedPointScalars");
auto outds = avg.Execute(InputDataSet, BenchmarkFilterPolicy());
auto outds = avg.Execute(InputDataSet);
InputDataSet.AddField(
outds.GetField("GeneratedPointScalars", vtkm::cont::Field::Association::POINTS));
PointScalarsName = "GeneratedPointScalars";
......@@ -977,7 +974,7 @@ void CreateFields(bool needPointScalars, bool needCellScalars, bool needPointVec
vtkm::filter::VectorMagnitude mag;
mag.SetActiveField(PointVectorsName, vtkm::cont::Field::Association::POINTS);
mag.SetOutputFieldName("GeneratedPointScalars");
auto outds = mag.Execute(InputDataSet, BenchmarkFilterPolicy());
auto outds = mag.Execute(InputDataSet);
InputDataSet.AddField(
outds.GetField("GeneratedPointScalars", vtkm::cont::Field::Association::POINTS));
PointScalarsName = "GeneratedPointScalars";
......@@ -999,7 +996,7 @@ void CreateFields(bool needPointScalars, bool needCellScalars, bool needPointVec
vtkm::filter::CellAverage avg;
avg.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
avg.SetOutputFieldName("GeneratedCellScalars");
auto outds = avg.Execute(InputDataSet, BenchmarkFilterPolicy());
auto outds = avg.Execute(InputDataSet);
InputDataSet.AddField(
outds.GetField("GeneratedCellScalars", vtkm::cont::Field::Association::CELL_SET));
CellScalarsName = "GeneratedCellScalars";
......
# Provide pre-built filters in the vtkm_filter library.
VTK-m now provides the following pre built versions of
the following filters as part of the vtkm_filter library,
when executed with the default types.
- CellAverage
- CleanGrid
- ClipWithField
- ClipWithImplicitFunction
- Contour
- ExternalFaces
- ExtractStuctured
- PointAverage
- Threshold
- VectorMagnitude
The decision on providing a subset of filters as a library
was based on balancing the resulting library size and cross domain
applicibaility of the filter. So the initial set of algorithms
have been selected by looking at what is commonly used by
current VTK-m consuming applications.
By default types we mean that no explicit user policy has been
passed to the `Execute` method on these filters. For example
the following will use the pre-build `Threshold` and `CleanGrid`
filters:
```cpp
vtkm::cont::DataSet input = ...;
//convert input to an unstructured grid
vtkm::filter::CleanGrid clean;
auto cleaned = clean.Execute(input);
vtkm::filter::Threshold threshold;
threshold.SetLowerThreshold(60.1);
threshold.SetUpperThreshold(60.1);
threshold.SetActiveField("pointvar");
threshold.SetFieldsToPass("cellvar");
auto output = threshold.Execute(cleaned);
...
```
While the following, even though it is a subset of the default
policy will need to be compiled by the consuming library by
including the relevant `.hxx` files
```cpp
#include <vtkm/filter/CleanGrid.hxx>
#include <vtkm/filter/Threshold.hxx>
...
struct CustomPolicy : vtkm::filter::PolicyBase<CustomPolicy>
{
// Defaults are the same as PolicyDefault expect for the field types
using FieldTypeList = vtkm::ListTagBase<vtkm::FloatDefault, vtkm::Vec3f>;
};
...
vtkm::cont::DataSet input = ...;
//convert input to an unstructured grid
vtkm::filter::CleanGrid clean;
auto cleaned = clean.Execute(input, CustomPolicy{});
vtkm::filter::Threshold threshold;
threshold.SetLowerThreshold(60.1);
threshold.SetUpperThreshold(60.1);
threshold.SetActiveField("pointvar");
threshold.SetFieldsToPass("cellvar");
auto output = threshold.Execute(cleaned, CustomPolicy{});
...
```
......@@ -15,7 +15,7 @@ find_package(VTKm REQUIRED QUIET)
if(TARGET vtkm_rendering)
add_executable(Demo Demo.cxx)
target_link_libraries(Demo PRIVATE vtkm_rendering)
target_link_libraries(Demo PRIVATE vtkm_filter vtkm_rendering)
vtkm_add_target_information(Demo
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
DEVICE_SOURCES Demo.cxx)
......
......@@ -13,8 +13,9 @@
#include <vtkm/cont/ArrayHandleExtrudeCoords.h>
#include <vtkm/cont/CellSetExtrude.h>
#include <vtkm/cont/testing/Testing.h>
#include <vtkm/filter/CellAverage.h>
#include <vtkm/filter/PointAverage.h>
#include <vtkm/filter/PointAverage.hxx>
#include <vtkm/filter/PolicyExtrude.h>
namespace
......
......@@ -139,16 +139,26 @@ set(header_template_sources
ZFPCompressor3D.hxx
ZFPDecompressor3D.hxx
)
set(sources_device
CellAverage.cxx
CleanGrid.cxx
ClipWithField.cxx
ClipWithImplicitFunction.cxx
Contour.cxx
ExternalFaces.cxx
ExtractStructured.cxx
PointAverage.cxx
Threshold.cxx
VectorMagnitude.cxx
)
vtkm_declare_headers(${headers})
vtkm_declare_headers(${header_template_sources})
# Create an interface library for vtkm_filter. At some point, this will be replaced with a real
# library that contains pre-built filters. That would be created with the vtkm_library CMake
# function (defined in VTKmWrappers.cmake).
add_library(vtkm_filter INTERFACE)
target_link_libraries(vtkm_filter INTERFACE vtkm_worklet)
install(TARGETS vtkm_filter EXPORT ${VTKm_EXPORT_NAME})
vtkm_library(
NAME vtkm_filter
TEMPLATE_SOURCES ${header_template_sources}
HEADERS ${headers}
DEVICE_SOURCES ${sources_device}
)
target_link_libraries(vtkm_filter PUBLIC vtkm_worklet)
add_subdirectory(internal)
......
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#define vtkm_filter_CellAverage_cxx
#include <vtkm/filter/CellAverage.h>
#include <vtkm/filter/CellAverage.hxx>
namespace vtkm
{
namespace filter
{
//-----------------------------------------------------------------------------
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(CellAverage);
}
}
......@@ -11,6 +11,9 @@
#ifndef vtk_m_filter_CellAverage_h
#define vtk_m_filter_CellAverage_h
#include <vtkm/filter/vtkm_filter_export.h>
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
#include <vtkm/filter/FilterCell.h>
#include <vtkm/worklet/CellAverage.h>
......@@ -25,24 +28,23 @@ namespace filter
/// The method of transformation is based on averaging the data
/// values of all points used by particular cell.
///
class CellAverage : public vtkm::filter::FilterCell<CellAverage>
class VTKM_ALWAYS_EXPORT CellAverage : public vtkm::filter::FilterCell<CellAverage>
{
public:
VTKM_CONT
CellAverage();
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
vtkm::filter::PolicyBase<DerivedPolicy> policy);
private:
vtkm::worklet::CellAverage Worklet;
};
#ifndef vtkm_filter_CellAverage_cxx
VTKM_FILTER_EXPORT_EXECUTE_METHOD(CellAverage);
#endif
}
} // namespace vtkm::filter
#include <vtkm/filter/CellAverage.hxx>
#endif // vtk_m_filter_CellAverage_h
......@@ -15,21 +15,13 @@ namespace vtkm
{
namespace filter
{
//-----------------------------------------------------------------------------
inline VTKM_CONT CellAverage::CellAverage()
: vtkm::filter::FilterCell<CellAverage>()
, Worklet()
{
}
//-----------------------------------------------------------------------------
template <typename T, typename StorageType, typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet CellAverage::DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& inField,
const vtkm::filter::FieldMetadata& fieldMetadata,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
vtkm::filter::PolicyBase<DerivedPolicy> policy)
{
if (!fieldMetadata.IsPointField())
{
......
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#define vtkm_filter_CleanGrid_cxx
#include <vtkm/filter/CleanGrid.h>
#include <vtkm/filter/CleanGrid.hxx>
namespace vtkm
{
namespace filter
{
//-----------------------------------------------------------------------------
CleanGrid::CleanGrid()
: CompactPointFields(true)
, MergePoints(true)
, Tolerance(1.0e-6)
, ToleranceIsAbsolute(false)
, RemoveDegenerateCells(true)
, FastMerge(true)
{
}
//-----------------------------------------------------------------------------
vtkm::cont::DataSet CleanGrid::GenerateOutput(const vtkm::cont::DataSet& inData,
vtkm::cont::CellSetExplicit<>& outputCellSet)
{
using VecId = std::size_t;
const VecId activeCoordIndex = static_cast<VecId>(this->GetActiveCoordinateSystemIndex());
const VecId numCoordSystems = static_cast<VecId>(inData.GetNumberOfCoordinateSystems());
std::vector<vtkm::cont::CoordinateSystem> outputCoordinateSystems(numCoordSystems);
// Start with a shallow copy of the coordinate systems
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
outputCoordinateSystems[coordSystemIndex] =
inData.GetCoordinateSystem(static_cast<vtkm::IdComponent>(coordSystemIndex));
}
// Optionally adjust the cell set indices to remove all unused points
if (this->GetCompactPointFields())
{
this->PointCompactor.FindPointsStart();
this->PointCompactor.FindPoints(outputCellSet);
this->PointCompactor.FindPointsEnd();
outputCellSet = this->PointCompactor.MapCellSet(outputCellSet);
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
outputCoordinateSystems[coordSystemIndex] =
vtkm::cont::CoordinateSystem(outputCoordinateSystems[coordSystemIndex].GetName(),
this->PointCompactor.MapPointFieldDeep(
outputCoordinateSystems[coordSystemIndex].GetData()));
}
}
// Optionally find and merge coincident points
if (this->GetMergePoints())
{
vtkm::cont::CoordinateSystem activeCoordSystem = outputCoordinateSystems[activeCoordIndex];
vtkm::Bounds bounds = activeCoordSystem.GetBounds();
vtkm::Float64 delta = this->GetTolerance();
if (!this->GetToleranceIsAbsolute())
{
delta *=
vtkm::Magnitude(vtkm::make_Vec(bounds.X.Length(), bounds.Y.Length(), bounds.Z.Length()));
}
auto coordArray = activeCoordSystem.GetData();
this->PointMerger.Run(delta, this->GetFastMerge(), bounds, coordArray);
activeCoordSystem = vtkm::cont::CoordinateSystem(activeCoordSystem.GetName(), coordArray);
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
if (coordSystemIndex == activeCoordIndex)
{
outputCoordinateSystems[coordSystemIndex] = activeCoordSystem;
}
else
{
outputCoordinateSystems[coordSystemIndex] = vtkm::cont::CoordinateSystem(
outputCoordinateSystems[coordSystemIndex].GetName(),
this->PointMerger.MapPointField(outputCoordinateSystems[coordSystemIndex].GetData()));
}
}
outputCellSet = this->PointMerger.MapCellSet(outputCellSet);
}
// Optionally remove degenerate cells
if (this->GetRemoveDegenerateCells())
{
outputCellSet = this->CellCompactor.Run(outputCellSet);
}
// Construct resulting data set with new cell sets
vtkm::cont::DataSet outData;
outData.SetCellSet(outputCellSet);
// Pass the coordinate systems
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
outData.AddCoordinateSystem(outputCoordinateSystems[coordSystemIndex]);
}
return outData;
}
//-----------------------------------------------------------------------------
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(CleanGrid);
}
}
......@@ -10,6 +10,8 @@
#ifndef vtk_m_filter_CleanGrid_h
#define vtk_m_filter_CleanGrid_h
#include <vtkm/filter/vtkm_filter_export.h>
#include <vtkm/filter/FilterDataSet.h>
#include <vtkm/worklet/PointMerge.h>
......@@ -35,10 +37,10 @@ namespace filter
/// \todo Add a feature to merge points that are coincident or within a
/// tolerance.
///
class CleanGrid : public vtkm::filter::FilterDataSet<CleanGrid>
class VTKM_ALWAYS_EXPORT CleanGrid : public vtkm::filter::FilterDataSet<CleanGrid>
{
public:
VTKM_CONT
VTKM_FILTER_EXPORT
CleanGrid();
/// When the CompactPointFields flag is true, the filter will identify any
......@@ -85,15 +87,41 @@ public:
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData,
vtkm::filter::PolicyBase<Policy> policy);
template <typename ValueType, typename Storage, typename Policy>
VTKM_CONT bool DoMapField(vtkm::cont::DataSet& result,
const vtkm::cont::ArrayHandle<ValueType, Storage>& input,
const vtkm::filter::FieldMetadata& fieldMeta,
vtkm::filter::PolicyBase<Policy>);
template <typename ValueType, typename Storage>
VTKM_CONT vtkm::cont::ArrayHandle<ValueType> MapPointField(
const vtkm::cont::ArrayHandle<ValueType, Storage>& inArray) const;
vtkm::filter::PolicyBase<Policy>)
{
if (fieldMeta.IsPointField() && (this->GetCompactPointFields() || this->GetMergePoints()))
{
vtkm::cont::ArrayHandle<ValueType> compactedArray;
if (this->GetCompactPointFields())
{
compactedArray = this->PointCompactor.MapPointFieldDeep(input);
if (this->GetMergePoints())
{
compactedArray = this->PointMerger.MapPointField(compactedArray);
}
}
else if (this->GetMergePoints())
{
compactedArray = this->PointMerger.MapPointField(input);
}
result.AddField(fieldMeta.AsField(compactedArray));
}
else if (fieldMeta.IsCellField() && this->GetRemoveDegenerateCells())
{
result.AddField(fieldMeta.AsField(this->CellCompactor.ProcessCellField(input)));
}
else
{
result.AddField(fieldMeta.AsField(input));
}
return true;
}
private:
bool CompactPointFields;
......@@ -103,13 +131,19 @@ private:
bool RemoveDegenerateCells;
bool FastMerge;
VTKM_FILTER_EXPORT vtkm::cont::DataSet GenerateOutput(
const vtkm::cont::DataSet& inData,
vtkm::cont::CellSetExplicit<>& outputCellSet);
vtkm::worklet::RemoveUnusedPoints PointCompactor;
vtkm::worklet::RemoveDegenerateCells CellCompactor;
vtkm::worklet::PointMerge PointMerger;
};
#ifndef vtkm_filter_CleanGrid_cxx
VTKM_FILTER_EXPORT_EXECUTE_METHOD(CleanGrid);
#endif
}
} // namespace vtkm::filter
#include <vtkm/filter/CleanGrid.hxx>
#endif //vtk_m_filter_CleanGrid_h
......@@ -20,24 +20,11 @@ namespace vtkm
namespace filter
{
inline VTKM_CONT CleanGrid::CleanGrid()
: CompactPointFields(true)
, MergePoints(true)
, Tolerance(1.0e-6)
, ToleranceIsAbsolute(false)
, RemoveDegenerateCells(true)
, FastMerge(true)
{
}
template <typename Policy>
inline VTKM_CONT vtkm::cont::DataSet CleanGrid::DoExecute(const vtkm::cont::DataSet& inData,
vtkm::filter::PolicyBase<Policy> policy)
{
using CellSetType = vtkm::cont::CellSetExplicit<>;
using VecId = std::size_t;
VecId activeCoordIndex = static_cast<VecId>(this->GetActiveCoordinateSystemIndex());
CellSetType outputCellSet;
// Do a deep copy of the cells to new CellSetExplicit structures
......@@ -78,122 +65,7 @@ inline VTKM_CONT vtkm::cont::DataSet CleanGrid::DoExecute(const vtkm::cont::Data
deducedCellSet.ReleaseResourcesExecution();
}
VecId numCoordSystems = static_cast<VecId>(inData.GetNumberOfCoordinateSystems());
std::vector<vtkm::cont::CoordinateSystem> outputCoordinateSystems(numCoordSystems);
// Start with a shallow copy of the coordinate systems
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
outputCoordinateSystems[coordSystemIndex] =
inData.GetCoordinateSystem(static_cast<vtkm::IdComponent>(coordSystemIndex));
}
// Optionally adjust the cell set indices to remove all unused points
if (this->GetCompactPointFields())
{
this->PointCompactor.FindPointsStart();
this->PointCompactor.FindPoints(outputCellSet);
this->PointCompactor.FindPointsEnd();
outputCellSet = this->PointCompactor.MapCellSet(outputCellSet);
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
outputCoordinateSystems[coordSystemIndex] =
vtkm::cont::CoordinateSystem(outputCoordinateSystems[coordSystemIndex].GetName(),
this->PointCompactor.MapPointFieldDeep(
outputCoordinateSystems[coordSystemIndex].GetData()));
}
}
// Optionally find and merge coincident points
if (this->GetMergePoints())
{
vtkm::cont::CoordinateSystem activeCoordSystem = outputCoordinateSystems[activeCoordIndex];
vtkm::Bounds bounds = activeCoordSystem.GetBounds();
vtkm::Float64 delta = this->GetTolerance();
if (!this->GetToleranceIsAbsolute())
{
delta *=
vtkm::Magnitude(vtkm::make_Vec(bounds.X.Length(), bounds.Y.Length(), bounds.Z.Length()));
}
auto coordArray = activeCoordSystem.GetData();
this->PointMerger.Run(delta, this->GetFastMerge(), bounds, coordArray);
activeCoordSystem = vtkm::cont::CoordinateSystem(activeCoordSystem.GetName(), coordArray);
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
if (coordSystemIndex == activeCoordIndex)
{
outputCoordinateSystems[coordSystemIndex] = activeCoordSystem;
}
else
{
outputCoordinateSystems[coordSystemIndex] = vtkm::cont::CoordinateSystem(
outputCoordinateSystems[coordSystemIndex].GetName(),
this->PointMerger.MapPointField(outputCoordinateSystems[coordSystemIndex].GetData()));
}
}
outputCellSet = this->PointMerger.MapCellSet(outputCellSet);
}
// Optionally remove degenerate cells
if (this->GetRemoveDegenerateCells())
{
outputCellSet = this->CellCompactor.Run(outputCellSet);
}
// Construct resulting data set with new cell sets
vtkm::cont::DataSet outData;
outData.SetCellSet(outputCellSet);
// Pass the coordinate systems
for (VecId coordSystemIndex = 0; coordSystemIndex < numCoordSystems; ++coordSystemIndex)
{
outData.AddCoordinateSystem(outputCoordinateSystems[coordSystemIndex]);
}
return outData;
}
template <typename ValueType, typename Storage, typename Policy>
inline VTKM_CONT bool CleanGrid::DoMapField(
vtkm::cont::DataSet& result,
const vtkm::cont::ArrayHandle<ValueType, Storage>& input,
const vtkm::filter::FieldMetadata& fieldMeta,
vtkm::filter::PolicyBase<Policy>)
{
if (fieldMeta.IsPointField() && (this->GetCompactPointFields() || this->GetMergePoints()))
{
vtkm::cont::ArrayHandle<ValueType> compactedArray;
if (this->GetCompactPointFields())
{
compactedArray = this->PointCompactor.MapPointFieldDeep(input);
if (this->GetMergePoints())
{
compactedArray = this->PointMerger.MapPointField(compactedArray);
}
}
else if (this->GetMergePoints())
{
compactedArray = this->PointMerger.MapPointField(input);
}
result.AddField(fieldMeta.AsField(compactedArray));
}
else if (fieldMeta.IsCellField() && this->GetRemoveDegenerateCells())
{
result.AddField(fieldMeta.AsField(this->CellCompactor.ProcessCellField(input)));
}
else
{
result.AddField(fieldMeta.AsField(input));
}
return true;
return this->GenerateOutput(inData, outputCellSet);
}
}
}
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#define vtkm_filter_Clip_cxx
#include <vtkm/filter/ClipWithField.h>
#include <vtkm/filter/ClipWithField.hxx>
namespace vtkm
{
namespace filter
{
//-----------------------------------------------------------------------------
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(ClipWithField);
}
}
......@@ -11,6 +11,8 @@
#ifndef vtk_m_filter_ClipWithField_h
#define vtk_m_filter_ClipWithField_h
#include <vtkm/filter/vtkm_filter_export.h>
#include <vtkm/filter/FilterDataSetWithField.h>
#include <vtkm/worklet/Clip.h>
......@@ -24,14 +26,11 @@ namespace filter
/// value are considered outside, and will be discarded. All points that are greater
/// are kept.
/// The resulting geometry will not be water tight.
class ClipWithField : public vtkm::filter::FilterDataSetWithField<ClipWithField>
class VTKM_ALWAYS_EXPORT ClipWithField : public vtkm::filter::FilterDataSetWithField<ClipWithField>
{
public:
using SupportedTypes = vtkm::TypeListTagScalarAll;
VTKM_CONT
ClipWithField();