ParaView
vtkPythonProgrammableFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPythonProgrammableFilter.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 =========================================================================*/
41 #ifndef vtkPythonProgrammableFilter_h
42 #define vtkPythonProgrammableFilter_h
43 
44 #include "vtkPVClientServerCoreCoreModule.h" //needed for exports
45 #include "vtkProgrammableFilter.h"
46 
47 class vtkPythonProgrammableFilterImplementation;
48 
49 class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPythonProgrammableFilter : public vtkProgrammableFilter
50 {
51 public:
52  vtkTypeMacro(vtkPythonProgrammableFilter, vtkProgrammableFilter);
53  void PrintSelf(ostream& os, vtkIndent indent);
54  static vtkPythonProgrammableFilter* New();
55 
57 
60  vtkSetStringMacro(Script) vtkGetStringMacro(Script)
62 
64 
67  vtkSetStringMacro(InformationScript) vtkGetStringMacro(InformationScript)
69 
71 
74  vtkSetStringMacro(UpdateExtentScript) vtkGetStringMacro(UpdateExtentScript)
76 
78 
82  void SetParameterInternal(const char* name, const char* value);
83  void SetParameter(const char* name, const char* value);
84  void SetParameter(const char* name, int value);
85  void SetParameter(const char* name, double value);
86  void SetParameter(const char* name, double value1, double value2);
87  void SetParameter(const char* name, double value1, double value2, double value3);
89 
91 
94  void AddParameter(const char* name, const char* value);
95  void ClearParameter(const char* name);
97 
101  void ClearParameters();
102 
106  static void ExecuteScript(void*);
107 
109 
113  vtkSetMacro(OutputDataSetType, int);
114  vtkGetMacro(OutputDataSetType, int);
116 
118 
122  vtkSetStringMacro(PythonPath);
123  vtkGetStringMacro(PythonPath);
125 
130  void SetNumberOfInputPorts(int numberOfInputPorts)
131  {
132  this->Superclass::SetNumberOfInputPorts(numberOfInputPorts);
133  }
134 
135 protected:
138 
142  void Exec(const char*, const char*);
143 
144  virtual int FillOutputPortInformation(int port, vtkInformation* info);
145 
146  // overridden to allow multiple inputs to port 0
147  virtual int FillInputPortInformation(int port, vtkInformation* info);
148 
152  virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
153  vtkInformationVector* outputVector);
154 
155  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
156  vtkInformationVector* outputVector);
157 
158  virtual int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
159  vtkInformationVector* outputVector);
160 
166  virtual int ProcessRequest(
167  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
168 
169  char* Script;
172  char* PythonPath;
174 
175 private:
176  vtkPythonProgrammableFilter(const vtkPythonProgrammableFilter&) VTK_DELETE_FUNCTION;
177  void operator=(const vtkPythonProgrammableFilter&) VTK_DELETE_FUNCTION;
178 
184  vtkInformation* Request;
185 
186  vtkPythonProgrammableFilterImplementation* const Implementation;
187 };
188 
189 #endif
void SetNumberOfInputPorts(int numberOfInputPorts)
Set the number of input ports This function is explicitly exposed to enable a vtkClientServerInterpre...
Executes a user supplied python script on its input dataset to produce an output dataset.