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

Graphics/vtkPolyDataNormals.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPolyDataNormals.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00061 #ifndef __vtkPolyDataNormals_h
00062 #define __vtkPolyDataNormals_h
00063 
00064 #include "vtkPolyDataToPolyDataFilter.h"
00065 
00066 class vtkFloatArray;
00067 class vtkIdList;
00068 class vtkPolyData;
00069 
00070 class VTK_GRAPHICS_EXPORT vtkPolyDataNormals : public vtkPolyDataToPolyDataFilter
00071 {
00072 public:
00073   vtkTypeRevisionMacro(vtkPolyDataNormals,vtkPolyDataToPolyDataFilter);
00074   void PrintSelf(ostream& os, vtkIndent indent);
00075 
00079   static vtkPolyDataNormals *New();
00080 
00082 
00085   vtkSetClampMacro(FeatureAngle,float,0.0,180.0);
00086   vtkGetMacro(FeatureAngle,float);
00088 
00090 
00091   vtkSetMacro(Splitting,int);
00092   vtkGetMacro(Splitting,int);
00093   vtkBooleanMacro(Splitting,int);
00095 
00097 
00098   vtkSetMacro(Consistency,int);
00099   vtkGetMacro(Consistency,int);
00100   vtkBooleanMacro(Consistency,int);
00102 
00104 
00105   vtkSetMacro(ComputePointNormals,int);
00106   vtkGetMacro(ComputePointNormals,int);
00107   vtkBooleanMacro(ComputePointNormals,int);
00109 
00111 
00112   vtkSetMacro(ComputeCellNormals,int);
00113   vtkGetMacro(ComputeCellNormals,int);
00114   vtkBooleanMacro(ComputeCellNormals,int);
00116 
00118 
00122   vtkSetMacro(FlipNormals,int);
00123   vtkGetMacro(FlipNormals,int);
00124   vtkBooleanMacro(FlipNormals,int);
00126 
00128 
00131   vtkSetMacro(NonManifoldTraversal,int);
00132   vtkGetMacro(NonManifoldTraversal,int);
00133   vtkBooleanMacro(NonManifoldTraversal,int);
00135   
00136 protected:
00137   vtkPolyDataNormals();
00138   ~vtkPolyDataNormals() {};
00139 
00140   // Usual data generation method
00141   void Execute();
00142 
00143   float FeatureAngle;
00144   int Splitting;
00145   int Consistency;
00146   int FlipNormals;
00147   int NonManifoldTraversal;
00148   int ComputePointNormals;
00149   int ComputeCellNormals;
00150   int NumFlips;
00151 
00152 private:
00153   vtkIdList *Wave;
00154   vtkIdList *Wave2;
00155   vtkIdList *CellIds;
00156   vtkIdList *Map;
00157   vtkPolyData *OldMesh;
00158   vtkPolyData *NewMesh;
00159   int *Visited;
00160   vtkFloatArray *PolyNormals;
00161   float CosAngle;
00162 
00163   // Uses the list of cell ids (this->Wave) to propagate a wave of
00164   // checked and properly ordered polygons.
00165   void TraverseAndOrder(void);
00166 
00167   // Check the point id give to see whether it lies on a feature
00168   // edge. If so, split the point (i.e., duplicate it) to topologically
00169   // separate the mesh.
00170   void MarkAndSplit(vtkIdType ptId);
00171 
00172 private:
00173   vtkPolyDataNormals(const vtkPolyDataNormals&);  // Not implemented.
00174   void operator=(const vtkPolyDataNormals&);  // Not implemented.
00175 };
00176 
00177 #endif