ParaView
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 "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
33 
34 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkAttributeDataReductionFilter
35  : public vtkDataObjectAlgorithm
36 {
37 public:
38  static vtkAttributeDataReductionFilter* New();
39  vtkTypeMacro(vtkAttributeDataReductionFilter, vtkDataObjectAlgorithm);
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43  {
44  ADD = 1,
45  MAX = 2,
46  MIN = 3
47  };
48 
49  enum AttributeTypes // These can be 'or'-ed together.
50  {
51  POINT_DATA = 0x01,
52  CELL_DATA = 0x02,
53  FIELD_DATA = 0x04, // FIXME: Field data not supported yet.
54  ROW_DATA = 0x08
55  };
56 
57  // Set the attributes to reduce. Only the choosen type of attributes will be
58  // reduced by this filter. The not-choosen attributes are passed through
59  // from the first input unchanged. Default is (POINT_DATA|CELL_DATA)
60  // i.e. point data and cell data will be reduced.
61  // FIXME: Field data not supported yet.
62  vtkSetMacro(AttributeType, int);
63  vtkGetMacro(AttributeType, int);
64 
65  // Set the reduction type. Reduction type dictates how overlapping cell/point
66  // data is combined. Default is ADD.
67  vtkSetMacro(ReductionType, int);
68  vtkGetMacro(ReductionType, int);
70  {
71  switch (this->ReductionType)
72  {
73  case ADD:
74  return "ADD";
75  case MAX:
76  return "MAX";
77  case MIN:
78  return "MIN";
79  }
80  return "";
81  }
82  void SetReductionTypeToAdd() { this->SetReductionType(vtkAttributeDataReductionFilter::ADD); }
83  void SetReductionTypeToMax() { this->SetReductionType(vtkAttributeDataReductionFilter::MAX); }
84  void SetReductionTypeToMin() { this->SetReductionType(vtkAttributeDataReductionFilter::MIN); }
85 protected:
88 
89  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
90  vtkInformationVector* outputVector);
91 
96  virtual int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
97 
98  virtual int FillInputPortInformation(int port, vtkInformation* info);
101 
102 private:
104  void operator=(const vtkAttributeDataReductionFilter&) VTK_DELETE_FUNCTION;
105 };
106 
107 #endif
Reduces cell/point attribute data with different modes to combine cell/point data.