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
52class vtkDataArray;
53class vtkArray;
54class vtkTree;
55class vtkTable;
56class vtkImplementationRSingleton;
57class vtkRAdapter;
58
59class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRInterface : public vtkObject
60{
61public:
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
135protected:
138
139private:
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 interface for N-dimensional arrays.
Definition: vtkArray.h:71
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
This is a utility class to convert VTK array data and VTK tables to and from Gnu R S expression (SEXP...
Definition: vtkRAdapter.h:71
This class defines a VTK interface to an embedded GNU R intepreter instance.
Definition: vtkRInterface.h:60
vtkDataArray * AssignRVariableToVTKDataArray(const char *RVariableName)
Copies the R variable RVariableName to the returned vtkDataArray.
static vtkRInterface * New()
vtkArray * AssignRVariableToVTKArray(const char *RVariableName)
Copies the R variable RVariableName to the returned vtkArray.
void AssignVTKArrayToRVariable(vtkArray *da, const char *RVariableName)
Copies vtkArray da into the R interpreter instance as a variable named RVariableName.
int EvalRcommand(const char *commandName, int param)
Evaluate an R command on the embedded R interpreter that takes one integer argument.
void AssignVTKDataArrayToRVariable(vtkDataArray *da, const char *RVariableName)
Copies vtkDataArray da into the R interpreter instance as a variable named RVariableName.
void AssignVTKTableToRVariable(vtkTable *table, const char *RVariableName)
Copies the vtkTable given in table to an R list structure name RVariableName.
void AssignVTKTreeToRVariable(vtkTree *tr, const char *RVariableName)
Copies vtkTree tr into the R interpreter instance as a variable named RVariableName.
int EvalRscript(const char *string, bool showRoutput=true)
Evaluate an R script given in string on the embedded R interpreter.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTree * AssignRVariableToVTKTree(const char *RVariableName)
Copies the R variable RVariableName to the returned vtkDataArray.
int OutputBuffer(char *p, int n)
Provide a character buffer in p of length n.
vtkTable * AssignRVariableToVTKTable(const char *RVariableName)
Copies the R matrix or R list in RVariableName to the returned vtkTable.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
A rooted tree data structure.
Definition: vtkTree.h:61