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 "vtkDataObjectAlgorithm.h"
47 
48 class vtkRInterface;
49 class vtkRCalculatorFilterInternals;
50 class vtkDataSet;
51 class vtkDoubleArray;
52 
54 {
55 
56 public:
57 
58  static vtkRCalculatorFilter *New();
59 
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
67  void PutArray(const char* NameOfVTKArray, const char* NameOfRvar);
68 
73  void GetArray(const char* NameOfVTKArray, const char* NameOfRvar);
74 
76  void RemoveAllPutVariables();
77 
79  void RemoveAllGetVariables();
80 
82 
85  void PutTable(const char* NameOfRvar);
86  void GetTable(const char* NameOfRvar);
88 
90 
91  vtkSetStringMacro(Rscript);
92  vtkGetStringMacro(Rscript);
94 
96 
97  vtkSetStringMacro(ScriptFname);
98  vtkGetStringMacro(ScriptFname);
100 
102 
103  vtkSetMacro(Routput,int);
104  vtkGetMacro(Routput,int);
106 
108 
114  vtkSetMacro(TimeOutput,int);
115  vtkGetMacro(TimeOutput,int);
117 
119 
121  vtkSetMacro(BlockInfoOutput,int);
122  vtkGetMacro(BlockInfoOutput,int);
124 
126 
127  virtual int ProcessRequest(vtkInformation* request,
128  vtkInformationVector** inputVector,
129  vtkInformationVector* outputVector);
131 
132 protected:
133 
134  int SetRscriptFromFile(const char* fname);
135 
136  virtual int RequestData(vtkInformation *vtkNotUsed(request),
137  vtkInformationVector **inputVector,
138  vtkInformationVector *outputVector);
139 
141 
142  virtual int RequestDataObject(vtkInformation* request,
143  vtkInformationVector** inputVector,
144  vtkInformationVector* outputVector);
146 
149 
150 private:
151 
152  vtkRCalculatorFilter(const vtkRCalculatorFilter&); // Not implemented.
153  void operator=(const vtkRCalculatorFilter&); // Not implemented.
154 
155  // Implementation details
156  vtkRCalculatorFilterInternals* rcfi;
157  int ProcessDataSet(vtkDataSet* dsinp, vtkDataSet* dsout);
158 
159  vtkRInterface* ri;
160  char* Rscript;
161  char* RfileScript;
162  char* ScriptFname;
163  int Routput;
164  int TimeOutput;
165  int BlockInfoOutput;
166  char* OutputBuffer;
167  vtkDoubleArray* CurrentTime;
168  vtkDoubleArray* TimeRange;
169  vtkDoubleArray* TimeSteps;
170  vtkDoubleArray* BlockId;
171  vtkDoubleArray* NumBlocks;
172 
173 };
174 
175 #endif
176