VTK  9.0.20201027
vtkBivariateLinearTableThreshold.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkBivariateLinearTableThreshold.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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2009 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
40 #ifndef vtkBivariateLinearTableThreshold_h
41 #define vtkBivariateLinearTableThreshold_h
42 
43 #include "vtkFiltersStatisticsModule.h" // For export macro
44 #include "vtkSmartPointer.h" //Required for smart pointer internal ivars
45 #include "vtkTableAlgorithm.h"
46 
48 class vtkDoubleArray;
49 class vtkIdTypeArray;
50 class vtkTable;
51 
52 class VTKFILTERSSTATISTICS_EXPORT vtkBivariateLinearTableThreshold : public vtkTableAlgorithm
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
64  vtkSetMacro(Inclusive, int);
65  vtkGetMacro(Inclusive, int);
67 
71  void AddColumnToThreshold(vtkIdType column, vtkIdType component);
72 
76  int GetNumberOfColumnsToThreshold();
77 
81  void GetColumnToThreshold(vtkIdType idx, vtkIdType& column, vtkIdType& component);
82 
86  void ClearColumnsToThreshold();
87 
91  vtkIdTypeArray* GetSelectedRowIds(int selection = 0);
92 
94  {
95  OUTPUT_ROW_IDS = 0,
96  OUTPUT_ROW_DATA
97  };
99  {
100  BLT_ABOVE = 0,
103  BLT_BETWEEN
104  };
105 
109  void Initialize();
110 
114  void AddLineEquation(double* p1, double* p2);
115 
119  void AddLineEquation(double* p, double slope);
120 
124  void AddLineEquation(double a, double b, double c);
125 
129  void ClearLineEquations();
130 
132 
138  vtkGetMacro(LinearThresholdType, int);
139  vtkSetMacro(LinearThresholdType, int);
141  {
142  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_ABOVE);
143  }
145  {
146  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BELOW);
147  }
149  {
150  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_NEAR);
151  }
153  {
154  this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BETWEEN);
155  }
157 
159 
164  vtkSetVector2Macro(ColumnRanges, double);
165  vtkGetVector2Macro(ColumnRanges, double);
167 
169 
172  vtkSetMacro(DistanceThreshold, double);
173  vtkGetMacro(DistanceThreshold, double);
175 
177 
184  vtkSetMacro(UseNormalizedDistance, vtkTypeBool);
185  vtkGetMacro(UseNormalizedDistance, vtkTypeBool);
186  vtkBooleanMacro(UseNormalizedDistance, vtkTypeBool);
188 
192  static void ComputeImplicitLineFunction(double* p1, double* p2, double* abc);
193 
197  static void ComputeImplicitLineFunction(double* p, double slope, double* abc);
198 
199 protected:
202 
203  double ColumnRanges[2];
209 
211  class Internals;
212  Internals* Implementation;
213 
215 
216  int FillInputPortInformation(int port, vtkInformation* info) override;
218 
222  virtual int ApplyThreshold(vtkTable* tableToThreshold, vtkIdTypeArray* acceptedIds);
223 
225 
228  int ThresholdAbove(double x, double y);
229 
233  int ThresholdBelow(double x, double y);
234 
238  int ThresholdNear(double x, double y);
239 
243  int ThresholdBetween(double x, double y);
245 
246 private:
248  void operator=(const vtkBivariateLinearTableThreshold&) = delete;
249 };
250 
251 #endif
vtkTableAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBivariateLinearTableThreshold::SetLinearThresholdTypeToBelow
void SetLinearThresholdTypeToBelow()
Definition: vtkBivariateLinearTableThreshold.h:144
vtkX3D::component
Definition: vtkX3D.h:181
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkDataArrayCollection
maintain an ordered list of dataarray objects
Definition: vtkDataArrayCollection.h:31
vtkBivariateLinearTableThreshold::LineEquations
vtkSmartPointer< vtkDoubleArray > LineEquations
Definition: vtkBivariateLinearTableThreshold.h:210
vtkSmartPointer< vtkDoubleArray >
vtkBivariateLinearTableThreshold::LinearThresholdType
int LinearThresholdType
Definition: vtkBivariateLinearTableThreshold.h:206
vtkBivariateLinearTableThreshold::UseNormalizedDistance
vtkTypeBool UseNormalizedDistance
Definition: vtkBivariateLinearTableThreshold.h:208
vtkBivariateLinearTableThreshold::SetLinearThresholdTypeToNear
void SetLinearThresholdTypeToNear()
Definition: vtkBivariateLinearTableThreshold.h:148
vtkBivariateLinearTableThreshold::BLT_BETWEEN
Definition: vtkBivariateLinearTableThreshold.h:103
vtkBivariateLinearTableThreshold::NumberOfLineEquations
int NumberOfLineEquations
Definition: vtkBivariateLinearTableThreshold.h:207
vtkBivariateLinearTableThreshold::SetLinearThresholdTypeToBetween
void SetLinearThresholdTypeToBetween()
Definition: vtkBivariateLinearTableThreshold.h:152
vtkX3D::port
Definition: vtkX3D.h:453
vtkBivariateLinearTableThreshold::BLT_NEAR
Definition: vtkBivariateLinearTableThreshold.h:102
vtkBivariateLinearTableThreshold::Implementation
Internals * Implementation
Definition: vtkBivariateLinearTableThreshold.h:211
vtkTableAlgorithm
Superclass for algorithms that produce only vtkTables as output.
Definition: vtkTableAlgorithm.h:48
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkBivariateLinearTableThreshold::SetLinearThresholdTypeToAbove
void SetLinearThresholdTypeToAbove()
Definition: vtkBivariateLinearTableThreshold.h:140
vtkBivariateLinearTableThreshold
performs line-based thresholding for vtkTable data.
Definition: vtkBivariateLinearTableThreshold.h:52
vtkSmartPointer.h
vtkTableAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkBivariateLinearTableThreshold::BLT_ABOVE
Definition: vtkBivariateLinearTableThreshold.h:100
vtkBivariateLinearTableThreshold::BLT_BELOW
Definition: vtkBivariateLinearTableThreshold.h:101
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
Definition: vtkX3D.h:382
vtkBivariateLinearTableThreshold::Inclusive
int Inclusive
Definition: vtkBivariateLinearTableThreshold.h:205
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkTableAlgorithm.h
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkBivariateLinearTableThreshold::DistanceThreshold
double DistanceThreshold
Definition: vtkBivariateLinearTableThreshold.h:204
vtkBivariateLinearTableThreshold::LinearThresholdType
LinearThresholdType
Definition: vtkBivariateLinearTableThreshold.h:98
vtkTableAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkBivariateLinearTableThreshold::OutputPorts
OutputPorts
Definition: vtkBivariateLinearTableThreshold.h:93
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkTableAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkTableAlgorithm::New
static vtkTableAlgorithm * New()