VTK
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 
30 #ifndef vtkPythonItem_h
31 #define vtkPythonItem_h
32 #if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_HIERARCHY__) || defined(__VTK_WRAP_PYTHON__)
33 
34 #include "vtkPython.h" // Must be first
35 
36 #include "vtkPythonContext2DModule.h" // For export macro
37 #include "vtkContextItem.h"
38 
39 class vtkSmartPyObject;
40 
41 class VTKPYTHONCONTEXT2D_EXPORT vtkPythonItem : public vtkContextItem
42 {
43 public:
44  vtkTypeMacro(vtkPythonItem, vtkContextItem);
45  void PrintSelf(ostream &os, vtkIndent indent) override;
46 
47  static vtkPythonItem * New();
48 
56 
57  bool Paint(vtkContext2D *painter) override;
58 
59 protected:
61  ~vtkPythonItem() override;
62 
63 private:
64  vtkPythonItem(const vtkPythonItem &) = delete;
65  void operator=(const vtkPythonItem &) = delete;
66 
67  bool CheckResult(const char* method, const vtkSmartPyObject& res);
68 
69  PyObject* Object;
70 };
71 
72 #endif // #ifndef vtkPythonItem_h
73 #endif
vtkPythonItem::SetPythonObject
void SetPythonObject(PyObject *obj)
Specify the Python object to use to operate on the data.
vtkPythonItem::~vtkPythonItem
~vtkPythonItem() override
vtkPythonItem::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the item, called whenever the item needs to be drawn.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
vtkContextItem.h
PyObject
struct _object PyObject
Definition: vtkMatplotlibMathTextUtilities.h:35
vtkPythonItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPythonItem
A vtkContextItem that can be implemented in Python.
Definition: vtkPythonItem.h:42
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:35
vtkPythonItem::vtkPythonItem
vtkPythonItem()
vtkPythonItem::New
static vtkPythonItem * New()