VTK
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 class vtkStringArray;
59 
60 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRCalculatorFilter : public vtkDataObjectAlgorithm
61 {
62 
63 public:
64 
65  static vtkRCalculatorFilter *New();
66 
68  void PrintSelf(ostream& os, vtkIndent indent);
69 
74  void PutArray(const char* NameOfVTKArray, const char* NameOfRvar);
75 
80  void GetArray(const char* NameOfVTKArray, const char* NameOfRvar);
81 
83  void RemoveAllPutVariables();
84 
86  void RemoveAllGetVariables();
87 
89 
92  void PutTable(const char* NameOfRvar);
93  void GetTable(const char* NameOfRvar);
95 
99  void PutTables(vtkStringArray* NamesOfRVars);
100 
104  void GetTables(vtkStringArray* NamesOfRVars);
105 
107 
110  void PutTree(const char* NameOfRvar);
111  void GetTree(const char* NameOfRvar);
113 
117  void PutTrees(vtkStringArray* NamesOfRvars);
118 
123  void GetTrees(vtkStringArray* NamesOfRvars);
124 
125 
127 
128  vtkSetStringMacro(Rscript);
129  vtkGetStringMacro(Rscript);
131 
133 
134  vtkSetStringMacro(ScriptFname);
135  vtkGetStringMacro(ScriptFname);
137 
139 
140  vtkSetMacro(Routput,int);
141  vtkGetMacro(Routput,int);
143 
145 
151  vtkSetMacro(TimeOutput,int);
152  vtkGetMacro(TimeOutput,int);
154 
156 
158  vtkSetMacro(BlockInfoOutput,int);
159  vtkGetMacro(BlockInfoOutput,int);
161 
163 
164  virtual int ProcessRequest(vtkInformation* request,
165  vtkInformationVector** inputVector,
166  vtkInformationVector* outputVector);
168 
169 protected:
170 
171  int SetRscriptFromFile(const char* fname);
172 
173  virtual int RequestData(vtkInformation *vtkNotUsed(request),
174  vtkInformationVector **inputVector,
175  vtkInformationVector *outputVector);
176 
178 
179  virtual int RequestDataObject(vtkInformation* request,
180  vtkInformationVector** inputVector,
181  vtkInformationVector* outputVector);
183 
186 
187 private:
188 
189  vtkRCalculatorFilter(const vtkRCalculatorFilter&); // Not implemented.
190  void operator=(const vtkRCalculatorFilter&); // Not implemented.
191 
192  // Implementation details
193  vtkRCalculatorFilterInternals* rcfi;
194 
195  int ProcessInputDataSet(vtkDataSet* dsIn);
196  int ProcessOutputDataSet(vtkDataSet* dsOut);
197 
198  int ProcessInputGraph(vtkGraph* gIn);
199  int ProcessOutputGraph(vtkGraph* gOut);
200 
201  int ProcessInputArrayData(vtkArrayData * adIn);
202  int ProcessOutputArrayData(vtkArrayData * adOut);
203 
204  int ProcessInputCompositeDataSet(vtkCompositeDataSet* cdsIn);
205  int ProcessOutputCompositeDataSet(vtkCompositeDataSet * cdsOut);
206 
207  int ProcessInputTable(vtkTable* tOut);
208  int ProcessInputTable(std::string& name, vtkTable* tIn);
209 
210  vtkTable* GetOutputTable(std::string& name);
211  int ProcessOutputTable(vtkTable* tOut);
212 
213  int ProcessInputTree(vtkTree* tIn);
214  int ProcessInputTree(std::string& name, vtkTree* tIn);
215 
216  vtkTree* GetOutputTree(std::string& name);
217  int ProcessOutputTree(vtkTree* tOut);
218 
219  int ProcessInputDataObject(vtkDataObject *input);
220  int ProcessOutputDataObject(vtkDataObject *input);
221  int HasMultipleGets();
222  int HasMultiplePuts();
223 
224  vtkRInterface* ri;
225  char* Rscript;
226  char* RfileScript;
227  char* ScriptFname;
228  int Routput;
229  int TimeOutput;
230  int BlockInfoOutput;
231  char* OutputBuffer;
232  vtkDoubleArray* CurrentTime;
233  vtkDoubleArray* TimeRange;
234  vtkDoubleArray* TimeSteps;
235  vtkDoubleArray* BlockId;
236  vtkDoubleArray* NumBlocks;
237 
238 };
239 
240 #endif
241 
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
static vtkDataObjectAlgorithm * New()
a vtkAbstractArray subclass for strings
void PrintSelf(ostream &os, vtkIndent indent)
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:51
dynamic, self-adjusting array of double
Base class for graph data types.
Definition: vtkGraph.h:288
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:38
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 *)
Store zero or more vtkInformation instances.
A rooted tree data structure.
Definition: vtkTree.h:59
general representation of visualization data
Definition: vtkDataObject.h:64