VTK
vtkCutter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCutter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
50 #ifndef __vtkCutter_h
51 #define __vtkCutter_h
52 
53 #include "vtkPolyDataAlgorithm.h"
54 
55 #include "vtkContourValues.h" // Needed for inline methods
56 
57 #define VTK_SORT_BY_VALUE 0
58 #define VTK_SORT_BY_CELL 1
59 
66 
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
75  static vtkCutter *New();
76 
78 
80  void SetValue(int i, double value)
81  {this->ContourValues->SetValue(i,value);}
83 
85 
86  double GetValue(int i)
87  {return this->ContourValues->GetValue(i);}
89 
91 
93  double *GetValues()
94  {return this->ContourValues->GetValues();}
96 
98 
101  void GetValues(double *contourValues)
102  {this->ContourValues->GetValues(contourValues);}
104 
106 
109  void SetNumberOfContours(int number)
110  {this->ContourValues->SetNumberOfContours(number);}
112 
114 
115  int GetNumberOfContours()
116  {return this->ContourValues->GetNumberOfContours();}
118 
120 
122  void GenerateValues(int numContours, double range[2])
123  {this->ContourValues->GenerateValues(numContours, range);}
125 
127 
129  void GenerateValues(int numContours, double rangeStart, double rangeEnd)
130  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
132 
135  unsigned long GetMTime();
136 
138 
139  virtual void SetCutFunction(vtkImplicitFunction*);
140  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
142 
144 
147  vtkSetMacro(GenerateCutScalars,int);
148  vtkGetMacro(GenerateCutScalars,int);
149  vtkBooleanMacro(GenerateCutScalars,int);
151 
153 
155  void SetLocator(vtkIncrementalPointLocator *locator);
156  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
158 
160 
170  vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
171  vtkGetMacro(SortBy,int);
172  void SetSortByToSortByValue()
173  {this->SetSortBy(VTK_SORT_BY_VALUE);}
174  void SetSortByToSortByCell()
175  {this->SetSortBy(VTK_SORT_BY_CELL);}
176  const char *GetSortByAsString();
178 
181  void CreateDefaultLocator();
182 
187  static void GetCellTypeDimensions(unsigned char* cellTypeDimensions);
188 
189 protected:
190  vtkCutter(vtkImplicitFunction *cf=NULL);
191  ~vtkCutter();
192 
194 
195  virtual int ProcessRequest(vtkInformation*,
199 
203  void UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output);
204  void DataSetCutter(vtkDataSet *input, vtkPolyData *output);
205  void StructuredPointsCutter(vtkDataSet *, vtkPolyData *,
208  void StructuredGridCutter(vtkDataSet *, vtkPolyData *);
209  void RectilinearGridCutter(vtkDataSet *, vtkPolyData *);
211 
216 
218  int SortBy;
221 private:
222  vtkCutter(const vtkCutter&); // Not implemented.
223  void operator=(const vtkCutter&); // Not implemented.
224 };
225 
227 
228 inline const char *vtkCutter::GetSortByAsString(void)
229 {
230  if ( this->SortBy == VTK_SORT_BY_VALUE )
231  {
232  return "SortByValue";
233  }
234  else
235  {
236  return "SortByCell";
237  }
238 }
240 
241 #endif