vtkPythonCommand.h 1.17 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkPythonCommand.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/

#ifndef __vtkPythonCommand_h
#define __vtkPythonCommand_h

#include "vtkPython.h"
#include "vtkCommand.h"

// To allow Python to use the vtkCommand features
23
class VTK_COMMON_PYTHON_EXPORT vtkPythonCommand : public vtkCommand
24
25
{
public:
26
27
  vtkTypeMacro(vtkPythonCommand,vtkCommand);

28
29
30
31
32
33
34
35
36
37
38
39
40
41
  static vtkPythonCommand *New() { return new vtkPythonCommand; };

  void SetObject(PyObject *o);
  void SetThreadState(PyThreadState *ts);
  void Execute(vtkObject *ptr, unsigned long eventtype, void *CallData);

  PyObject *obj;
  PyThreadState *ThreadState;
protected:
  vtkPythonCommand();
  ~vtkPythonCommand();
};

#endif