VTK
|
00001 00002 /*========================================================================= 00003 00004 Program: Visualization Toolkit 00005 Module: vtkRCalculatorFilter.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 00043 #ifndef __vtkRCalculatorFilter_h 00044 #define __vtkRCalculatorFilter_h 00045 00046 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro 00047 #include "vtkDataObjectAlgorithm.h" 00048 00049 class vtkRInterface; 00050 class vtkRCalculatorFilterInternals; 00051 class vtkDataSet; 00052 class vtkDoubleArray; 00053 class vtkGraph; 00054 class vtkTree; 00055 class vtkTable; 00056 class vtkCompositeDataSet; 00057 class vtkArrayData; 00058 00059 class VTKFILTERSSTATISTICSGNUR_EXPORT vtkRCalculatorFilter : public vtkDataObjectAlgorithm 00060 { 00061 00062 public: 00063 00064 static vtkRCalculatorFilter *New(); 00065 00066 vtkTypeMacro(vtkRCalculatorFilter, vtkDataObjectAlgorithm ); 00067 void PrintSelf(ostream& os, vtkIndent indent); 00068 00073 void PutArray(const char* NameOfVTKArray, const char* NameOfRvar); 00074 00079 void GetArray(const char* NameOfVTKArray, const char* NameOfRvar); 00080 00082 void RemoveAllPutVariables(); 00083 00085 void RemoveAllGetVariables(); 00086 00088 00091 void PutTable(const char* NameOfRvar); 00092 void GetTable(const char* NameOfRvar); 00094 00096 00099 void PutTree(const char* NameOfRvar); 00100 void GetTree(const char* NameOfRvar); 00102 00104 00105 vtkSetStringMacro(Rscript); 00106 vtkGetStringMacro(Rscript); 00108 00110 00111 vtkSetStringMacro(ScriptFname); 00112 vtkGetStringMacro(ScriptFname); 00114 00116 00117 vtkSetMacro(Routput,int); 00118 vtkGetMacro(Routput,int); 00120 00122 00128 vtkSetMacro(TimeOutput,int); 00129 vtkGetMacro(TimeOutput,int); 00131 00133 00135 vtkSetMacro(BlockInfoOutput,int); 00136 vtkGetMacro(BlockInfoOutput,int); 00138 00140 00141 virtual int ProcessRequest(vtkInformation* request, 00142 vtkInformationVector** inputVector, 00143 vtkInformationVector* outputVector); 00145 00146 protected: 00147 00148 int SetRscriptFromFile(const char* fname); 00149 00150 virtual int RequestData(vtkInformation *vtkNotUsed(request), 00151 vtkInformationVector **inputVector, 00152 vtkInformationVector *outputVector); 00153 00155 00156 virtual int RequestDataObject(vtkInformation* request, 00157 vtkInformationVector** inputVector, 00158 vtkInformationVector* outputVector); 00160 00161 vtkRCalculatorFilter(); 00162 ~vtkRCalculatorFilter(); 00163 00164 private: 00165 00166 vtkRCalculatorFilter(const vtkRCalculatorFilter&); // Not implemented. 00167 void operator=(const vtkRCalculatorFilter&); // Not implemented. 00168 00169 // Implementation details 00170 vtkRCalculatorFilterInternals* rcfi; 00171 00172 int ProcessInputDataSet(vtkDataSet* dsIn); 00173 int ProcessOutputDataSet(vtkDataSet* dsOut); 00174 00175 int ProcessInputGraph(vtkGraph* gIn); 00176 int ProcessOutputGraph(vtkGraph* gOut); 00177 00178 int ProcessInputArrayData(vtkArrayData * adIn); 00179 int ProcessOutputArrayData(vtkArrayData * adOut); 00180 00181 int ProcessInputCompositeDataSet(vtkCompositeDataSet* cdsIn); 00182 int ProcessOutputCompositeDataSet(vtkCompositeDataSet * cdsOut); 00183 00184 int ProcessInputTable(vtkTable* tOut); 00185 int ProcessOutputTable(vtkTable* tOut); 00186 00187 int ProcessInputTree(vtkTree* tIn); 00188 int ProcessOutputTree(vtkTree* tOut); 00189 00190 int ProcessInputDataObject(vtkDataObject *input); 00191 int ProcessOutputDataObject(vtkDataObject *input); 00192 00193 vtkRInterface* ri; 00194 char* Rscript; 00195 char* RfileScript; 00196 char* ScriptFname; 00197 int Routput; 00198 int TimeOutput; 00199 int BlockInfoOutput; 00200 char* OutputBuffer; 00201 vtkDoubleArray* CurrentTime; 00202 vtkDoubleArray* TimeRange; 00203 vtkDoubleArray* TimeSteps; 00204 vtkDoubleArray* BlockId; 00205 vtkDoubleArray* NumBlocks; 00206 00207 }; 00208 00209 #endif 00210