ParaView
vtkMinMax.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMinMax.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkMinMax_h
33 #define vtkMinMax_h
34 
35 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
36 #include "vtkPolyDataAlgorithm.h"
37 
38 class vtkFieldData;
39 class vtkAbstractArray;
40 class vtkUnsignedCharArray;
41 
42 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkMinMax : public vtkPolyDataAlgorithm
43 {
44 public:
45  static vtkMinMax* New();
46  vtkTypeMacro(vtkMinMax, vtkPolyDataAlgorithm);
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
55  {
56  MIN = 0,
57  MAX = 1,
58  SUM = 2
59  };
60 
61  vtkSetClampMacro(Operation, int, MIN, SUM);
62  vtkGetMacro(Operation, int);
63  void SetOperation(const char* op);
64 
66 
70  vtkGetMacro(MismatchOccurred, int);
72 
74 
78  vtkGetStringMacro(FirstPasses);
79  void FlagsForPoints();
80  void FlagsForCells();
82 
83  // temp for debugging
84  const char* Name;
85  vtkIdType Idx;
86 
87 protected:
88  vtkMinMax();
89  ~vtkMinMax();
90 
91  // overridden to allow multiple inputs to port 0
92  virtual int FillInputPortInformation(int port, vtkInformation* info);
93 
94  // run the algorithm
95  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
96  vtkInformationVector* outputVector);
97 
98  // helper methods to break up the work
99  void OperateOnField(vtkFieldData* id, vtkFieldData* od);
100  void OperateOnArray(vtkAbstractArray* ia, vtkAbstractArray* oa);
101 
102  // choice of operation to perform
104 
105  // for keeping track of data initialization on the first value
107  char* CFirstPass;
108  char* PFirstPass;
109  char* FirstPasses;
110 
111  // for deciding what cells and points to ignore
112  vtkUnsignedCharArray* GhostArray;
113 
114  // a flag that indicates if values computed could be inaccurate
116 
117 private:
118  vtkMinMax(const vtkMinMax&) VTK_DELETE_FUNCTION;
119  void operator=(const vtkMinMax&) VTK_DELETE_FUNCTION;
120 };
121 
122 #endif
Finds the min, max, or sum of all of its input data attributes.
Definition: vtkMinMax.h:42
int Operation
Definition: vtkMinMax.h:103
char * CFirstPass
Definition: vtkMinMax.h:107
int ComponentIdx
Definition: vtkMinMax.h:106
vtkUnsignedCharArray * GhostArray
Definition: vtkMinMax.h:112
Operations
Selects the operation to perform on the data.
Definition: vtkMinMax.h:54
char * FirstPasses
Definition: vtkMinMax.h:109
int MismatchOccurred
Definition: vtkMinMax.h:115
const char * Name
Definition: vtkMinMax.h:84
vtkIdType Idx
Definition: vtkMinMax.h:85
char * PFirstPass
Definition: vtkMinMax.h:108