VTK  9.0.1
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 
36 class vtkSmartPyObject;
37 
38 class VTKPYTHONCONTEXT2D_EXPORT vtkPythonItem : public vtkContextItem
39 {
40 public:
41  vtkTypeMacro(vtkPythonItem, vtkContextItem);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  static vtkPythonItem* New();
45 
52  void SetPythonObject(PyObject* obj);
53 
54  bool Paint(vtkContext2D* painter) override;
55 
56 protected:
57  vtkPythonItem();
58  ~vtkPythonItem() override;
59 
60 private:
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
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkContextItem.h
PyObject
struct _object PyObject
Definition: vtkMatplotlibMathTextUtilities.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPythonItem
A vtkContextItem that can be implemented in Python.
Definition: vtkPythonItem.h:38
vtkContextItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:31
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.