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