itom  4.1.0
pythonFigure.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 PYTHONFIGURE_H
24 #define PYTHONFIGURE_H
25 
26 #include "pythonCommon.h"
27 #include "pythonUi.h"
28 #include "pythonQtConversion.h"
29 #include "pythonQtSignalMapper.h"
30 #include "pythonItomMetaObject.h"
31 
32 #include <qstring.h>
33 #include <qvariant.h>
34 #include <qobject.h>
35 #include <qhash.h>
36 #include <qsharedpointer.h>
37 #include <qpointer.h>
38 
39 namespace ito
40 {
41 
43 {
44 public:
45 
46  //#################################################################################################
47  // Figure
48  //#################################################################################################
49 
50  //-------------------------------------------------------------------------------------------------
51  // typedefs
52  //-------------------------------------------------------------------------------------------------
53 
54  typedef struct
55  {
56  PythonUi::PyUiItem uiItem;
57  QSharedPointer<unsigned int> guardedFigHandle;
58  int rows;
59  int cols;
60  int currentSubplotIdx;
61  PythonQtSignalMapper *signalMapper;
62  }
63  PyFigure;
64 
65  //-------------------------------------------------------------------------------------------------
66  // macros
67  //-------------------------------------------------------------------------------------------------
68  #define PyFigure_Check(op) PyObject_TypeCheck(op, &ito::PythonFigure::PyFigureType)
69 
70  //-------------------------------------------------------------------------------------------------
71  // constructor, deconstructor, alloc, dellaoc
72  //-------------------------------------------------------------------------------------------------
73  static void PyFigure_dealloc(PyFigure *self);
74  static PyObject *PyFigure_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
75  static int PyFigure_init(PyFigure *self, PyObject *args, PyObject *kwds);
76 
77  //-------------------------------------------------------------------------------------------------
78  // general members
79  //-------------------------------------------------------------------------------------------------
80  static PyObject* PyFigure_repr(PyFigure *self);
81  static PyObject* PyFigure_show(PyFigure *self, PyObject *args);
82  static PyObject* PyFigure_hide(PyFigure *self);
83  static PyObject* PyFigure_plot(PyFigure *self, PyObject *args, PyObject *kwds);
84  static PyObject* PyFigure_plot1(PyFigure *self, PyObject *args, PyObject *kwds);
85  static PyObject* PyFigure_plot2(PyFigure *self, PyObject *args, PyObject *kwds);
86  static PyObject* PyFigure_plot25(PyFigure *self, PyObject *args, PyObject *kwds);
87  static PyObject* PyFigure_liveImage(PyFigure *self, PyObject *args, PyObject *kwds);
88  static PyObject* PyFigure_matplotlib(PyFigure *self, PyObject *args, PyObject *kwds);
89 
90  static PyObject* PyFigure_getSubplot(PyFigure *self, PyObject *args);
91 
92  //-------------------------------------------------------------------------------------------------
93  // getter / setter
94  //-------------------------------------------------------------------------------------------------
95  static PyObject* PyFigure_getHandle(PyFigure *self, void *closure);
96  static PyObject* PyFigure_getDocked(PyFigure *self, void *closure);
97  static int PyFigure_setDocked(PyFigure *self, PyObject *value, void *closure);
98 
99  //-------------------------------------------------------------------------------------------------
100  // static members
101  //-------------------------------------------------------------------------------------------------
102  static PyObject* PyFigure_close(PyFigure *self, PyObject *args);
103 
104  //-------------------------------------------------------------------------------------------------
105  // type structures
106  //-------------------------------------------------------------------------------------------------
107  static PyGetSetDef PyFigure_getseters[];
108  static PyMemberDef PyFigure_members[];
109  static PyMethodDef PyFigure_methods[];
110  static PyTypeObject PyFigureType;
111  static PyModuleDef PyFigureModule;
112  static void PyFigure_addTpDict(PyObject *tp_dict);
113 
114 private:
115 
116 };
117 
118 }; //end namespace ito
119 
120 
121 #endif
Definition: apiFunctionsGraph.cpp:39
Definition: pythonFigure.h:42
Definition: pythonFigure.h:54
This class provides the possibility to redirect any signal emitted in an user-defined GUI to differen...
Definition: pythonQtSignalMapper.h:169
Definition: pythonUi.h:50