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 "vtkFiltersStatisticsGnuRModule.h" // For export macro 00049 #include "vtkObject.h" 00050 00051 class vtkDataArray; 00052 class vtkArray; 00053 class vtkTree; 00054 class vtkTable; 00055 class vtkImplementationRSingleton; 00056 class vtkRAdapter; 00057 00058 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRInterface : public vtkObject 00059 { 00060 public: 00061 00062 static vtkRInterface* New(); 00063 vtkTypeMacro(vtkRInterface,vtkObject); 00064 void PrintSelf(ostream& os, vtkIndent indent); 00065 00068 int EvalRcommand(const char *commandName, int param); 00069 00072 int EvalRscript(const char *string, bool showRoutput = true); 00073 00076 int OutputBuffer(char* p, int n); 00077 00081 void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName); 00082 00086 void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName); 00087 00091 void AssignVTKTreeToRVariable(vtkTree* tr, const char* RVariableName); 00092 00095 vtkTree* AssignRVariableToVTKTree(const char* RVariableName); 00096 00099 vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName); 00100 00104 vtkArray* AssignRVariableToVTKArray(const char* RVariableName); 00105 00110 vtkTable* AssignRVariableToVTKTable(const char* RVariableName); 00111 00115 void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName); 00116 00117 protected: 00118 vtkRInterface(); 00119 ~vtkRInterface(); 00120 00121 private: 00122 int FillOutputBuffer(); 00123 vtkRInterface(const vtkRInterface&); // Not implemented 00124 void operator=(const vtkRInterface&); // Not implemented 00125 00126 vtkImplementationRSingleton* rs; 00127 00128 char* buffer; 00129 int buffer_size; 00130 vtkRAdapter* vra; 00131 00132 }; 00133 00134 #endif 00135