VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkClipDataSet.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkClipDataSet.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 =========================================================================*/
62 #ifndef __vtkClipDataSet_h
63 #define __vtkClipDataSet_h
64 
65 #include "vtkFiltersGeneralModule.h" // For export macro
66 #include "vtkUnstructuredGridAlgorithm.h"
67 
68 class vtkCallbackCommand;
69 class vtkImplicitFunction;
70 class vtkIncrementalPointLocator;
71 
72 class VTKFILTERSGENERAL_EXPORT vtkClipDataSet : public vtkUnstructuredGridAlgorithm
73 {
74 public:
75  vtkTypeMacro(vtkClipDataSet,vtkUnstructuredGridAlgorithm);
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
80  static vtkClipDataSet *New();
81 
83 
87  vtkSetMacro(Value,double);
88  vtkGetMacro(Value,double);
90 
92 
95  vtkSetMacro(UseValueAsOffset, bool);
96  vtkGetMacro(UseValueAsOffset, bool);
97  vtkBooleanMacro(UseValueAsOffset, bool);
99 
101 
106  vtkSetMacro(InsideOut,int);
107  vtkGetMacro(InsideOut,int);
108  vtkBooleanMacro(InsideOut,int);
110 
112 
115  virtual void SetClipFunction(vtkImplicitFunction*);
116  vtkGetObjectMacro(ClipFunction,vtkImplicitFunction);
118 
120 
124  vtkSetMacro(GenerateClipScalars,int);
125  vtkGetMacro(GenerateClipScalars,int);
126  vtkBooleanMacro(GenerateClipScalars,int);
128 
130 
132  vtkSetMacro(GenerateClippedOutput,int);
133  vtkGetMacro(GenerateClippedOutput,int);
134  vtkBooleanMacro(GenerateClippedOutput,int);
136 
138 
142  vtkSetClampMacro(MergeTolerance,double,0.0001,0.25);
143  vtkGetMacro(MergeTolerance,double);
145 
147  vtkUnstructuredGrid *GetClippedOutput();
148 
150 
152  void SetLocator(vtkIncrementalPointLocator *locator);
153  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
155 
158  void CreateDefaultLocator();
159 
161  unsigned long GetMTime();
162 
164 
167  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
168  vtkGetMacro(OutputPointsPrecision, int);
170 
171 protected:
172  vtkClipDataSet(vtkImplicitFunction *cf=NULL);
173  ~vtkClipDataSet();
174 
176 
177  virtual int ProcessRequest(vtkInformation*,
178  vtkInformationVector**,
179  vtkInformationVector*);
181 
182  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
183  virtual int FillInputPortInformation(int port, vtkInformation *info);
184  vtkImplicitFunction *ClipFunction;
185 
186  vtkIncrementalPointLocator *Locator;
188  double Value;
190 
193 
194  // Callback registered with the InternalProgressObserver.
195  static void InternalProgressCallbackFunction(vtkObject*, unsigned long,
196  void* clientdata, void*);
197  void InternalProgressCallback(vtkAlgorithm *algorithm);
198  // The observer to report progress from the internal readers.
199  vtkCallbackCommand* InternalProgressObserver;
200 
201  //helper functions
202  void ClipVolume(vtkDataSet *input, vtkUnstructuredGrid *output);
203 
204  int ClipPoints(vtkDataSet* input, vtkUnstructuredGrid* output,
205  vtkInformationVector** inputVector);
206 
209 
210 private:
211  vtkClipDataSet(const vtkClipDataSet&); // Not implemented.
212  void operator=(const vtkClipDataSet&); // Not implemented.
213 };
214 
215 #endif
vtkIncrementalPointLocator * Locator
vtkImplicitFunction * ClipFunction
vtkCallbackCommand * InternalProgressObserver
clip any dataset with user-specified implicit function or input scalar data