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
44#ifndef vtkRCalculatorFilter_h
45#define vtkRCalculatorFilter_h
46
47#include "vtkFiltersStatisticsGnuRModule.h" // For export macro
49
50class vtkRInterface;
51class vtkRCalculatorFilterInternals;
52class vtkDataSet;
53class vtkDoubleArray;
54class vtkGraph;
55class vtkTree;
56class vtkTable;
58class vtkArrayData;
59class vtkStringArray;
60
61class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRCalculatorFilter : public vtkDataObjectAlgorithm
62{
63
64public:
65
67
69 void PrintSelf(ostream& os, vtkIndent indent);
70
78 void PutArray(const char* NameOfVTKArray, const char* NameOfRvar);
79
87 void GetArray(const char* NameOfVTKArray, const char* NameOfRvar);
88
93
98
100
105 void PutTable(const char* NameOfRvar);
106 void GetTable(const char* NameOfRvar);
108
113 void PutTables(vtkStringArray* NamesOfRVars);
114
120 void GetTables(vtkStringArray* NamesOfRVars);
121
123
128 void PutTree(const char* NameOfRvar);
129 void GetTree(const char* NameOfRvar);
131
136 void PutTrees(vtkStringArray* NamesOfRvars);
137
143 void GetTrees(vtkStringArray* NamesOfRvars);
144
145
147
150 vtkSetStringMacro(Rscript);
153
155
158 vtkSetStringMacro(ScriptFname);
159 vtkGetStringMacro(ScriptFname);
161
163
166 vtkSetMacro(Routput,int);
167 vtkGetMacro(Routput,int);
169
171
180 vtkSetMacro(TimeOutput,int);
181 vtkGetMacro(TimeOutput,int);
183
185
188 vtkSetMacro(BlockInfoOutput,int);
189 vtkGetMacro(BlockInfoOutput,int);
191
195 virtual int ProcessRequest(vtkInformation* request,
196 vtkInformationVector** inputVector,
197 vtkInformationVector* outputVector);
198
199protected:
200
201 int SetRscriptFromFile(const char* fname);
202
203 virtual int RequestData(vtkInformation *vtkNotUsed(request),
204 vtkInformationVector **inputVector,
205 vtkInformationVector *outputVector);
206
210 virtual int RequestDataObject(vtkInformation* request,
211 vtkInformationVector** inputVector,
212 vtkInformationVector* outputVector);
213
216
217private:
218
219 vtkRCalculatorFilter(const vtkRCalculatorFilter&) VTK_DELETE_FUNCTION;
220 void operator=(const vtkRCalculatorFilter&) VTK_DELETE_FUNCTION;
221
222 // Implementation details
223 vtkRCalculatorFilterInternals* rcfi;
224
225 int ProcessInputDataSet(vtkDataSet* dsIn);
226 int ProcessOutputDataSet(vtkDataSet* dsOut);
227
228 int ProcessInputGraph(vtkGraph* gIn);
229 int ProcessOutputGraph(vtkGraph* gOut);
230
231 int ProcessInputArrayData(vtkArrayData * adIn);
232 int ProcessOutputArrayData(vtkArrayData * adOut);
233
234 int ProcessInputCompositeDataSet(vtkCompositeDataSet* cdsIn);
235 int ProcessOutputCompositeDataSet(vtkCompositeDataSet * cdsOut);
236
237 int ProcessInputTable(vtkTable* tOut);
238 int ProcessInputTable(std::string& name, vtkTable* tIn);
239
240 vtkTable* GetOutputTable(std::string& name);
241 int ProcessOutputTable(vtkTable* tOut);
242
243 int ProcessInputTree(vtkTree* tIn);
244 int ProcessInputTree(std::string& name, vtkTree* tIn);
245
246 vtkTree* GetOutputTree(std::string& name);
247 int ProcessOutputTree(vtkTree* tOut);
248
249 int ProcessInputDataObject(vtkDataObject *input);
250 int ProcessOutputDataObject(vtkDataObject *input);
251 int HasMultipleGets();
252 int HasMultiplePuts();
253
254 vtkRInterface* ri;
255 char* Rscript;
256 char* RfileScript;
257 char* ScriptFname;
258 int Routput;
259 int TimeOutput;
260 int BlockInfoOutput;
261 char* OutputBuffer;
262 vtkDoubleArray* CurrentTime;
263 vtkDoubleArray* TimeRange;
264 vtkDoubleArray* TimeSteps;
265 vtkDoubleArray* BlockId;
266 vtkDoubleArray* NumBlocks;
267
268};
269
270#endif
271
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:53
abstract superclass for composite (multi-block or AMR) datasets
Superclass for algorithms that produce only data object as output.
general representation of visualization data
Definition: vtkDataObject.h:65
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
dynamic, self-adjusting array of double
Base class for graph data types.
Definition: vtkGraph.h:288
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
This class functions as an array calculator for vtkDataArrays and VTKarray objects,...
void GetTree(const char *NameOfRvar)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void PutTree(const char *NameOfRvar)
For vtkTree input to the filter.
void PutTable(const char *NameOfRvar)
For vtkTable input to the filter.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is required to capture REQUEST_DATA_OBJECT requests.
void GetArray(const char *NameOfVTKArray, const char *NameOfRvar)
Copies R variable NameOfRvar from R to the vtkDataArray named NameOfVTKArray.
static vtkRCalculatorFilter * New()
void GetTables(vtkStringArray *NamesOfRVars)
For vtkTable output of the filter.
void PutTables(vtkStringArray *NamesOfRVars)
For vtkTable input to the filter.
void GetTrees(vtkStringArray *NamesOfRvars)
For vtkTree output of the filter.
void GetTable(const char *NameOfRvar)
virtual int RequestData(vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void RemoveAllGetVariables()
Clears the list of variables to be copied from R.
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Creates the same output type as the input type.
void PutArray(const char *NameOfVTKArray, const char *NameOfRvar)
Copies vtkDataArray named NameOfVTKArray to R with variable name NameOfRvar.
int SetRscriptFromFile(const char *fname)
void PutTrees(vtkStringArray *NamesOfRvars)
For vtkTree input to the filter.
void RemoveAllPutVariables()
Clears the list of variables to be copied to R.
This class defines a VTK interface to an embedded GNU R intepreter instance.
Definition: vtkRInterface.h:60
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
A rooted tree data structure.
Definition: vtkTree.h:61
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.