itom
Loading...
Searching...
No Matches
pythonAutoInterval.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität 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 PYTHONAUTOINTERVAL
24#define PYTHONAUTOINTERVAL
25
26/* includes */
27#ifndef Q_MOC_RUN
28 #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API //see numpy help ::array api :: Miscellaneous :: Importing the api (this line must before include global.h)
29 #define NO_IMPORT_ARRAY
30 #include "python/pythonWrapper.h"
31#endif
32
33#include "../../common/typeDefs.h"
34#include "../../common/interval.h"
35#include "../../common/qtMetaTypeDeclarations.h"
36#include "structmember.h"
37#include <qobject.h>
38
39namespace ito
40{
42 {
43
44 public:
45
46 //-------------------------------------------------------------------------------------------------
47 // typedefs
48 //-------------------------------------------------------------------------------------------------
49 typedef struct
50 {
51 PyObject_HEAD
52 ito::AutoInterval interval;
53 }
55
56
57 #define PyAutoInterval_Check(op) PyObject_TypeCheck(op, &ito::PythonAutoInterval::PyAutoIntervalType)
58
59
60 //-------------------------------------------------------------------------------------------------
61 // constructor, deconstructor, alloc, dellaoc
62 //-------------------------------------------------------------------------------------------------
63
64 static void PyAutoInterval_dealloc(PyAutoInterval *self);
65 static PyObject *PyAutoInterval_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
66 static int PyAutoInterval_init(PyAutoInterval *self, PyObject *args, PyObject *kwds);
67
68 static PyAutoInterval* createEmptyPyAutoInterval();
69
70
71 //-------------------------------------------------------------------------------------------------
72 // general members
73 //-------------------------------------------------------------------------------------------------
74 static PyObject *PyAutoInterval_name(PyAutoInterval *self);
75
76 static PyObject* PyAutoInterval_repr(PyAutoInterval *self);
77
78 static PyObject* PyAutoInterval_RichCompare(PyAutoInterval *self, PyObject *other, int cmp_op);
79
80 static PyGetSetDef PyAutoInterval_getseters[];
81
82 static PyObject* PyAutoInterval_getValue(PyAutoInterval *self, void *closure);
83 static int PyAutoInterval_setValue(PyAutoInterval *self, PyObject *value, void *closure);
84
85 static PyObject* PyAutoInterval_Reduce(PyAutoInterval *self, PyObject *args);
86 static PyObject* PyAutoInterval_SetState(PyAutoInterval *self, PyObject *args);
87
88 //-------------------------------------------------------------------------------------------------
89 // getter / setter
90 //-------------------------------------------------------------------------------------------------
91 static PyObject* PyAutoInterval_getMin(PyAutoInterval *self, void *closure);
92 static int PyAutoInterval_setMin(PyAutoInterval *self, PyObject *value, void *closure);
93
94 static PyObject* PyAutoInterval_getMax(PyAutoInterval *self, void *closure);
95 static int PyAutoInterval_setMax(PyAutoInterval *self, PyObject *value, void *closure);
96
97 static PyObject* PyAutoInterval_getAuto(PyAutoInterval *self, void *closure);
98 static int PyAutoInterval_setAuto(PyAutoInterval *self, PyObject *value, void *closure);
99
100
101 //-------------------------------------------------------------------------------------------------
102 // type structures
103 //-------------------------------------------------------------------------------------------------
104 static PyMemberDef PyAutoInterval_members[];
105 static PyMethodDef PyAutoInterval_methods[];
106 static PyTypeObject PyAutoIntervalType;
107 static PyModuleDef PyAutoIntervalModule;
108
109 //-------------------------------------------------------------------------------------------------
110 // helper methods
111 //-------------------------------------------------------------------------------------------------
112
113 //-------------------------------------------------------------------------------------------------
114 // static type methods
115 //-------------------------------------------------------------------------------------------------
116
117
118};
119
120} //end namespace ito
121
122#endif
class for a interval type containing a min-max-range and an auto-flag.
Definition interval.h:50
Definition pythonAutoInterval.h:42
Definition apiFunctionsGraph.cpp:40
Definition pythonAutoInterval.h:50