VTK-m  2.0
GenerateIds.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 #ifndef vtk_m_filter_field_transform_GenerateIds_h
11 #define vtk_m_filter_field_transform_GenerateIds_h
12 
13 #include <vtkm/filter/Filter.h>
14 #include <vtkm/filter/field_transform/vtkm_filter_field_transform_export.h>
15 
16 namespace vtkm
17 {
18 namespace filter
19 {
20 namespace field_transform
21 {
31 class VTKM_FILTER_FIELD_TRANSFORM_EXPORT GenerateIds : public vtkm::filter::Filter
32 {
33  std::string PointFieldName = "pointids";
34  std::string CellFieldName = "cellids";
35  bool GeneratePointIds = true;
36  bool GenerateCellIds = true;
37  bool UseFloat = false;
38 
39 public:
45  const std::string& GetPointFieldName() const { return this->PointFieldName; }
46  void SetPointFieldName(const std::string& name) { this->PointFieldName = name; }
48 
54  const std::string& GetCellFieldName() const { return this->CellFieldName; }
55  void SetCellFieldName(const std::string& name) { this->CellFieldName = name; }
57 
64  bool GetGeneratePointIds() const { return this->GeneratePointIds; }
65  void SetGeneratePointIds(bool flag) { this->GeneratePointIds = flag; }
67 
74  bool GetGenerateCellIds() const { return this->GenerateCellIds; }
75  void SetGenerateCellIds(bool flag) { this->GenerateCellIds = flag; }
77 
85  bool GetUseFloat() const { return this->UseFloat; }
86  void SetUseFloat(bool flag) { this->UseFloat = flag; }
87 
88 private:
89  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
90 };
91 } // namespace field_transform
92 } // namespace vtkm::filter
93 } // namespace vtkm
94 
95 #endif //vtk_m_filter_field_transform_GenerateIds_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::field_transform::GenerateIds::SetUseFloat
void SetUseFloat(bool flag)
Specify whether the generated fields should be integer or float.
Definition: GenerateIds.h:86
vtkm::filter::field_transform::GenerateIds
Adds fields to a DataSet that give the ids for the points and cells.
Definition: GenerateIds.h:31
vtkm::filter::field_transform::GenerateIds::GetCellFieldName
const std::string & GetCellFieldName() const
The name given to the generated cell field.
Definition: GenerateIds.h:54
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::field_transform::GenerateIds::SetPointFieldName
void SetPointFieldName(const std::string &name)
The name given to the generated point field.
Definition: GenerateIds.h:46
vtkm::filter::field_transform::GenerateIds::GetPointFieldName
const std::string & GetPointFieldName() const
The name given to the generated point field.
Definition: GenerateIds.h:45
vtkm::filter::Filter
base class for all filters.
Definition: Filter.h:218
vtkm::filter::field_transform::GenerateIds::SetCellFieldName
void SetCellFieldName(const std::string &name)
The name given to the generated cell field.
Definition: GenerateIds.h:55
vtkm::filter::field_transform::GenerateIds::GetUseFloat
bool GetUseFloat() const
Specify whether the generated fields should be integer or float.
Definition: GenerateIds.h:85
vtkm::filter::field_transform::GenerateIds::GetGenerateCellIds
bool GetGenerateCellIds() const
Specify whether the cell id field is generated.
Definition: GenerateIds.h:74
vtkm::filter::field_transform::GenerateIds::SetGenerateCellIds
void SetGenerateCellIds(bool flag)
Specify whether the cell id field is generated.
Definition: GenerateIds.h:75
vtkm::filter::field_transform::GenerateIds::SetGeneratePointIds
void SetGeneratePointIds(bool flag)
Specify whether the point id field is generated.
Definition: GenerateIds.h:65
vtkm::filter::field_transform::GenerateIds::GetGeneratePointIds
bool GetGeneratePointIds() const
Specify whether the point id field is generated.
Definition: GenerateIds.h:64
Filter.h