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 vtkTree;
54 class vtkTable;
55 class vtkImplementationRSingleton;
56 class vtkRAdapter;
57 
58 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRInterface : public vtkObject
59 {
60 public:
61 
62  static vtkRInterface* New();
63  vtkTypeMacro(vtkRInterface,vtkObject);
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
68  int EvalRcommand(const char *commandName, int param);
69 
72  int EvalRscript(const char *string, bool showRoutput = true);
73 
76  int OutputBuffer(char* p, int n);
77 
81  void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName);
82 
86  void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName);
87 
91  void AssignVTKTreeToRVariable(vtkTree* tr, const char* RVariableName);
92 
95  vtkTree* AssignRVariableToVTKTree(const char* RVariableName);
96 
99  vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName);
100 
104  vtkArray* AssignRVariableToVTKArray(const char* RVariableName);
105 
110  vtkTable* AssignRVariableToVTKTable(const char* RVariableName);
111 
115  void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName);
116 
117 protected:
118  vtkRInterface();
119  ~vtkRInterface();
120 
121 private:
122  int FillOutputBuffer();
123  vtkRInterface(const vtkRInterface&); // Not implemented
124  void operator=(const vtkRInterface&); // Not implemented
125 
126  vtkImplementationRSingleton* rs;
127 
128  char* buffer;
129  int buffer_size;
130  vtkRAdapter* vra;
131 
132 };
133 
134 #endif
135 
abstract base class for most VTK objects
Definition: vtkObject.h:61
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:69
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
This is a utility class to convert VTK array data and VTK tables to and from Gnu R S expression (SEXP...
Definition: vtkRAdapter.h:69
static vtkObject * New()
A rooted tree data structure.
Definition: vtkTree.h:59