VTK-m  2.0
SurfaceNormals.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_vector_analysis_SurfaceNormal_h
11 #define vtk_m_filter_vector_analysis_SurfaceNormal_h
12 
14 #include <vtkm/filter/vector_analysis/vtkm_filter_vector_analysis_export.h>
15 
16 namespace vtkm
17 {
18 namespace filter
19 {
20 namespace vector_analysis
21 {
28 class VTKM_FILTER_VECTOR_ANALYSIS_EXPORT SurfaceNormals : public vtkm::filter::FilterField
29 {
30 public:
35 
38  void SetGenerateCellNormals(bool value) { this->GenerateCellNormals = value; }
39  bool GetGenerateCellNormals() const { return this->GenerateCellNormals; }
41 
48  void SetNormalizeCellNormals(bool value) { this->NormalizeCellNormals = value; }
49  bool GetNormalizeCellNormals() const { return this->NormalizeCellNormals; }
51 
54  void SetGeneratePointNormals(bool value) { this->GeneratePointNormals = value; }
55  bool GetGeneratePointNormals() const { return this->GeneratePointNormals; }
57 
60  void SetCellNormalsName(const std::string& name) { this->CellNormalsName = name; }
61  const std::string& GetCellNormalsName() const { return this->CellNormalsName; }
63 
66  void SetPointNormalsName(const std::string& name) { this->PointNormalsName = name; }
67  const std::string& GetPointNormalsName() const { return this->PointNormalsName; }
69 
76  void SetAutoOrientNormals(bool v) { this->AutoOrientNormals = v; }
77  bool GetAutoOrientNormals() const { return this->AutoOrientNormals; }
79 
83  void SetFlipNormals(bool v) { this->FlipNormals = v; }
84  bool GetFlipNormals() const { return this->FlipNormals; }
86 
93  void SetConsistency(bool v) { this->Consistency = v; }
94  bool GetConsistency() const { return this->Consistency; }
96 
97 private:
98  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inputDataSet) override;
99 
100  bool GenerateCellNormals = false;
101  bool NormalizeCellNormals = true;
102  bool GeneratePointNormals = true;
103  bool AutoOrientNormals = false;
104  bool FlipNormals = false;
105  bool Consistency = true;
106 
107  std::string CellNormalsName;
108  std::string PointNormalsName;
109 };
110 } // namespace vector_analysis
111 } // namespace filter
112 } // namespace vtkm
113 
114 #endif // vtk_m_filter_vector_analysis_SurfaceNormal_h
vtkm::filter::vector_analysis::SurfaceNormals::GetPointNormalsName
const std::string & GetPointNormalsName() const
Set/Get the name of the point normals field.
Definition: SurfaceNormals.h:67
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::vector_analysis::SurfaceNormals::SetPointNormalsName
void SetPointNormalsName(const std::string &name)
Set/Get the name of the point normals field.
Definition: SurfaceNormals.h:66
vtkm::filter::vector_analysis::SurfaceNormals::GetGeneratePointNormals
bool GetGeneratePointNormals() const
Set/Get if the point normals should be generated.
Definition: SurfaceNormals.h:55
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::vector_analysis::SurfaceNormals::CellNormalsName
std::string CellNormalsName
Definition: SurfaceNormals.h:107
vtkm::filter::vector_analysis::SurfaceNormals::SetConsistency
void SetConsistency(bool v)
Ensure that polygon winding is consistent with normal orientation.
Definition: SurfaceNormals.h:93
vtkm::filter::vector_analysis::SurfaceNormals::GetGenerateCellNormals
bool GetGenerateCellNormals() const
Set/Get if cell normals should be generated.
Definition: SurfaceNormals.h:39
vtkm::filter::vector_analysis::SurfaceNormals::GetFlipNormals
bool GetFlipNormals() const
Reverse the normals to point inward when AutoOrientNormals is true.
Definition: SurfaceNormals.h:84
vtkm::filter::vector_analysis::SurfaceNormals::SetNormalizeCellNormals
void SetNormalizeCellNormals(bool value)
Set/Get if the cell normals should be normalized.
Definition: SurfaceNormals.h:48
vtkm::filter::vector_analysis::SurfaceNormals::SetGeneratePointNormals
void SetGeneratePointNormals(bool value)
Set/Get if the point normals should be generated.
Definition: SurfaceNormals.h:54
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::vector_analysis::SurfaceNormals
compute normals for polygonal mesh
Definition: SurfaceNormals.h:28
vtkm::filter::vector_analysis::SurfaceNormals::PointNormalsName
std::string PointNormalsName
Definition: SurfaceNormals.h:108
vtkm::filter::vector_analysis::SurfaceNormals::SetGenerateCellNormals
void SetGenerateCellNormals(bool value)
Set/Get if cell normals should be generated.
Definition: SurfaceNormals.h:38
vtkm::filter::vector_analysis::SurfaceNormals::GetNormalizeCellNormals
bool GetNormalizeCellNormals() const
Set/Get if the cell normals should be normalized.
Definition: SurfaceNormals.h:49
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::vector_analysis::SurfaceNormals::GetCellNormalsName
const std::string & GetCellNormalsName() const
Set/Get the name of the cell normals field.
Definition: SurfaceNormals.h:61
vtkm::filter::vector_analysis::SurfaceNormals::SetFlipNormals
void SetFlipNormals(bool v)
Reverse the normals to point inward when AutoOrientNormals is true.
Definition: SurfaceNormals.h:83
vtkm::filter::vector_analysis::SurfaceNormals::GetConsistency
bool GetConsistency() const
Ensure that polygon winding is consistent with normal orientation.
Definition: SurfaceNormals.h:94
vtkm::filter::vector_analysis::SurfaceNormals::SetCellNormalsName
void SetCellNormalsName(const std::string &name)
Set/Get the name of the cell normals field.
Definition: SurfaceNormals.h:60
vtkm::filter::vector_analysis::SurfaceNormals::SetAutoOrientNormals
void SetAutoOrientNormals(bool v)
If true, the normals will be oriented to face outwards from the surface.
Definition: SurfaceNormals.h:76
vtkm::filter::vector_analysis::SurfaceNormals::GetAutoOrientNormals
bool GetAutoOrientNormals() const
If true, the normals will be oriented to face outwards from the surface.
Definition: SurfaceNormals.h:77