Viskores  1.0
SurfaceNormals.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_vector_analysis_SurfaceNormal_h
19 #define viskores_filter_vector_analysis_SurfaceNormal_h
20 
21 #include <viskores/filter/Filter.h>
23 
24 namespace viskores
25 {
26 namespace filter
27 {
28 namespace vector_analysis
29 {
52 class VISKORES_FILTER_VECTOR_ANALYSIS_EXPORT SurfaceNormals : public viskores::filter::Filter
53 {
54 public:
59 
63  void SetGenerateCellNormals(bool value) { this->GenerateCellNormals = value; }
65  bool GetGenerateCellNormals() const { return this->GenerateCellNormals; }
66 
74  void SetNormalizeCellNormals(bool value) { this->NormalizeCellNormals = value; }
76  bool GetNormalizeCellNormals() const { return this->NormalizeCellNormals; }
77 
81  void SetGeneratePointNormals(bool value) { this->GeneratePointNormals = value; }
83  bool GetGeneratePointNormals() const { return this->GeneratePointNormals; }
84 
88  void SetCellNormalsName(const std::string& name) { this->CellNormalsName = name; }
90  const std::string& GetCellNormalsName() const { return this->CellNormalsName; }
91 
95  void SetPointNormalsName(const std::string& name) { this->PointNormalsName = name; }
97  const std::string& GetPointNormalsName() const { return this->PointNormalsName; }
98 
105  void SetAutoOrientNormals(bool v) { this->AutoOrientNormals = v; }
107  bool GetAutoOrientNormals() const { return this->AutoOrientNormals; }
108 
114  void SetFlipNormals(bool v) { this->FlipNormals = v; }
116  bool GetFlipNormals() const { return this->FlipNormals; }
117 
124  void SetConsistency(bool v) { this->Consistency = v; }
126  bool GetConsistency() const { return this->Consistency; }
127 
128 private:
130  const viskores::cont::DataSet& inputDataSet) override;
131 
132  bool GenerateCellNormals = false;
133  bool NormalizeCellNormals = true;
134  bool GeneratePointNormals = true;
135  bool AutoOrientNormals = false;
136  bool FlipNormals = false;
137  bool Consistency = true;
138 
139  std::string CellNormalsName;
140  std::string PointNormalsName;
141 };
142 } // namespace vector_analysis
143 } // namespace filter
144 } // namespace viskores
145 
146 #endif // viskores_filter_vector_analysis_SurfaceNormal_h
viskores::filter::vector_analysis::SurfaceNormals::GetPointNormalsName
const std::string & GetPointNormalsName() const
Specify the name of the point normals field.
Definition: SurfaceNormals.h:97
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::vector_analysis::SurfaceNormals::GetCellNormalsName
const std::string & GetCellNormalsName() const
Specify the name of the cell normals field.
Definition: SurfaceNormals.h:90
viskores::filter::vector_analysis::SurfaceNormals::SetConsistency
void SetConsistency(bool v)
Specify whtehr polygon winding should be made consistent with normal orientation.
Definition: SurfaceNormals.h:124
viskores::filter::vector_analysis::SurfaceNormals::GetGeneratePointNormals
bool GetGeneratePointNormals() const
Specify whether the point normals should be generated.
Definition: SurfaceNormals.h:83
viskores::filter::vector_analysis::SurfaceNormals::GetAutoOrientNormals
bool GetAutoOrientNormals() const
Specify whether to orient the normals outwards from the surface.
Definition: SurfaceNormals.h:107
viskores::filter::vector_analysis::SurfaceNormals::GetGenerateCellNormals
bool GetGenerateCellNormals() const
Specify whether cell normals should be generated.
Definition: SurfaceNormals.h:65
viskores::filter::vector_analysis::SurfaceNormals
Computes normals for polygonal mesh.
Definition: SurfaceNormals.h:52
viskores::filter::vector_analysis::SurfaceNormals::SetNormalizeCellNormals
void SetNormalizeCellNormals(bool value)
Specify whether the cell normals should be normalized.
Definition: SurfaceNormals.h:74
viskores::filter::vector_analysis::SurfaceNormals::GetConsistency
bool GetConsistency() const
Specify whtehr polygon winding should be made consistent with normal orientation.
Definition: SurfaceNormals.h:126
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::vector_analysis::SurfaceNormals::SetAutoOrientNormals
void SetAutoOrientNormals(bool v)
Specify whether to orient the normals outwards from the surface.
Definition: SurfaceNormals.h:105
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::vector_analysis::SurfaceNormals::SetGenerateCellNormals
void SetGenerateCellNormals(bool value)
Specify whether cell normals should be generated.
Definition: SurfaceNormals.h:63
viskores::filter::vector_analysis::SurfaceNormals::SetFlipNormals
void SetFlipNormals(bool v)
Specify the direction to point normals when SetAutoOrientNormals() is true.
Definition: SurfaceNormals.h:114
viskores::filter::vector_analysis::SurfaceNormals::SetPointNormalsName
void SetPointNormalsName(const std::string &name)
Specify the name of the point normals field.
Definition: SurfaceNormals.h:95
viskores::filter::vector_analysis::SurfaceNormals::GetFlipNormals
bool GetFlipNormals() const
Specify the direction to point normals when SetAutoOrientNormals() is true.
Definition: SurfaceNormals.h:116
viskores::filter::vector_analysis::SurfaceNormals::GetNormalizeCellNormals
bool GetNormalizeCellNormals() const
Specify whether the cell normals should be normalized.
Definition: SurfaceNormals.h:76
viskores::filter::vector_analysis::SurfaceNormals::SetGeneratePointNormals
void SetGeneratePointNormals(bool value)
Specify whether the point normals should be generated.
Definition: SurfaceNormals.h:81
viskores::filter::vector_analysis::SurfaceNormals::SetCellNormalsName
void SetCellNormalsName(const std::string &name)
Specify the name of the cell normals field.
Definition: SurfaceNormals.h:88
viskores::filter::vector_analysis::SurfaceNormals::CellNormalsName
std::string CellNormalsName
Definition: SurfaceNormals.h:139
viskores_filter_vector_analysis_export.h
viskores::filter::vector_analysis::SurfaceNormals::PointNormalsName
std::string PointNormalsName
Definition: SurfaceNormals.h:140
Filter.h