VTK
vtkRInterface.h
Go to the documentation of this file.
1 
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkRInterface.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 
45 #ifndef __vtkRInterface_h
46 #define __vtkRInterface_h
47 
48 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro
49 #include "vtkObject.h"
50 
51 class vtkDataArray;
52 class vtkArray;
53 class vtkTable;
54 class vtkImplementationRSingleton;
55 class vtkRAdapter;
56 
57 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRInterface : public vtkObject
58 {
59 public:
60 
61  static vtkRInterface* New();
62  vtkTypeMacro(vtkRInterface,vtkObject);
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
67  int EvalRcommand(const char *commandName, int param);
68 
71  int EvalRscript(const char *string, bool showRoutput = true);
72 
75  int OutputBuffer(char* p, int n);
76 
80  void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName);
81 
85  void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName);
86 
89  vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName);
90 
94  vtkArray* AssignRVariableToVTKArray(const char* RVariableName);
95 
100  vtkTable* AssignRVariableToVTKTable(const char* RVariableName);
101 
105  void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName);
106 
107 protected:
108  vtkRInterface();
109  ~vtkRInterface();
110 
111 private:
112  int FillOutputBuffer();
113  vtkRInterface(const vtkRInterface&); // Not implemented
114  void operator=(const vtkRInterface&); // Not implemented
115 
116  vtkImplementationRSingleton* rs;
117 
118  char* buffer;
119  int buffer_size;
120  vtkRAdapter* vra;
121 
122 };
123 
124 #endif
125