VTK  9.1.0
vtkPythonItem.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPythonItem.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=========================================================================*/
15
27#ifndef vtkPythonItem_h
28#define vtkPythonItem_h
29#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_HIERARCHY__) || defined(__VTK_WRAP_PYTHON__)
30
31#include "vtkPython.h" // Must be first
32
33#include "vtkContextItem.h"
34#include "vtkPythonContext2DModule.h" // For export macro
35
36class vtkSmartPyObject;
37
38class VTKPYTHONCONTEXT2D_EXPORT vtkPythonItem : public vtkContextItem
39{
40public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
44 static vtkPythonItem* New();
45
53
54 bool Paint(vtkContext2D* painter) override;
55
56protected:
58 ~vtkPythonItem() override;
59
60private:
61 vtkPythonItem(const vtkPythonItem&) = delete;
62 void operator=(const vtkPythonItem&) = delete;
63
64 bool CheckResult(const char* method, const vtkSmartPyObject& res);
65
66 PyObject* Object;
67};
68
69#endif // #ifndef vtkPythonItem_h
70#endif
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
base class for items that are part of a vtkContextScene.
a simple class to control print indentation
Definition: vtkIndent.h:113
A vtkContextItem that can be implemented in Python.
Definition: vtkPythonItem.h:39
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