VTK
dox/Graphics/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 "vtkPolyDataAlgorithm.h"
00060 
00061 class vtkFloatArray;
00062 class vtkIdList;
00063 class vtkPolyData;
00064 
00065 class VTK_GRAPHICS_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
00066 {
00067 public:
00068   vtkTypeMacro(vtkPolyDataNormals,vtkPolyDataAlgorithm);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00074   static vtkPolyDataNormals *New();
00075 
00077 
00080   vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
00081   vtkGetMacro(FeatureAngle,double);
00083 
00085 
00086   vtkSetMacro(Splitting,int);
00087   vtkGetMacro(Splitting,int);
00088   vtkBooleanMacro(Splitting,int);
00090 
00092 
00093   vtkSetMacro(Consistency,int);
00094   vtkGetMacro(Consistency,int);
00095   vtkBooleanMacro(Consistency,int);
00097 
00099 
00107   vtkSetMacro(AutoOrientNormals, int);
00108   vtkGetMacro(AutoOrientNormals, int);
00109   vtkBooleanMacro(AutoOrientNormals, int);
00111 
00113 
00114   vtkSetMacro(ComputePointNormals,int);
00115   vtkGetMacro(ComputePointNormals,int);
00116   vtkBooleanMacro(ComputePointNormals,int);
00118 
00120 
00121   vtkSetMacro(ComputeCellNormals,int);
00122   vtkGetMacro(ComputeCellNormals,int);
00123   vtkBooleanMacro(ComputeCellNormals,int);
00125 
00127 
00131   vtkSetMacro(FlipNormals,int);
00132   vtkGetMacro(FlipNormals,int);
00133   vtkBooleanMacro(FlipNormals,int);
00135 
00137 
00140   vtkSetMacro(NonManifoldTraversal,int);
00141   vtkGetMacro(NonManifoldTraversal,int);
00142   vtkBooleanMacro(NonManifoldTraversal,int);
00144   
00145 protected:
00146   vtkPolyDataNormals();
00147   ~vtkPolyDataNormals() {};
00148 
00149   // Usual data generation method
00150   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00151 
00152   double FeatureAngle;
00153   int Splitting;
00154   int Consistency;
00155   int FlipNormals;
00156   int AutoOrientNormals;
00157   int NonManifoldTraversal;
00158   int ComputePointNormals;
00159   int ComputeCellNormals;
00160   int NumFlips;
00161 
00162 private:
00163   vtkIdList *Wave;
00164   vtkIdList *Wave2;
00165   vtkIdList *CellIds;
00166   vtkIdList *Map;
00167   vtkPolyData *OldMesh;
00168   vtkPolyData *NewMesh;
00169   int *Visited;
00170   vtkFloatArray *PolyNormals;
00171   double CosAngle;
00172 
00173   // Uses the list of cell ids (this->Wave) to propagate a wave of
00174   // checked and properly ordered polygons.
00175   void TraverseAndOrder(void);
00176 
00177   // Check the point id give to see whether it lies on a feature
00178   // edge. If so, split the point (i.e., duplicate it) to topologically
00179   // separate the mesh.
00180   void MarkAndSplit(vtkIdType ptId);
00181 
00182 private:
00183   vtkPolyDataNormals(const vtkPolyDataNormals&);  // Not implemented.
00184   void operator=(const vtkPolyDataNormals&);  // Not implemented.
00185 };
00186 
00187 #endif