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 PYTHONITOM_H 00024 #define PYTHONITOM_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 #include "../global.h" 00054 00055 #include <qhash.h> 00056 #include <qstring.h> 00057 00058 namespace ito 00059 { 00060 00061 class PythonItom 00062 { 00063 00064 public: 00065 static PyMethodDef PythonMethodItom[]; 00066 static PyModuleDef PythonModuleItom; 00067 static PyObject* PyInitItom(void); 00068 00070 static PyObject* PyOpenEmptyScriptEditor(PyObject *pSelf, PyObject *pArgs); 00071 static PyObject* PyNewScript(PyObject *pSelf, PyObject *pArgs); 00072 static PyObject* PyOpenScript(PyObject *pSelf, PyObject *pArgs); 00073 00074 static PyObject* PyPlotImage(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds); 00075 static PyObject* PyLiveImage(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds); 00076 //static PyObject* PyLiveLine(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds); 00077 /*static PyObject* PyCloseFigure(PyObject *pSelf, PyObject *pArgs); 00078 static PyObject* PySetFigParam(PyObject *pSelf, PyObject *pArgs); 00079 static PyObject* PyGetFigParam(PyObject *pSelf, PyObject *pArgs);*/ 00080 00081 static PyObject* PyFilter(PyObject *pSelf, PyObject *pArgs, PyObject *kwds); 00082 static PyObject* PyFilterHelp(PyObject* pSelf, PyObject* pArgs); 00083 static PyObject* PyWidgetHelp(PyObject* pSelf, PyObject* pArgs); 00084 static PyObject* PyPluginHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00085 static PyObject* PyITOMVersion(PyObject* pSelf, PyObject* pArgs); 00086 00087 static PyObject* PyLoadIDC(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00088 static PyObject* PySaveIDC(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00089 00090 static PyObject* PyPluginLoaded(PyObject* pSelf, PyObject* pArgs); 00091 static PyObject* PyFilterLoaded(PyObject* pSelf, PyObject* pArgs); 00092 00093 static PyObject* PySaveDataObject(PyObject* pSelf, PyObject* pArgs); 00094 static PyObject* PyLoadDataObject(PyObject* pSelf, PyObject* pArgs); 00095 00096 static PyObject* PyAddButton(PyObject* pSelf, PyObject* pArgs, PyObject *kwds); 00097 static PyObject* PyRemoveButton(PyObject* pSelf, PyObject* pArgs); 00098 00099 static PyObject* PyAddMenu(PyObject* pSelf, PyObject* args, PyObject *kwds); 00100 static PyObject* PyRemoveMenu(PyObject* pSelf, PyObject* args, PyObject *kwds); 00101 00102 static PyObject* PyCheckSignals(PyObject* pSelf); 00103 static PyObject* PyProcessEvents(PyObject* pSelf); 00104 00105 static PyObject* PySaveMatlabMat(PyObject* pSelf, PyObject* pArgs); 00106 static PyObject* PyLoadMatlabMat(PyObject* pSelf, PyObject* pArgs); 00107 static PyObject* PyMatlabMatDataObjectConverter(PyObject *element); 00109 static PyObject* PyGetDebugger(PyObject* pSelf); 00110 static PyObject* PyGCStartTracking(PyObject *pSelf); 00111 static PyObject* PyGCEndTracking(PyObject *pSelf); 00112 //static PyObject* PyGetGlobalDict(PyObject *pSelf); 00113 00114 static PyObject* PyGetScreenInfo(PyObject* pSelf); 00115 00116 static PyObject* getDefaultScaleAbleUnits(PyObject* pSelf); 00117 static PyObject* ScaleValueAndUnit(PyObject* pSelf, PyObject* pArgs); 00118 00119 static PyObject* getAppPath(PyObject* pSelf); 00120 static PyObject* getCurrentPath(PyObject* pSelf); 00121 static PyObject* setCurrentPath(PyObject* pSelf, PyObject* pArgs); 00122 00123 static PyObject* setApplicationCursor(PyObject* pSelf, PyObject* pArgs); 00124 00125 00126 protected: 00127 static QHash<unsigned int, QString> m_gcTrackerList; 00128 }; 00129 00130 } //end namespace ito 00131 #endif