Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkPolyDataNormals.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPolyDataNormals.h,v $
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 =========================================================================*/
00058 #ifndef __vtkPolyDataNormals_h
00059 #define __vtkPolyDataNormals_h
00060 
00061 #include "vtkPolyDataToPolyDataFilter.h"
00062 
00063 class vtkFloatArray;
00064 class vtkIdList;
00065 class vtkPolyData;
00066 
00067 class VTK_GRAPHICS_EXPORT vtkPolyDataNormals : public vtkPolyDataToPolyDataFilter
00068 {
00069 public:
00070   vtkTypeRevisionMacro(vtkPolyDataNormals,vtkPolyDataToPolyDataFilter);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00076   static vtkPolyDataNormals *New();
00077 
00079 
00082   vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
00083   vtkGetMacro(FeatureAngle,double);
00085 
00087 
00088   vtkSetMacro(Splitting,int);
00089   vtkGetMacro(Splitting,int);
00090   vtkBooleanMacro(Splitting,int);
00092 
00094 
00095   vtkSetMacro(Consistency,int);
00096   vtkGetMacro(Consistency,int);
00097   vtkBooleanMacro(Consistency,int);
00099 
00101 
00109   vtkSetMacro(AutoOrientNormals, int);
00110   vtkGetMacro(AutoOrientNormals, int);
00111   vtkBooleanMacro(AutoOrientNormals, int);
00113 
00115 
00116   vtkSetMacro(ComputePointNormals,int);
00117   vtkGetMacro(ComputePointNormals,int);
00118   vtkBooleanMacro(ComputePointNormals,int);
00120 
00122 
00123   vtkSetMacro(ComputeCellNormals,int);
00124   vtkGetMacro(ComputeCellNormals,int);
00125   vtkBooleanMacro(ComputeCellNormals,int);
00127 
00129 
00133   vtkSetMacro(FlipNormals,int);
00134   vtkGetMacro(FlipNormals,int);
00135   vtkBooleanMacro(FlipNormals,int);
00137 
00139 
00142   vtkSetMacro(NonManifoldTraversal,int);
00143   vtkGetMacro(NonManifoldTraversal,int);
00144   vtkBooleanMacro(NonManifoldTraversal,int);
00146   
00147 protected:
00148   vtkPolyDataNormals();
00149   ~vtkPolyDataNormals() {};
00150 
00151   // Usual data generation method
00152   void Execute();
00153 
00154   double FeatureAngle;
00155   int Splitting;
00156   int Consistency;
00157   int FlipNormals;
00158   int AutoOrientNormals;
00159   int NonManifoldTraversal;
00160   int ComputePointNormals;
00161   int ComputeCellNormals;
00162   int NumFlips;
00163 
00164 private:
00165   vtkIdList *Wave;
00166   vtkIdList *Wave2;
00167   vtkIdList *CellIds;
00168   vtkIdList *Map;
00169   vtkPolyData *OldMesh;
00170   vtkPolyData *NewMesh;
00171   int *Visited;
00172   vtkFloatArray *PolyNormals;
00173   double CosAngle;
00174 
00175   // Uses the list of cell ids (this->Wave) to propagate a wave of
00176   // checked and properly ordered polygons.
00177   void TraverseAndOrder(void);
00178 
00179   // Check the point id give to see whether it lies on a feature
00180   // edge. If so, split the point (i.e., duplicate it) to topologically
00181   // separate the mesh.
00182   void MarkAndSplit(vtkIdType ptId);
00183 
00184 private:
00185   vtkPolyDataNormals(const vtkPolyDataNormals&);  // Not implemented.
00186   void operator=(const vtkPolyDataNormals&);  // Not implemented.
00187 };
00188 
00189 #endif