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

vtkCutter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCutter.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 __vtkCutter_h
00059 #define __vtkCutter_h
00060 
00061 #include "vtkDataSetToPolyDataFilter.h"
00062 
00063 #include "vtkContourValues.h" // Needed for inline methods
00064 
00065 #define VTK_SORT_BY_VALUE 0
00066 #define VTK_SORT_BY_CELL 1
00067 
00068 class vtkImplicitFunction;
00069 class vtkPointLocator;
00070 
00071 class VTK_GRAPHICS_EXPORT vtkCutter : public vtkDataSetToPolyDataFilter
00072 {
00073 public:
00074   vtkTypeRevisionMacro(vtkCutter,vtkDataSetToPolyDataFilter);
00075   void PrintSelf(ostream& os, vtkIndent indent);
00076 
00079   static vtkCutter *New();
00080 
00082 
00084   void SetValue(int i, double value) 
00085     {this->ContourValues->SetValue(i,value);}
00087   
00089 
00090   double GetValue(int i) 
00091     {return this->ContourValues->GetValue(i);}
00093 
00095 
00097   double *GetValues() 
00098     {return this->ContourValues->GetValues();}
00100 
00102 
00105   void GetValues(double *contourValues)
00106     {this->ContourValues->GetValues(contourValues);}
00108   
00110 
00113   void SetNumberOfContours(int number) 
00114     {this->ContourValues->SetNumberOfContours(number);}
00116 
00118 
00119   int GetNumberOfContours() 
00120     {return this->ContourValues->GetNumberOfContours();}
00122 
00124 
00126   void GenerateValues(int numContours, double range[2]) 
00127     {this->ContourValues->GenerateValues(numContours, range);}
00129 
00131 
00133   void GenerateValues(int numContours, double rangeStart, double rangeEnd) 
00134     {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00136 
00139   unsigned long GetMTime();
00140 
00142 
00143   virtual void SetCutFunction(vtkImplicitFunction*);
00144   vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
00146 
00148 
00151   vtkSetMacro(GenerateCutScalars,int);
00152   vtkGetMacro(GenerateCutScalars,int);
00153   vtkBooleanMacro(GenerateCutScalars,int);
00155 
00157 
00159   void SetLocator(vtkPointLocator *locator);
00160   vtkGetObjectMacro(Locator,vtkPointLocator);
00162 
00164 
00172   vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
00173   vtkGetMacro(SortBy,int);
00174   void SetSortByToSortByValue() 
00175     {this->SetSortBy(VTK_SORT_BY_VALUE);}
00176   void SetSortByToSortByCell() 
00177     {this->SetSortBy(VTK_SORT_BY_CELL);}
00178   const char *GetSortByAsString();
00180 
00183   void CreateDefaultLocator();
00184 
00185 protected:
00186   vtkCutter(vtkImplicitFunction *cf=NULL);
00187   ~vtkCutter();
00188 
00189   void Execute();
00190   void UnstructuredGridCutter();
00191   void DataSetCutter();
00192   vtkImplicitFunction *CutFunction;
00193   
00194   vtkPointLocator *Locator;
00195   int SortBy;
00196   vtkContourValues *ContourValues;
00197   int GenerateCutScalars;
00198 private:
00199   vtkCutter(const vtkCutter&);  // Not implemented.
00200   void operator=(const vtkCutter&);  // Not implemented.
00201 };
00202 
00204 inline const char *vtkCutter::GetSortByAsString(void)
00205 {
00206   if ( this->SortBy == VTK_SORT_BY_VALUE ) 
00207     {
00208     return "SortByValue";
00209     }
00210   else 
00211     {
00212     return "SortByCell";
00213     }
00214 }
00215 
00216 
00217 #endif
00218 
00219