VTK
vtkMatlabEngineFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMatlabEngineFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2009 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
43 #ifndef vtkMatlabEngineFilter_h
44 #define vtkMatlabEngineFilter_h
45 
46 #include "vtkFiltersMatlabModule.h" // For export macro
47 #include "vtkDataObjectAlgorithm.h"
48 
50 class vtkMatlabEngineFilterInternals;
51 class vtkDataSet;
52 class vtkDoubleArray;
53 
54 class VTKFILTERSMATLAB_EXPORT vtkMatlabEngineFilter : public vtkDataObjectAlgorithm
55 {
56 
57 public:
58 
60 
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
71  void PutArray(const char* NameOfVTKArray, const char* NameOfMatVar);
72 
80  void GetArray(const char* NameOfVTKArray, const char* NameOfMatVar);
81 
86 
91 
93 
96  vtkSetStringMacro(MatlabScript);
97  vtkGetStringMacro(MatlabScript);
99 
101 
104  vtkSetStringMacro(ScriptFname);
105  vtkGetStringMacro(ScriptFname);
107 
109 
112  vtkSetMacro(EngineVisible,int);
113  vtkGetMacro(EngineVisible,int);
115 
117 
120  vtkSetMacro(EngineOutput,int);
121  vtkGetMacro(EngineOutput,int);
123 
125 
134  vtkSetMacro(TimeOutput,int);
135  vtkGetMacro(TimeOutput,int);
137 
139 
143  vtkSetMacro(BlockInfoOutput,int);
144  vtkGetMacro(BlockInfoOutput,int);
146 
150  virtual int ProcessRequest(vtkInformation* request,
151  vtkInformationVector** inputVector,
152  vtkInformationVector* outputVector);
153 
154 protected:
155 
156  int SetMatlabScriptFromFile(const char* fname);
157 
158  virtual int RequestData(vtkInformation *vtkNotUsed(request),
159  vtkInformationVector **inputVector,
160  vtkInformationVector *outputVector);
161 
165  virtual int RequestDataObject(vtkInformation* request,
166  vtkInformationVector** inputVector,
167  vtkInformationVector* outputVector);
168 
171 
172 private:
173 
174  vtkMatlabEngineFilter(const vtkMatlabEngineFilter&) VTK_DELETE_FUNCTION;
175  void operator=(const vtkMatlabEngineFilter&) VTK_DELETE_FUNCTION;
176 
177  // Implementation details
178  vtkMatlabEngineFilterInternals* mefi;
179 
180  int ProcessDataSet(vtkDataSet* dsinp, vtkDataSet* dsout);
181 
183  char* MatlabScript;
184  char* MatlabFileScript;
185  char* ScriptFname;
186  int EngineVisible;
187  int EngineOutput;
188  int TimeOutput;
189  int BlockInfoOutput;
190  char* OutputBuffer;
191  vtkDoubleArray* CurrentTime;
192  vtkDoubleArray* TimeRange;
193  vtkDoubleArray* TimeSteps;
194  vtkDoubleArray* BlockId;
195  vtkDoubleArray* NumBlocks;
196 
197 };
198 
199 #endif
vtkMatlabEngineFilter::RemoveAllPutVariables
void RemoveAllPutVariables()
Clears the list of variables to be copied to the Matlab engine.
vtkMatlabEngineFilter::RemoveAllGetVariables
void RemoveAllGetVariables()
Clears the list of variables to be copied from the Matlab engine.
vtkMatlabEngineFilter::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is required to capture REQUEST_DATA_OBJECT requests.
vtkMatlabEngineFilter::vtkMatlabEngineFilter
vtkMatlabEngineFilter()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:44
vtkMatlabEngineFilter
This VTK uses the vtkMatlabEngineInterface class to perform calculations on VTK array input using the...
Definition: vtkMatlabEngineFilter.h:55
vtkMatlabEngineFilter::New
static vtkMatlabEngineFilter * New()
vtkMatlabEngineFilter::~vtkMatlabEngineFilter
~vtkMatlabEngineFilter()
vtkMatlabEngineFilter::GetArray
void GetArray(const char *NameOfVTKArray, const char *NameOfMatVar)
Copies Matlab variable NameOfMatVar from the Matlab Engine to the vtkDataArray named NameOfVTKArray.
vtkMatlabEngineFilter::SetMatlabScriptFromFile
int SetMatlabScriptFromFile(const char *fname)
vtkMatlabEngineInterface
This class defines a VTK inteface to the MathWorks Matlab Engine.
Definition: vtkMatlabEngineInterface.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMatlabEngineFilter::RequestDataObject
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Creates the same output type as the input type.
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkMatlabEngineFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkMatlabEngineFilter::PutArray
void PutArray(const char *NameOfVTKArray, const char *NameOfMatVar)
Copies vtkDataArray named NameOfVTKArray to the Matlab engine with Matlab variable name NameOfMatVar.
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:42
vtkDataObjectAlgorithm.h
vtkMatlabEngineFilter::RequestData
virtual int RequestData(vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector)