itom 1.0.14
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef PYTHONPROXY_H 00024 #define PYTHONPROXY_H 00025 00026 /* includes */ 00027 #ifndef Q_MOC_RUN 00028 #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API //see numpy help ::array api :: Miscellaneous :: Importing the api (this line must bebefore include global.h) 00029 #define NO_IMPORT_ARRAY 00030 //python 00031 // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3 00032 #ifdef _DEBUG 00033 #undef _DEBUG 00034 #if (defined linux) | (defined CMAKE) 00035 #include "Python.h" 00036 //#include "numpy/arrayobject.h" 00037 #else 00038 #include "Python.h" 00039 //#include "../Lib/site-packages/numpy/core/include/numpy/arrayobject.h" //for numpy arrays 00040 #endif 00041 #define _DEBUG 00042 #else 00043 #ifdef linux 00044 #include "Python.h" 00045 //#include "numpy/arrayobject.h" 00046 #else 00047 #include "Python.h" 00048 //#include "../Lib/site-packages/numpy/core/include/numpy/arrayobject.h" //for numpy arrays 00049 #endif 00050 #endif 00051 #endif 00052 00053 namespace ito 00054 { 00055 00056 class PythonProxy 00057 { 00058 public: 00059 typedef struct 00060 { 00061 PyObject_HEAD 00062 PyObject* inst; 00063 PyObject* func; 00064 PyObject* klass; 00065 PyObject* base; 00066 } 00067 PyProxy; 00068 00069 00070 00071 //------------------------------------------------------------------------------------------------- 00072 // constructor, deconstructor, alloc, dellaoc 00073 //------------------------------------------------------------------------------------------------- 00074 static void PyProxy_dealloc(PyProxy *self); 00075 static PyObject* PyProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00076 static int PyProxy_init(PyProxy *self, PyObject *args, PyObject *kwds); 00077 00078 00079 static PyObject *PyProxy_richcompare(PyObject *v, PyObject *w, int op); 00080 static PyObject *PyProxy_call(PyProxy *self, PyObject *args, PyObject *kwds); 00081 //------------------------------------------------------------------------------------------------- 00082 // type structures 00083 //------------------------------------------------------------------------------------------------- 00084 //static PyMemberDef PyNpDataObject_members[]; 00085 //static PyMethodDef PyPointCloud_methods[]; 00086 static PyTypeObject PyProxyType; 00087 static PyModuleDef PyProxyModule; 00088 00089 static void PyProxy_addTpDict(PyObject *tp_dict); 00090 00091 00092 00093 }; 00094 00095 }; //end namespace ito 00096 00097 00098 #endif