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 
46 #ifndef vtkRInterface_h
47 #define vtkRInterface_h
48 
49 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro
50 #include "vtkObject.h"
51 
52 class vtkDataArray;
53 class vtkArray;
54 class vtkTree;
55 class vtkTable;
56 class vtkImplementationRSingleton;
57 class vtkRAdapter;
58 
59 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRInterface : public vtkObject
60 {
61 public:
62 
63  static vtkRInterface* New();
64  vtkTypeMacro(vtkRInterface,vtkObject);
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
70  int EvalRcommand(const char *commandName, int param);
71 
76  int EvalRscript(const char *string, bool showRoutput = true);
77 
82  int OutputBuffer(char* p, int n);
83 
88  void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName);
89 
94  void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName);
95 
100  void AssignVTKTreeToRVariable(vtkTree* tr, const char* RVariableName);
101 
106  vtkTree* AssignRVariableToVTKTree(const char* RVariableName);
107 
112  vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName);
113 
119  vtkArray* AssignRVariableToVTKArray(const char* RVariableName);
120 
126  vtkTable* AssignRVariableToVTKTable(const char* RVariableName);
127 
133  void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName);
134 
135 protected:
136  vtkRInterface();
137  ~vtkRInterface();
138 
139 private:
140  int FillOutputBuffer();
141  vtkRInterface(const vtkRInterface&) VTK_DELETE_FUNCTION;
142  void operator=(const vtkRInterface&) VTK_DELETE_FUNCTION;
143 
144  vtkImplementationRSingleton* rs;
145 
146  char* buffer;
147  int buffer_size;
148  vtkRAdapter* vra;
149 
150 };
151 
152 #endif
153 
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:70
This class defines a VTK interface to an embedded GNU R intepreter instance.
Definition: vtkRInterface.h:59
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
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:60