VTK-m  2.0
CellMeasures.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 vtk_m_filter_mesh_info_CellMeasures_h
12 #define vtk_m_filter_mesh_info_CellMeasures_h
13 
15 #include <vtkm/filter/mesh_info/vtkm_filter_mesh_info_export.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace mesh_info
22 {
23 
25 enum struct IntegrationType
26 {
27  None = 0x00,
28  ArcLength = 0x01,
29  Area = 0x02,
30  Volume = 0x04,
32 };
33 
35 {
36  return static_cast<IntegrationType>(static_cast<int>(left) & static_cast<int>(right));
37 }
39 {
40  return static_cast<IntegrationType>(static_cast<int>(left) | static_cast<int>(right));
41 }
42 
50 class VTKM_FILTER_MESH_INFO_EXPORT CellMeasures : public vtkm::filter::FilterField
51 {
52 public:
53  VTKM_CONT
54  explicit CellMeasures(IntegrationType);
55 
57  void SetCellMeasureName(const std::string& name) { this->SetOutputFieldName(name); }
58  const std::string& GetCellMeasureName() const { return this->GetOutputFieldName(); }
59 
60 private:
61  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
62 
64 };
65 } // namespace mesh_info
66 } // namespace filter
67 } // namespace vtkm
68 
69 #endif // vtk_m_filter_mesh_info_CellMeasures_h
vtkm::filter::mesh_info::IntegrationType::None
@ None
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::mesh_info::CellMeasures::measure
IntegrationType measure
Definition: CellMeasures.h:63
vtkm::filter::mesh_info::operator|
VTKM_EXEC_CONT IntegrationType operator|(IntegrationType left, IntegrationType right)
Definition: CellMeasures.h:38
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::filter::mesh_info::CellMeasures::GetCellMeasureName
const std::string & GetCellMeasureName() const
Definition: CellMeasures.h:58
vtkm::filter::mesh_info::IntegrationType::ArcLength
@ ArcLength
vtkm::filter::mesh_info::CellMeasures::SetCellMeasureName
void SetCellMeasureName(const std::string &name)
Set/Get the name of the cell measure field. If not set, "measure" is used.
Definition: CellMeasures.h:57
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::mesh_info::IntegrationType::Area
@ Area
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::mesh_info::IntegrationType::Volume
@ Volume
vtkm::filter::mesh_info::operator&
VTKM_EXEC_CONT IntegrationType operator&(IntegrationType left, IntegrationType right)
Definition: CellMeasures.h:34
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::mesh_info::CellMeasures
Compute the measure of each (3D) cell in a dataset.
Definition: CellMeasures.h:50
vtkm::filter::mesh_info::IntegrationType::AllMeasures
@ AllMeasures
vtkm::filter::mesh_info::IntegrationType
IntegrationType
Specifies over what types of mesh elements CellMeasures will operate.
Definition: CellMeasures.h:25