VTK
dox/Filters/Core/vtkPolyDataNormals.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPolyDataNormals.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00056 #ifndef __vtkPolyDataNormals_h
00057 #define __vtkPolyDataNormals_h
00058 
00059 #include "vtkFiltersCoreModule.h" // For export macro
00060 #include "vtkPolyDataAlgorithm.h"
00061 
00062 class vtkFloatArray;
00063 class vtkIdList;
00064 class vtkPolyData;
00065 
00066 class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
00067 {
00068 public:
00069   vtkTypeMacro(vtkPolyDataNormals,vtkPolyDataAlgorithm);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00075   static vtkPolyDataNormals *New();
00076 
00078 
00081   vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
00082   vtkGetMacro(FeatureAngle,double);
00084 
00086 
00087   vtkSetMacro(Splitting,int);
00088   vtkGetMacro(Splitting,int);
00089   vtkBooleanMacro(Splitting,int);
00091 
00093 
00094   vtkSetMacro(Consistency,int);
00095   vtkGetMacro(Consistency,int);
00096   vtkBooleanMacro(Consistency,int);
00098 
00100 
00108   vtkSetMacro(AutoOrientNormals, int);
00109   vtkGetMacro(AutoOrientNormals, int);
00110   vtkBooleanMacro(AutoOrientNormals, int);
00112 
00114 
00115   vtkSetMacro(ComputePointNormals,int);
00116   vtkGetMacro(ComputePointNormals,int);
00117   vtkBooleanMacro(ComputePointNormals,int);
00119 
00121 
00122   vtkSetMacro(ComputeCellNormals,int);
00123   vtkGetMacro(ComputeCellNormals,int);
00124   vtkBooleanMacro(ComputeCellNormals,int);
00126 
00128 
00132   vtkSetMacro(FlipNormals,int);
00133   vtkGetMacro(FlipNormals,int);
00134   vtkBooleanMacro(FlipNormals,int);
00136 
00138 
00141   vtkSetMacro(NonManifoldTraversal,int);
00142   vtkGetMacro(NonManifoldTraversal,int);
00143   vtkBooleanMacro(NonManifoldTraversal,int);
00145 
00147 
00150   vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
00151   vtkGetMacro(OutputPointsPrecision, int);
00153 
00154 protected:
00155   vtkPolyDataNormals();
00156   ~vtkPolyDataNormals() {}
00157 
00158   // Usual data generation method
00159   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00160 
00161   double FeatureAngle;
00162   int Splitting;
00163   int Consistency;
00164   int FlipNormals;
00165   int AutoOrientNormals;
00166   int NonManifoldTraversal;
00167   int ComputePointNormals;
00168   int ComputeCellNormals;
00169   int NumFlips;
00170   int OutputPointsPrecision;
00171 
00172 private:
00173   vtkIdList *Wave;
00174   vtkIdList *Wave2;
00175   vtkIdList *CellIds;
00176   vtkIdList *Map;
00177   vtkPolyData *OldMesh;
00178   vtkPolyData *NewMesh;
00179   int *Visited;
00180   vtkFloatArray *PolyNormals;
00181   double CosAngle;
00182 
00183   // Uses the list of cell ids (this->Wave) to propagate a wave of
00184   // checked and properly ordered polygons.
00185   void TraverseAndOrder(void);
00186 
00187   // Check the point id give to see whether it lies on a feature
00188   // edge. If so, split the point (i.e., duplicate it) to topologically
00189   // separate the mesh.
00190   void MarkAndSplit(vtkIdType ptId);
00191 
00192 private:
00193   vtkPolyDataNormals(const vtkPolyDataNormals&);  // Not implemented.
00194   void operator=(const vtkPolyDataNormals&);  // Not implemented.
00195 };
00196 
00197 #endif