VTK
vtkPythonAlgorithm.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPythonAlgorithm.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 =========================================================================*/
43 #ifndef vtkPythonAlgorithm_h
44 #define vtkPythonAlgorithm_h
45 #if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_HIERARCHY__) || defined(__VTK_WRAP_PYTHON__)
46 
47 #include "vtkPython.h" // Must be first
48 
49 #include "vtkFiltersPythonModule.h" // For export macro
50 #include "vtkAlgorithm.h"
51 
52 class vtkSmartPyObject;
53 
54 class VTKFILTERSPYTHON_EXPORT vtkPythonAlgorithm : public vtkAlgorithm
55 {
56 public:
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
69 
74  void SetNumberOfInputPorts(int n) override;
75 
80  void SetNumberOfOutputPorts(int n) override;
81 
82 protected:
84  ~vtkPythonAlgorithm() override;
85 
87  vtkInformationVector** inInfo,
88  vtkInformationVector* outInfo) override;
91 
92 private:
93  vtkPythonAlgorithm(const vtkPythonAlgorithm&) = delete;
94  void operator=(const vtkPythonAlgorithm&) = delete;
95 
96  int CheckResult(const char* method, const vtkSmartPyObject& res);
97 
98  PyObject* Object;
99 };
100 
101 #endif
102 #endif
vtkPythonAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkPythonAlgorithm::vtkPythonAlgorithm
vtkPythonAlgorithm()
vtkPythonAlgorithm::SetNumberOfOutputPorts
void SetNumberOfOutputPorts(int n) override
Set the number of output ports provided by the algorithm.
PyObject
struct _object PyObject
Definition: vtkMatplotlibMathTextUtilities.h:35
vtkPythonAlgorithm::New
static vtkPythonAlgorithm * New()
vtkAlgorithm.h
vtkPythonAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPythonAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPythonAlgorithm
algorithm that can be implemented in Python
Definition: vtkPythonAlgorithm.h:55
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPythonAlgorithm::SetNumberOfInputPorts
void SetNumberOfInputPorts(int n) override
Set the number of input ports used by the algorithm.
vtkPythonAlgorithm::ProcessRequest
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkPythonAlgorithm::~vtkPythonAlgorithm
~vtkPythonAlgorithm() override
vtkPythonAlgorithm::SetPythonObject
void SetPythonObject(PyObject *obj)
Specify the Python object to use to operate on the data.