VTK  9.7.1
vtkHyperTreeGridEvaluateCoarse.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
65 #ifndef vtkHyperTreeGridEvaluateCoarse_h
66 #define vtkHyperTreeGridEvaluateCoarse_h
67 
68 #include "vtkFiltersHyperTreeModule.h" // For export macro
70 
71 #include <vector> // For scratch storage.
72 
73 VTK_ABI_NAMESPACE_BEGIN
74 class vtkBitArray;
75 
76 class vtkHyperTreeGrid;
77 
79 
80 class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridEvaluateCoarse : public vtkHyperTreeGridAlgorithm
81 {
82 public:
83  enum
84  {
85  OPERATOR_DON_T_CHANGE_FAST = 0,
86  OPERATOR_DON_T_CHANGE = 1,
87  OPERATOR_MIN = 2,
88  OPERATOR_MAX = 3,
89  OPERATOR_SUM = 4,
90  OPERATOR_AVERAGE = 5,
91  OPERATOR_UNMASKED_AVERAGE = 6,
92  OPERATOR_ELDER_CHILD = 7,
93  OPERATOR_SPLATTING_AVERAGE = 8
94  };
95 
98  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
101 
104  vtkSetMacro(Operator, unsigned int);
105  vtkGetMacro(Operator, unsigned int);
107 
111  vtkSetMacro(Default, double);
112 
113 protected:
115  ~vtkHyperTreeGridEvaluateCoarse() override;
116 
121 
125  int FillOutputPortInformation(int, vtkInformation*) override;
126 
130  virtual void ProcessNode(vtkHyperTreeGridNonOrientedCursor*);
131 
132 private:
134  void operator=(const vtkHyperTreeGridEvaluateCoarse&) = delete;
135 
139  virtual void ProcessNodeNoChange(vtkHyperTreeGridNonOrientedCursor*);
140 
145  void ProcessChild(vtkHyperTreeGridNonOrientedCursor* outCursor, int ichild,
146  std::vector<std::vector<double>>& childrenValues);
147 
152  virtual double EvalCoarse(const std::vector<double>&);
153 
155 
158  virtual double Min(const std::vector<double>&);
159  virtual double Max(const std::vector<double>&);
160  virtual double Sum(const std::vector<double>&);
161  virtual double Average(const std::vector<double>&);
162  virtual double UnmaskedAverage(const std::vector<double>&);
163  virtual double ElderChild(const std::vector<double>&);
164  virtual double SplattingAverage(const std::vector<double>&);
166 
167  unsigned int Operator = OPERATOR_DON_T_CHANGE;
168  double Default = 0.0;
169  unsigned int SplattingFactor = 1;
170  unsigned int NumberOfChildren = 0;
171  vtkBitArray* Mask = nullptr;
172 };
173 
174 VTK_ABI_NAMESPACE_END
175 #endif // vtkHyperTreeGridEvaluateCoarse_h
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.
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.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:32
Superclass for algorithms that produce a hyper tree grid as output.
static vtkAlgorithm * New()
The value of the parent cell is determined from an operation defined on the values of the child cells...
general representation of visualization data
Definition: vtkDataObject.h:55
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...