VTK  9.7.1
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 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkBitArray;
41 class vtkHyperTreeGrid;
42 
44 
45 class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridThreshold : public vtkHyperTreeGridAlgorithm
46 {
47 public:
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 
97 protected:
99  ~vtkHyperTreeGridThreshold() override;
100 
104  int FillOutputPortInformation(int, vtkInformation*) override;
105 
110 
114  bool RecursivelyProcessTree(
116 
121  bool RecursivelyProcessTreeWithCreateNewMask(vtkHyperTreeGridNonOrientedCursor*);
122 
127 
132 
137 
142 
147 
152 
153 private:
155  void operator=(const vtkHyperTreeGridThreshold&) = delete;
161  bool RecursivelyProcessChild(vtkHyperTreeGridNonOrientedCursor* outCursor, int ichild);
162 
166  void SafeInsertOutMask(vtkIdType tupleIdx, double value);
167 
168  int MemoryStrategy = MaskInput;
169  std::vector<std::mutex> OutMaskMutexes;
170  int ArrayMutexSize = 0; // Needs to be a multiple of 8
171 
172  struct Internals;
173  std::unique_ptr<Internals> Internal;
174 };
175 
176 VTK_ABI_NAMESPACE_END
177 #endif /* vtkHyperTreeGridThreshold */
int FillOutputPortInformation(int, vtkInformation *) override
Define default input and output port types.
Store vtkAlgorithm input/output information.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
double UpperThreshold
UpperThreshold scalar value to be accepted.
int vtkIdType
Definition: vtkType.h:363
vtkIdType CurrentId
Keep track of current index in output hyper tree grid.
Objects for traversal a HyperTreeGrid.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBitArray * InMask
Input material mask.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
double LowerThreshold
LowerThreshold scalar value to be accepted.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:32
Superclass for algorithms that produce a hyper tree grid as output.
MemoryStrategyChoice
Enum for defining the strategy to take in allocating the memory used by the output.
static vtkAlgorithm * New()
vtkBitArray * OutMask
Output material mask constructed by this filter.
vtkDataArray * InScalars
Keep track of selected input scalars.
general representation of visualization data
Definition: vtkDataObject.h:55
Extract cells from a hyper tree grid where selected scalar value is within given range.
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...