VTK
dox/Filters/Statistics/vtkBivariateLinearTableThreshold.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   Visualization Toolkit
00004 Module:    vtkBivariateLinearTableThreshold.h
00005 
00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007 All rights reserved.
00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010 This software is distributed WITHOUT ANY WARRANTY; without even
00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012 PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2009 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00039 #ifndef __vtkBivariateLinearTableThreshold__h
00040 #define __vtkBivariateLinearTableThreshold__h
00041 
00042 #include "vtkFiltersStatisticsModule.h" // For export macro
00043 #include "vtkTableAlgorithm.h"
00044 #include "vtkSmartPointer.h"  //Required for smart pointer internal ivars
00045 
00046 class vtkDataArrayCollection;
00047 class vtkDoubleArray;
00048 class vtkIdTypeArray;
00049 class vtkTable;
00050 
00051 class VTKFILTERSSTATISTICS_EXPORT vtkBivariateLinearTableThreshold : public vtkTableAlgorithm
00052 {
00053 public:
00054   static vtkBivariateLinearTableThreshold* New();
00055   vtkTypeMacro(vtkBivariateLinearTableThreshold, vtkTableAlgorithm);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00061   vtkSetMacro(Inclusive,int);
00062   vtkGetMacro(Inclusive,int);
00064 
00067   void AddColumnToThreshold(vtkIdType column, vtkIdType component);
00068 
00070   int GetNumberOfColumnsToThreshold();
00071 
00074   void GetColumnToThreshold(vtkIdType idx, vtkIdType& column, vtkIdType& component);
00075 
00077   void ClearColumnsToThreshold();
00078 
00080   vtkIdTypeArray* GetSelectedRowIds(int selection=0);
00081 
00082   //BTX
00083   enum OutputPorts
00084   {
00085     OUTPUT_ROW_IDS=0,
00086     OUTPUT_ROW_DATA
00087   };
00088   enum LinearThresholdType
00089   {
00090     BLT_ABOVE=0,
00091     BLT_BELOW,
00092     BLT_NEAR,
00093     BLT_BETWEEN
00094   };
00095   //ETX
00096 
00098   void Initialize();
00099 
00101   void AddLineEquation(double* p1, double* p2);
00102 
00104   void AddLineEquation(double* p, double slope);
00105 
00107   void AddLineEquation(double a, double b, double c);
00108 
00110   void ClearLineEquations();
00111 
00113 
00117   vtkGetMacro(LinearThresholdType,int);
00118   vtkSetMacro(LinearThresholdType,int);
00119   void SetLinearThresholdTypeToAbove() { this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_ABOVE); }
00120   void SetLinearThresholdTypeToBelow() { this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BELOW); }
00121   void SetLinearThresholdTypeToNear() { this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_NEAR); }
00122   void SetLinearThresholdTypeToBetween() { this->SetLinearThresholdType(vtkBivariateLinearTableThreshold::BLT_BETWEEN); }
00124 
00126 
00129   vtkSetVector2Macro(ColumnRanges,double);
00130   vtkGetVector2Macro(ColumnRanges,double);
00132 
00134 
00136   vtkSetMacro(DistanceThreshold,double);
00137   vtkGetMacro(DistanceThreshold,double);
00139 
00141 
00147   vtkSetMacro(UseNormalizedDistance,int);
00148   vtkGetMacro(UseNormalizedDistance,int);
00149   vtkBooleanMacro(UseNormalizedDistance,int);
00151 
00153   static void ComputeImplicitLineFunction(double* p1, double* p2, double* abc);
00154 
00156   static void ComputeImplicitLineFunction(double* p, double slope, double* abc);
00157 
00158 protected:
00159   vtkBivariateLinearTableThreshold();
00160   virtual ~vtkBivariateLinearTableThreshold();
00161 
00162   double ColumnRanges[2];
00163   double DistanceThreshold;
00164   int Inclusive;
00165   int LinearThresholdType;
00166   int NumberOfLineEquations;
00167   int UseNormalizedDistance;
00168 
00169   //BTX
00170   vtkSmartPointer<vtkDoubleArray> LineEquations;
00171   class Internals;
00172   Internals* Implementation;
00173   //ETX
00174 
00175   virtual int RequestData(
00176     vtkInformation*,
00177     vtkInformationVector**,
00178     vtkInformationVector*);
00179 
00180   virtual int FillInputPortInformation( int port, vtkInformation* info );
00181   virtual int FillOutputPortInformation( int port, vtkInformation* info );
00182 
00185   virtual int ApplyThreshold(vtkTable* tableToThreshold, vtkIdTypeArray* acceptedIds);
00186 
00188   int ThresholdAbove(double x, double y);
00189 
00191   int ThresholdBelow(double x, double y);
00192 
00194   int ThresholdNear(double x, double y);
00195 
00197 
00198   int ThresholdBetween(double x, double y);
00199 private:
00200   vtkBivariateLinearTableThreshold(const vtkBivariateLinearTableThreshold&); // Not implemented
00201   void operator=(const vtkBivariateLinearTableThreshold&); // Not implemented
00202 };
00204 
00205 #endif