itom 2.0.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut fuer Technische Optik (ITO), 00005 Universitaet 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 PYTHONAUTOINTERVAL 00024 #define PYTHONAUTOINTERVAL 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 #if (defined _DEBUG) && (defined WIN32) 00033 #undef _DEBUG 00034 #include "Python.h" 00035 #define _DEBUG 00036 #else 00037 #include "Python.h" 00038 #endif 00039 #endif 00040 00041 #include "../../common/typeDefs.h" 00042 #include "../../common/interval.h" 00043 #include "../../common/qtMetaTypeDeclarations.h" 00044 #include "structmember.h" 00045 #include <qobject.h> 00046 00047 namespace ito 00048 { 00049 class PythonAutoInterval 00050 { 00051 00052 public: 00053 00054 //------------------------------------------------------------------------------------------------- 00055 // typedefs 00056 //------------------------------------------------------------------------------------------------- 00057 typedef struct 00058 { 00059 PyObject_HEAD 00060 ito::AutoInterval interval; 00061 } 00062 PyAutoInterval; 00063 00064 00065 #define PyAutoInterval_Check(op) PyObject_TypeCheck(op, &ito::PythonAutoInterval::PyAutoIntervalType) 00066 00067 00068 //------------------------------------------------------------------------------------------------- 00069 // constructor, deconstructor, alloc, dellaoc 00070 //------------------------------------------------------------------------------------------------- 00071 00072 static void PyAutoInterval_dealloc(PyAutoInterval *self); 00073 static PyObject *PyAutoInterval_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00074 static int PyAutoInterval_init(PyAutoInterval *self, PyObject *args, PyObject *kwds); 00075 00076 static PyAutoInterval* createEmptyPyAutoInterval(); 00077 00078 00079 //------------------------------------------------------------------------------------------------- 00080 // general members 00081 //------------------------------------------------------------------------------------------------- 00082 static PyObject *PyAutoInterval_name(PyAutoInterval *self); 00083 00084 static PyObject* PyAutoInterval_repr(PyAutoInterval *self); 00085 00086 static PyObject* PyAutoInterval_RichCompare(PyAutoInterval *self, PyObject *other, int cmp_op); 00087 00088 static PyGetSetDef PyAutoInterval_getseters[]; 00089 00090 static PyObject* PyAutoInterval_getValue(PyAutoInterval *self, void *closure); 00091 static int PyAutoInterval_setValue(PyAutoInterval *self, PyObject *value, void *closure); 00092 00093 static PyObject* PyAutoInterval_Reduce(PyAutoInterval *self, PyObject *args); 00094 static PyObject* PyAutoInterval_SetState(PyAutoInterval *self, PyObject *args); 00095 00096 00097 //------------------------------------------------------------------------------------------------- 00098 // type structures 00099 //------------------------------------------------------------------------------------------------- 00100 static PyMemberDef PyAutoInterval_members[]; 00101 static PyMethodDef PyAutoInterval_methods[]; 00102 static PyTypeObject PyAutoIntervalType; 00103 static PyModuleDef PyAutoIntervalModule; 00104 00105 //------------------------------------------------------------------------------------------------- 00106 // helper methods 00107 //------------------------------------------------------------------------------------------------- 00108 00109 //------------------------------------------------------------------------------------------------- 00110 // static type methods 00111 //------------------------------------------------------------------------------------------------- 00112 00113 00114 }; 00115 00116 } //end namespace ito 00117 00118 #endif