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 =========================================================================*/
44 #ifndef __vtkPolyDataNormals_h
45 #define __vtkPolyDataNormals_h
46 
47 #include "vtkPolyDataAlgorithm.h"
48 
49 class vtkFloatArray;
50 class vtkIdList;
51 class vtkPolyData;
52 
54 {
55 public:
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
62  static vtkPolyDataNormals *New();
63 
65 
68  vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
69  vtkGetMacro(FeatureAngle,double);
71 
73 
74  vtkSetMacro(Splitting,int);
75  vtkGetMacro(Splitting,int);
76  vtkBooleanMacro(Splitting,int);
78 
80 
81  vtkSetMacro(Consistency,int);
82  vtkGetMacro(Consistency,int);
83  vtkBooleanMacro(Consistency,int);
85 
87 
95  vtkSetMacro(AutoOrientNormals, int);
96  vtkGetMacro(AutoOrientNormals, int);
97  vtkBooleanMacro(AutoOrientNormals, int);
99 
101 
102  vtkSetMacro(ComputePointNormals,int);
103  vtkGetMacro(ComputePointNormals,int);
104  vtkBooleanMacro(ComputePointNormals,int);
106 
108 
109  vtkSetMacro(ComputeCellNormals,int);
110  vtkGetMacro(ComputeCellNormals,int);
111  vtkBooleanMacro(ComputeCellNormals,int);
113 
115 
119  vtkSetMacro(FlipNormals,int);
120  vtkGetMacro(FlipNormals,int);
121  vtkBooleanMacro(FlipNormals,int);
123 
125 
128  vtkSetMacro(NonManifoldTraversal,int);
129  vtkGetMacro(NonManifoldTraversal,int);
130  vtkBooleanMacro(NonManifoldTraversal,int);
132 
133 protected:
136 
137  // Usual data generation method
139 
140  double FeatureAngle;
148  int NumFlips;
149 
150 private:
151  vtkIdList *Wave;
152  vtkIdList *Wave2;
153  vtkIdList *CellIds;
154  vtkIdList *Map;
155  vtkPolyData *OldMesh;
156  vtkPolyData *NewMesh;
157  int *Visited;
158  vtkFloatArray *PolyNormals;
159  double CosAngle;
160 
161  // Uses the list of cell ids (this->Wave) to propagate a wave of
162  // checked and properly ordered polygons.
163  void TraverseAndOrder(void);
164 
165  // Check the point id give to see whether it lies on a feature
166  // edge. If so, split the point (i.e., duplicate it) to topologically
167  // separate the mesh.
168  void MarkAndSplit(vtkIdType ptId);
169 
170 private:
171  vtkPolyDataNormals(const vtkPolyDataNormals&); // Not implemented.
172  void operator=(const vtkPolyDataNormals&); // Not implemented.
173 };
174 
175 #endif