2016-01-19 14:59:31 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2016-01-19 14:59:31 +00:00
|
|
|
// 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.
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef vtk_m_filter_ExternalFaces_h
|
|
|
|
#define vtk_m_filter_ExternalFaces_h
|
|
|
|
|
2020-08-19 23:20:43 +00:00
|
|
|
#include <vtkm/filter/vtkm_filter_extra_export.h>
|
2019-09-09 13:39:23 +00:00
|
|
|
|
2017-03-07 14:48:59 +00:00
|
|
|
#include <vtkm/filter/CleanGrid.h>
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/filter/FilterDataSet.h>
|
2020-02-05 04:44:10 +00:00
|
|
|
#include <vtkm/filter/MapFieldPermutation.h>
|
2016-01-19 14:59:31 +00:00
|
|
|
#include <vtkm/worklet/ExternalFaces.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2017-07-06 17:51:45 +00:00
|
|
|
/// \brief Extract external faces of a geometry
|
|
|
|
///
|
|
|
|
/// ExternalFaces is a filter that extracts all external faces from a
|
|
|
|
/// data set. An external face is defined is defined as a face/side of a cell
|
|
|
|
/// that belongs only to one cell in the entire mesh.
|
|
|
|
/// @warning
|
|
|
|
/// This filter is currently only supports propagation of point properties
|
|
|
|
///
|
2020-11-17 19:37:05 +00:00
|
|
|
class VTKM_FILTER_EXTRA_EXPORT ExternalFaces : public vtkm::filter::FilterDataSet<ExternalFaces>
|
2016-01-19 14:59:31 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ExternalFaces();
|
|
|
|
|
2017-03-07 14:48:59 +00:00
|
|
|
// When CompactPoints is set, instead of copying the points and point fields
|
|
|
|
// from the input, the filter will create new compact fields without the
|
|
|
|
// unused elements
|
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
bool GetCompactPoints() const { return this->CompactPoints; }
|
2017-03-07 14:48:59 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
void SetCompactPoints(bool value) { this->CompactPoints = value; }
|
2017-03-07 14:48:59 +00:00
|
|
|
|
2017-08-03 15:19:22 +00:00
|
|
|
// When PassPolyData is set (the default), incoming poly data (0D, 1D, and 2D cells)
|
|
|
|
// will be passed to the output external faces data set.
|
|
|
|
VTKM_CONT
|
|
|
|
bool GetPassPolyData() const { return this->PassPolyData; }
|
|
|
|
VTKM_CONT
|
|
|
|
void SetPassPolyData(bool value)
|
|
|
|
{
|
|
|
|
this->PassPolyData = value;
|
|
|
|
this->Worklet.SetPassPolyData(value);
|
|
|
|
}
|
|
|
|
|
2018-08-30 15:53:18 +00:00
|
|
|
template <typename DerivedPolicy>
|
2018-04-02 21:58:21 +00:00
|
|
|
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
|
2018-08-30 15:53:18 +00:00
|
|
|
vtkm::filter::PolicyBase<DerivedPolicy> policy);
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2020-11-17 19:37:05 +00:00
|
|
|
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result, const vtkm::cont::Field& field);
|
2017-03-07 14:48:59 +00:00
|
|
|
|
2020-02-05 04:44:10 +00:00
|
|
|
template <typename DerivedPolicy>
|
|
|
|
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
|
|
|
const vtkm::cont::Field& field,
|
|
|
|
vtkm::filter::PolicyBase<DerivedPolicy>)
|
|
|
|
{
|
|
|
|
return this->MapFieldOntoOutput(result, field);
|
2019-09-09 13:39:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2017-03-07 14:48:59 +00:00
|
|
|
bool CompactPoints;
|
2017-08-03 15:19:22 +00:00
|
|
|
bool PassPolyData;
|
2019-09-09 13:39:23 +00:00
|
|
|
|
2020-11-17 19:37:05 +00:00
|
|
|
vtkm::cont::DataSet GenerateOutput(const vtkm::cont::DataSet& input,
|
|
|
|
vtkm::cont::CellSetExplicit<>& outCellSet);
|
2019-09-09 13:39:23 +00:00
|
|
|
|
2017-03-07 14:48:59 +00:00
|
|
|
vtkm::filter::CleanGrid Compactor;
|
2017-07-31 14:06:33 +00:00
|
|
|
vtkm::worklet::ExternalFaces Worklet;
|
2016-01-19 14:59:31 +00:00
|
|
|
};
|
2019-09-09 13:39:23 +00:00
|
|
|
#ifndef vtkm_filter_ExternalFaces_cxx
|
2020-11-17 19:37:05 +00:00
|
|
|
extern template VTKM_FILTER_EXTRA_TEMPLATE_EXPORT vtkm::cont::DataSet ExternalFaces::DoExecute(
|
|
|
|
const vtkm::cont::DataSet&,
|
|
|
|
vtkm::filter::PolicyBase<vtkm::filter::PolicyDefault>);
|
2019-09-09 13:39:23 +00:00
|
|
|
#endif
|
2016-01-19 14:59:31 +00:00
|
|
|
}
|
|
|
|
} // namespace vtkm::filter
|
|
|
|
|
2016-04-07 21:09:11 +00:00
|
|
|
#endif // vtk_m_filter_ExternalFaces_h
|