VTK
|
00001 00002 /*========================================================================= 00003 00004 Program: Visualization Toolkit 00005 Module: vtkRInterface.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 00045 #ifndef __vtkRInterface_h 00046 #define __vtkRInterface_h 00047 00048 #include "vtkObject.h" 00049 00050 class vtkDataArray; 00051 class vtkArray; 00052 class vtkTable; 00053 class vtkImplementationRSingleton; 00054 class vtkRAdapter; 00055 00056 class VTK_GRAPHICS_EXPORT vtkRInterface : public vtkObject 00057 { 00058 public: 00059 00060 static vtkRInterface* New(); 00061 vtkTypeMacro(vtkRInterface,vtkObject); 00062 void PrintSelf(ostream& os, vtkIndent indent); 00063 00066 int EvalRcommand(const char *commandName, int param); 00067 00070 int EvalRscript(const char *string, bool showRoutput = true); 00071 00074 int OutputBuffer(char* p, int n); 00075 00079 void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName); 00080 00084 void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName); 00085 00088 vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName); 00089 00093 vtkArray* AssignRVariableToVTKArray(const char* RVariableName); 00094 00099 vtkTable* AssignRVariableToVTKTable(const char* RVariableName); 00100 00104 void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName); 00105 00106 protected: 00107 vtkRInterface(); 00108 ~vtkRInterface(); 00109 00110 private: 00111 int FillOutputBuffer(); 00112 vtkRInterface(const vtkRInterface&); // Not implemented 00113 void operator=(const vtkRInterface&); // Not implemented 00114 00115 vtkImplementationRSingleton* rs; 00116 00117 char* buffer; 00118 int buffer_size; 00119 vtkRAdapter* vra; 00120 00121 }; 00122 00123 #endif 00124