Viskores  1.0
GhostCellRemove.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_filter_entity_extraction_GhostCellRemove_h
20 #define viskores_filter_entity_extraction_GhostCellRemove_h
21 
23 #include <viskores/Deprecated.h>
24 #include <viskores/filter/Filter.h>
26 
27 namespace viskores
28 {
29 namespace filter
30 {
31 namespace entity_extraction
32 {
46 class VISKORES_FILTER_ENTITY_EXTRACTION_EXPORT GhostCellRemove : public viskores::filter::Filter
47 {
48 public:
50 
55  VISKORES_CONT void SetRemoveGhostField(bool flag) { this->RemoveField = flag; }
57  VISKORES_CONT bool GetRemoveGhostField() const { return this->RemoveField; }
58 
64  {
65  this->TypesToRemove = typeFlags;
66  }
68  VISKORES_CONT viskores::UInt8 GetTypesToRemove() const { return this->TypesToRemove; }
69 
75  VISKORES_CONT void SetTypesToRemoveToAll() { this->SetTypesToRemove(0xFF); }
77  VISKORES_CONT bool AreAllTypesRemoved() const { return this->GetTypesToRemove() == 0xFF; }
78 
79  VISKORES_DEPRECATED(2.1, "Use SetRemoveGhostField(true).")
80  VISKORES_CONT void RemoveGhostField() { this->SetRemoveGhostField(true); }
81  VISKORES_DEPRECATED(2.1, "Use SetTypesToRemoveToAll().")
82  VISKORES_CONT void RemoveAllGhost() { this->SetTypesToRemoveToAll(); }
83  VISKORES_DEPRECATED(2.1, "Use SetTypesToRemove(vals).")
84  VISKORES_CONT void RemoveByType(const viskores::UInt8& vals) { this->SetTypesToRemove(vals); }
85 
86  VISKORES_DEPRECATED(2.1, "Use AreAllTypesRemoved().")
87  VISKORES_CONT bool GetRemoveAllGhost() const { return this->AreAllTypesRemoved(); }
88 
95  VISKORES_CONT bool GetUseGhostCellsAsField() const { return this->UseGhostCellsAsField; }
97  VISKORES_CONT void SetUseGhostCellsAsField(bool flag) { this->UseGhostCellsAsField = flag; }
98 
99  VISKORES_DEPRECATED(2.1, "Use !AreAllTypesRemoved().")
100  VISKORES_CONT bool GetRemoveByType() const { return !this->AreAllTypesRemoved(); }
101  VISKORES_DEPRECATED(2.1, "Use GetTypesToRemove().")
102  VISKORES_CONT viskores::UInt8 GetRemoveType() const { return this->GetTypesToRemove(); }
103 
104 private:
106  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
107 
108  bool UseGhostCellsAsField = true;
109  bool RemoveField = false;
110  viskores::UInt8 TypesToRemove = 0xFF;
111 };
112 
113 } // namespace entity_extraction
114 } // namespace filter
115 } // namespace viskores
116 
117 #endif // viskores_filter_entity_extraction_GhostCellRemove_h
viskores::filter::entity_extraction::GhostCellRemove::GetTypesToRemove
viskores::UInt8 GetTypesToRemove() const
Specify which types of cells to remove.
Definition: GhostCellRemove.h:68
CellClassification.h
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::entity_extraction::GhostCellRemove::SetUseGhostCellsAsField
void SetUseGhostCellsAsField(bool flag)
Specify whether the marked ghost cells or a named field should be used as the ghost field.
Definition: GhostCellRemove.h:97
viskores::filter::entity_extraction::GhostCellRemove::SetTypesToRemove
void SetTypesToRemove(viskores::UInt8 typeFlags)
Specify which types of cells to remove.
Definition: GhostCellRemove.h:63
viskores::filter::entity_extraction::GhostCellRemove::AreAllTypesRemoved
bool AreAllTypesRemoved() const
Returns true if all abnormal cell types are removed.
Definition: GhostCellRemove.h:77
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::entity_extraction::GhostCellRemove
Removes cells marked as ghost cells.
Definition: GhostCellRemove.h:46
viskores::filter::entity_extraction::GhostCellRemove::GetRemoveGhostField
bool GetRemoveGhostField() const
Specify whether the ghost cell array should be removed from the input.
Definition: GhostCellRemove.h:57
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
VISKORES_DEPRECATED
#define VISKORES_DEPRECATED(...)
Definition: Deprecated.h:156
viskores::filter::entity_extraction::GhostCellRemove::SetRemoveGhostField
void SetRemoveGhostField(bool flag)
Specify whether the ghost cell array should be removed from the input.
Definition: GhostCellRemove.h:55
viskores_filter_entity_extraction_export.h
viskores::UInt8
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
viskores::filter::entity_extraction::GhostCellRemove::GetUseGhostCellsAsField
bool GetUseGhostCellsAsField() const
Specify whether the marked ghost cells or a named field should be used as the ghost field.
Definition: GhostCellRemove.h:95
viskores::filter::entity_extraction::GhostCellRemove::SetTypesToRemoveToAll
void SetTypesToRemoveToAll()
Set filter to remove any special cell type.
Definition: GhostCellRemove.h:75
Deprecated.h
Filter.h