VTK  9.4.20241231
vtkPythonItem.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
3
18#ifndef vtkPythonItem_h
19#define vtkPythonItem_h
20#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_HIERARCHY__) || defined(__VTK_WRAP_PYTHON__)
21
22#include "vtkPython.h" // Must be first
23
24#include "vtkContextItem.h"
25#include "vtkPythonContext2DModule.h" // For export macro
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkSmartPyObject;
29
30class VTKPYTHONCONTEXT2D_EXPORT vtkPythonItem : public vtkContextItem
31{
32public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
36 static vtkPythonItem* New();
37
45
46 bool Paint(vtkContext2D* painter) override;
47
48protected:
50 ~vtkPythonItem() override;
51
52private:
53 vtkPythonItem(const vtkPythonItem&) = delete;
54 void operator=(const vtkPythonItem&) = delete;
55
56 bool CheckResult(const char* method, const vtkSmartPyObject& res);
57
58 PyObject* Object;
59};
60
61VTK_ABI_NAMESPACE_END
62#endif // #ifndef vtkPythonItem_h
63#endif
Class for drawing 2D primitives to a graphical context.
base class for items that are part of a vtkContextScene.
a simple class to control print indentation
Definition vtkIndent.h:108
A vtkContextItem that can be implemented in Python.
bool Paint(vtkContext2D *painter) override
Paint event for the item, called whenever the item needs to be drawn.
void SetPythonObject(PyObject *obj)
Specify the Python object to use to operate on the data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkPythonItem() override
static vtkPythonItem * New()
struct _object PyObject