VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkRAdapter.h
Go to the documentation of this file.
1 
2 /*=========================================================================
3 
4  Program: Visualization Toolkit
5  Module: vtkRAdapter.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 
47 #ifndef __vtkRAdapter
48 #define __vtkRAdapter
49 
50 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro
51 #include "vtkObject.h"
52 #include "Rinternals.h" // Needed for Rinternals.h SEXP data structure
53 
54 class vtkInformation;
55 class vtkInformationVector;
56 class vtkDataArray;
57 class vtkArray;
58 class vtkTable;
59 class vtkTree;
60 class vtkDataArrayCollection;
61 class vtkArrayData;
62 class vtkDataObjectCollection;
63 
64 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRAdapter : public vtkObject
65 {
66 
67 public:
68 
69  vtkTypeMacro(vtkRAdapter, vtkObject);
70 
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
73  static vtkRAdapter *New();
74 
75 //BTX
79  vtkDataArray* RToVTKDataArray(SEXP variable);
80 
84  vtkArray* RToVTKArray(SEXP variable);
85 
88  SEXP VTKDataArrayToR(vtkDataArray* da);
89 
92  SEXP VTKArrayToR(vtkArray* da);
93 
96  SEXP VTKTableToR(vtkTable* table);
97 
101  vtkTable* RToVTKTable(SEXP variable);
102 
105  SEXP VTKTreeToR(vtkTree* tree);
106 
108 
110  vtkTree* RToVTKTree(SEXP variable);
111 //ETX
113 
114 protected:
115  vtkRAdapter();
116  ~vtkRAdapter();
117 
118 private:
119 
120  vtkRAdapter(const vtkRAdapter&); // Not implemented
121  void operator=(const vtkRAdapter&); // Not implemented
122 
123  vtkDataArrayCollection* vdac; // Collection of vtkDataArrays that have been converted from R.
124  vtkArrayData* vad; // Collection of vtkArrays that have been converted from R.
125  vtkDataObjectCollection* vdoc; // Collection of vtkTables that have been converted from R.
126 
127 };
128 
129 
130 #endif
131 
132 
133 
This is a utility class to convert VTK array data and VTK tables to and from Gnu R S expression (SEXP...
Definition: vtkRAdapter.h:64