VTK
dox/Graphics/vtkCleanPolyData.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCleanPolyData.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 =========================================================================*/
00065 #ifndef __vtkCleanPolyData_h
00066 #define __vtkCleanPolyData_h
00067 
00068 #include "vtkPolyDataAlgorithm.h"
00069 
00070 class vtkIncrementalPointLocator;
00071 
00072 class VTK_GRAPHICS_EXPORT vtkCleanPolyData : public vtkPolyDataAlgorithm
00073 {
00074 public:
00075   static vtkCleanPolyData *New();
00076   void PrintSelf(ostream& os, vtkIndent indent);
00077   vtkTypeMacro(vtkCleanPolyData,vtkPolyDataAlgorithm);
00078 
00080 
00083   vtkSetMacro(ToleranceIsAbsolute,int);
00084   vtkBooleanMacro(ToleranceIsAbsolute,int);
00085   vtkGetMacro(ToleranceIsAbsolute,int);
00087 
00089 
00091   vtkSetClampMacro(Tolerance,double,0.0,1.0);
00092   vtkGetMacro(Tolerance,double);
00094 
00096 
00097   vtkSetClampMacro(AbsoluteTolerance,double,0.0,VTK_DOUBLE_MAX);
00098   vtkGetMacro(AbsoluteTolerance,double);
00100 
00102 
00103   vtkSetMacro(ConvertLinesToPoints,int);
00104   vtkBooleanMacro(ConvertLinesToPoints,int);
00105   vtkGetMacro(ConvertLinesToPoints,int);
00107 
00109 
00110   vtkSetMacro(ConvertPolysToLines,int);
00111   vtkBooleanMacro(ConvertPolysToLines,int);
00112   vtkGetMacro(ConvertPolysToLines,int);
00114 
00116 
00117   vtkSetMacro(ConvertStripsToPolys,int);
00118   vtkBooleanMacro(ConvertStripsToPolys,int);
00119   vtkGetMacro(ConvertStripsToPolys,int);
00121 
00123 
00127   vtkSetMacro(PointMerging,int);
00128   vtkGetMacro(PointMerging,int);
00129   vtkBooleanMacro(PointMerging,int);
00131 
00133 
00135   virtual void SetLocator(vtkIncrementalPointLocator *locator);
00136   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00138 
00140   void CreateDefaultLocator(vtkPolyData *input = 0);
00141 
00143   void ReleaseLocator() { this->SetLocator(NULL); }
00144 
00146   unsigned long int GetMTime();
00147 
00149   virtual void OperateOnPoint(double in[3], double out[3]);
00150 
00152   virtual void OperateOnBounds(double in[6], double out[6]);
00153 
00154   // This filter is difficult to stream.
00155   // To get invariant results, the whole input must be processed at once.
00156   // This flag allows the user to select whether strict piece invariance
00157   // is required.  By default it is on.  When off, the filter can stream,
00158   // but results may change.
00159   vtkSetMacro(PieceInvariant, int);
00160   vtkGetMacro(PieceInvariant, int);
00161   vtkBooleanMacro(PieceInvariant, int);
00162 
00163 protected:
00164   vtkCleanPolyData();
00165  ~vtkCleanPolyData();
00166 
00167   // Usual data generation method
00168   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00169   virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00170   virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00171 
00172   int   PointMerging;
00173   double Tolerance;
00174   double AbsoluteTolerance;
00175   int ConvertLinesToPoints;
00176   int ConvertPolysToLines;
00177   int ConvertStripsToPolys;
00178   int ToleranceIsAbsolute;
00179   vtkIncrementalPointLocator *Locator;
00180 
00181   int PieceInvariant;
00182 private:
00183   vtkCleanPolyData(const vtkCleanPolyData&);  // Not implemented.
00184   void operator=(const vtkCleanPolyData&);  // Not implemented.
00185 };
00186 
00187 #endif