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 "vtkObject.h"
49 
50 class vtkDataArray;
51 class vtkArray;
52 class vtkTable;
53 class vtkImplementationRSingleton;
54 class vtkRAdapter;
55 
57 {
58 public:
59 
60  static vtkRInterface* New();
61  vtkTypeMacro(vtkRInterface,vtkObject);
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
66  int EvalRcommand(const char *commandName, int param);
67 
70  int EvalRscript(const char *string, bool showRoutput = true);
71 
74  int OutputBuffer(char* p, int n);
75 
79  void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName);
80 
84  void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName);
85 
88  vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName);
89 
93  vtkArray* AssignRVariableToVTKArray(const char* RVariableName);
94 
99  vtkTable* AssignRVariableToVTKTable(const char* RVariableName);
100 
104  void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName);
105 
106 protected:
107  vtkRInterface();
108  ~vtkRInterface();
109 
110 private:
111  int FillOutputBuffer();
112  vtkRInterface(const vtkRInterface&); // Not implemented
113  void operator=(const vtkRInterface&); // Not implemented
114 
115  vtkImplementationRSingleton* rs;
116 
117  char* buffer;
118  int buffer_size;
119  vtkRAdapter* vra;
120 
121 };
122 
123 #endif
124 
#define VTK_GRAPHICS_EXPORT
abstract base class for most VTK objects
Definition: vtkObject.h:60
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:68
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:66
This is a utility class to convert VTK array data and VTK tables to and from Gnu R S expression (SEXP...
Definition: vtkRAdapter.h:62
static vtkObject * New()