Viskores  1.0
GenerateIds.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 #ifndef viskores_filter_field_transform_GenerateIds_h
19 #define viskores_filter_field_transform_GenerateIds_h
20 
21 #include <viskores/filter/Filter.h>
23 
24 namespace viskores
25 {
26 namespace filter
27 {
28 namespace field_transform
29 {
39 class VISKORES_FILTER_FIELD_TRANSFORM_EXPORT GenerateIds : public viskores::filter::Filter
40 {
41  std::string PointFieldName = "pointids";
42  std::string CellFieldName = "cellids";
43  bool GeneratePointIds = true;
44  bool GenerateCellIds = true;
45  bool UseFloat = false;
46 
47 public:
52  const std::string& GetPointFieldName() const { return this->PointFieldName; }
54  void SetPointFieldName(const std::string& name) { this->PointFieldName = name; }
55 
60  const std::string& GetCellFieldName() const { return this->CellFieldName; }
62  void SetCellFieldName(const std::string& name) { this->CellFieldName = name; }
63 
69  bool GetGeneratePointIds() const { return this->GeneratePointIds; }
71  void SetGeneratePointIds(bool flag) { this->GeneratePointIds = flag; }
72 
78  bool GetGenerateCellIds() const { return this->GenerateCellIds; }
80  void SetGenerateCellIds(bool flag) { this->GenerateCellIds = flag; }
81 
88  bool GetUseFloat() const { return this->UseFloat; }
90  void SetUseFloat(bool flag) { this->UseFloat = flag; }
91 
92 private:
93  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
94 };
95 } // namespace field_transform
96 } // namespace viskores::filter
97 } // namespace viskores
98 
99 #endif //viskores_filter_field_transform_GenerateIds_h
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::field_transform::GenerateIds::SetUseFloat
void SetUseFloat(bool flag)
Specify whether the generated fields should be integer or float.
Definition: GenerateIds.h:90
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::field_transform::GenerateIds
Adds fields to a viskores::cont::DataSet that give the ids for the points and cells.
Definition: GenerateIds.h:39
viskores::filter::field_transform::GenerateIds::GetPointFieldName
const std::string & GetPointFieldName() const
The name given to the generated point field.
Definition: GenerateIds.h:52
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::filter::field_transform::GenerateIds::GetGeneratePointIds
bool GetGeneratePointIds() const
Specify whether the point id field is generated.
Definition: GenerateIds.h:69
viskores::filter::field_transform::GenerateIds::SetPointFieldName
void SetPointFieldName(const std::string &name)
The name given to the generated point field.
Definition: GenerateIds.h:54
viskores::filter::field_transform::GenerateIds::SetCellFieldName
void SetCellFieldName(const std::string &name)
The name given to the generated cell field.
Definition: GenerateIds.h:62
viskores::filter::field_transform::GenerateIds::GetUseFloat
bool GetUseFloat() const
Specify whether the generated fields should be integer or float.
Definition: GenerateIds.h:88
viskores::filter::field_transform::GenerateIds::GetCellFieldName
const std::string & GetCellFieldName() const
The name given to the generated cell field.
Definition: GenerateIds.h:60
viskores::filter::field_transform::GenerateIds::SetGeneratePointIds
void SetGeneratePointIds(bool flag)
Specify whether the point id field is generated.
Definition: GenerateIds.h:71
viskores_filter_field_transform_export.h
viskores::filter::field_transform::GenerateIds::GetGenerateCellIds
bool GetGenerateCellIds() const
Specify whether the cell id field is generated.
Definition: GenerateIds.h:78
viskores::filter::field_transform::GenerateIds::SetGenerateCellIds
void SetGenerateCellIds(bool flag)
Specify whether the cell id field is generated.
Definition: GenerateIds.h:80
Filter.h