00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
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&);    
00113   void operator=(const vtkRInterface&);   
00114 
00115   vtkImplementationRSingleton* rs;
00116 
00117   char* buffer;
00118   int buffer_size;
00119   vtkRAdapter* vra;
00120 
00121 };
00122 
00123 #endif
00124