itom 1.3.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 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 00031 //python 00032 // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3 00033 #if (defined _DEBUG) && (!defined linux) 00034 #undef _DEBUG 00035 #include "Python.h" 00036 #define _DEBUG 00037 #else 00038 #include "Python.h" 00039 #endif 00040 #endif 00041 00042 #include "../global.h" 00043 00044 #include <qhash.h> 00045 #include <qstring.h> 00046 00047 namespace ito 00048 { 00049 00050 class PythonItom 00051 { 00052 00053 public: 00054 static PyMethodDef PythonMethodItom[]; 00055 static PyModuleDef PythonModuleItom; 00056 static PyObject* PyInitItom(void); 00057 00059 static PyObject* PyOpenEmptyScriptEditor(PyObject *pSelf, PyObject *pArgs); 00060 static PyObject* PyNewScript(PyObject *pSelf, PyObject *pArgs); 00061 static PyObject* PyOpenScript(PyObject *pSelf, PyObject *pArgs); 00062 static PyObject* PyClearCommandLine(PyObject *pSelf); 00063 00064 static PyObject* PyPlotImage(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds); 00065 static PyObject* PyLiveImage(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds); 00066 //static PyObject* PyLiveLine(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds); 00067 /*static PyObject* PyCloseFigure(PyObject *pSelf, PyObject *pArgs); 00068 static PyObject* PySetFigParam(PyObject *pSelf, PyObject *pArgs); 00069 static PyObject* PyGetFigParam(PyObject *pSelf, PyObject *pArgs);*/ 00070 00071 static PyObject* PyFilter(PyObject *pSelf, PyObject *pArgs, PyObject *kwds); 00072 static PyObject* PyFilterHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00073 static PyObject* PyWidgetHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00074 static PyObject* PyPluginHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00075 static PyObject* PyPlotHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00076 static PyObject* PyITOMVersion(PyObject* pSelf, PyObject* pArgs); 00077 00078 static PyObject* PyLoadIDC(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00079 static PyObject* PySaveIDC(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00080 00081 static PyObject* PyPluginLoaded(PyObject* pSelf, PyObject* pArgs); 00082 static PyObject* PyFilterLoaded(PyObject* pSelf, PyObject* pArgs); 00083 static PyObject* PyPlotLoaded(PyObject* pSelf, PyObject* pArgs); 00084 00085 static PyObject* PySaveDataObject(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00086 static PyObject* PyLoadDataObject(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00087 00088 static PyObject* PyAddButton(PyObject* pSelf, PyObject* pArgs, PyObject *kwds); 00089 static PyObject* PyRemoveButton(PyObject* pSelf, PyObject* pArgs); 00090 00091 static PyObject* PyAddMenu(PyObject* pSelf, PyObject* args, PyObject *kwds); 00092 static PyObject* PyRemoveMenu(PyObject* pSelf, PyObject* args, PyObject *kwds); 00093 00094 static PyObject* PyCheckSignals(PyObject* pSelf); 00095 static PyObject* PyProcessEvents(PyObject* pSelf); 00096 00097 static PyObject* PySaveMatlabMat(PyObject* pSelf, PyObject* pArgs); 00098 static PyObject* PyLoadMatlabMat(PyObject* pSelf, PyObject* pArgs); 00099 static PyObject* PyMatlabMatDataObjectConverter(PyObject *element); 00101 static PyObject* PyGetDebugger(PyObject* pSelf); 00102 static PyObject* PyGCStartTracking(PyObject *pSelf); 00103 static PyObject* PyGCEndTracking(PyObject *pSelf); 00104 //static PyObject* PyGetGlobalDict(PyObject *pSelf); 00105 00106 static PyObject* PyAutoReloader(PyObject* pSelf, PyObject *args, PyObject *kwds); 00107 00108 static PyObject* PyGetScreenInfo(PyObject* pSelf); 00109 00110 static PyObject* getDefaultScaleableUnits(PyObject* pSelf); 00111 static PyObject* scaleValueAndUnit(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds); 00112 00113 static PyObject* getAppPath(PyObject* pSelf); 00114 static PyObject* getCurrentPath(PyObject* pSelf); 00115 static PyObject* setCurrentPath(PyObject* pSelf, PyObject* pArgs); 00116 00117 static PyObject* compressData(PyObject* pSelf, PyObject* pArgs); 00118 static PyObject* uncompressData(PyObject* pSelf, PyObject* pArgs); 00119 00120 static PyObject* setApplicationCursor(PyObject* pSelf, PyObject* pArgs); 00121 00122 static PyObject* userCheckIsAdmin(PyObject* pSelf); 00123 static PyObject* userCheckIsDeveloper(PyObject* pSelf); 00124 static PyObject* userCheckIsUser(PyObject* pSelf); 00125 static PyObject* userGetUserInfo(PyObject* pSelf); 00126 00127 protected: 00128 static QHash<size_t, QString> m_gcTrackerList; 00129 }; 00130 00131 } //end namespace ito 00132 #endif