VTK
vtkStatisticsAlgorithm.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkStatisticsAlgorithm.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 2011 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  -------------------------------------------------------------------------*/
58 #ifndef __vtkStatisticsAlgorithm_h
59 #define __vtkStatisticsAlgorithm_h
60 
61 #include "vtkTableAlgorithm.h"
62 
65 class vtkStdString;
66 class vtkStringArray;
67 class vtkVariant;
68 class vtkVariantArray;
70 
72 {
73 public:
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
77 //BTX
79 
81  {
82  INPUT_DATA = 0,
83  LEARN_PARAMETERS = 1,
84  INPUT_MODEL = 2
85  };
87 
89 
91  {
92  OUTPUT_DATA = 0,
93  OUTPUT_MODEL = 1,
94  ASSESSMENT = 2,
95  OUTPUT_TEST = 2
96  };
97 //ETX
99 
101 
104  virtual void SetLearnOptionParameterConnection( vtkAlgorithmOutput* params )
107 
109 
112  virtual void SetLearnOptionParameters( vtkDataObject* params )
115 
117 
120  virtual void SetInputModelConnection( vtkAlgorithmOutput* model )
123 
125 
127  virtual void SetInputModel( vtkDataObject* model )
128  { this->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, model ); }
130 
132 
133  vtkSetMacro( LearnOption, bool );
134  vtkGetMacro( LearnOption, bool );
136 
138 
139  vtkSetMacro( DeriveOption, bool );
140  vtkGetMacro( DeriveOption, bool );
142 
144 
145  vtkSetMacro( AssessOption, bool );
146  vtkGetMacro( AssessOption, bool );
148 
150 
151  vtkSetMacro( TestOption, bool );
152  vtkGetMacro( TestOption, bool );
154 
156 
157  vtkSetMacro( NumberOfPrimaryTables, vtkIdType );
158  vtkGetMacro( NumberOfPrimaryTables, vtkIdType );
160 
162 
163  virtual void SetAssessNames( vtkStringArray* );
164  vtkGetObjectMacro(AssessNames,vtkStringArray);
166 
167 //BTX
169 
171  public:
172  virtual void operator() ( vtkVariantArray*,
173  vtkIdType ) = 0;
174  virtual ~AssessFunctor() { }
175  };
176 //ETX
178 
190  virtual void SetColumnStatus( const char* namCol, int status );
191 
194  virtual void ResetAllColumnStates();
195 
199  virtual int RequestSelectedColumns();
200 
202  virtual void ResetRequests();
203 
209  virtual vtkIdType GetNumberOfRequests();
210 
212  virtual vtkIdType GetNumberOfColumnsForRequest( vtkIdType request );
213 
215 
224  virtual const char* GetColumnForRequest( vtkIdType r, vtkIdType c );
225  //BTX
226  virtual int GetColumnForRequest( vtkIdType r, vtkIdType c, vtkStdString& columnName );
227  //ETX
229 
235  void AddColumn( const char* namCol );
236 
244  void AddColumnPair( const char* namColX, const char* namColY );
245 
247 
252  virtual bool SetParameter( const char* parameter,
253  int index,
254  vtkVariant value );
256 
258 
259  virtual void Aggregate( vtkDataObjectCollection*,
260  vtkMultiBlockDataSet* ) = 0;
262 
263 protected:
266 
267  virtual int FillInputPortInformation( int port, vtkInformation* info );
268  virtual int FillOutputPortInformation( int port, vtkInformation* info );
269 
270  virtual int RequestData(
274 
276 
278  virtual void Learn( vtkTable*,
279  vtkTable*,
280  vtkMultiBlockDataSet* ) = 0;
282 
284  virtual void Derive( vtkMultiBlockDataSet* ) = 0;
285 
287 
288  virtual void Assess( vtkTable*,
290  vtkTable* ) = 0;
292 
294 
296  void Assess( vtkTable*,
298  vtkTable*,
299  int );
301 
303 
304  virtual void Test( vtkTable*,
306  vtkTable* ) = 0;
308 
309  //BTX
311 
312  virtual void SelectAssessFunctor( vtkTable* outData,
313  vtkDataObject* inMeta,
314  vtkStringArray* rowNames,
315  AssessFunctor*& dfunc ) = 0;
316  //ETX
318 
326 
327 private:
328  vtkStatisticsAlgorithm(const vtkStatisticsAlgorithm&); // Not implemented
329  void operator=(const vtkStatisticsAlgorithm&); // Not implemented
330 };
331 
332 #endif