vtkAttributeDataReductionFilter.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
17 #ifndef vtkAttributeDataReductionFilter_h
18 #define vtkAttributeDataReductionFilter_h
19 
20 #include "vtkDataObjectAlgorithm.h"
21 #include "vtkPVVTKExtensionsMiscModule.h" //needed for exports
22 
24 {
25 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
31  {
32  ADD = 1,
33  MAX = 2,
34  MIN = 3
35  };
36 
37  enum AttributeTypes // These can be 'or'-ed together.
38  {
39  POINT_DATA = 0x01,
40  CELL_DATA = 0x02,
41  FIELD_DATA = 0x04, // FIXME: Field data not supported yet.
42  ROW_DATA = 0x08
43  };
44 
45  // Set the attributes to reduce. Only the chosen type of attributes will be
46  // reduced by this filter. The not-chosen attributes are passed through
47  // from the first input unchanged. Default is (POINT_DATA|CELL_DATA)
48  // i.e. point data and cell data will be reduced.
49  // FIXME: Field data not supported yet.
50  vtkSetMacro(AttributeType, int);
51  vtkGetMacro(AttributeType, int);
52 
53  // Set the reduction type. Reduction type dictates how overlapping cell/point
54  // data is combined. Default is ADD.
55  vtkSetMacro(ReductionType, int);
56  vtkGetMacro(ReductionType, int);
58  {
59  switch (this->ReductionType)
60  {
61  case ADD:
62  return "ADD";
63  case MAX:
64  return "MAX";
65  case MIN:
66  return "MIN";
67  }
68  return "";
69  }
70  void SetReductionTypeToAdd() { this->SetReductionType(vtkAttributeDataReductionFilter::ADD); }
71  void SetReductionTypeToMax() { this->SetReductionType(vtkAttributeDataReductionFilter::MAX); }
72  void SetReductionTypeToMin() { this->SetReductionType(vtkAttributeDataReductionFilter::MIN); }
73 
74 protected:
77 
78  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
79  vtkInformationVector* outputVector) override;
80 
86 
90 
91 private:
93  void operator=(const vtkAttributeDataReductionFilter&) = delete;
94 };
95 
96 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkDataObjectAlgorithm * New()
info
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Reduces cell/point attribute data with different modes to combine cell/point data.
#define VTKPVVTKEXTENSIONSMISC_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
port
void operator=(const vtkObjectBase &)