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 
40 #ifndef vtkRInterface_h
41 #define vtkRInterface_h
42 
43 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro
44 #include "vtkObject.h"
45 
46 class vtkDataArray;
47 class vtkArray;
48 class vtkTree;
49 class vtkTable;
50 class vtkImplementationRSingleton;
51 class vtkRAdapter;
52 
53 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRInterface : public vtkObject
54 {
55 public:
56 
57  static vtkRInterface* New();
58  vtkTypeMacro(vtkRInterface,vtkObject);
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
64  int EvalRcommand(const char *commandName, int param);
65 
70  int EvalRscript(const char *string, bool showRoutput = true);
71 
76  int OutputBuffer(char* p, int n);
77 
82  void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName);
83 
88  void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName);
89 
94  void AssignVTKTreeToRVariable(vtkTree* tr, const char* RVariableName);
95 
100  vtkTree* AssignRVariableToVTKTree(const char* RVariableName);
101 
106  vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName);
107 
113  vtkArray* AssignRVariableToVTKArray(const char* RVariableName);
114 
120  vtkTable* AssignRVariableToVTKTable(const char* RVariableName);
121 
127  void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName);
128 
129 protected:
130  vtkRInterface();
131  ~vtkRInterface();
132 
133 private:
134  int FillOutputBuffer();
135  vtkRInterface(const vtkRInterface&) VTK_DELETE_FUNCTION;
136  void operator=(const vtkRInterface&) VTK_DELETE_FUNCTION;
137 
138  vtkImplementationRSingleton* rs;
139 
140  char* buffer;
141  int buffer_size;
142  vtkRAdapter* vra;
143 
144 };
145 
146 #endif
147 
abstract base class for most VTK objects
Definition: vtkObject.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:64
This class defines a VTK interface to an embedded GNU R interpreter instance.
Definition: vtkRInterface.h:53
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
This is a utility class to convert VTK array data and VTK tables to and from Gnu R S expression (SEXP...
Definition: vtkRAdapter.h:70
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
A rooted tree data structure.
Definition: vtkTree.h:54