itom
Loading...
Searching...
No Matches
itomParamManager.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 and its software development toolkit (SDK).
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 In addition, as a special exception, the Institut für Technische
15 Optik (ITO) gives you certain additional rights.
16 These rights are described in the ITO LGPL Exception version 1.0,
17 which can be found in the file LGPL_EXCEPTION.txt in this package.
18
19 itom is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22 General Public Licence for more details.
23
24 You should have received a copy of the GNU Library General Public License
25 along with itom. If not, see <http://www.gnu.org/licenses/>.
26*********************************************************************** */
27
28
29#ifndef ITOMPARAMMANAGER_H
30#define ITOMPARAMMANAGER_H
31
32#include "qtpropertybrowser.h"
33#include "common/param.h"
34#include "common/paramMeta.h"
35
36#include <qicon.h>
37
38namespace ito
39{
40
41class AbstractParamPropertyManagerPrivate;
42
43/*
44Abstract base class for all property managers that are responsible for ito::Param values.
45*/
47{
48 Q_OBJECT
49public:
50 AbstractParamPropertyManager(QObject *parent = 0);
52
53 const ito::ParamBase &paramBase(const QtProperty *property) const;
54 const ito::Param &param(const QtProperty *property) const;
55
56public Q_SLOTS:
57 virtual void setParam(QtProperty *property, const ito::Param &param) = 0;
58
59protected:
60 virtual QString valueText(const QtProperty *property) const;
61 virtual QIcon valueIcon(const QtProperty *property) const;
62 virtual void initializeProperty(QtProperty *property) = 0;
63 virtual void uninitializeProperty(QtProperty *property);
64
66
67private:
68 Q_DECLARE_PRIVATE(AbstractParamPropertyManager)
69 Q_DISABLE_COPY(AbstractParamPropertyManager)
70};
71
72
73/*
74Property Manager for parameters of type ito::ParamBase::Int
75*/
77{
78 Q_OBJECT
79public:
80 ParamIntPropertyManager(QObject *parent = 0);
82
83protected:
84 QString valueText(const QtProperty *property) const;
85 QIcon valueIcon(const QtProperty *property) const;
86 void initializeProperty(QtProperty *property);
87
88Q_SIGNALS:
89 void valueChanged(QtProperty *property, int val);
90 void metaChanged(QtProperty *property, ito::IntMeta meta);
91
92public Q_SLOTS:
93 void setParam(QtProperty *property, const ito::Param &param);
94 void setValue(QtProperty *property, int value);
95
96private:
97 Q_DISABLE_COPY(ParamIntPropertyManager)
98};
99
100/*
101Property Manager for parameters of type ito::ParamBase::Char
102*/
104{
105 Q_OBJECT
106public:
107 ParamCharPropertyManager(QObject *parent = 0);
109
110protected:
111 QString valueText(const QtProperty *property) const;
112 QIcon valueIcon(const QtProperty *property) const;
113 void initializeProperty(QtProperty *property);
114
115Q_SIGNALS:
116 void valueChanged(QtProperty *property, char val);
117 void metaChanged(QtProperty *property, ito::CharMeta meta);
118
119public Q_SLOTS:
120 void setParam(QtProperty *property, const ito::Param &param);
121 void setValue(QtProperty *property, char value);
122
123private:
124 Q_DISABLE_COPY(ParamCharPropertyManager)
125};
126
127/*
128Property Manager for parameters of type ito::ParamBase::Double
129*/
131{
132 Q_OBJECT
133public:
134 ParamDoublePropertyManager(QObject *parent = 0);
136
137 bool hasPopupSlider() const;
138 void setPopupSlider(bool popup);
139
140protected:
141 QString valueText(const QtProperty *property) const;
142 QIcon valueIcon(const QtProperty *property) const;
143 void initializeProperty(QtProperty *property);
144
145Q_SIGNALS:
146 void valueChanged(QtProperty *property, double val);
147 void metaChanged(QtProperty *property, ito::DoubleMeta meta);
148
149public Q_SLOTS:
150 void setParam(QtProperty *property, const ito::Param &param);
151 void setValue(QtProperty *property, double value);
152
153private:
154 Q_DISABLE_COPY(ParamDoublePropertyManager)
155
156 bool m_popupSlider;
157};
158
159
160/*
161Property Manager for parameters of type ito::ParamBase::String
162*/
164{
165 Q_OBJECT
166public:
167 ParamStringPropertyManager(QObject *parent = 0);
169
170protected:
171 QString valueText(const QtProperty *property) const;
172 void initializeProperty(QtProperty *property);
173
174Q_SIGNALS:
175 void valueChanged(QtProperty *property, const QByteArray &value);
176 void metaChanged(QtProperty *property, ito::StringMeta meta);
177
178public Q_SLOTS:
179 void setParam(QtProperty *property, const ito::Param &param);
180 void setValue(QtProperty *property, const QByteArray &value);
181
182private:
183 Q_DISABLE_COPY(ParamStringPropertyManager)
184};
185
186/*
187Property Manager for parameters of type ito::ParamBase::Interval and ito::ParamBase::Range
188*/
190{
191 Q_OBJECT
192public:
193 ParamIntervalPropertyManager(QObject *parent = 0);
195
196protected:
197 QString valueText(const QtProperty *property) const;
198 void initializeProperty(QtProperty *property);
199
200Q_SIGNALS:
201 void valueChanged(QtProperty *property, int min, int max);
202 void metaChanged(QtProperty *property, ito::IntervalMeta meta);
203
204public Q_SLOTS:
205 void setParam(QtProperty *property, const ito::Param &param);
206 void setValue(QtProperty *property, int min, int max);
207
208private:
209 Q_DISABLE_COPY(ParamIntervalPropertyManager)
210};
211
212
214
215/*
216Property Manager for parameters of type ito::ParamBase::Rect
217*/
219{
220 Q_OBJECT
221public:
222 ParamRectPropertyManager(QObject *parent = 0);
224
225Q_SIGNALS:
226 void valueChanged(QtProperty *property, int left, int top, int width, int height);
227 void metaChanged(QtProperty *property, ito::RectMeta meta);
228
229public Q_SLOTS:
230 void setParam(QtProperty *property, const ito::Param &param);
231 void setValue(QtProperty *property, int left, int top, int width, int height);
232
233 ParamIntervalPropertyManager *subIntervalPropertyManager() const;
234
235protected:
236 QString valueText(const QtProperty *property) const;
237 void initializeProperty(QtProperty *property);
238 virtual void uninitializeProperty(QtProperty *property);
240
241private:
242 Q_DECLARE_PRIVATE(ParamRectPropertyManager)
243 Q_DISABLE_COPY(ParamRectPropertyManager)
244
245 Q_PRIVATE_SLOT(d_func(), void slotIntervalChanged(QtProperty *, int, int))
246 Q_PRIVATE_SLOT(d_func(), void slotPropertyDestroyed(QtProperty *))
247};
248
249
251
252/*
253Property Manager for parameters of type ito::ParamBase::CharArray
254*/
256{
257 Q_OBJECT
258public:
259 ParamCharArrayPropertyManager(QObject *parent = 0);
261
262 typedef char DataType;
263
264Q_SIGNALS:
265 void valueChanged(QtProperty *property, int num, const char* values);
266 void metaChanged(QtProperty *property, ito::CharArrayMeta meta);
267
268public Q_SLOTS:
269 void setParam(QtProperty *property, const ito::Param &param);
270 void setValue(QtProperty *property, int num, const char* values);
271
272 ParamCharPropertyManager *subPropertyManager() const;
273
274protected:
275 QString valueText(const QtProperty *property) const;
276 void initializeProperty(QtProperty *property);
277 virtual void uninitializeProperty(QtProperty *property);
279
280private:
281 Q_DECLARE_PRIVATE(ParamCharArrayPropertyManager)
282 Q_DISABLE_COPY(ParamCharArrayPropertyManager)
283
284 Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, char))
285 Q_PRIVATE_SLOT(d_func(), void slotPropertyDestroyed(QtProperty *))
286};
287
289
290/*
291Property Manager for parameters of type ito::ParamBase::IntArray
292*/
294{
295 Q_OBJECT
296public:
297 ParamIntArrayPropertyManager(QObject *parent = 0);
299
300 typedef int DataType;
301
302Q_SIGNALS:
303 void valueChanged(QtProperty *property, int num, const int* values);
304 void metaChanged(QtProperty *property, ito::IntArrayMeta meta);
305
306public Q_SLOTS:
307 void setParam(QtProperty *property, const ito::Param &param);
308 void setValue(QtProperty *property, int num, const int* values);
309
310 ParamIntPropertyManager *subPropertyManager() const;
311
312protected:
313 QString valueText(const QtProperty *property) const;
314 void initializeProperty(QtProperty *property);
315 virtual void uninitializeProperty(QtProperty *property);
317
318private:
319 Q_DECLARE_PRIVATE(ParamIntArrayPropertyManager)
320 Q_DISABLE_COPY(ParamIntArrayPropertyManager)
321
322 Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, int))
323 Q_PRIVATE_SLOT(d_func(), void slotPropertyDestroyed(QtProperty *))
324};
325
327
328/*
329Property Manager for parameters of type ito::ParamBase::DoubleArray
330*/
332{
333 Q_OBJECT
334public:
335 ParamDoubleArrayPropertyManager(QObject *parent = 0);
337
338 typedef double DataType;
339
340Q_SIGNALS:
341 void valueChanged(QtProperty *property, int num, const double* values);
342 void metaChanged(QtProperty *property, ito::DoubleArrayMeta meta);
343
344public Q_SLOTS:
345 void setParam(QtProperty *property, const ito::Param &param);
346 void setValue(QtProperty *property, int num, const double* values);
347
348 ParamDoublePropertyManager *subPropertyManager() const;
349
350protected:
351 QString valueText(const QtProperty *property) const;
352 void initializeProperty(QtProperty *property);
353 virtual void uninitializeProperty(QtProperty *property);
355
356private:
357 Q_DECLARE_PRIVATE(ParamDoubleArrayPropertyManager)
358 Q_DISABLE_COPY(ParamDoubleArrayPropertyManager)
359
360 Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, double))
361 Q_PRIVATE_SLOT(d_func(), void slotPropertyDestroyed(QtProperty *))
362};
363
365
366/*
367Property Manager for parameters of type ito::ParamBase::StringList
368*/
370{
371 Q_OBJECT
372public:
373 ParamStringListPropertyManager(QObject *parent = 0);
375
376 typedef ito::ByteArray DataType;
377
378Q_SIGNALS:
379 void valueChanged(QtProperty *property, int num, const ito::ByteArray* values);
380 void metaChanged(QtProperty *property, ito::StringListMeta meta);
381
382public Q_SLOTS:
383 void setParam(QtProperty *property, const ito::Param &param);
384 void setValue(QtProperty *property, int num, const ito::ByteArray* values);
385
386 ParamStringPropertyManager *subPropertyManager() const;
387
388protected:
389 QString valueText(const QtProperty *property) const;
390 void initializeProperty(QtProperty *property);
391 virtual void uninitializeProperty(QtProperty *property);
393
394private:
395 Q_DECLARE_PRIVATE(ParamStringListPropertyManager)
396 Q_DISABLE_COPY(ParamStringListPropertyManager)
397
398 Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QByteArray &))
399 Q_PRIVATE_SLOT(d_func(), void slotPropertyDestroyed(QtProperty *))
400};
401
402/*
403Property Manager for parameters of type ito::ParamBase::HWRef, ito::ParamBase::DObjPtr,
404ito::ParamBase::PolygonMeshPtr, ito::ParamBase::PointCloudPtr, ito::ParamBase::PointPtr
405*/
407{
408 Q_OBJECT
409public:
410 ParamOtherPropertyManager(QObject *parent = 0);
412
413protected:
414 QString valueText(const QtProperty *property) const;
415 void initializeProperty(QtProperty *property);
416
417public Q_SLOTS:
418 void setParam(QtProperty *property, const ito::Param &param);
419
420private:
421 Q_DISABLE_COPY(ParamOtherPropertyManager)
422};
423
424
425
426} //end namespace ito
427
428#endif
The QtAbstractPropertyManager provides an interface for property managers.
Definition qtpropertybrowser.h:102
The QtProperty class encapsulates an instance of a property.
Definition qtpropertybrowser.h:61
Definition itomParamManager.h:47
virtual void initializeProperty(QtProperty *property)=0
Definition itomParamManager.cpp:47
This is a Qt-free class for byte arrays (strings) without specific encoding information.
Definition byteArray.h:65
Meta-information for Param of type CharArrayMeta.
Definition paramMeta.h:733
meta-information for Param of type Char.
Definition paramMeta.h:160
Meta-information for Param of type DoubleArrayMeta.
Definition paramMeta.h:787
Meta-information for ito::Param of type Double.
Definition paramMeta.h:346
Definition paramMeta.h:760
Meta-information for Param of type Int.
Definition paramMeta.h:253
Meta-information for Param of type IntArrayMeta that represent an interval [minimum,...
Definition paramMeta.h:957
<
Definition param.h:95
Definition itomParamManager.h:256
Definition itomParamManager.cpp:1139
Definition itomParamManager.h:104
Definition itomParamManager.h:332
Definition itomParamManager.cpp:1696
Definition itomParamManager.h:131
class for parameter handling e.g. to pass parameters to plugins
Definition param.h:477
Definition itomParamManager.h:294
Definition itomParamManager.cpp:1419
Definition itomParamManager.h:77
Definition itomParamManager.h:190
Definition itomParamManager.h:407
Definition itomParamManager.h:219
Definition itomParamManager.cpp:904
Definition itomParamManager.h:370
Definition itomParamManager.cpp:1973
Definition itomParamManager.h:164
Meta-information for Param of type IntArrayMeta that represent a rectangle (left, top,...
Definition paramMeta.h:1068
Meta-information for Param of type STringListMeta.
Definition paramMeta.h:890
Meta-information for Param of type String.
Definition paramMeta.h:527
Definition apiFunctionsGraph.cpp:40
PyObject * setParam(ito::AddInBase *addInObj, PyObject *args)
Definition pythonPlugins.cpp:1249