VTK
vtkBinCellDataFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBinCellDataFilter.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 =========================================================================*/
30 #ifndef vtkBinCellDataFilter_h
31 #define vtkBinCellDataFilter_h
32 
33 #include "vtkFiltersCoreModule.h" // For export macro
34 #include "vtkDataSetAlgorithm.h"
35 #include "vtkDataSetAttributes.h" // needed for vtkDataSetAttributes::FieldList
36 
37 #include "vtkContourValues.h" // Needed for inline methods
38 
39 class vtkCellLocator;
40 
41 class VTKFILTERSCORE_EXPORT vtkBinCellDataFilter : public vtkDataSetAlgorithm
42 {
43 public:
45 
47  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48 
53  static vtkBinCellDataFilter *New();
54 
56 
59  void SetValue(int i, double value);
60  double GetValue(int i);
61  double *GetValues();
62  void GetValues(double *binValues);
63  void SetNumberOfBins(int numBins);
64  int GetNumberOfBins();
65  void GenerateValues(int numBins, double range[2]);
66  void GenerateValues(int numBins, double rangeStart, double rangeEnd);
68 
70 
76  void SetSourceData(vtkDataObject *source);
77  vtkDataObject *GetSource();
79 
86  void SetSourceConnection(vtkAlgorithmOutput* algOutput);
87 
89 
99  vtkSetMacro(SpatialMatch, int);
100  vtkGetMacro(SpatialMatch, int);
101  vtkBooleanMacro(SpatialMatch, int);
103 
105 
109  vtkSetMacro(StoreNumberOfNonzeroBins, bool);
110  vtkBooleanMacro(StoreNumberOfNonzeroBins, bool);
111  vtkGetMacro(StoreNumberOfNonzeroBins, bool);
113 
115 
120  vtkSetStringMacro(NumberOfNonzeroBinsArrayName)
121  vtkGetStringMacro(NumberOfNonzeroBinsArrayName)
123 
125 
130  vtkSetMacro(Tolerance, double);
131  vtkGetMacro(Tolerance, double);
133 
135 
140  vtkSetMacro(ComputeTolerance, bool);
141  vtkBooleanMacro(ComputeTolerance, bool);
142  vtkGetMacro(ComputeTolerance, bool);
144 
146 
149  vtkSetMacro(ArrayComponent,int);
150  vtkGetMacro(ArrayComponent,int);
152 
154  {
155  CELL_CENTROID=0,
156  CELL_POINTS=1,
157  };
158 
160 
165  vtkSetClampMacro(CellOverlapMethod,int,CELL_CENTROID,CELL_POINTS);
166  vtkGetMacro(CellOverlapMethod, int);
168 
170 
174  virtual void SetCellLocator(vtkCellLocator *cellLocator);
175  vtkGetObjectMacro(CellLocator,vtkCellLocator);
177 
178 protected:
180  ~vtkBinCellDataFilter() VTK_OVERRIDE;
181 
182  int SpatialMatch;
183 
184  bool StoreNumberOfNonzeroBins;
185  double Tolerance;
186  bool ComputeTolerance;
187  int ArrayComponent;
188  int CellOverlapMethod;
189 
190  vtkBinValues *BinValues;
191  vtkCellLocator *CellLocator;
192 
193  int RequestData(vtkInformation *, vtkInformationVector **,
194  vtkInformationVector *) VTK_OVERRIDE;
195  int RequestInformation(vtkInformation *, vtkInformationVector **,
196  vtkInformationVector *) VTK_OVERRIDE;
197  int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
198  vtkInformationVector *) VTK_OVERRIDE;
199 
200  virtual void CreateDefaultLocator();
201 
202  char* NumberOfNonzeroBinsArrayName;
203 
204 private:
205  vtkBinCellDataFilter(const vtkBinCellDataFilter&) VTK_DELETE_FUNCTION;
206  void operator=(const vtkBinCellDataFilter&) VTK_DELETE_FUNCTION;
207 };
208 
213 inline void vtkBinCellDataFilter::SetValue(int i, double value)
214 {this->BinValues->SetValue(i,value);}
215 
219 inline double vtkBinCellDataFilter::GetValue(int i)
220 {return this->BinValues->GetValue(i);}
221 
227 {return this->BinValues->GetValues();}
228 
234 inline void vtkBinCellDataFilter::GetValues(double *binValues)
235 {this->BinValues->GetValues(binValues);}
236 
243 {this->BinValues->SetNumberOfContours(number);}
244 
250 {return this->BinValues->GetNumberOfContours();}
251 
256 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double range[2])
257 {this->BinValues->GenerateValues(numBins, range);}
258 
263 inline void vtkBinCellDataFilter::GenerateValues(int numBins, double
264  rangeStart, double rangeEnd)
265 {this->BinValues->GenerateValues(numBins, rangeStart, rangeEnd);}
266 
267 #endif
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
Proxy object to connect input/output ports.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bin source cell data into input cells.
octree-based spatial search object to quickly locate cells
double * GetValues()
Get a pointer to an array of bin values.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkContourValues vtkBinValues
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double GetValue(int i)
Get the ith bin value.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void GenerateValues(int numBins, double range[2])
Generate numBins equally spaced bin values between specified range.
int GetNumberOfBins()
Get the number of bins in the list of bin values, not counting the overflow bin.
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:58
static vtkDataSetAlgorithm * New()
void SetNumberOfBins(int numBins)
Set the number of bins to place into the list.
void SetValue(int i, double value)
Set the ith contour value.