itom
Loading...
Searching...
No Matches
uiOrganizer.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 UIORGANIZER_H
24#define UIORGANIZER_H
25
26//#include "../python/pythonQtConversion.h"
27#include "../python/pythonItomMetaObject.h"
28
29#include <qwidget.h>
30
31#include "../common/sharedStructuresQt.h"
32#include "../common/functionCancellationAndObserver.h"
33
34#include "../DataObject/dataobj.h"
35#if ITOM_POINTCLOUDLIBRARY > 0
36#include "../../PointCloud/pclStructures.h"
37#endif
38
39#include "../widgets/userUiDialog.h"
40#include "../widgets/figureWidget.h"
41
42#include "../global.h"
43#include "../common/sharedStructuresGraphics.h"
44#include "../common/addInInterface.h"
45#include "../common/shape.h"
46
47#include "../../plot/AbstractFigure.h"
48
49#include <qmap.h>
50#include <qsharedpointer.h>
51#include <qstring.h>
52#include <qvariant.h>
53#include <qhash.h>
54#include <qtimer.h>
55#include <qfiledialog.h>
56#include <qmainwindow.h>
57#include <qthread.h>
58#include <qtranslator.h>
59#include <qpoint.h>
60#include <qsize.h>
61
62class QUiLoader; //forward declaration
63
64namespace ito
65{
66class WidgetWrapper; //forward declaration
67class TimerModel; //forward declaration
68
75{
76public:
77 enum tUiType
78 {
79 uiTypeUiDialog = 0x0001,
80 uiTypeQDialog = 0x0002,
81 uiTypeQMainWindow = 0x0003,
82 uiTypeQDockWidget = 0x0004,
83 uiTypeFigure = 0x0005,
84 uiTypeWidget = 0x0006
85 };
86
88
94 m_type(uiTypeUiDialog)
95 {
96 m_weakDialog = QPointer<QWidget>(uiDialog);
97 }
98
100
105 UiContainer(QDialog *dialog) :
106 m_type(uiTypeQDialog)
107 {
108 m_weakDialog = QPointer<QDialog>(dialog);
109 }
110
112
117 UiContainer(QMainWindow *mainWindow) :
118 m_type(uiTypeQMainWindow)
119 {
120 m_weakDialog = QPointer<QWidget>(mainWindow);
121 }
122
124
129 UiContainer(FigureWidget *figureWidget) :
130 m_type(uiTypeFigure)
131 {
132 m_weakDialog = QPointer<QWidget>(figureWidget);
133 }
134
136
141 UiContainer(QDockWidget *dockWidget) :
142 m_type(uiTypeQDockWidget)
143 {
144 m_weakDialog = QPointer<QWidget>(dockWidget);
145 }
146
148
154 UiContainer(QWidget *widget, tUiType type) :
155 m_type(type)
156 {
157 m_weakDialog = QPointer<QWidget>(widget);
158 }
159
162 {
163 m_weakDialog = QPointer<QWidget>(cpy.getUiWidget());
164 m_type = cpy.m_type;
165 }
166
167
168 ~UiContainer(); //comment in source file
169
170
172 inline UserUiDialog *getUiDialog() const
173 {
174 if(m_type == uiTypeUiDialog)
175 {
176 if(m_weakDialog.isNull()) return NULL;
177 return qobject_cast<UserUiDialog*>(m_weakDialog.data());
178 }
179 return NULL;
180 }
181
183
187 inline QWidget *getUiWidget() const
188 {
189 if(m_weakDialog.isNull()) return NULL;
190 return m_weakDialog.data();
191 }
192
194 inline tUiType getType() const { return m_type; }
195
196private:
197 QPointer<QWidget> m_weakDialog;
199};
200
202{
203public:
204 UiContainerItem() : container(NULL) {}
205
207 {
208 guardedHandle = cpy.guardedHandle;
209 container = cpy.container;
210 }
211
212 QWeakPointer< unsigned int > guardedHandle;
213 UiContainer *container;
214};
215
217{
218private:
219 ito::ParamBase::Type m_dataType;
220 QSharedPointer<ito::DataObject> m_dObjPtr;
221#if ITOM_POINTCLOUDLIBRARY > 0
222 QSharedPointer<ito::PCLPointCloud> m_dPCPtr;
223 QSharedPointer<ito::PCLPolygonMesh> m_dPMPtr;
224#endif
225
226public:
227 UiDataContainer() : m_dataType(ito::ParamBase::DObjPtr) {};
228 ~UiDataContainer() {};
229 UiDataContainer(const QSharedPointer<ito::DataObject> &sharedDataObject) : m_dataType(ito::ParamBase::DObjPtr), m_dObjPtr(sharedDataObject) {}
230#if ITOM_POINTCLOUDLIBRARY > 0
231 UiDataContainer(const QSharedPointer<ito::PCLPointCloud> &sharedPointCloud) : m_dataType(ito::ParamBase::PointCloudPtr), m_dPCPtr(sharedPointCloud) {}
232 UiDataContainer(const QSharedPointer<ito::PCLPolygonMesh> &sharedPolygonMesh) : m_dataType(ito::ParamBase::PolygonMeshPtr), m_dPMPtr(sharedPolygonMesh) {}
233
234 inline UiDataContainer & operator = (QSharedPointer<ito::PCLPointCloud> sharedPointCloud)
235 {
237 m_dPCPtr = sharedPointCloud;
238 m_dObjPtr.clear();
239 m_dPMPtr.clear();
240 return *this;
241 }
242
243 inline UiDataContainer & operator = (QSharedPointer<ito::PCLPolygonMesh> sharedPolygonMesh)
244 {
246 m_dPMPtr = sharedPolygonMesh;
247 m_dObjPtr.clear();
248 m_dPCPtr.clear();
249 return *this;
250 }
251#endif
252
253 inline UiDataContainer & operator = (QSharedPointer<ito::DataObject> sharedDataObject)
254 {
255 m_dataType = ito::ParamBase::DObjPtr;
256 m_dObjPtr = sharedDataObject;
257#if ITOM_POINTCLOUDLIBRARY > 0
258 m_dPCPtr.clear();
259 m_dPMPtr.clear();
260#endif
261 return *this;
262 }
263
264 inline ito::ParamBase::Type getType() const { return m_dataType; }
265 inline QSharedPointer<ito::DataObject> getDataObject() const { return m_dObjPtr; }
266#if ITOM_POINTCLOUDLIBRARY > 0
267 inline QSharedPointer<ito::PCLPointCloud> getPointCloud() const { return m_dPCPtr; }
268 inline QSharedPointer<ito::PCLPolygonMesh> getPolygonMesh() const { return m_dPMPtr; }
269#endif
270};
271
273{
274 enum Type {TypeClassInfo, TypeSlot, TypeSignal, TypeProperty, TypeEnum, TypeFlag, TypeInheritance};
276 Type type,
277 const QString& name,
278 const QString& shortDescription = "",
279 const QString& description = "",
280 const QString& signature = "") :
281 m_type(type),
282 m_name(name), m_shortDescription(shortDescription), m_description(description),
283 m_signature(signature)
284 {
285 if (m_description == "")
286 {
287 m_description = m_shortDescription;
288 }
289 }
290
291 Type m_type;
292 QString m_name;
293 QString m_shortDescription;
294 QString m_description;
295 QString m_signature;
296};
297
298} // namespace ito
299
300namespace ito {
301
302class UiOrganizer : public QObject
303{
304 Q_OBJECT
305public:
307 {
308 propValid = 0x0001,
309 propConstant = 0x0002,
310 propFinal = 0x0004,
311 propReadable = 0x0008,
312 propWritable = 0x0010,
313 propResettable = 0x0020
314 };
315
317 {
318 errorUiHandleInvalid = 0x1001,
319 errorObjDoesNotExist = 0x1002,
320 errorObjPropWrite = 0x1003,
321 errorObjPropRead = 0x1004,
322 errorObjPropDoesNotExist = 0x1005,
323 errorUnregisteredType = 0x1006,
324 errorSlotDoesNotExist = 0x1007,
325 errorSignalDoesNotExist = 0x1008,
326 errorConnectionError = 0x1009
327 };
328
330 {
331 typeDialog = 0x0000,
332 typeMainWindow = 0x0001,
333 typeDockWidget = 0x0002,
334 typeCentralWidget = 0x0003
335 };
336
337 enum tObjectInfo
338 {
339 infoShowNoInheritance = 0x0001,
340 infoShowItomInheritance = 0x0002,
341 infoShowInheritanceUpToWidget = 0x0004,
342 infoShowAllInheritance =0x0008
343 };
344
345 typedef QList<ClassInfoContainer> ClassInfoContainerList;
346
347 UiOrganizer(ito::RetVal &retval);
348 ~UiOrganizer();
349
350 void showDialog(QWidget *parent);
351 inline QObject *getPluginReference(unsigned int objectID) { return getWeakObjectReference(objectID); }
352
353 static inline void parseUiDescription(int uiDescription, int* uiType = NULL, int* buttonBarType = NULL, bool* childOfMainWindow = NULL, bool* deleteOnClose = NULL, int* dockWidgetArea = NULL)
354 {
355 if(uiType) *uiType = (uiDescription & 0x000000FF); //bits 1-8
356 if(buttonBarType) *buttonBarType = ((uiDescription & 0x0000FF00) >> 8); //bits 9-16
357 if(childOfMainWindow) *childOfMainWindow = ((uiDescription & 0x000F0000) > 0); //bits 17-20
358 if(deleteOnClose) *deleteOnClose = ((uiDescription & 0x00F00000) > 0); //bits 21-24
359 if(dockWidgetArea) *dockWidgetArea = ((uiDescription & 0xFF000000) >> 24); //bits 25-32
360 }
361
362 static inline int createUiDescription(int uiType, int buttonBarType, bool childOfMainWindow, bool deleteOnClose, int dockWidgetArea)
363 {
364 int v = uiType & 0x000000FF; //bits 1-8
365 v += (buttonBarType << 8); //bits 9-16
366 if(childOfMainWindow) v += (1 << 16); //bits 17-24
367 if(deleteOnClose) v+= (1 << 20); //bits 21-24
368 v += (dockWidgetArea << 24); //bits 25-32
369
370 return v;
371 }
372
373 RetVal getNewPluginWindow(const QString &pluginName, unsigned int &objectID, QWidget** newWidget, QWidget *parent = NULL);
374
375 QWidget* loadDesignerPluginWidget(const QString &name, RetVal &retValue, AbstractFigure::WindowMode winMode, QWidget *parent = NULL);
376
377 QWidget* createWidget(const QString &className, RetVal &retValue, QWidget *parent = NULL, const QString &objectName = QString());
378
380 QWidget* loadUiFile(const QString &filename, RetVal &retValue, QWidget *parent = NULL, const QString &objectNameSuffix = QString());
381
382 TimerModel* getTimerModel() const;
383
384protected:
385
386 //static void threadSafeDeleteUi(unsigned int *handle);
387
388 void startGarbageCollectorTimer();
389
390 RetVal addWidgetToOrganizer(QWidget *widget, int uiDescription, const StringMap &dialogButtons,
391 QSharedPointer<unsigned int>dialogHandle,
392 QSharedPointer<unsigned int> objectID,
393 QSharedPointer<QByteArray> className);
394
395private:
397
398 unsigned int addObjectToList(QObject* objPtr);
399 QObject *getWeakObjectReference(unsigned int objectID);
400
401 QByteArray getReadableMethodSignature(const QMetaMethod &method, bool pythonNotCStyle, QByteArray *methodName = NULL, bool *valid = NULL);
402 QByteArray getReadableParameter(const QByteArray &parameter, bool pythonNotCStyle, bool *valid = NULL);
403 ito::UiOrganizer::ClassInfoContainerList::Iterator parseMetaPropertyForEnumerationTypes(const QMetaProperty &meth, ClassInfoContainerList &currentPropList);
404
405 void timerEvent(QTimerEvent *event);
406
409 QHash<unsigned int, UiContainerItem> m_dialogList;
410 QHash<unsigned int, QPointer<QObject> > m_objectList;
412 QMap<QObject*, QThread*> m_watcherThreads;
414 static unsigned int autoIncUiDialogCounter;
415 static unsigned int autoIncObjectCounter;
417 void setApiPointersToWidgetAndChildren(QWidget *widget);
418 //moved the uiLoader object to here from loadDesignerPluginWidget and createNewDialog methods as according
419 //to valgrind it causes memory leaks. So better have only one instance created and maintain mem leaks low ;-)
420 QUiLoader *m_pUiLoader;
421 QHash<QString, QTranslator*> m_transFiles;
422 TimerModel *m_pTimerModel;
423
424signals:
425
426public slots:
427 void pythonKeyboardInterrupt(bool checked);
428
429 RetVal loadPluginWidget(void* algoWidgetFunc, int uiDescription, const StringMap &dialogButtons, QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, QSharedPointer<unsigned int>dialogHandle, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> className, ItomSharedSemaphore *semaphore = NULL);
430 RetVal createNewDialog(const QString &filename, int uiDescription, const StringMap &dialogButtons, QSharedPointer<unsigned int> dialogHandle, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> className, ItomSharedSemaphore *semaphore = NULL);
431 RetVal deleteDialog(unsigned int handle, ItomSharedSemaphore *semaphore = NULL);
432 RetVal showDialog(unsigned int handle, int modalLevel, QSharedPointer<int> retCodeIfModal, ItomSharedSemaphore *semaphore = NULL);
433 RetVal hideDialog(unsigned int handle, ItomSharedSemaphore *semaphore = NULL);
434 RetVal setAttribute(unsigned int handle, Qt::WidgetAttribute attribute, bool on = true, ItomSharedSemaphore *semaphore = NULL);
435 RetVal isVisible(unsigned int handle, QSharedPointer<bool> visible, ItomSharedSemaphore *semaphore = NULL);
436 RetVal handleExist(unsigned int handle, QSharedPointer<bool> exist, ItomSharedSemaphore *semaphore = NULL);
437
438 UiContainer* getUiDialogByHandle(unsigned int uiHandle);
439
440 RetVal getDockedStatus(unsigned int uiHandle, QSharedPointer<bool> docked, ItomSharedSemaphore *semaphore = NULL);
441 RetVal setDockedStatus(unsigned int uiHandle, bool docked, ItomSharedSemaphore *semaphore = NULL);
442
443 RetVal showInputDialogGetDouble(unsigned int objectID, const QString &title, const QString &label, double defaultValue, QSharedPointer<bool> ok, QSharedPointer<double> value, double min = -2147483647, double max = 2147483647, int decimals = 1, ItomSharedSemaphore *semaphore = NULL );
444 RetVal showInputDialogGetInt(unsigned int objectID, const QString &title, const QString &label, int defaultValue, QSharedPointer<bool> ok, QSharedPointer<int> value, int min = -2147483647, int max = 2147483647, int step = 1, ItomSharedSemaphore *semaphore = NULL );
445 RetVal showInputDialogGetItem(unsigned int objectID, const QString &title, const QString &label, const QStringList &stringList, QSharedPointer<bool> ok, QSharedPointer<QString> value, int currentIndex = 0, bool editable = false, ItomSharedSemaphore *semaphore = NULL );
446 RetVal showInputDialogGetText(unsigned int objectID, const QString &title, const QString &label, const QString &defaultString, QSharedPointer<bool> ok, QSharedPointer<QString> value, ItomSharedSemaphore *semaphore = NULL );
447 RetVal showMessageBox(unsigned int objectID, int type, const QString &title, const QString &text, int buttons, int defaultButton, QSharedPointer<int> retButton, QSharedPointer<QString> retButtonText, ItomSharedSemaphore *semaphore = NULL );
448
449 RetVal showFileDialogExistingDir(unsigned int objectID, const QString &caption, QSharedPointer<QString> directory, int options = QFileDialog::ShowDirsOnly, ItomSharedSemaphore *semaphore = NULL); //options are of type QFileDialog::Options
450 RetVal showFileOpenDialog(unsigned int objectID, const QString &caption, const QString &directory, const QString &filter, QSharedPointer<QString> file, int selectedFilterIndex = 0, int options = 0, ItomSharedSemaphore *semaphore = NULL);
451 RetVal showFilesOpenDialog(unsigned int objectID, const QString &caption, const QString &directory, const QString &filter, QSharedPointer<QStringList> files, int selectedFilterIndex = 0, int options = 0, ItomSharedSemaphore *semaphore = NULL);
452 RetVal showFileSaveDialog(unsigned int objectID, const QString &caption, const QString &directory, const QString &filter, QSharedPointer<QString> file, int selectedFilterIndex = 0, int options = 0, ItomSharedSemaphore *semaphore = NULL);
453
454 RetVal exists(unsigned int objectID, QSharedPointer<bool> exists, ItomSharedSemaphore *semaphore = NULL);
455 RetVal getPropertyInfos(unsigned int objectID, QSharedPointer<QVariantMap> retPropertyMap, ItomSharedSemaphore *semaphore = NULL);
456 RetVal readProperties(unsigned int objectID, QSharedPointer<QVariantMap> properties, ItomSharedSemaphore *semaphore = NULL);
457 RetVal writeProperties(unsigned int objectID, const QVariantMap &properties, ItomSharedSemaphore *semaphore = NULL);
458 RetVal readProperties(unsigned int handle, const QString &widgetName, QSharedPointer<QVariantMap> properties, ItomSharedSemaphore *semaphore = NULL);
459 RetVal writeProperties(unsigned int handle, const QString &widgetName, const QVariantMap &properties, ItomSharedSemaphore *semaphore = NULL);
460 RetVal getAttribute(unsigned int objectID, int attributeNumber, QSharedPointer<bool> value, ItomSharedSemaphore *semaphore = NULL);
461 RetVal setAttribute(unsigned int objectID, int attributeNumber, bool value, ItomSharedSemaphore *semaphore = NULL);
462 RetVal getWindowFlags(unsigned int objectID, QSharedPointer<int> flags, ItomSharedSemaphore *semaphore = NULL);
463 RetVal setWindowFlags(unsigned int objectID, int flags, ItomSharedSemaphore *semaphore = NULL);
464 RetVal widgetMetaObjectCounts(unsigned int objectID, QSharedPointer<int> classInfoCount, QSharedPointer<int> enumeratorCount, QSharedPointer<int> methodCount, QSharedPointer<int> propertyCount, ItomSharedSemaphore *semaphore = NULL );
465
466 RetVal getChildObject(unsigned int uiHandle, const QString &objectName, QSharedPointer<unsigned int> objectID, ItomSharedSemaphore *semaphore = NULL);
467 RetVal getChildObject2(unsigned int parentObjectID, const QString &objectName, QSharedPointer<unsigned int> objectID, ItomSharedSemaphore *semaphore = NULL);
468 RetVal getChildObject3(unsigned int parentObjectID, const QString &objectName, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> widgetClassName, ItomSharedSemaphore *semaphore = NULL);
469 RetVal getLayout(unsigned int objectID, QSharedPointer<unsigned int> layoutObjectID, QSharedPointer<QByteArray> layoutClassName, QSharedPointer<QString> layoutObjectName, ItomSharedSemaphore *semaphore = NULL);
470 RetVal getSignalIndex(unsigned int objectID, const QByteArray &signalSignature, QSharedPointer<int> signalIndex, QSharedPointer<QObject*> objPtr, QSharedPointer<IntList> argTypes, ItomSharedSemaphore *semaphore = NULL);
471 RetVal callSlotOrMethod(bool slotNotMethod, unsigned int objectID, int slotOrMethodIndex, QSharedPointer<FctCallParamContainer> args, ItomSharedSemaphore *semaphore = NULL);
472
473 RetVal getObjectInfo(const QString &classname, bool pythonNotCStyle, ito::UiOrganizer::ClassInfoContainerList *objectInfo, ItomSharedSemaphore *semaphore = NULL);
474 RetVal getObjectInfo(const QObject *obj, int type, bool pythonNotCStyle, ito::UiOrganizer::ClassInfoContainerList* objectInfo, ItomSharedSemaphore *semaphore = NULL);
475
476 inline RetVal getObjectInfo(unsigned int objectID, int type, bool pythonNotCStyle, ito::UiOrganizer::ClassInfoContainerList *objectInfo, ItomSharedSemaphore *semaphore = NULL)
477 {
478 return getObjectInfo(getWeakObjectReference(objectID), type, pythonNotCStyle, objectInfo, semaphore);
479 }
480
481 RetVal getObjectAndWidgetName(unsigned int objectID, QSharedPointer<QByteArray> objectName, QSharedPointer<QByteArray> widgetClassName, ItomSharedSemaphore *semaphore = NULL);
482 RetVal getObjectChildrenInfo(unsigned int objectID, bool recursive, QSharedPointer<QStringList> objectNames, QSharedPointer<QStringList> classNames, ItomSharedSemaphore *semaphore = NULL);
483
484 RetVal getObjectID(const QObject *obj, QSharedPointer<unsigned int> objectID, ItomSharedSemaphore *semaphore = NULL);
485
486 RetVal connectWithKeyboardInterrupt(unsigned int objectID, const QByteArray &signalSignature, ItomSharedSemaphore *semaphore = NULL);
487 RetVal connectProgressObserverInterrupt(unsigned int objectID, const QByteArray &signalSignature, QPointer<QObject> progressObserver, ItomSharedSemaphore *semaphore = NULL);
488 RetVal getMethodDescriptions(unsigned int objectID, QSharedPointer<MethodDescriptionList> methodList, ItomSharedSemaphore *semaphore = NULL);
489
490 RetVal createFigure(QSharedPointer< QSharedPointer<unsigned int> > guardedFigureHandle, QSharedPointer<unsigned int> objectID, QSharedPointer<int> rows, QSharedPointer<int> cols, QPoint offset = QPoint(), QSize size = QSize(), ItomSharedSemaphore *semaphore = NULL);
491 RetVal getSubplot(QSharedPointer<unsigned int> figHandle, unsigned int subplotIndex, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> objectName, QSharedPointer<QByteArray> widgetClassName, ItomSharedSemaphore *semaphore = NULL);
492
493 RetVal figurePlot(ito::UiDataContainer &dataCont, ito::UiDataContainer &xAxisCont,QSharedPointer<unsigned int> figHandle, QSharedPointer<unsigned int> objectID, int areaRow, int areaCol, QString className, QVariantMap properties, ItomSharedSemaphore *semaphore = NULL);
494 RetVal figureLiveImage(AddInDataIO* dataIO, QSharedPointer<unsigned int> figHandle, QSharedPointer<unsigned int> objectID, int areaRow, int areaCol, QString className, QVariantMap properties, ItomSharedSemaphore *semaphore = NULL);
495 RetVal figureDesignerWidget(QSharedPointer<unsigned int> figHandle, QSharedPointer<unsigned int> objectID, int areaRow, int areaCol, QString className, QVariantMap properties, ItomSharedSemaphore *semaphore = NULL);
496 void figureAssureMinimalSize(ito::FigureWidget* fig);
497
498 RetVal figureClose(unsigned int figHandle, ItomSharedSemaphore *semaphore = NULL);
499 RetVal closeAllFloatableFigures(ItomSharedSemaphore *semaphore = NULL);
500 RetVal figureShow(const unsigned int& handle = 0, ItomSharedSemaphore *semaphore = NULL);
501 RetVal figureMinimizeAll(ItomSharedSemaphore *semaphore = NULL);
502 RetVal figurePickPoints(unsigned int objectID, QSharedPointer<QVector<ito::Shape> > shapes, int maxNrPoints, ItomSharedSemaphore *semaphore);
503 RetVal figureDrawGeometricShapes(unsigned int objectID, QSharedPointer<QVector<ito::Shape> > shapes, int shapeType, int maxNrElements, ItomSharedSemaphore *semaphore);
504 RetVal figurePickPointsInterrupt(unsigned int objectID);
505 RetVal isFigureItem(unsigned int objectID, QSharedPointer<unsigned int> isFigureItem, ItomSharedSemaphore *semaphore);
506 RetVal getAllAvailableHandles(QSharedPointer<QList<unsigned int> > list, ItomSharedSemaphore *semaphore = NULL);
507 RetVal getPlotWindowTitlebyHandle(const unsigned int& objectID, QSharedPointer<QString> title, ItomSharedSemaphore * semaphore = NULL);
508
509 RetVal connectWidgetsToProgressObserver(bool hasProgressBar, unsigned int progressBarObjectID, bool hasLabel, unsigned int labelObjectID, QSharedPointer<ito::FunctionCancellationAndObserver> progressObserver, ItomSharedSemaphore *semaphore);
510
511 RetVal getAvailableWidgetNames(QSharedPointer<QStringList> widgetNames, ItomSharedSemaphore *semaphore);
512
513 RetVal registerActiveTimer(const QWeakPointer<QTimer> &timer, const QString &name);
514
515 RetVal copyStringToClipboard(const QString &text, ItomSharedSemaphore *semaphore);
516
517 void figureDestroyed(QObject *obj);
518
519private slots:
520 void watcherThreadFinished();
521
522};
523
524} //namespace ito
525
526Q_DECLARE_METATYPE(ito::UiOrganizer::ClassInfoContainerList*)
527
528#endif
semaphore which can be used for asynchronous thread communication. By using this class it is possible...
Definition sharedStructuresQt.h:58
base class for all dataIO plugin classes
Definition addInInterface.h:662
Definition figureWidget.h:47
Type
Definition param.h:142
@ PointCloudPtr
point parameter (pointer, no auto-safe possible)
Definition param.h:182
@ DObjPtr
string parameter
Definition param.h:161
@ PolygonMeshPtr
list of strings, given as ito::ByteArray
Definition param.h:188
Class for managing status values (like errors or warning)
Definition retVal.h:54
model for management of all timer objects. This model will be is used as model for the view in the ti...
Definition timerModel.h:42
Definition uiOrganizer.h:217
The UiOrganizer is started as singleton instance within itom and organizes all main windows,...
Definition uiOrganizer.h:303
QHash< unsigned int, QPointer< QObject > > m_objectList
Definition uiOrganizer.h:410
QWidget * createWidget(const QString &className, RetVal &retValue, QWidget *parent=NULL, const QString &objectName=QString())
loads a widget from an ui file (including its optional translation) and returns it.
Definition uiOrganizer.cpp:1002
tWinType
Definition uiOrganizer.h:330
tErrorCode
Definition uiOrganizer.h:317
WidgetWrapper * m_widgetWrapper
Definition uiOrganizer.h:407
int m_garbageCollectorTimer
Definition uiOrganizer.h:411
void execGarbageCollection()
executes the garbage collection process
Definition uiOrganizer.cpp:190
TimerModel * getTimerModel() const
returns the timer model that organizes all registered QTimer objects
Definition uiOrganizer.cpp:4249
UiOrganizer(ito::RetVal &retval)
constructor
Definition uiOrganizer.cpp:114
QMap< QObject *, QThread * > m_watcherThreads
Definition uiOrganizer.h:412
void timerEvent(QTimerEvent *event)
method, called by garbage collection timer, in order to regularly start the garbage collection proces...
Definition uiOrganizer.cpp:268
QHash< unsigned int, UiContainerItem > m_dialogList
Definition uiOrganizer.h:409
unsigned int addObjectToList(QObject *objPtr)
adds a given QObject* pointer to m_objectList if not yet available.
Definition uiOrganizer.cpp:233
static unsigned int autoIncUiDialogCounter
Definition uiOrganizer.h:414
RetVal registerActiveTimer(const QWeakPointer< QTimer > &timer, const QString &name)
registerActiveTimer can be used to register a running timer instance for the 'active timer dialog' of...
Definition uiOrganizer.cpp:4227
~UiOrganizer()
destructor
Definition uiOrganizer.cpp:147
static unsigned int autoIncObjectCounter
Definition uiOrganizer.h:415
tPropertyFlags
Definition uiOrganizer.h:307
RetVal getAllAvailableHandles(QSharedPointer< QList< unsigned int > > list, ItomSharedSemaphore *semaphore=NULL)
getAllAvailableHandles ruturns all available figure handles
Definition uiOrganizer.cpp:4263
Definition userUiDialog.h:45
One instance of this class acts as wrapper for several import public methods of classes,...
Definition widgetWrapper.h:56
Definition apiFunctionsGraph.cpp:40
Definition uiOrganizer.h:273
Every instance of this class contains information about one user interface (main window,...
Definition uiOrganizer.h:75
UserUiDialog * getUiDialog() const
returns instance of UiDialog or NULL, if the widget is not longer available of the type is not uiType...
Definition uiOrganizer.h:172
UiContainer(QMainWindow *mainWindow)
creates new UiContainer from instance of QMainWindow
Definition uiOrganizer.h:117
UiContainer(FigureWidget *figureWidget)
creates new UiContainer from instance of QMainWindow
Definition uiOrganizer.h:129
tUiType getType() const
returns type of the guarded user interface
Definition uiOrganizer.h:194
UiContainer(QWidget *widget, tUiType type)
general constructor to create an instance of UiContainer from given QWidget*-pointer and type
Definition uiOrganizer.h:154
tUiType
Definition uiOrganizer.h:78
QWidget * getUiWidget() const
returns instance of Widget or NULL, if the widget is not longer available.
Definition uiOrganizer.h:187
tUiType m_type
Definition uiOrganizer.h:198
QPointer< QWidget > m_weakDialog
Definition uiOrganizer.h:197
UiContainer(const UiContainer &cpy)
copy constructor
Definition uiOrganizer.h:161
UiContainer(UserUiDialog *uiDialog)
creates new UiContainer from instance of dialog-widget UserUiDialog
Definition uiOrganizer.h:93
~UiContainer()
destructor
Definition uiOrganizer.cpp:70
UiContainer(QDialog *dialog)
creates new UiContainer from instance of QDialog
Definition uiOrganizer.h:105
UiContainer(QDockWidget *dockWidget)
creates new UiContainer from instance of QDockWidget
Definition uiOrganizer.h:141
Definition uiOrganizer.h:202