VTK  9.4.20251007
vtkHyperTreeGridThreshold.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
29
30#ifndef vtkHyperTreeGridThreshold_h
31#define vtkHyperTreeGridThreshold_h
32
33#include "vtkDeprecation.h" // For deprecation macros
34#include "vtkFiltersHyperTreeModule.h" // For export macro
36
37#include <memory> // For std::unique_ptr
38#include <mutex>
39
40VTK_ABI_NAMESPACE_BEGIN
41class vtkBitArray;
43
45
46class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridThreshold : public vtkHyperTreeGridAlgorithm
47{
48public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54
60 VTK_DEPRECATED_IN_9_3_0("JustCreateNewMask is deprecated in favor of MemoryStrategy")
61 virtual void SetJustCreateNewMask(bool) {}
62 VTK_DEPRECATED_IN_9_3_0("JustCreateNewMask is deprecated in favor of MemoryStrategy")
63 virtual bool GetJustCreateNewMask() { return (this->GetMemoryStrategy() == MaskInput); }
65
67
70 vtkSetMacro(LowerThreshold, double);
71 vtkGetMacro(LowerThreshold, double);
73
75
78 vtkSetMacro(UpperThreshold, double);
79 vtkGetMacro(UpperThreshold, double);
81
85 void ThresholdBetween(double, double);
86
88
102
107 vtkGetMacro(MemoryStrategy, int);
108 vtkSetClampMacro(MemoryStrategy, int, MaskInput, DeepThreshold);
110
111protected:
114
119
124
130
136
141
146
151
156
161
166
171
172private:
174 void operator=(const vtkHyperTreeGridThreshold&) = delete;
180 bool RecursivelyProcessChild(vtkHyperTreeGridNonOrientedCursor* outCursor, int ichild);
181
185 void SafeInsertOutMask(vtkIdType tupleIdx, double value);
186
187 int MemoryStrategy = MaskInput;
188 std::vector<std::mutex> OutMaskMutexes;
189 int ArrayMutexSize = 0; // Needs to be a multiple of 8
190
191 struct Internals;
192 std::unique_ptr<Internals> Internal;
193};
194
195VTK_ABI_NAMESPACE_END
196#endif /* vtkHyperTreeGridThreshold */
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:29
general representation of visualization data
Objects for traversal a HyperTreeGrid.
vtkIdType CurrentId
Keep track of current index in output hyper tree grid.
virtual bool GetJustCreateNewMask()
Set/Get True, sets the MemoryStrategy to MaskInput ; False, does nothing now prefer SetMemoryStrategy...
bool RecursivelyProcessTree(vtkHyperTreeGridNonOrientedCursor *, vtkHyperTreeGridNonOrientedCursor *)
Recursively descend into input tree down to leaves, creating output structure at the same time.
static vtkHyperTreeGridThreshold * New()
double LowerThreshold
LowerThreshold scalar value to be accepted.
vtkBitArray * InMask
Input material mask.
MemoryStrategyChoice
Enum for defining the strategy to take in allocating the memory used by the output.
~vtkHyperTreeGridThreshold() override
int FillOutputPortInformation(int, vtkInformation *) override
For this algorithm the output is a vtkHyperTreeGrid instance.
bool JustCreateNewMask
With or without copy (deprecated in favor of MemoryStrategy)
vtkBitArray * OutMask
Output material mask constructed by this filter.
bool RecursivelyProcessTreeWithCreateNewMask(vtkHyperTreeGridNonOrientedCursor *)
Recursively descend into input tree down to leaves, filling the output mask as it goes.
double UpperThreshold
UpperThreshold scalar value to be accepted.
vtkDataArray * InScalars
Keep track of selected input scalars.
void ThresholdBetween(double, double)
Convenience method to set both threshold values at once.
virtual int GetMemoryStrategy()
Setter and Getter for the memory strategy.
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to extract cells based on thresholded value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetJustCreateNewMask(bool)
Set/Get True, sets the MemoryStrategy to MaskInput ; False, does nothing now prefer SetMemoryStrategy...
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
#define vtkDataArray
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition vtkType.h:315