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 
00090   vtkSetClampMacro(Tolerance,double,0.0,1.0);
00091   vtkGetMacro(Tolerance,double);
00093 
00095 
00096   vtkSetClampMacro(AbsoluteTolerance,double,0.0,VTK_DOUBLE_MAX);
00097   vtkGetMacro(AbsoluteTolerance,double);
00099 
00101 
00102   vtkSetMacro(ConvertLinesToPoints,int);
00103   vtkBooleanMacro(ConvertLinesToPoints,int);
00104   vtkGetMacro(ConvertLinesToPoints,int);
00106 
00108 
00109   vtkSetMacro(ConvertPolysToLines,int);
00110   vtkBooleanMacro(ConvertPolysToLines,int);
00111   vtkGetMacro(ConvertPolysToLines,int);
00113 
00115 
00116   vtkSetMacro(ConvertStripsToPolys,int);
00117   vtkBooleanMacro(ConvertStripsToPolys,int);
00118   vtkGetMacro(ConvertStripsToPolys,int);
00120 
00122 
00126   vtkSetMacro(PointMerging,int);
00127   vtkGetMacro(PointMerging,int);
00128   vtkBooleanMacro(PointMerging,int);
00130 
00132 
00134   virtual void SetLocator(vtkIncrementalPointLocator *locator);
00135   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00137 
00139   void CreateDefaultLocator(vtkPolyData *input = 0);
00140 
00142   void ReleaseLocator() { this->SetLocator(NULL); }
00143 
00145   unsigned long int GetMTime();
00146 
00148   virtual void OperateOnPoint(double in[3], double out[3]);
00149 
00151   virtual void OperateOnBounds(double in[6], double out[6]);
00152 
00153   // This filter is difficult to stream.
00154   // To get invariant results, the whole input must be processed at once.
00155   // This flag allows the user to select whether strict piece invariance
00156   // is required.  By default it is on.  When off, the filter can stream,
00157   // but results may change.
00158   vtkSetMacro(PieceInvariant, int);
00159   vtkGetMacro(PieceInvariant, int);
00160   vtkBooleanMacro(PieceInvariant, int);
00161 
00162 protected:
00163   vtkCleanPolyData();
00164  ~vtkCleanPolyData();
00165 
00166   // Usual data generation method
00167   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00168   virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00169   virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00170 
00171   int   PointMerging;
00172   double Tolerance;
00173   double AbsoluteTolerance;
00174   int ConvertLinesToPoints;
00175   int ConvertPolysToLines;
00176   int ConvertStripsToPolys;
00177   int ToleranceIsAbsolute;
00178   vtkIncrementalPointLocator *Locator;
00179 
00180   int PieceInvariant;
00181 private:
00182   vtkCleanPolyData(const vtkCleanPolyData&);  // Not implemented.
00183   void operator=(const vtkCleanPolyData&);  // Not implemented.
00184 };
00185 
00186 #endif