vtkMinMax.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkMinMax_h
22 #define vtkMinMax_h
23 
24 #include "vtkPVVTKExtensionsMiscModule.h" // needed for export macro
25 #include "vtkPolyDataAlgorithm.h"
26 
27 class vtkFieldData;
28 class vtkAbstractArray;
30 
32 {
33 public:
34  static vtkMinMax* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
44  {
45  MIN = 0,
46  MAX = 1,
47  SUM = 2
48  };
49 
50  vtkSetClampMacro(Operation, int, MIN, SUM);
51  vtkGetMacro(Operation, int);
52  void SetOperation(const char* op);
53 
55 
59  vtkGetMacro(MismatchOccurred, int);
61 
63 
67  vtkGetStringMacro(FirstPasses);
68  void FlagsForPoints();
69  void FlagsForCells();
71 
72  // temp for debugging
73  const char* Name;
75 
76 protected:
77  vtkMinMax();
78  ~vtkMinMax() override;
79 
80  // overridden to allow multiple inputs to port 0
81  int FillInputPortInformation(int port, vtkInformation* info) override;
82 
83  // run the algorithm
84  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
85  vtkInformationVector* outputVector) override;
86 
87  // helper methods to break up the work
88  void OperateOnField(vtkFieldData* id, vtkFieldData* od);
89  void OperateOnArray(vtkAbstractArray* ia, vtkAbstractArray* oa);
90 
91  // choice of operation to perform
92  int Operation;
93 
94  // for keeping track of data initialization on the first value
96  char* CFirstPass;
97  char* PFirstPass;
98  char* FirstPasses;
99 
100  // for deciding what cells and points to ignore
102 
103  // a flag that indicates if values computed could be inaccurate
105 
106 private:
107  vtkMinMax(const vtkMinMax&) = delete;
108  void operator=(const vtkMinMax&) = delete;
109 };
110 
111 #endif
Finds the min, max, or sum of all of its input data attributes.
Definition: vtkMinMax.h:31
virtual int FillInputPortInformation(int port, vtkInformation *info)
int Operation
Definition: vtkMinMax.h:92
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
int vtkIdType
char * CFirstPass
Definition: vtkMinMax.h:96
int ComponentIdx
Definition: vtkMinMax.h:95
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkUnsignedCharArray * GhostArray
Definition: vtkMinMax.h:101
static vtkPolyDataAlgorithm * New()
Operations
Selects the operation to perform on the data.
Definition: vtkMinMax.h:43
#define VTKPVVTKEXTENSIONSMISC_EXPORT
char * FirstPasses
Definition: vtkMinMax.h:98
int MismatchOccurred
Definition: vtkMinMax.h:104
const char * Name
Definition: vtkMinMax.h:73
void operator=(const vtkObjectBase &)
vtkIdType Idx
Definition: vtkMinMax.h:74
char * PFirstPass
Definition: vtkMinMax.h:97