VTK  9.3.1
vtkBivariateLinearTableThreshold.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
24 #ifndef vtkBivariateLinearTableThreshold_h
25 #define vtkBivariateLinearTableThreshold_h
26 
27 #include "vtkFiltersStatisticsModule.h" // For export macro
28 #include "vtkSmartPointer.h" //Required for smart pointer internal ivars
29 #include "vtkTableAlgorithm.h"
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDoubleArray;
34 class vtkIdTypeArray;
35 class vtkTable;
36 
37 class VTKFILTERSSTATISTICS_EXPORT vtkBivariateLinearTableThreshold : public vtkTableAlgorithm
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
49  vtkSetMacro(Inclusive, int);
50  vtkGetMacro(Inclusive, int);
52 
56  void AddColumnToThreshold(vtkIdType column, vtkIdType component);
57 
61  int GetNumberOfColumnsToThreshold();
62 
66  void GetColumnToThreshold(vtkIdType idx, vtkIdType& column, vtkIdType& component);
67 
71  void ClearColumnsToThreshold();
72 
76  vtkIdTypeArray* GetSelectedRowIds(int selection = 0);
77 
79  {
80  OUTPUT_ROW_IDS = 0,
81  OUTPUT_ROW_DATA
82  };
84  {
85  BLT_ABOVE = 0,
88  BLT_BETWEEN
89  };
90 
94  void Initialize();
95 
99  void AddLineEquation(double* p1, double* p2);
100 
104  void AddLineEquation(double* p, double slope);
105 
109  void AddLineEquation(double a, double b, double c);
110 
114  void ClearLineEquations();
115 
117 
123  vtkGetMacro(LinearThresholdType, int);
124  vtkSetMacro(LinearThresholdType, int);
126  {
127  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_ABOVE);
128  }
130  {
131  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BELOW);
132  }
134  {
135  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_NEAR);
136  }
138  {
139  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BETWEEN);
140  }
142 
144 
149  vtkSetVector2Macro(ColumnRanges, double);
150  vtkGetVector2Macro(ColumnRanges, double);
152 
154 
157  vtkSetMacro(DistanceThreshold, double);
158  vtkGetMacro(DistanceThreshold, double);
160 
162 
169  vtkSetMacro(UseNormalizedDistance, vtkTypeBool);
170  vtkGetMacro(UseNormalizedDistance, vtkTypeBool);
171  vtkBooleanMacro(UseNormalizedDistance, vtkTypeBool);
173 
177  static void ComputeImplicitLineFunction(double* p1, double* p2, double* abc);
178 
182  static void ComputeImplicitLineFunction(double* p, double slope, double* abc);
183 
184 protected:
187 
188  double ColumnRanges[2];
194 
196  class Internals;
197  Internals* Implementation;
198 
200 
201  int FillInputPortInformation(int port, vtkInformation* info) override;
203 
207  virtual int ApplyThreshold(vtkTable* tableToThreshold, vtkIdTypeArray* acceptedIds);
208 
210 
213  int ThresholdAbove(double x, double y);
214 
218  int ThresholdBelow(double x, double y);
219 
223  int ThresholdNear(double x, double y);
224 
228  int ThresholdBetween(double x, double y);
230 
231 private:
233  void operator=(const vtkBivariateLinearTableThreshold&) = delete;
234 };
235 
236 VTK_ABI_NAMESPACE_END
237 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
void SetLinearThresholdTypeToNear()
Set the threshold type.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
void SetLinearThresholdTypeToAbove()
Set the threshold type.
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:64
void SetLinearThresholdTypeToBelow()
Set the threshold type.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetLinearThresholdTypeToBetween()
Set the threshold type.
vtkSmartPointer< vtkDoubleArray > LineEquations
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
maintain an ordered list of dataarray objects
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Superclass for algorithms that produce only vtkTables as output.
Store zero or more vtkInformation instances.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
performs line-based thresholding for vtkTable data.