VTK  9.7.1
vtkTableBasedClipDataSet.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
3 // SPDX-License-Identifier: BSD-3-Clause
4 
80 #ifndef vtkTableBasedClipDataSet_h
81 #define vtkTableBasedClipDataSet_h
82 
83 #include "vtkFiltersGeneralModule.h" // For export macro
84 #include "vtkIncrementalPointLocator.h" // For vtkIncrementalPointLocator
86 #include "vtkWeakPointer.h" // Needed for weak pointer to the vtkIncrementalPointLocator
87 
88 VTK_ABI_NAMESPACE_BEGIN
89 class vtkCallbackCommand;
90 class vtkDataArray;
92 class vtkPolyData;
93 
94 class VTKFILTERSGENERAL_EXPORT vtkTableBasedClipDataSet : public vtkUnstructuredGridAlgorithm
95 {
96 public:
98  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
104  static vtkTableBasedClipDataSet* New();
105 
109  vtkMTimeType GetMTime() override;
110 
112 
119  vtkSetMacro(InsideOut, vtkTypeBool);
120  vtkGetMacro(InsideOut, vtkTypeBool);
121  vtkBooleanMacro(InsideOut, vtkTypeBool);
123 
125 
131  vtkSetMacro(Value, double);
132  vtkGetMacro(Value, double);
134 
136 
141  vtkSetMacro(UseValueAsOffset, bool);
142  vtkGetMacro(UseValueAsOffset, bool);
143  vtkBooleanMacro(UseValueAsOffset, bool);
145 
147 
152  virtual void SetClipFunction(vtkImplicitFunction*);
153  vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
155 
157 
163  vtkSetMacro(GenerateClipScalars, vtkTypeBool);
164  vtkGetMacro(GenerateClipScalars, vtkTypeBool);
165  vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
167 
175  {
176  InputPoint = 0,
177  EdgePoint = 1,
178  CentroidPoint = 2
179  };
180 
182 
191  vtkSetMacro(GenerateClipPointTypes, bool);
192  vtkGetMacro(GenerateClipPointTypes, bool);
193  vtkBooleanMacro(GenerateClipPointTypes, bool);
195 
200  static const char* GetPointTypesArrayName() { return "vtkClipPointTypes"; }
201 
203 
209  vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
210  vtkGetMacro(MergeTolerance, double);
212 
214 
218  vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
219  vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
220  vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
222 
226  vtkUnstructuredGrid* GetClippedOutput();
227 
229 
234  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
235  vtkGetMacro(OutputPointsPrecision, int);
237 
239 
247  vtkSetClampMacro(BatchSize, unsigned int, 1, VTK_INT_MAX);
248  vtkGetMacro(BatchSize, unsigned int);
250 
252 
256  void SetLocator(vtkIncrementalPointLocator* locator);
257  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
259 
260 protected:
262  ~vtkTableBasedClipDataSet() override;
263 
265  int FillInputPortInformation(int port, vtkInformation* info) override;
266 
267 private:
273  void ClipDataSet(vtkDataSet* pDataSet, vtkUnstructuredGrid* outputUG);
274 
281  void ClipPolyData(
282  vtkPolyData* inputGrid, vtkDataArray* scalars, double isoValue, vtkUnstructuredGrid* outputUG);
283 
290  template <class TGrid>
291  void ClipTDataSet(
292  TGrid* inputGrid, vtkDataArray* scalars, double isoValue, vtkUnstructuredGrid* outputUG);
293 
297  template <typename TGrid, typename TInputIdType, bool InsideOut>
299  TGrid* input, vtkDataArray* scalars, double isoValue);
300 
304  static void InternalProgressCallbackFunction(vtkObject*, unsigned long, void* clientdata, void*);
305 
309  void InternalProgressCallback(vtkAlgorithm* algorithm);
310 
311 protected:
316  double Value;
320  unsigned int BatchSize;
321 
323 
325 
326 private:
328  void operator=(const vtkTableBasedClipDataSet&) = delete;
329 
330  bool GenerateClipPointTypes;
331 };
332 
333 VTK_ABI_NAMESPACE_END
334 #endif
abstract interface for implicit functions
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
abstract base class for most VTK objects
Definition: vtkObject.h:52
static const char * GetPointTypesArrayName()
Return the array name used classify the points from their origin.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
#define vtkTableBasedClipDataSet
Definition: vtkmClip.h:25
#define VTK_INT_MAX
Definition: vtkType.h:192
vtkCallbackCommand * InternalProgressObserver
static vtkUnstructuredGridAlgorithm * New()
vtkWeakPointer< vtkIncrementalPointLocator > Locator
Abstract class in support of both point location and point insertion.
vtkImplicitFunction * ClipFunction
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int vtkTypeBool
Definition: vtkABI.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
supports function callbacks
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
a simple class to control print indentation
Definition: vtkIndent.h:28
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual vtkMTimeType GetMTime()
Return this object's modified time.
Clip any dataset with a user-specified implicit function or an input scalar point data array...
Superclass for algorithms that produce only unstructured grid as output.
PointTypes
PointType enum can be used to flag point origin.
Store zero or more vtkInformation instances.