itom  4.1.0
pythonMatlab.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef PYTHONMATLAB_H
24 #define PYTHONMATLAB_H
25 
26 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
27 
28 // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
29 #if (defined _DEBUG) && (defined WIN32)
30  #undef _DEBUG
31  #include "pythonWrapper.h"
32  #include "numpy/arrayobject.h"
33  #define _DEBUG
34 #else
35  #include "pythonWrapper.h"
36  #include "numpy/arrayobject.h"
37 #endif
38 #include "structmember.h"
39 
40 #include "../global.h"
41 
42 #if ITOM_PYTHONMATLAB == 1
43 /* * *
44  * Copyright 2010 Joakim Mller
45  *
46  * This file is part of pymatlab.
47  *
48  * pymatlab is free software: you can redistribute it and/or modify
49  * it under the terms of the GNU General Public License as published by
50  * the Free Software Foundation, either version 3 of the License, or
51  * (at your option) any later version.
52  *
53  * pymatlab is distributed in the hope that it will be useful,
54  * but WITHOUT ANY WARRANTY; without even the implied warranty of
55  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56  * GNU General Public License for more details.
57  *
58  * You should have received a copy of the GNU General Public License
59  * along with pymatlab. If not, see <http://www.gnu.org/licenses/>.
60  * * */
61 
62 #include "common/retVal.h"
63 #include <qlibrary.h>
64 #include <engine.h>
65 
66 
67 
68 namespace ito
69 {
70 
71 class PythonMatlab
72 {
73 
74 public:
75 
76  typedef struct
77  {
78  PyObject_HEAD
79  Engine *ep;
80  } PyMatlabSessionObject;
81 
82  static PyObject * PyMatlabSessionObject_new(PyTypeObject *type, PyObject *args, PyObject * kwds);
83 
84  static int PyMatlabSessionObject_init(PyMatlabSessionObject *self, PyObject *args, PyObject *kwds);
85 
86  static void PyMatlabSessionObject_dealloc(PyMatlabSessionObject *self);
87 
88  static PyObject * PyMatlabSessionObject_run(PyMatlabSessionObject *self, PyObject *args);
89 
90  static PyObject * PyMatlabSessionObject_setValue(PyMatlabSessionObject *self, PyObject *args);
91 
92  static PyObject * PyMatlabSessionObject_setString(PyMatlabSessionObject *self, PyObject *args);
93 
94  static PyObject * PyMatlabSessionObject_getString(PyMatlabSessionObject *self, PyObject *args);
95 
96  static PyObject * PyMatlabSessionObject_GetValue(PyMatlabSessionObject * self, PyObject *args);
97 
98  static PyObject * PyMatlabSessionObject_close(PyMatlabSessionObject * self, PyObject *args);
99 
100 
101  static PyMethodDef PyMatlabSessionObject_methods[];
102  static PyMemberDef PyMatlabSessionObject_members[]; // = { { NULL } };
103  static PyTypeObject PyMatlabSessionObjectType;
104  static PyModuleDef PyMatlabSessionObject_Module;
105  static PyObject* PyInit_matlab(void);
106 
107  static bool initialized;
108  static ito::RetVal loadLibrary();
109 
110  static QLibrary engineLibrary;
111  static QLibrary mxLibrary;
112 
113 }; //end class PythonMatlab
114 
115 } //end namespace ito
116 
117 
118 #endif
119 
120 #endif
Class for managing status values (like errors or warning)
Definition: retVal.h:54
Definition: apiFunctionsGraph.cpp:39