VTK
vtkPolyDataNormals.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolyDataNormals.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
56 #ifndef __vtkPolyDataNormals_h
57 #define __vtkPolyDataNormals_h
58 
59 #include "vtkPolyDataAlgorithm.h"
60 
61 class vtkFloatArray;
62 class vtkIdList;
63 class vtkPolyData;
64 
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
74  static vtkPolyDataNormals *New();
75 
77 
80  vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
81  vtkGetMacro(FeatureAngle,double);
83 
85 
86  vtkSetMacro(Splitting,int);
87  vtkGetMacro(Splitting,int);
88  vtkBooleanMacro(Splitting,int);
90 
92 
93  vtkSetMacro(Consistency,int);
94  vtkGetMacro(Consistency,int);
95  vtkBooleanMacro(Consistency,int);
97 
99 
107  vtkSetMacro(AutoOrientNormals, int);
108  vtkGetMacro(AutoOrientNormals, int);
109  vtkBooleanMacro(AutoOrientNormals, int);
111 
113 
114  vtkSetMacro(ComputePointNormals,int);
115  vtkGetMacro(ComputePointNormals,int);
116  vtkBooleanMacro(ComputePointNormals,int);
118 
120 
121  vtkSetMacro(ComputeCellNormals,int);
122  vtkGetMacro(ComputeCellNormals,int);
123  vtkBooleanMacro(ComputeCellNormals,int);
125 
127 
131  vtkSetMacro(FlipNormals,int);
132  vtkGetMacro(FlipNormals,int);
133  vtkBooleanMacro(FlipNormals,int);
135 
137 
140  vtkSetMacro(NonManifoldTraversal,int);
141  vtkGetMacro(NonManifoldTraversal,int);
142  vtkBooleanMacro(NonManifoldTraversal,int);
144 
145 protected:
148 
149  // Usual data generation method
151 
152  double FeatureAngle;
160  int NumFlips;
161 
162 private:
163  vtkIdList *Wave;
164  vtkIdList *Wave2;
165  vtkIdList *CellIds;
166  vtkIdList *Map;
167  vtkPolyData *OldMesh;
168  vtkPolyData *NewMesh;
169  int *Visited;
170  vtkFloatArray *PolyNormals;
171  double CosAngle;
172 
173  // Uses the list of cell ids (this->Wave) to propagate a wave of
174  // checked and properly ordered polygons.
175  void TraverseAndOrder(void);
176 
177  // Check the point id give to see whether it lies on a feature
178  // edge. If so, split the point (i.e., duplicate it) to topologically
179  // separate the mesh.
180  void MarkAndSplit(vtkIdType ptId);
181 
182 private:
183  vtkPolyDataNormals(const vtkPolyDataNormals&); // Not implemented.
184  void operator=(const vtkPolyDataNormals&); // Not implemented.
185 };
186 
187 #endif