VTK: Filters/Python/vtkPythonAlgorithm.h Source File

| VTK 9.3.1

vtkPythonAlgorithm.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
32 #ifndef vtkPythonAlgorithm_h
33 #define vtkPythonAlgorithm_h
34 #if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_HIERARCHY__) || defined(__VTK_WRAP_PYTHON__)
35
36 #include "vtkPython.h" // Must be first
37
38 #include "vtkAlgorithm.h"
39 #include "vtkFiltersPythonModule.h" // For export macro
40
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkSmartPyObject;
43
44 class VTKFILTERSPYTHON_EXPORT vtkPythonAlgorithm : public vtkAlgorithm
45 {
46 public:
47 static vtkPythonAlgorithm* New();
48 vtkTypeMacro(vtkPythonAlgorithm, vtkAlgorithm);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
58 void SetPythonObject(PyObject* obj);
59
64 void SetNumberOfInputPorts(int n) override;
65
70 void SetNumberOfOutputPorts(int n) override;
71
72 protected:
73 vtkPythonAlgorithm();
74 ~vtkPythonAlgorithm() override;
75
76 vtkTypeBool ProcessRequest(
77 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
78 int FillInputPortInformation(int port, vtkInformation* info) override;
79 int FillOutputPortInformation(int port, vtkInformation* info) override;
80
81 private:
82 vtkPythonAlgorithm(const vtkPythonAlgorithm&) = delete;
83 void operator=(const vtkPythonAlgorithm&) = delete;
84
85 int CheckResult(const char* method, const vtkSmartPyObject& res);
86
87 PyObject* Object;
88 };
89
90 VTK_ABI_NAMESPACE_END
91 #endif
92 #endif
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkPythonAlgorithm
algorithm that can be implemented in Python
Definition: vtkPythonAlgorithm.h:45
vtkPythonAlgorithm::SetNumberOfInputPorts
void SetNumberOfInputPorts(int n) override
Set the number of input ports used by the algorithm.
vtkPythonAlgorithm::New
static vtkPythonAlgorithm * New()
vtkPythonAlgorithm::~vtkPythonAlgorithm
~vtkPythonAlgorithm() override
vtkPythonAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPythonAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkPythonAlgorithm::SetNumberOfOutputPorts
void SetNumberOfOutputPorts(int n) override
Set the number of output ports provided by the algorithm.
vtkPythonAlgorithm::vtkPythonAlgorithm
vtkPythonAlgorithm()
vtkPythonAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPythonAlgorithm::SetPythonObject
void SetPythonObject(PyObject *obj)
Specify the Python object to use to operate on the data.
vtkPythonAlgorithm::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkAlgorithm.h
PyObject
struct _object PyObject
Definition: vtkMatplotlibMathTextUtilities.h:44