VTK-m  2.2
ExternalFaces.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 
11 #ifndef vtkm_filter_entity_extraction_ExternalFaces_h
12 #define vtkm_filter_entity_extraction_ExternalFaces_h
13 
14 #include <vtkm/filter/Filter.h>
16 
17 namespace vtkm
18 {
19 namespace worklet
20 {
21 struct ExternalFaces;
22 }
23 namespace filter
24 {
25 namespace entity_extraction
26 {
34 {
35 public:
36  ExternalFaces();
37  ~ExternalFaces() override;
38 
39  // New Design: I am too lazy to make this filter thread-safe. Let's use it as an example of
40  // thread un-safe filter.
41  bool CanThread() const override { return false; }
42 
50  VTKM_CONT bool GetCompactPoints() const { return this->CompactPoints; }
52  VTKM_CONT void SetCompactPoints(bool value) { this->CompactPoints = value; }
53 
59  VTKM_CONT bool GetPassPolyData() const { return this->PassPolyData; }
61  VTKM_CONT void SetPassPolyData(bool value);
62 
63 private:
64  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
65 
66  vtkm::cont::DataSet GenerateOutput(const vtkm::cont::DataSet& input,
67  vtkm::cont::CellSetExplicit<>& outCellSet);
68 
69  VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result, const vtkm::cont::Field& field);
70 
71  bool CompactPoints = false;
72  bool PassPolyData = true;
73 
74  // Note: This shared state as a data member requires us to explicitly implement the
75  // constructor and destructor in the .cxx file, after the compiler actually have
76  // seen the definition of worklet:ExternalFaces, even if the implementation of
77  // the cstr/dstr is just = default. Otherwise the compiler does not know how to
78  // allocate/free storage for the std::unique_ptr.
79  std::unique_ptr<vtkm::worklet::ExternalFaces> Worklet;
80 };
81 } // namespace entity_extraction
82 } // namespace filter
83 } // namespace vtkm
84 
85 #endif // vtkm_filter_entity_extraction_ExternalFaces_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::entity_extraction::ExternalFaces::Worklet
std::unique_ptr< vtkm::worklet::ExternalFaces > Worklet
Definition: ExternalFaces.h:79
VTKM_FILTER_ENTITY_EXTRACTION_EXPORT
#define VTKM_FILTER_ENTITY_EXTRACTION_EXPORT
Definition: vtkm_filter_entity_extraction_export.h:44
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::filter::entity_extraction::ExternalFaces::CanThread
bool CanThread() const override
Returns whether the filter can execute on partitions in concurrent threads.
Definition: ExternalFaces.h:41
vtkm::filter::entity_extraction::ExternalFaces
Extract external faces of a geometry.
Definition: ExternalFaces.h:33
vtkm::filter::entity_extraction::ExternalFaces::GetCompactPoints
bool GetCompactPoints() const
Option to remove unused points and compact result int a smaller array.
Definition: ExternalFaces.h:50
vtkm::cont::Field
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:31
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::entity_extraction::ExternalFaces::SetCompactPoints
void SetCompactPoints(bool value)
Option to remove unused points and compact result int a smaller array.
Definition: ExternalFaces.h:52
vtkm::filter::entity_extraction::ExternalFaces::GetPassPolyData
bool GetPassPolyData() const
Specify how polygonal data (polygons, lines, and vertices) will be handled.
Definition: ExternalFaces.h:59
vtkm::cont::CellSetExplicit
Defines an irregular collection of cells.
Definition: CastAndCall.h:36
vtkm_filter_entity_extraction_export.h
Filter.h