00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPythonCommand.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00016 #ifndef __vtkPythonCommand_h 00017 #define __vtkPythonCommand_h 00018 00019 #include "vtkPython.h" 00020 #include "vtkCommand.h" 00021 00022 // To allow Python to use the vtkCommand features 00023 class VTK_COMMON_PYTHON_EXPORT vtkPythonCommand : public vtkCommand 00024 { 00025 public: 00026 vtkTypeMacro(vtkPythonCommand,vtkCommand); 00027 00028 static vtkPythonCommand *New() { return new vtkPythonCommand; }; 00029 00030 void SetObject(PyObject *o); 00031 void SetThreadState(PyThreadState *ts); 00032 void Execute(vtkObject *ptr, unsigned long eventtype, void *CallData); 00033 00034 PyObject *obj; 00035 PyThreadState *ThreadState; 00036 protected: 00037 vtkPythonCommand(); 00038 ~vtkPythonCommand(); 00039 }; 00040 00041 #endif