vtkAttributeDataReductionFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAttributeDataReductionFilter.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 =========================================================================*/
28 #ifndef vtkAttributeDataReductionFilter_h
29 #define vtkAttributeDataReductionFilter_h
30 
31 #include "vtkDataObjectAlgorithm.h"
32 #include "vtkPVVTKExtensionsMiscModule.h" //needed for exports
33 
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42  {
43  ADD = 1,
44  MAX = 2,
45  MIN = 3
46  };
47 
48  enum AttributeTypes // These can be 'or'-ed together.
49  {
50  POINT_DATA = 0x01,
51  CELL_DATA = 0x02,
52  FIELD_DATA = 0x04, // FIXME: Field data not supported yet.
53  ROW_DATA = 0x08
54  };
55 
56  // Set the attributes to reduce. Only the chosen type of attributes will be
57  // reduced by this filter. The not-chosen attributes are passed through
58  // from the first input unchanged. Default is (POINT_DATA|CELL_DATA)
59  // i.e. point data and cell data will be reduced.
60  // FIXME: Field data not supported yet.
61  vtkSetMacro(AttributeType, int);
62  vtkGetMacro(AttributeType, int);
63 
64  // Set the reduction type. Reduction type dictates how overlapping cell/point
65  // data is combined. Default is ADD.
66  vtkSetMacro(ReductionType, int);
67  vtkGetMacro(ReductionType, int);
69  {
70  switch (this->ReductionType)
71  {
72  case ADD:
73  return "ADD";
74  case MAX:
75  return "MAX";
76  case MIN:
77  return "MIN";
78  }
79  return "";
80  }
81  void SetReductionTypeToAdd() { this->SetReductionType(vtkAttributeDataReductionFilter::ADD); }
82  void SetReductionTypeToMax() { this->SetReductionType(vtkAttributeDataReductionFilter::MAX); }
83  void SetReductionTypeToMin() { this->SetReductionType(vtkAttributeDataReductionFilter::MIN); }
84 protected:
87 
88  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
89  vtkInformationVector* outputVector) override;
90 
96 
100 
101 private:
103  void operator=(const vtkAttributeDataReductionFilter&) = delete;
104 };
105 
106 #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 &)