Viskores  1.0
CellMeasures.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_mesh_info_CellMeasures_h
20 #define viskores_filter_mesh_info_CellMeasures_h
21 
22 #include <viskores/filter/Filter.h>
24 
25 #include <viskores/Deprecated.h>
26 
27 namespace viskores
28 {
29 namespace filter
30 {
31 namespace mesh_info
32 {
33 
37 enum struct IntegrationType
38 {
39  None = 0x00,
41  ArcLength = 0x01,
43  Area = 0x02,
45  Volume = 0x04,
48 };
49 
51 {
52  return static_cast<IntegrationType>(static_cast<int>(left) & static_cast<int>(right));
53 }
55 {
56  return static_cast<IntegrationType>(static_cast<int>(left) | static_cast<int>(right));
57 }
58 
66 class VISKORES_FILTER_MESH_INFO_EXPORT CellMeasures : public viskores::filter::Filter
67 {
68 public:
70 
71  VISKORES_DEPRECATED(2.2, "Use default constructor and `SetIntegrationType`.")
73 
82  {
83  this->Measure = measure;
84  }
87  {
88  return this->Measure;
89  }
92  {
94  }
97  {
99  }
102  {
104  }
107  {
109  }
110 
114  VISKORES_CONT void SetCellMeasureName(const std::string& name) { this->SetOutputFieldName(name); }
116  VISKORES_CONT const std::string& GetCellMeasureName() const { return this->GetOutputFieldName(); }
117 
118 private:
119  VISKORES_CONT viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
120 
122 };
123 } // namespace mesh_info
124 } // namespace filter
125 } // namespace viskores
126 
127 #endif // viskores_filter_mesh_info_CellMeasures_h
viskores::filter::mesh_info::CellMeasures::SetMeasureToArea
void SetMeasureToArea()
Compute the area of 2D elements.
Definition: CellMeasures.h:96
viskores::filter::mesh_info::IntegrationType::Area
@ Area
Compute the area of 2D elements.
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::mesh_info::CellMeasures::GetMeasure
viskores::filter::mesh_info::IntegrationType GetMeasure() const
Specify the type of integrations to support.
Definition: CellMeasures.h:86
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
VISKORES_EXEC_CONT
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::filter::mesh_info::CellMeasures::SetCellMeasureName
void SetCellMeasureName(const std::string &name)
Specify the name of the field generated.
Definition: CellMeasures.h:114
viskores::filter::mesh_info::IntegrationType::ArcLength
@ ArcLength
Compute the length of 1D elements.
viskores::filter::mesh_info::operator|
IntegrationType operator|(IntegrationType left, IntegrationType right)
Definition: CellMeasures.h:54
viskores::filter::mesh_info::CellMeasures
Compute the size measure of each cell in a dataset.
Definition: CellMeasures.h:66
viskores::filter::mesh_info::CellMeasures::SetMeasureToArcLength
void SetMeasureToArcLength()
Compute the length of 1D elements.
Definition: CellMeasures.h:91
viskores::filter::mesh_info::IntegrationType::None
@ None
viskores::filter::mesh_info::IntegrationType::Volume
@ Volume
Compute the volume of 3D elements.
VISKORES_DEPRECATED
#define VISKORES_DEPRECATED(...)
Definition: Deprecated.h:156
viskores::filter::mesh_info::operator&
IntegrationType operator&(IntegrationType left, IntegrationType right)
Definition: CellMeasures.h:50
viskores::filter::mesh_info::IntegrationType
IntegrationType
Specifies over what types of mesh elements CellMeasures will operate.
Definition: CellMeasures.h:37
Deprecated.h
viskores::filter::mesh_info::CellMeasures::SetMeasure
void SetMeasure(viskores::filter::mesh_info::IntegrationType measure)
Specify the type of integrations to support.
Definition: CellMeasures.h:81
viskores::filter::mesh_info::CellMeasures::SetMeasureToAll
void SetMeasureToAll()
Compute the size of all types of elements.
Definition: CellMeasures.h:106
viskores::filter::mesh_info::CellMeasures::GetCellMeasureName
const std::string & GetCellMeasureName() const
Specify the name of the field generated.
Definition: CellMeasures.h:116
viskores_filter_mesh_info_export.h
viskores::filter::mesh_info::CellMeasures::SetMeasureToVolume
void SetMeasureToVolume()
Compute the volume of 3D elements.
Definition: CellMeasures.h:101
viskores::filter::mesh_info::IntegrationType::AllMeasures
@ AllMeasures
Compute the size of all types of elements.
Filter.h