VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkRCalculatorFilter.h
Go to the documentation of this file.
1 
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkRCalculatorFilter.h
6 
7  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
16 /*-------------------------------------------------------------------------
17  Copyright 2009 Sandia Corporation.
18  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
19  the U.S. Government retains certain rights in this software.
20 -------------------------------------------------------------------------*/
21 
43 #ifndef __vtkRCalculatorFilter_h
44 #define __vtkRCalculatorFilter_h
45 
46 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro
47 #include "vtkDataObjectAlgorithm.h"
48 
49 class vtkRInterface;
50 class vtkRCalculatorFilterInternals;
51 class vtkDataSet;
52 class vtkDoubleArray;
53 class vtkGraph;
54 class vtkTree;
55 class vtkTable;
57 class vtkArrayData;
58 
59 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRCalculatorFilter : public vtkDataObjectAlgorithm
60 {
61 
62 public:
63 
64  static vtkRCalculatorFilter *New();
65 
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
73  void PutArray(const char* NameOfVTKArray, const char* NameOfRvar);
74 
79  void GetArray(const char* NameOfVTKArray, const char* NameOfRvar);
80 
82  void RemoveAllPutVariables();
83 
85  void RemoveAllGetVariables();
86 
88 
91  void PutTable(const char* NameOfRvar);
92  void GetTable(const char* NameOfRvar);
94 
96 
99  void PutTree(const char* NameOfRvar);
100  void GetTree(const char* NameOfRvar);
102 
104 
105  vtkSetStringMacro(Rscript);
106  vtkGetStringMacro(Rscript);
108 
110 
111  vtkSetStringMacro(ScriptFname);
112  vtkGetStringMacro(ScriptFname);
114 
116 
117  vtkSetMacro(Routput,int);
118  vtkGetMacro(Routput,int);
120 
122 
128  vtkSetMacro(TimeOutput,int);
129  vtkGetMacro(TimeOutput,int);
131 
133 
135  vtkSetMacro(BlockInfoOutput,int);
136  vtkGetMacro(BlockInfoOutput,int);
138 
140 
141  virtual int ProcessRequest(vtkInformation* request,
142  vtkInformationVector** inputVector,
143  vtkInformationVector* outputVector);
145 
146 protected:
147 
148  int SetRscriptFromFile(const char* fname);
149 
150  virtual int RequestData(vtkInformation *vtkNotUsed(request),
151  vtkInformationVector **inputVector,
152  vtkInformationVector *outputVector);
153 
155 
156  virtual int RequestDataObject(vtkInformation* request,
157  vtkInformationVector** inputVector,
158  vtkInformationVector* outputVector);
160 
163 
164 private:
165 
166  vtkRCalculatorFilter(const vtkRCalculatorFilter&); // Not implemented.
167  void operator=(const vtkRCalculatorFilter&); // Not implemented.
168 
169  // Implementation details
170  vtkRCalculatorFilterInternals* rcfi;
171 
172  int ProcessInputDataSet(vtkDataSet* dsIn);
173  int ProcessOutputDataSet(vtkDataSet* dsOut);
174 
175  int ProcessInputGraph(vtkGraph* gIn);
176  int ProcessOutputGraph(vtkGraph* gOut);
177 
178  int ProcessInputArrayData(vtkArrayData * adIn);
179  int ProcessOutputArrayData(vtkArrayData * adOut);
180 
181  int ProcessInputCompositeDataSet(vtkCompositeDataSet* cdsIn);
182  int ProcessOutputCompositeDataSet(vtkCompositeDataSet * cdsOut);
183 
184  int ProcessInputTable(vtkTable* tOut);
185  int ProcessOutputTable(vtkTable* tOut);
186 
187  int ProcessInputTree(vtkTree* tIn);
188  int ProcessOutputTree(vtkTree* tOut);
189 
190  int ProcessInputDataObject(vtkDataObject *input);
191  int ProcessOutputDataObject(vtkDataObject *input);
192 
193  vtkRInterface* ri;
194  char* Rscript;
195  char* RfileScript;
196  char* ScriptFname;
197  int Routput;
198  int TimeOutput;
199  int BlockInfoOutput;
200  char* OutputBuffer;
201  vtkDoubleArray* CurrentTime;
202  vtkDoubleArray* TimeRange;
203  vtkDoubleArray* TimeSteps;
204  vtkDoubleArray* BlockId;
205  vtkDoubleArray* NumBlocks;
206 
207 };
208 
209 #endif
210 
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkDataObjectAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:51
Base class for graph data types.
Definition: vtkGraph.h:288
abstract superclass for composite (multi-block or AMR) datasets
Superclass for algorithms that produce only data object as output.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
general representation of visualization data
Definition: vtkDataObject.h:64