vtkPythonCalculator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPythonCalculator.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 =========================================================================*/
33 #ifndef vtkPythonCalculator_h
34 #define vtkPythonCalculator_h
35 
36 #include "vtkPVVTKExtensionsFiltersPythonModule.h" //needed for exports
37 #include "vtkProgrammableFilter.h"
38 
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44  static vtkPythonCalculator* New();
45 
47 
52  vtkSetMacro(ArrayAssociation, int);
53  vtkGetMacro(ArrayAssociation, int);
55 
57 
62  vtkSetStringMacro(Expression) vtkGetStringMacro(Expression)
64 
66 
69  vtkSetStringMacro(ArrayName) vtkGetStringMacro(ArrayName)
71 
75  static void ExecuteScript(void*);
76 
77 protected:
79  ~vtkPythonCalculator() override;
80 
84  void Exec(const char*);
85 
86  int FillOutputPortInformation(int port, vtkInformation* info) override;
87 
88  // overridden to allow multiple inputs to port 0
89  int FillInputPortInformation(int port, vtkInformation* info) override;
90 
91  // DeExpressionion:
92  // Creates whatever output data set type is selected.
93  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
94  vtkInformationVector* outputVector) override;
95 
96  char* Expression;
97  char* ArrayName;
99 
100 private:
101  vtkPythonCalculator(const vtkPythonCalculator&) = delete;
102  void operator=(const vtkPythonCalculator&) = delete;
103 };
104 
105 #endif
void PrintSelf(ostream &os, vtkIndent indent)
Evaluates a Python expression vtkPythonCalculator uses Python to calculate an expression.
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTKPVVTKEXTENSIONSFILTERSPYTHON_EXPORT
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
static vtkProgrammableFilter * New()
void operator=(const vtkObjectBase &)
virtual int FillOutputPortInformation(int port, vtkInformation *info)