VTK  9.4.20250209
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
30#ifndef vtkHyperTreeGridThreshold_h
31#define vtkHyperTreeGridThreshold_h
32
33#include "vtkFiltersHyperTreeModule.h" // For export macro
35
36#include <memory> // For std::unique_ptr
37#include <mutex>
38
39VTK_ABI_NAMESPACE_BEGIN
40class vtkBitArray;
42
44
45class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridThreshold : public vtkHyperTreeGridAlgorithm
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
53
56 vtkSetMacro(LowerThreshold, double);
57 vtkGetMacro(LowerThreshold, double);
59
61
64 vtkSetMacro(UpperThreshold, double);
65 vtkGetMacro(UpperThreshold, double);
67
71 void ThresholdBetween(double, double);
72
74
83 {
84 MaskInput = 0,
85 CopyStructureAndIndexArrays = 1,
86 DeepThreshold = 2
87 };
93 vtkGetMacro(MemoryStrategy, int);
94 vtkSetClampMacro(MemoryStrategy, int, MaskInput, DeepThreshold);
96
97protected:
100
105
110
116
122
127
132
137
142
147
152
157
158private:
160 void operator=(const vtkHyperTreeGridThreshold&) = delete;
166 bool RecursivelyProcessChild(vtkHyperTreeGridNonOrientedCursor* outCursor, int ichild);
167
171 void SafeInsertOutMask(vtkIdType tupleIdx, double value);
172
173 int MemoryStrategy = MaskInput;
174 std::vector<std::mutex> OutMaskMutexes;
175 int ArrayMutexSize = 0; // Needs to be a multiple of 8
176
177 struct Internals;
178 std::unique_ptr<Internals> Internal;
179};
180
181VTK_ABI_NAMESPACE_END
182#endif /* vtkHyperTreeGridThreshold */
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:29
abstract superclass for arrays of numeric data
general representation of visualization data
Superclass for algorithms that produce a hyper tree grid as output.
Objects for traversal a HyperTreeGrid.
Extract cells from a hyper tree grid where selected scalar value is within given range.
vtkIdType CurrentId
Keep track of current index in output hyper tree grid.
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.
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.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
int vtkIdType
Definition vtkType.h:315