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

# Graphics/vtkCutter.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkCutter.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 =========================================================================*/
    00062 #ifndef __vtkCutter_h
    00063 #define __vtkCutter_h
    00064
    00065 #include "vtkDataSetToPolyDataFilter.h"
    00066
    00067 #include "vtkContourValues.h" // Needed for inline methods
    00068
    00069 #define VTK_SORT_BY_VALUE 0
    00070 #define VTK_SORT_BY_CELL 1
    00071
    00072 class vtkImplicitFunction;
    00073 class vtkPointLocator;
    00074
    00075 class VTK_GRAPHICS_EXPORT vtkCutter : public vtkDataSetToPolyDataFilter
    00076 {
    00077 public:
    00078   vtkTypeRevisionMacro(vtkCutter,vtkDataSetToPolyDataFilter);
    00079   void PrintSelf(ostream& os, vtkIndent indent);
    00080
    00083   static vtkCutter *New();
    00084
    00086
    00088   void SetValue(int i, float value)
    00089     {this->ContourValues->SetValue(i,value);}
    00091
    00093
    00094   float GetValue(int i)
    00095     {return this->ContourValues->GetValue(i);}
    00097
    00099
    00101   float *GetValues()
    00102     {return this->ContourValues->GetValues();}
    00104
    00106
    00109   void GetValues(float *contourValues)
    00110     {this->ContourValues->GetValues(contourValues);}
    00112
    00114
    00117   void SetNumberOfContours(int number)
    00118     {this->ContourValues->SetNumberOfContours(number);}
    00120
    00122
    00123   int GetNumberOfContours()
    00124     {return this->ContourValues->GetNumberOfContours();}
    00126
    00128
    00130   void GenerateValues(int numContours, float range[2])
    00131     {this->ContourValues->GenerateValues(numContours, range);}
    00133
    00135
    00137   void GenerateValues(int numContours, float rangeStart, float rangeEnd)
    00138     {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
    00140
    00143   unsigned long GetMTime();
    00144
    00146
    00147   virtual void SetCutFunction(vtkImplicitFunction*);
    00148   vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
    00150
    00152
    00155   vtkSetMacro(GenerateCutScalars,int);
    00156   vtkGetMacro(GenerateCutScalars,int);
    00157   vtkBooleanMacro(GenerateCutScalars,int);
    00159
    00161
    00163   void SetLocator(vtkPointLocator *locator);
    00164   vtkGetObjectMacro(Locator,vtkPointLocator);
    00166
    00168
    00176   vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
    00177   vtkGetMacro(SortBy,int);
    00178   void SetSortByToSortByValue()
    00179     {this->SetSortBy(VTK_SORT_BY_VALUE);}
    00180   void SetSortByToSortByCell()
    00181     {this->SetSortBy(VTK_SORT_BY_CELL);}
    00182   const char *GetSortByAsString();
    00184
    00187   void CreateDefaultLocator();
    00188
    00189 protected:
    00190   vtkCutter(vtkImplicitFunction *cf=NULL);
    00191   ~vtkCutter();
    00192
    00193   void Execute();
    00194   vtkImplicitFunction *CutFunction;
    00195
    00196   vtkPointLocator *Locator;
    00197   int SortBy;
    00198   vtkContourValues *ContourValues;
    00199   int GenerateCutScalars;
    00200 private:
    00201   vtkCutter(const vtkCutter&);  // Not implemented.
    00202   void operator=(const vtkCutter&);  // Not implemented.
    00203 };
    00204
    00206 inline const char *vtkCutter::GetSortByAsString(void)
    00207 {
    00208   if ( this->SortBy == VTK_SORT_BY_VALUE )
    00209     {
    00210     return "SortByValue";
    00211     }
    00212   else
    00213     {
    00214     return "SortByCell";
    00215     }
    00216 }
    00217
    00218
    00219 #endif
    00220
    00221