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