VTK: Filters/General/vtkClipDataSet.h Source File

| VTK 9.3.1

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
60 #ifndef vtkClipDataSet_h
61 #define vtkClipDataSet_h
62
63 #include "vtkFiltersGeneralModule.h" // For export macro
64 #include "vtkUnstructuredGridAlgorithm.h"
65
66 VTK_ABI_NAMESPACE_BEGIN
67 class vtkCallbackCommand;
68 class vtkImplicitFunction;
69 class vtkIncrementalPointLocator;
70
71 class VTKFILTERSGENERAL_EXPORT vtkClipDataSet : public vtkUnstructuredGridAlgorithm
72 {
73 public:
74 vtkTypeMacro(vtkClipDataSet, vtkUnstructuredGridAlgorithm);
75 void PrintSelf(ostream& os, vtkIndent indent) override;
76
81 static vtkClipDataSet* New();
82
84
90 vtkSetMacro(Value, double);
91 vtkGetMacro(Value, double);
93
95
100 vtkSetMacro(UseValueAsOffset, bool);
101 vtkGetMacro(UseValueAsOffset, bool);
102 vtkBooleanMacro(UseValueAsOffset, bool);
104
106
114 vtkSetMacro(InsideOut, vtkTypeBool);
115 vtkGetMacro(InsideOut, vtkTypeBool);
116 vtkBooleanMacro(InsideOut, vtkTypeBool);
118
120
125 virtual void SetClipFunction(vtkImplicitFunction*);
126 vtkGetObjectMacro(ClipFunction, vtkImplicitFunction);
128
130
136 vtkSetMacro(GenerateClipScalars, vtkTypeBool);
137 vtkGetMacro(GenerateClipScalars, vtkTypeBool);
138 vtkBooleanMacro(GenerateClipScalars, vtkTypeBool);
140
142
146 vtkSetMacro(GenerateClippedOutput, vtkTypeBool);
147 vtkGetMacro(GenerateClippedOutput, vtkTypeBool);
148 vtkBooleanMacro(GenerateClippedOutput, vtkTypeBool);
150
152
158 vtkSetClampMacro(MergeTolerance, double, 0.0001, 0.25);
159 vtkGetMacro(MergeTolerance, double);
161
165 vtkUnstructuredGrid* GetClippedOutput();
166
168
172 void SetLocator(vtkIncrementalPointLocator* locator);
173 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
175
180 void CreateDefaultLocator();
181
185 vtkMTimeType GetMTime() override;
186
188
193 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
194 vtkGetMacro(OutputPointsPrecision, int);
196
198
201 vtkGetMacro(StableClipNonLinear, bool);
202 vtkSetMacro(StableClipNonLinear, bool);
203 vtkBooleanMacro(StableClipNonLinear, bool);
205
206 protected:
207 vtkClipDataSet(vtkImplicitFunction* cf = nullptr);
208 ~vtkClipDataSet() override;
209
210 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
211 int FillInputPortInformation(int port, vtkInformation* info) override;
212 vtkImplicitFunction* ClipFunction;
213
214 vtkIncrementalPointLocator* Locator;
215 vtkTypeBool InsideOut;
216 double Value;
217 vtkTypeBool GenerateClipScalars;
218
219 vtkTypeBool GenerateClippedOutput;
220 double MergeTolerance;
221
222 // Callback registered with the InternalProgressObserver.
223 static void InternalProgressCallbackFunction(vtkObject*, unsigned long, void* clientdata, void*);
224 void InternalProgressCallback(vtkAlgorithm* algorithm);
225 // The observer to report progress from the internal readers.
226 vtkCallbackCommand* InternalProgressObserver;
227
228 // helper functions
229 void ClipVolume(vtkDataSet* input, vtkUnstructuredGrid* output);
230
231 int ClipPoints(
232 vtkDataSet* input, vtkUnstructuredGrid* output, vtkInformationVector** inputVector);
233
234 bool UseValueAsOffset;
235 int OutputPointsPrecision;
236
237 bool StableClipNonLinear = true;
238
239 private:
240 vtkClipDataSet(const vtkClipDataSet&) = delete;
241 void operator=(const vtkClipDataSet&) = delete;
242 };
243
244 VTK_ABI_NAMESPACE_END
245 #endif
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:49
vtkClipDataSet
clip any dataset with user-specified implicit function or input scalar data
Definition: vtkClipDataSet.h:72
vtkClipDataSet::Value
double Value
Definition: vtkClipDataSet.h:216
vtkClipDataSet::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkClipDataSet::GenerateClippedOutput
vtkTypeBool GenerateClippedOutput
Definition: vtkClipDataSet.h:219
vtkClipDataSet::InternalProgressObserver
vtkCallbackCommand * InternalProgressObserver
Definition: vtkClipDataSet.h:226
vtkClipDataSet::SetClipFunction
virtual void SetClipFunction(vtkImplicitFunction *)
Specify the implicit function with which to perform the clipping.
vtkClipDataSet::~vtkClipDataSet
~vtkClipDataSet() override
vtkClipDataSet::InternalProgressCallbackFunction
static void InternalProgressCallbackFunction(vtkObject *, unsigned long, void *clientdata, void *)
vtkClipDataSet::MergeTolerance
double MergeTolerance
Definition: vtkClipDataSet.h:220
vtkClipDataSet::InsideOut
vtkTypeBool InsideOut
Definition: vtkClipDataSet.h:215
vtkClipDataSet::GetClippedOutput
vtkUnstructuredGrid * GetClippedOutput()
Return the Clipped output.
vtkClipDataSet::ClipVolume
void ClipVolume(vtkDataSet *input, vtkUnstructuredGrid *output)
vtkClipDataSet::UseValueAsOffset
bool UseValueAsOffset
Definition: vtkClipDataSet.h:234
vtkClipDataSet::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkClipDataSet.h:214
vtkClipDataSet::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkClipDataSet::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
vtkClipDataSet::ClipPoints
int ClipPoints(vtkDataSet *input, vtkUnstructuredGrid *output, vtkInformationVector **inputVector)
vtkClipDataSet::ClipFunction
vtkImplicitFunction * ClipFunction
Definition: vtkClipDataSet.h:212
vtkClipDataSet::vtkClipDataSet
vtkClipDataSet(vtkImplicitFunction *cf=nullptr)
vtkClipDataSet::GetMTime
vtkMTimeType GetMTime() override
Return the mtime also considering the locator and clip function.
vtkClipDataSet::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkClipDataSet.h:235
vtkClipDataSet::InternalProgressCallback
void InternalProgressCallback(vtkAlgorithm *algorithm)
vtkClipDataSet::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkClipDataSet::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkClipDataSet::New
static vtkClipDataSet * New()
Construct with user-specified implicit function; InsideOut turned off; value set to 0....
vtkClipDataSet::GenerateClipScalars
vtkTypeBool GenerateClipScalars
Definition: vtkClipDataSet.h:217
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:59
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:30
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:99
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
vtkUnstructuredGridAlgorithm.h