VTK  9.5.20250817
vtkClipDataSet.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
90#ifndef vtkClipDataSet_h
91#define vtkClipDataSet_h
92
93#include "vtkFiltersGeneralModule.h" // For export macro
95
96VTK_ABI_NAMESPACE_BEGIN
98class vtkCellArray;
99class vtkCellData;
103
104class VTKFILTERSGENERAL_EXPORT vtkClipDataSet : public vtkUnstructuredGridAlgorithm
105{
106public:
108 void PrintSelf(ostream& os, vtkIndent indent) override;
109
115
117
123 vtkSetMacro(Value, double);
124 vtkGetMacro(Value, double);
126
128
133 vtkSetMacro(UseValueAsOffset, bool);
134 vtkGetMacro(UseValueAsOffset, bool);
135 vtkBooleanMacro(UseValueAsOffset, bool);
137
139
147 vtkSetMacro(InsideOut, vtkTypeBool);
148 vtkGetMacro(InsideOut, vtkTypeBool);
149 vtkBooleanMacro(InsideOut, vtkTypeBool);
151
153
159 vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
161
163
169 vtkSetMacro(GenerateClipScalars, vtkTypeBool);
170 vtkGetMacro(GenerateClipScalars, vtkTypeBool);
171 vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
173
175
179 vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
180 vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
181 vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
183
185
191 vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
192 vtkGetMacro(MergeTolerance, double);
194
199
201
206 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
208
214
219
221
226 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
227 vtkGetMacro(OutputPointsPrecision, int);
229
231
234 vtkGetMacro(StableClipNonLinear, bool);
235 vtkSetMacro(StableClipNonLinear, bool);
236 vtkBooleanMacro(StableClipNonLinear, bool);
238
239protected:
241 ~vtkClipDataSet() override;
242
244 int FillInputPortInformation(int port, vtkInformation* info) override;
246
249 double Value;
251
254
255 // Callback registered with the InternalProgressObserver.
256 static void InternalProgressCallbackFunction(vtkObject*, unsigned long, void* clientdata, void*);
258 // The observer to report progress from the internal readers.
260
261 // helper functions
263
265 vtkDataSet* input, vtkUnstructuredGrid* output, vtkInformationVector** inputVector);
266
269
270 bool StableClipNonLinear = true;
271
272private:
273 vtkClipDataSet(const vtkClipDataSet&) = delete;
274 void operator=(const vtkClipDataSet&) = delete;
275
280 vtkIdType SeparateCellIds(vtkIdType numCells, vtkDataSet* input, std::vector<vtkIdType>& pointMap,
281 std::vector<vtkIdType>& clippingCellIds, double clipValue, vtkDataArray* clipScalars,
282 std::array<std::vector<vtkIdType>, 2>& intactCellIds);
283
287 void FillIntactCells(vtkDataSet* input, int numOutputs,
288 std::array<std::vector<vtkIdType>, 2>& intactCellIds, std::vector<vtkIdType>& pointMap,
289 vtkSmartPointer<vtkCellArray> conn[2], vtkCellData* outCD[2], vtkCellData* inCD,
291};
292
293VTK_ABI_NAMESPACE_END
294#endif
Superclass for all sources, filters, and sinks in VTK.
supports function callbacks
object to represent cell connectivity
represent and manipulate cell attribute data
clip any dataset with user-specified implicit function or input scalar data
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool GenerateClippedOutput
vtkUnstructuredGrid * GetClippedOutput()
Return the Clipped output.
vtkCallbackCommand * InternalProgressObserver
virtual void SetClipFunction(vtkImplicitFunction *)
Specify the implicit function with which to perform the clipping.
~vtkClipDataSet() override
static void InternalProgressCallbackFunction(vtkObject *, unsigned long, void *clientdata, void *)
vtkTypeBool InsideOut
void ClipVolume(vtkDataSet *input, vtkUnstructuredGrid *output)
vtkIncrementalPointLocator * Locator
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
int ClipPoints(vtkDataSet *input, vtkUnstructuredGrid *output, vtkInformationVector **inputVector)
vtkImplicitFunction * ClipFunction
vtkClipDataSet(vtkImplicitFunction *cf=nullptr)
vtkMTimeType GetMTime() override
Return the mtime also considering the locator and clip function.
static vtkClipDataSet * New()
Construct with user-specified implicit function; InsideOut turned off; value set to 0....
void InternalProgressCallback(vtkAlgorithm *algorithm)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateDefaultLocator()
Create default locator.
vtkTypeBool GenerateClipScalars
abstract superclass for arrays of numeric data
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
abstract interface for implicit functions
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition vtkObject.h:162
Hold a reference to a vtkObjectBase instance.
dynamic, self-adjusting array of unsigned char
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287