00001 00002 /*========================================================================= 00003 00004 Program: Visualization Toolkit 00005 Module: vtkRAdapter.h 00006 00007 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00016 /*------------------------------------------------------------------------- 00017 Copyright 2009 Sandia Corporation. 00018 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00019 the U.S. Government retains certain rights in this software. 00020 -------------------------------------------------------------------------*/ 00021 00047 #ifndef __vtkRAdapter 00048 #define __vtkRAdapter 00049 00050 #include "vtkObject.h" 00051 #include "Rinternals.h" // Needed for Rinternals.h SEXP data structure 00052 00053 class vtkInformation; 00054 class vtkInformationVector; 00055 class vtkDataArray; 00056 class vtkArray; 00057 class vtkTable; 00058 class vtkDataArrayCollection; 00059 class vtkArrayData; 00060 class vtkDataObjectCollection; 00061 00062 class VTK_GRAPHICS_EXPORT vtkRAdapter : public vtkObject 00063 { 00064 00065 public: 00066 00067 vtkTypeMacro(vtkRAdapter, vtkObject); 00068 00069 void PrintSelf(ostream& os, vtkIndent indent); 00070 00071 static vtkRAdapter *New(); 00072 00073 //BTX 00077 vtkDataArray* RToVTKDataArray(SEXP variable); 00078 00082 vtkArray* RToVTKArray(SEXP variable); 00083 00086 SEXP VTKDataArrayToR(vtkDataArray* da); 00087 00090 SEXP VTKArrayToR(vtkArray* da); 00091 00094 SEXP VTKTableToR(vtkTable* table); 00095 00099 vtkTable* RToVTKTable(SEXP variable); 00100 //ETX 00101 00102 protected: 00103 vtkRAdapter(); 00104 ~vtkRAdapter(); 00105 00106 private: 00107 00108 vtkRAdapter(const vtkRAdapter&); // Not implemented 00109 void operator=(const vtkRAdapter&); // Not implemented 00110 00111 vtkDataArrayCollection* vdac; // Collection of vtkDataArrays that have been converted from R. 00112 vtkArrayData* vad; // Collection of vtkArrays that have been converted from R. 00113 vtkDataObjectCollection* vdoc; // Collection of vtkTables that have been converted from R. 00114 00115 }; 00116 00117 00118 #endif 00119 00120 00121