Developer Documentation
Core.hh
Go to the documentation of this file.
1/*===========================================================================*\
2* *
3* OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39* *
40\*===========================================================================*/
41
42
43
44
45
46
47//=============================================================================
48//
49// CLASS Core
50//
51//=============================================================================
52
58#ifndef MVIEWWIDGET_HH
59#define MVIEWWIDGET_HH
60
61
62//== INCLUDES =================================================================
63
64#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
65
66// QT INCLUDES
67#include <QVariant>
68#include <QMainWindow>
69#include <QToolBox>
70#include <QStackedWidget>
71#include <QSplashScreen>
72
73#include <QDockWidget>
74#include <QVector>
75#include <QProgressDialog>
76
77#if QT_VERSION_MAJOR < 6
78#include <QtScript/QScriptEngine>
79#include <QtScript/QtScript>
80#endif
81
82#include "OpenFlipper/Logging/PluginLogging.hh"
83#include "OpenFlipper/Scripting/ScriptingWrapper.hh"
84
85// Prototypes for scripting
86#include "OpenFlipper/Scripting/scriptPrototypes/prototypeVec3d.hh"
87#include "OpenFlipper/Scripting/scriptPrototypes/prototypeVec4d.hh"
88#include "OpenFlipper/Scripting/scriptPrototypes/prototypeMatrix4x4.hh"
89#include "OpenFlipper/Scripting/scriptPrototypes/prototypeDataType.hh"
90#include <OpenFlipper/Scripting/scriptWrappers/vec3dWrapper.hh>
91#include <OpenFlipper/Scripting/scriptWrappers/vec4dWrapper.hh>
92#include <OpenFlipper/Scripting/scriptWrappers/matrix4x4Wrapper.hh>
93#include <OpenFlipper/Scripting/scriptWrappers/DataTypeWrapper.hh>
94// #include <OpenFlipper/Scripting/scriptWrappers/ObjectIdWrapper.hh>
95
96// Required Interface definition ( Some variables were defined there )
102#include "OpenFlipper/BasePlugin/SelectionInterface.hh" // -> for SelectionInterface::PrimitiveType
104
106
107// Process manager widget
108#include <OpenFlipper/widgets/processManagerWidget/processManagerWidget.hh>
109
111
112#include <OpenFlipper/Core/PluginInfo.hh>
113
114#include <ACG/Scenegraph/CoordsysNode.hh>
115
116#include <OpenFlipper/threads/JobInfo.hh>
117
118#include <OpenFlipper/common/InformationPlugins.hh>
119#include "SpinBoxEventFilter.hh"
120
121//== CLASS DEFINITION =========================================================
122
123
124struct dataTypes {
125 QString name;
126 DataType type;
127 TypeInterface* plugin;
128};
129
132class Core : public QObject
133{
134 Q_OBJECT
135
136public:
137
139 Core();
140
141 void init();
142
144 ~Core();
145
147 bool add_sync_host(const QString& _name);
148
149
150private slots:
151
153 void slotMouseEventIdentify( QMouseEvent* _event );
154
156 void slotMouseEventLight( QMouseEvent* _event );
157
158protected:
159
160 //===========================================================================
163 //===========================================================================
164signals:
167
170
173
175 void PluginWheelEvent(QWheelEvent * , const std::string & );
176
178 void PluginMouseEvent(QMouseEvent* );
179
181 void PluginMouseEventLight( QMouseEvent* );
182
185
188
191
193 void addTexture( QString, QString , uint, int );
194
196 void addTexture( QString, QImage , uint, int );
197
199 void addTexture( QString, QString , uint );
200
202 void addTexture( QString, QImage , uint );
203
205 void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId );
206
208 void addMultiTexture( QString _textureGroup , QString _name , QImage _image , int _id , int& _textureId );
209
211 void updateTexture( QString , int );
212
215
217 void updatedTextures( QString , int );
218
220 void setTextureMode(QString _textureName ,QString _mode, int _id);
221
223 void setTextureMode(QString _textureName ,QString _mode);
224
226 void switchTexture( QString, int );
227
229 void switchTexture( QString );
230
232 void textureChangeImage( QString _textureName , QImage& _image );
233
235 void textureChangeImage( QString _textureName , QImage& _image , int _id );
236
238 void textureGetImage( QString _textureName , QImage& _image );
239
241 void textureGetImage( QString _textureName , QImage& _image , int _id );
242
244 void textureIndex( QString _textureName, int _id, int& _index);
245
247 void textureIndexPropertyName( int _id, QString& _propertyName);
248
250 void textureName( int _id, int _textureIndex, QString& _textureName);
251
253 void textureFilename( int _id, QString _textureName, QString& _textureFilename);
254
256 void getCurrentTexture( int _id, QString& _textureName );
257
259 void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
260
262 void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
263
265 void registerType(QString _handleName, DataType _type);
266
268 void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
269
271 void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
272 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
273 void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
274 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
275 DataType _objectTypeRestriction);
276
278 void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type);
279
281 void addSelectionParameters(QString _handleName, QWidget* _widget, QString _category, SelectionInterface::PrimitiveType _type);
282
284 void selectionOperation(QString _operation);
285
287 void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
288
290 void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
291
293 void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
294
296 void showSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
297
299 void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
300
302 void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
303
305 void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
306
308 void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
309
311 void toggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
312
314 void lassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
315
317 void volumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
318
320 void surfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
321
323 void sphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
324
326 void closestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
327
329 void floodFillSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
330
332 void componentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
333
335 void customSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
336
338 void getActiveDataTypes(SelectionInterface::TypeList& _types);
339
341 void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
342
344 void targetObjectsOnly(bool& _targetsOnly);
345
347 void loadSelection(const INIFile& _file);
348
350 void saveSelection(INIFile& _file);
351
353 void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers);
354
356 void keyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier);
357
359 void iniLoad( INIFile&, int );
360
362 void iniSave( INIFile& _ini ,int _id );
363
365 void iniSaveOptions( INIFile& _ini );
366
368 void iniLoadOptions( INIFile& _ini );
369
372
374 void saveOnExit( INIFile& _ini );
375
377 void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
378 void createBackup( IdList _objectids, QString _name, std::vector<UpdateType> _types);
379
381 void undo(int _objectid);
382 void redo(int _objectid);
383 void undo();
384 void redo();
385
387 void aboutToRestore(int _objectId);
388
390 void restored( int _objectId);
391
393 void openedFile( int _id );
394
396 void emptyObjectAdded( int _id);
397
400
402 void pluginsInitialized(QVector<QPair<QString, QString>> const&);
403
405 void visibilityChanged(int _id);
406
408 void objectPropertiesChanged( int _id );
409
411 void objectDeleted( int );
412
415 //===========================================================================
418 //===========================================================================
419 public slots :
420
422 void slotObjectUpdated(int _identifier, const UpdateType& _type = UPDATE_ALL);
423
424 private slots:
426 void slotVisibilityChanged(int _id);
427
429 void slotObjectPropertiesChanged( int _id );
430
432 void slotObjectSelectionChanged( int _id);
433
435 void slotAddPickMode( const std::string& _mode );
436
438 void slotAddHiddenPickMode( const std::string& _mode );
439
441 void slotAddTexture( QString _textureName , QString _filename , uint _dimension , int _id );
442
444 void slotAddTexture( QString _textureName , QImage _image , uint _dimension , int _id );
445
447 void slotAddTexture( QString _textureName , QString _filename , uint _dimension );
448
450 void slotAddTexture( QString _textureName , QImage _image , uint _dimension );
451
453 void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId );
454 void slotMultiTextureAdded(const QString &_textureGroup , const QString &_name , const QString &_filename , int _id , int* _textureId );
455
457 void slotMultiTextureAdded( QString _textureGroup , QString _name , QImage _image , int _id , int& _textureId );
458
460 void slotUpdateTexture(const QString &_name , int _identifier);
461
463 void slotUpdateAllTextures( );
464
466 void slotTextureUpdated(const QString &_textureName , int _identifier );
467
469 void slotSetTextureMode(const QString &_textureName , const QString &_mode, int _id);
470
472 void slotSetTextureMode(const QString &_textureName , const QString &_mode);
473
475 void slotSwitchTexture(const QString &_textureName, int _id );
476
478 void slotSwitchTexture(const QString &_textureName );
479
481 void slotTextureChangeImage(const QString &_textureName , QImage& _image );
482
484 void slotTextureChangeImage( const QString& _textureName , QImage& _image , int _id );
485
487 void slotTextureGetImage(const QString &_textureName , QImage& _image );
488
490 void slotTextureGetImage(const QString &_textureName , QImage& _image , int _id );
491
493 void slotTextureIndex(const QString &_textureName, int _id, int& _index);
494
496 void slotTextureIndexPropertyName( int _id, QString& _propertyName);
497
499 void slotTextureName( int _id, int _textureIndex, QString& _textureName);
500
502 void slotTextureFilename(int _id, const QString &_textureName, QString& _textureFilename);
503
505 void slotGetCurrentTexture( int _id, QString& _textureName );
506
508 void slotGetSubTextures(int _id, const QString &_multiTextureName, QStringList& _subTextures );
509
511 void slotLoad(QString _filename, DataType _type, int& _id);
512
514 void slotLoad(QStringList _filenames, IdList _pluginIDs);
515
517 void slotFileOpened ( int _id );
518
520 void slotEmptyObjectAdded ( int _id );
521
523 void slotAddSelectionEnvironment(const QString &_modeName, const QString &_description, const QString &_icon, QString &_handleName);
524
526 void slotRegisterType(const QString &_handleName, DataType _type);
527
529 void slotAddPrimitiveType(const QString &_handleName, const QString &_name, const QString &_icon, SelectionInterface::PrimitiveType& _typeHandle);
530
540 void slotAddCustomSelectionMode(const QString &_handleName, const QString &_modeName, const QString &_description, const QString &_icon,
541 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
542
553 void slotAddCustomSelectionMode(const QString &_handleName, const QString &_modeName, const QString &_description, const QString &_icon,
554 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
555 DataType _objectTypeRestriction);
556
558 void slotAddSelectionOperations(const QString &_handleName, const QStringList &_operationsList, const QString &_category, SelectionInterface::PrimitiveType _type);
559
561 void slotAddSelectionParameters(const QString &_handleName, QWidget* _widget, const QString &_category, SelectionInterface::PrimitiveType _type);
562
564 void slotSelectionOperation(const QString &_operation);
565
567 void slotShowToggleSelectionMode(const QString& _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
568
570 void slotShowLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
571
573 void slotShowVolumeLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
574
576 void slotShowSurfaceLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
577
579 void slotShowSphereSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
580
582 void slotShowClosestBoundarySelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
583
585 void slotShowFloodFillSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
586
588 void slotShowComponentsSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
589
591 void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
592
594 void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
595
597 void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
598
600 void slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
601
603 void slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
604
606 void slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
607
609 void slotFloodFillSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
610
612 void slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
613
615 void slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, const QString &_customIdentifier, bool _deselect);
616
618 void slotGetActiveDataTypes(SelectionInterface::TypeList& _types);
619
621 void slotGetActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
622
624 void slotTargetObjectsOnly(bool& _targetsOnly);
625
627 void slotLoadSelection(const INIFile& _file);
628
630 void slotSaveSelection(INIFile& _file);
631
633 void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers);
634
636 void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers);
637
645 void slotGetAllFilters ( QStringList& _list);
646
647
649 void slotDeleteAllObjects( );
650
652 void slotCrossPluginConnect(const QString &_pluginName1, const char* _signal, const QString &_pluginName2, const char* _slot);
653
655 void slotCrossPluginConnectQueued(const QString &_pluginName1, const char* _signal, const QString &_pluginName2, const char* _slot);
656
658 void slotSetRenderer(unsigned int _viewer, QString _rendererName);
659
661 void slotGetCurrentRenderer(unsigned int _viewer, QString& _rendererName);
662
664 // void slotGetPlugin(QString _name, QObject* & _plugin );
665
668 //===========================================================================
671 //===========================================================================
672public slots:
673
675 void updateView();
676
678 void blockScenegraphUpdates(bool _block);
679
681 void updateUI();
682
684 void clearAll();
685
687 void deleteObject( int _id );
688
689 void setObjectComment(int objId, QString key, QString comment);
690 void clearObjectComment(int objId, QString key);
691 void clearAllComments(int objId);
692
694 void fullscreen( bool _state );
695
697 void showViewModeControls( bool _show );
698
700 void loggerState(int _state);
701
703 void enableOpenMeshErrorLog(bool _state);
704
706 void showToolbox( bool _state );
707
709 void showStatusBar( bool _state );
710
712 void multiViewMode( int _mode );
713
715 void restrictFrameRate( bool _enable );
716
718 void setMaxFrameRate( int _rate );
719
722 void snapshotBaseFileName(QString _fname, unsigned int _viewerId = 0);
723
725 void snapshotFileType(QString _type, unsigned int _viewerId = 0);
726
728 void snapshotCounterStart(const int _counter, unsigned int _viewerId = 0);
729
735 void snapshot(unsigned int _viewerId = 0, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int _numSamples = 1);
736
738 void applicationSnapshot();
739
741 void applicationSnapshotName(QString _name);
742
744 void viewerSnapshot();
745
747 void viewerSnapshot(QString file_name, bool store_comments,
748 bool comments_visible_only, bool comments_targeted_only,
749 bool store_material_info, int snapshot_width, int snapshot_height,
750 bool snapshot_transparent, bool hide_coord_sys,
751 int snapshot_multisampling, bool store_view);
752
754 void resizeViewers(int _width, int _height );
755
757 void resizeApplication(int _width, int _height );
758
760 void writeVersionNumbers(QString _filename);
761
763 QList<int> objectList (QString _selection, QStringList _types);
764
767
770
771 void setView(QString view);
772 void setViewAndWindowGeometry(QString view);
773
776 //===========================================================================
779 //===========================================================================
780
781public slots:
787 void addViewModeToolboxes(QString _modeName, QString _toolboxList);
788
795 void addViewModeToolbars(QString _modeName, QString _toolbarList);
796
802 void addViewModeContextMenus(QString _modeName, QString _contextMenuList);
803
808 void addViewModeIcon(QString _modeName, QString _iconName);
809
814 void setToolBoxSide(QString _side);
815
821 void setToolBoxActive(QString _toolBoxName, bool _active);
822
825 //===========================================================================
828 //===========================================================================
829public slots:
838 int loadObject ( QString _filename );
839
840private slots:
841 void loadObjectFinished(const QString &_filename);
842
847 void resetScenegraph( bool _resetTrackBall );
848
849 public :
850
862 void commandLineOpen(const QString& _filename, bool _asPolyMesh );
863
874 void commandLineScript(const QString& _filename );
875
876 private slots:
877
885
886 private:
888 std::vector< std::pair < QString , bool > > commandLineFileNames_;
889
891 std::vector< QString > commandLineScriptNames_;
892
893 public:
894
898 int addEmptyObject( DataType _type );
899
907 int loadObject( DataType _type, QString _filename);
908
911 //===========================================================================
914 //===========================================================================
915 private slots:
917 void viewUpdated();
918
920 void captureVideo();
921
922 public slots:
923
925 void startVideoCapture(const QString &_baseName, int _fps, bool _captureViewers);
926
928 void stopVideoCapture();
929
930 private:
932 QElapsedTimer lastVideoTime_;
933
935
937
940
942 //===========================================================================
945 //===========================================================================
946
947 public slots:
948
952 bool saveObject( int _id, QString _filename );
953
954 void saveObject( int _id, QString _filename, int _pluginID );
955
956 void saveObjects( IdList _ids, QString _filename, int _pluginID );
957
962 bool saveObjectTo( int _id, QString _filename );
963
964 bool saveObjectsTo( IdList _ids, QString _filename );
965
967 void saveAllObjects();
968
970 void saveAllObjectsTo();
971
973 void saveSettings();
974
976 void saveSettings(QString filePath, bool is_saveObjectInfo, bool is_targetOnly, bool is_saveAll,
977 bool is_askOverwrite, bool is_saveProgramSettings, bool is_savePluginSettings);
978
980 void loadObject();
981
983 void loadSettings();
984
986 void loadSettings(QString _filename);
987
989 int getObjectId(QString _filename);
990
996 void deserializeMaterialProperties(int _objId, QString _props);
997
1003 QString serializeMaterialProperties(int _objId);
1004
1007 //===========================================================================
1010 //===========================================================================
1011 private slots :
1012
1014 void slotMouseEvent( QMouseEvent* _event );
1015
1017 void slotWheelEvent( QWheelEvent * _event, const std::string & _mode);
1018
1024
1026 void slotAddEmptyObject( DataType _type , int& _id );
1027 void slotAddEmptyObject( DataType _type, int* _id);
1028
1030 void slotCopyObject( int _oldId , int& _newId );
1031
1033 void slotExit();
1034
1036 void slotRecentOpen(QAction* _action);
1037
1039 void slotGenerateBackup( int _id, QString _name, UpdateType _type );
1040
1041 public slots:
1042
1044 void addToolbox(const QString &_name , QWidget* _widget);
1045
1047 void addToolbox(const QString &_name , QWidget* _widget, QIcon* _icon);
1048
1050 void addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
1051 QWidget* _headerAreaWidget);
1052
1060 QWidget *getToolbox(const QString &_pluginName, const QString &_toolboxName);
1061
1068 void activateToolbox(QString _pluginName, QString _toolboxName, bool activate);
1069
1070 private :
1071
1072 //===========================================================================
1075 //===========================================================================
1076
1077 private:
1080
1083
1086
1087
1090
1093
1096
1099
1102 //===========================================================================
1105 //===========================================================================
1106
1108 void setupOptions();
1109
1112
1114 void readApplicationOptions(INIFile& _ini);
1115
1117 void writeApplicationOptions(INIFile& _ini);
1118
1120 void restoreKeyBindings();
1121
1122 public slots:
1123
1125 void saveOptions();
1126
1128 void applyOptions();
1129
1140 void openIniFile( QString _filename,
1141 bool _coreSettings ,
1142 bool _perPluginSettings,
1143 bool _loadObjects );
1144
1145 private:
1146
1159 void writeIniFile( QString _filename,
1160 bool _relativePaths,
1161 bool _targetOnly,
1162 bool _saveSystemSettings,
1163 bool _savePluginSettings ,
1164 bool _saveObjectInfo,
1165 std::map<int,QString>& _fileMapping);
1166
1171 void writeObjFile(QString _filename, bool _relativePaths, bool _targetOnly, std::map<int,QString>& _fileMapping);
1172
1174 void writeOnExit();
1175
1179 //===========================================================================
1182 //===========================================================================
1183
1184 signals:
1186 void log(Logtype _type , QString _message );
1187
1189 void log(QString _message );
1190
1192 void scriptLog(QString _message);
1193
1195 void externalLog(Logtype _type , QString _message);
1196
1197 private slots:
1198
1200 void slotLog(Logtype _type, QString _message);
1201
1203 void slotLogToFile(Logtype _type, QString _message);
1204
1205 private:
1207 QTextStream* logStream_;
1208
1210 QFile* logFile_;
1211
1212 public :
1213 void scriptLogFunction(const QString &_output);
1214
1218 //===========================================================================
1221 //===========================================================================
1222
1223 private :
1225 bool checkSlot(QObject* _plugin , const char* _slotSignature);
1226
1228 bool checkSignal(QObject* _plugin , const char* _signalSignature);
1229
1232 //===========================================================================
1235 //===========================================================================
1236
1237 public :
1238 std::vector<PluginInfo>& plugins();
1239
1240 private:
1241
1244
1246 void loadPlugins();
1247
1249 void printPluginLoadLog(const QString& errors,const QString& warnings);
1250
1251 private slots:
1253 void slotShowPlugins();
1254
1256 void loadPlugin(const QString& _filename,const bool _silent, QString& _licenseErrors , QObject* _plugin = 0 );
1257
1259 void slotLoadPlugin();
1260
1262 void slotBlockPlugin(const QString &_rpcName);
1263
1265 void slotUnBlockPlugin(const QString &_rpcName);
1266
1269 //===========================================================================
1272 //===========================================================================
1273 signals:
1274 void genericMetadataDeserialized(QString key, QString value);
1275 void objectMetadataDeserialized(QString object_name, QString value);
1276 void objectMetadataDeserializedJson(
1277 QString object_name, QJsonDocument value);
1278
1279 private slots:
1280 void slotMetadataDeserialized( const QVector<QPair<QString, QString> > &data);
1281
1285 //===========================================================================
1288 //===========================================================================
1289
1290 signals:
1291
1292 void scriptInfo( QString _pluginName , QString _functionName );
1293
1294 void executeScript( QString _script );
1295
1296 void executeFileScript( QString _filename );
1297
1298 void setSlotDescription(QString _slotName, QString _slotDescription,
1299 QStringList _parameters, QStringList _descriptions);
1300
1301 public slots:
1309 void createWidget(const QString &_objectName, const QString &_uiFilename, bool _show = true);
1310
1312 void setViewMode(QString _viewMode);
1313
1315 QString getCurrentViewMode();
1316
1318 void setViewModeIcon(QString _mode, QString _iconName);
1319
1321 void moveToolBoxToTop(QString _name);
1322
1324 void moveToolBoxToBottom(QString _name);
1325
1326 void showReducedMenuBar(bool reduced);
1327
1332 void executePythonScriptFile(QString _filename);
1333
1338 void executePythonScript(const QString &_script);
1339
1340 private :
1341#if QT_VERSION_MAJOR < 6
1342
1344 QScriptEngine scriptEngine_;
1345
1347 std::vector<ScriptingWrapper*> scriptingWrappers_;
1348
1349#endif
1350
1353
1354#if QT_VERSION_MAJOR < 6
1357
1360
1363
1366
1367
1368 private slots:
1369 void slotScriptInfo(const QString &_pluginName , const QString &_functionName );
1370
1371
1376 void slotExecuteScript(const QString &_script );
1377
1378
1379
1380 void slotGetScriptingEngine( QScriptEngine*& _engine );
1381
1382#endif
1383
1384 private slots:
1389 void slotExecuteFileScript(const QString &_filename );
1390
1395 void slotShowScriptInEditor(const QString &_filename );
1396
1397
1398private slots:
1399 void slotGetAllAvailableFunctions( QStringList& _functions );
1400
1402 void slotSetSlotDescription(QString _slotName, QString _slotDescription,
1403 QStringList _parameters, QStringList _descriptions);
1404
1406 void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription,
1407 QStringList _parameters, QStringList _descriptions);
1408
1409#if QT_VERSION_MAJOR < 6
1410
1411 void slotScriptError(const QScriptValue &error);
1412
1413#endif
1414
1415 public slots:
1416
1418 void slotGetDescription(QString _function, QString& _fnDescription,
1419 QStringList& _parameters, QStringList& _descriptions );
1420
1421 private:
1422
1423 QList< SlotInfo > coreSlots_;
1424 QList< SlotInfo > globalFunctions_;
1425
1426 void setDescriptions();
1427
1430 //===========================================================================
1433 //===========================================================================
1434 private slots:
1435
1441 void slotPluginExists(const QString &_pluginName , bool& _exists );
1442
1449 void slotFunctionExists(const QString &_pluginName , const QString &_functionName , bool& _exists );
1450
1451 #if QT_VERSION_MAJOR < 6
1458 void slotCall(const QString &_pluginName , const QString &_functionName , bool& _success );
1459
1460
1466 void slotCall(const QString &_expression , bool& _success );
1467
1478 void slotGetValue(const QString &_expression, QVariant& _result ){
1479 //execute the expression
1480 bool ok;
1481
1482 slotCall("var tmpValue=" + _expression + ";", ok);
1483
1484 if (!ok){
1485 _result = QVariant();
1486 return;
1487 }
1488
1489 //get the return value
1490 QScriptValue val = scriptEngine_.globalObject().property("tmpValue");
1491
1492 // std::cerr << "Type:" << val.toVariant().userType() << std::endl;
1493 // std::cerr << "Value:" << val.toVariant().toString().toStdString()<< std::endl;
1494
1495 _result = val.toVariant();
1496 }
1497#endif
1498
1501 //===========================================================================
1504 //===========================================================================
1505 private slots:
1506
1507 // Execute python script
1508 void slotExecutePythonScript(const QString &_script);
1509
1510 // Open python script editor
1511 void slotOpenPythonScriptInEditor( QString _script);
1512
1515 //===========================================================================
1518 //===========================================================================
1519
1520 private slots:
1521
1523 void checkScenegraphDirty();
1524
1525 private:
1526
1529
1531 QElapsedTimer *redrawTime_;
1532
1536 //===========================================================================
1539 //===========================================================================
1540
1541 private:
1542
1543 QList< JobInfo > currentJobs;
1544
1546
1548 bool getJob(QString _jobId, int& _index);
1549
1550 private slots:
1551
1553 void slotStartJob( QString _jobId, QString _description , int _min , int _max,bool _blocking );
1554
1556 void slotSetJobState(QString _jobId, int _value );
1557
1559 void slotSetJobName(QString _jobId, QString _name );
1560
1562 void slotSetJobDescription(QString _jobId, QString _text );
1563
1565 void slotCancelJob(QString _jobId );
1566
1568 void slotFinishJob(QString _jobId );
1569
1571 void slotJobCancelRequested(const QString& _jobId);
1572
1573 signals:
1574
1575 void jobCanceled( QString _jobId );
1576
1579 //===========================================================================
1582 //===========================================================================
1583
1584 private slots:
1585
1587 void newObject(int _objectId);
1588
1590 void deletedObject(int _objectId);
1591
1594 //===========================================================================
1597 //===========================================================================
1598
1599 public slots:
1600
1602 void exitApplication();
1603
1609 void exitFailure();
1610
1611 void finishSplash();
1612
1613
1616 private:
1623
1628 bool checkLibraryVersions();
1629
1630 void hookUpEventFilter(QWidget *widget);
1631
1632
1633 private :
1634
1637
1640
1642 std::vector<PluginLogger*> loggers_;
1643
1645 std::vector<dataTypes> supportedDataTypes_;
1646
1647 private :
1650
1653
1655 QSplashScreen* splash_;
1656
1659
1661 QVector<ViewMode*> viewModes_;
1662
1665
1666 SpinBoxEventFilter spinBoxEventFilter_;
1667
1668
1669};
1670
1671#if QT_VERSION_MAJOR < 6
1672
1674QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine);
1675
1677QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine);
1678
1680QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine);
1681
1682#endif
1683
1684//=============================================================================
1685#endif // MVIEWWIDGET_HH defined
1686//=============================================================================
1687
QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for sending output to a file.
Definition: scripting.cc:405
QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine)
Function to print help about scripting functions.
Definition: scripting.cc:431
QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for core logger.
Definition: scripting.cc:387
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:181
Logtype
Log types for Message Window.
Definition: Core.hh:133
void textureIndex(QString _textureName, int _id, int &_index)
get the texture index
void showStatusBar(bool _state)
Show or hide Status Bar.
Definition: Core.cc:1151
void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Core scripting engine.
prototypeDataType DataTypePrototype_
Prototype for the DataType.
Definition: Core.hh:1362
void slotCrossPluginConnectQueued(const QString &_pluginName1, const char *_signal, const QString &_pluginName2, const char *_slot)
Called to create inter plugin connections.
void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Called by plugins if texture index property name should be fetched.
void slotGetAllFilters(QStringList &_list)
Called when a plugin requests a list of file-filters.
void slotGetAllAvailableFunctions(QStringList &_functions)
Core scripting engine.
Definition: scripting.cc:126
void executeFileScript(QString _filename)
Core scripting engine.
void addViewModeToolbars(QString _modeName, QString _toolbarList)
Scripting function to set toolbars in a view mode.
Definition: scripting.cc:243
void undo()
Signal send to plugins when whole scene is cleared.
void updateTexture(QString, int)
Tell the plugins to update the given texture.
void keyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
SelectionInterface: This signal is emitted when a key shortcut has been pressed.
void clearAll()
Clear all data objects.
Definition: Core.cc:1066
void updatedTextures(QString, int)
This Signal is send to the plugins if a texture has been updated.
bool saveObjectTo(int _id, QString _filename)
void addTexture(QString, QString, uint, int)
The texture with the given name and filename has been added.
void saveSelection(INIFile &_file)
SelectionInterface: This signal is emitted when a selection should be written into a file.
void targetObjectsOnly(bool &_targetsOnly)
SelectionInterface: This signal is emitted if the current target restriction state is requested.
void commandLineOpen(const QString &_filename, bool _asPolyMesh)
Load an object from the commandline on application start.
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void pluginSceneDrawn()
This signal is emitted after the scene has been drawn.
Core()
constructor
Definition: Core.cc:108
void slotAddTexture(QString _textureName, QString _filename, uint _dimension, int _id)
Called by a plugin if it creates a texture.
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options
void PluginMouseEventLight(QMouseEvent *)
Emitted when an light event occurs.
void addViewModeToolboxes(QString _modeName, QString _toolboxList)
Scripting function to set toolboxes in a view mode.
Definition: scripting.cc:235
void slotMouseEvent(QMouseEvent *_event)
Gets called by examiner widget when mouse is moved in picking mode.
Definition: Core.cc:860
void slotAddSelectionOperations(const QString &_handleName, const QStringList &_operationsList, const QString &_category, SelectionInterface::PrimitiveType _type)
SelectionInterface: Called in order to add non-interactive operations for a specific primitive type.
void showToolbox(bool _state)
Show or hide toolbox.
Definition: Core.cc:1144
void slotObjectPropertiesChanged(int _id)
Called by plugins if object properties like names have changed.
void addTexture(QString, QImage, uint, int)
The texture with the given name and image has been added.
void slotTextureName(int _id, int _textureIndex, QString &_textureName)
Called by plugins if texture name should be fetched.
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard toggle selection is required.
void slotSetJobName(QString _jobId, QString _name)
A job's widget caption has been updated by a plugin.
Definition: process.cc:165
BaseObject * objectRoot_
Pointer to the data rootNode;.
Definition: Core.hh:1649
void switchTexture(QString, int)
Switch Texture Plugins to a given Mode.
void saveSettings()
Save current status to a settings file. Solicit file name through dialog.
Definition: saveSettings.cc:53
void componentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard connected components selection has been perf...
void slotWheelEvent(QWheelEvent *_event, const std::string &_mode)
Gets called by examiner widget when Wheel is moved in picking mode.
Definition: Core.cc:914
void setDescriptions()
set the descriptions for scriptable slots of the core
Definition: Core.cc:1641
void slotCall(const QString &_pluginName, const QString &_functionName, bool &_success)
Definition: RPC.cc:95
QWidget * getToolbox(const QString &_pluginName, const QString &_toolboxName)
Definition: scripting.cc:276
void allCleared()
Signal send to plugins when whole scene is cleared.
void slotFunctionExists(const QString &_pluginName, const QString &_functionName, bool &_exists)
Check if a function exists.
Definition: RPC.cc:75
void createBackup(IdList _objectids, QString _name, std::vector< UpdateType > _types)
Signal send to plugins when whole scene is cleared.
bool add_sync_host(const QString &_name)
Synchronise two viewers.
void slotShowFloodFillSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide flood fill selection operation for specific selection mode.
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString &_handleName)
SelectionInterface: This signal is emitted when a new toolbutton should be added.
void PluginMouseEvent(QMouseEvent *)
When this Signal is emitted when a Mouse Event occures.
void slotTextureUpdated(const QString &_textureName, int _identifier)
A Texture has been updated.
void slotShowLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide lasso selection operation for specific selection mode.
SeparatorNode * core_nodes_
Separator Node holding all core scenegraph nodes.
Definition: Core.hh:1085
void iniLoadOptionsLast(INIFile &_ini)
This signal is used to tell the plugins to load their new status after objects are loaded.
void slotShowComponentsSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide connected components selection operation for specific selection mode.
void setToolBoxSide(QString _side)
Scripting function to set the side of the main window on which the toolbox should be displayed.
Definition: scripting.cc:263
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: Called when a key event occurred.
void snapshotBaseFileName(QString _fname, unsigned int _viewerId=0)
Definition: Core.cc:1485
void log(QString _message)
Default logging as OUT.
void resizeApplication(int _width, int _height)
resize the whole Application
Definition: Core.cc:1582
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type)
SelectionInterface: This signal is used to add non-interactive operations for a specific primitive ty...
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard volume lasso selection is required.
int lastWidth_
Slot called everytime the view is updated.
Definition: Core.hh:938
void emptyObjectAdded(int _id)
Tell the plugins that an empty object has been added.
void slotShowClosestBoundarySelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide closest boundary selection operation for specific selection mode.
void checkScenegraphDirty()
Called to check if the scenegraph needs to be redrawn.
Definition: Core.cc:1034
void selectionOperation(QString _operation)
SelectionInterface: This signal is emitted when a non-interactive operation has been performed.
bool saveObjectsTo(IdList _ids, QString _filename)
void printPluginLoadLog(const QString &errors, const QString &warnings)
Print all info collected about plugin during loading.
void addViewModeContextMenus(QString _modeName, QString _contextMenuList)
Scripting function to set context menus in a view mode.
Definition: scripting.cc:251
void setViewAndWindowGeometry(QString view)
Called when a plugin requests an update in the viewer.
Definition: scripting.cc:373
void iniSaveOptions(INIFile &_ini)
This signal is used to tell the plugins to save their current status.
void resizeViewers(int _width, int _height)
resize the examinerViewer
Definition: Core.cc:1571
void updateAllTextures()
Update all textures in the plugins.
void slotScriptError(const QScriptValue &error)
Core scripting engine.
Definition: scripting.cc:383
void captureVideo()
Function called for every frame when capturing video.
Definition: Video.cc:92
void undo(int _objectid)
Tell backup-plugin to undo/redo.
void clearAllComments(int objId)
Called when a plugin requests an update in the viewer.
Definition: Core.cc:1907
void deserializeMaterialProperties(int _objId, QString _props)
Serialize material properties.
Definition: Core.cc:1842
void saveAllObjectsTo()
Slot for saving objects to a new location.
void blockSceneGraphUpdates()
Block the scenegraph updates.
Definition: scripting.cc:360
void addViewModeIcon(QString _modeName, QString _iconName)
Scripting function to set an icon for a view mode.
Definition: scripting.cc:257
void slotAddPrimitiveType(const QString &_handleName, const QString &_name, const QString &_icon, SelectionInterface::PrimitiveType &_typeHandle)
SelectionInterface: Called when a new, non-standard primitive type should be handled.
void setupOptions()
Get all ini files and set basic paths and options.
void textureName(int _id, int _textureIndex, QString &_textureName)
get the texture name
void commandLineScript(const QString &_filename)
Load a script from the commandline on application start.
void fullscreen(bool _state)
set fullscreen mode
Definition: Core.cc:1095
void saveAllObjects()
Slot for saving objects from Menu.
void slotExecuteScript(const QString &_script)
Definition: scripting.cc:71
void scriptLog(QString _message)
Logging signal for ScriptEngine.
void slotGetDescription(QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
get available descriptions for a given public slot
Definition: Core.cc:1416
void addSelectionParameters(QString _handleName, QWidget *_widget, QString _category, SelectionInterface::PrimitiveType _type)
SelectionInterface: This signal is used to add interactive selection parameters for a specific primit...
void showReducedMenuBar(bool reduced)
Core scripting engine.
Definition: Core.cc:2086
void slotAddEmptyObjectMenu()
Open the add Empty dialog.
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
void slotGenerateBackup(int _id, QString _name, UpdateType _type)
Slot for generating type specific backups.
std::vector< dataTypes > supportedDataTypes_
Type-Plugins.
Definition: Core.hh:1645
void openedFile(int _id)
Tell the plugins that a file has been opened ( -> Database)
void slotShowSurfaceLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide surface lasso selection operation for specific selection mode.
void scriptInfo(QString _pluginName, QString _functionName)
Core scripting engine.
void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard connected components selection is required.
ACG::SceneGraph::MaterialNode * coordsysMaterialNode_
Node for coordsys Material.
Definition: Core.hh:1095
void getActivePrimitiveType(SelectionInterface::PrimitiveType &_type)
SelectionInterface: This signal is emitted when the active (selected) primitive type should be fetche...
QElapsedTimer * redrawTime_
Holds the time since last redraw.
Definition: Core.hh:1531
void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
Called by a plugin if it creates a multitexture.
ACG::SceneGraph::CoordsysNode * coordsysNode_
Node for the coordinate system.
Definition: Core.hh:1098
QStringList scriptingFunctions_
List of all registered scripting functions.
Definition: Core.hh:1352
void slotSetTextureMode(const QString &_textureName, const QString &_mode, int _id)
A texture mode should be changed.
SeparatorNode * dataRootNode_
Root Node for data objects.
Definition: Core.hh:1092
void moveToolBoxToBottom(QString _name)
Move selected toolbox to bottom of side area.
Definition: scripting.cc:226
void writeApplicationOptions(INIFile &_ini)
Write Application options to ini file.
Definition: ParseIni.cc:285
void exitFailure()
Aborts the application with an error code.
Definition: Core.cc:1295
void customSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
SelectionInterface: This signal is emitted when a custom selection operation has been performed.
void slotLoadPlugin()
Load Plugins from menu.
void snapshotFileType(QString _type, unsigned int _viewerId=0)
Set the file type for snapshots.
Definition: Core.cc:1498
std::vector< ScriptingWrapper * > scriptingWrappers_
Wrappers for plugin scripting.
Definition: Core.hh:1347
void slotLog(Logtype _type, QString _message)
Console logger.
Definition: Logging.cc:91
void slotTextureIndex(const QString &_textureName, int _id, int &_index)
Called by plugins if texture index should be fetched.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when connected components selection operation has been performed.
void pluginsInitialized()
Called after all plugins are loaded.
void saveOnExit(INIFile &_ini)
This signal is emitted before the core deletes its data and exits.
void showSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard surface lasso selection is required.
void visibilityChanged(int _id)
Tell plugins that the visibility of an object has changed.
void slotCopyObject(int _oldId, int &_newId)
Slot copying an object.
void setTextureMode(QString _textureName, QString _mode)
A texture mode should be changed.
void slotFloodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when flood fill selection operation has been performed.
void redo()
Signal send to plugins when whole scene is cleared.
void executeScript(QString _script)
Core scripting engine.
void addToolbox(const QString &_name, QWidget *_widget)
Add a Toolbox from a plugin or from scripting.
Definition: scripting.cc:299
void slotLoadSelection(const INIFile &_file)
SelectionInterface: Called when a selection should be loaded from a file.
void slotEmptyObjectAdded(int _id)
Called when an empty object has been Added.
void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: Called when a key shortcut is to be registered.
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier)
SelectionInterface: This signal is emitted when a custom selection mode is added.
void slotFinishJob(QString _jobId)
A job state has been finished by a plugin.
Definition: process.cc:238
void slotUpdateAllTextures()
Update all textures in the plugins.
QTimer * redrawTimer_
If enabled, this timer will block screen refresh if done more then 30 times per second.
Definition: Core.hh:1664
void loadObject()
Open Load Widget.
void slotGetActiveDataTypes(SelectionInterface::TypeList &_types)
SelectionInterface: Called when active (selected) data types should be fetched.
void writeOnExit()
Called if app is closed and writes all information to ini file.
Definition: Core.cc:1203
void slotLogToFile(Logtype _type, QString _message)
log to file
Definition: Core.cc:1318
void restrictFrameRate(bool _enable)
Enable or disable framerate restriction.
Definition: Core.cc:1049
QVector< ViewMode * > viewModes_
List of available draw modes.
Definition: Core.hh:1661
prototypeVec4d vec4dPrototype_
Prototype for the Vector type.
Definition: Core.hh:1359
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when toggle selection operation has been performed.
QTimer * scenegraphCheckTimer_
Timer that starts scenegraph check.
Definition: Core.hh:1528
std::vector< std::pair< QString, bool > > commandLineFileNames_
Vector storing filenames from commandline to be opened after application startup (objects)
Definition: Core.hh:888
void slotSelectionOperation(const QString &_operation)
SelectionInterface: Called when a non-interactive operation has been performed.
void setToolBoxActive(QString _toolBoxName, bool _active)
Scripting function to activate or deactivate a toolbox.
Definition: scripting.cc:352
void slotShowScriptInEditor(const QString &_filename)
Definition: scripting.cc:107
int captureType_
Slot called everytime the view is updated.
Definition: Core.hh:934
bool checkSlot(QObject *_plugin, const char *_slotSignature)
Check if a plugin has a slot.
void unblockSceneGraphUpdates()
Unblock the scenegraph updates.
Definition: scripting.cc:365
void readApplicationOptions(INIFile &_ini)
Get and set Application options from ini file.
Definition: ParseIni.cc:72
~Core()
destructor
Definition: Core.cc:752
void slotObjectSelectionChanged(int _id)
Called by Plugins if they changed the active object.
void pluginViewChanged()
This signal is emitted if one of the viewers updated its view.
void createBackup(int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
Tell backup-plugin to create a backup.
void objectSelectionChanged(int)
This signal is emitted if the object has been changed (source/target)
void iniLoadOptions(INIFile &_ini)
This signal is used to tell the plugins to load their new status.
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
void setViewModeIcon(QString _mode, QString _iconName)
Set the icon of a viewMode.
Definition: scripting.cc:197
int lastHeight_
Slot called everytime the view is updated.
Definition: Core.hh:939
void slotTextureGetImage(const QString &_textureName, QImage &_image)
Called by plugins if texture image should be fetched.
void volumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard volume lasso selection has been performed.
void moveToolBoxToTop(QString _name)
Move selected toolbox to top of side area.
Definition: scripting.cc:217
void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get a multi-texture's sub textures
void slotDeleteAllObjects()
Called when a plugin wants to delete all objects.
Definition: Core.cc:1921
void blockScenegraphUpdates(bool _block)
Called when a plugin wants to lock or unlock scenegraph updates.
Definition: Core.cc:1023
void slotBlockPlugin(const QString &_rpcName)
Function for Blocking Plugins. Blocked plugins will unloaded and not loaded wthin the next starts.
void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard sphere selection is required.
QTextStream * logStream_
stream for logging to file
Definition: Core.hh:1207
void slotSetJobDescription(QString _jobId, QString _text)
A job's widget's status text has been updated by a plugin.
Definition: process.cc:188
void slotSetJobState(QString _jobId, int _value)
A job state has been updated by a plugin.
Definition: process.cc:141
void slotShowToggleSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide toggle selection operation for specific selection mode.
void executePythonScriptFile(QString _filename)
Open the given file and execute its contents as a python script.
Definition: scripting.cc:469
void iniSave(INIFile &_ini, int _id)
This signal is used to tell the plugins to save the data of _id to the given file.
void sphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard sphere selection has been performed.
QList< SlotInfo > coreSlots_
Core scripting engine.
Definition: Core.hh:1423
void objectDeleted(int)
Called after an object has been deleted.
void iniLoad(INIFile &, int)
If an ini File is opened, this signal is send to Plugins capable of handling ini files.
void signalObjectUpdated(int, const UpdateType &)
When this Signal is emitted all Plugins are informed that some type of update was performed on an obj...
QSplashScreen * splash_
SplashScreen, only used in gui mode.
Definition: Core.hh:1655
void objectPropertiesChanged(int _id)
Tell plugins that object properties such as object names have been changed.
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
Definition: Core.cc:770
QElapsedTimer lastVideoTime_
Slot called everytime the view is updated.
Definition: Core.hh:932
void writeIniFile(QString _filename, bool _relativePaths, bool _targetOnly, bool _saveSystemSettings, bool _savePluginSettings, bool _saveObjectInfo, std::map< int, QString > &_fileMapping)
Write current status to ini file (Application and File Options)
Definition: ParseIni.cc:540
void slotCrossPluginConnect(const QString &_pluginName1, const char *_signal, const QString &_pluginName2, const char *_slot)
Called to create inter plugin connections.
void slotAddPickMode(const std::string &_mode)
Add a new picking mode to the examiner_widget_.
Definition: Core.cc:946
void snapshotCounterStart(const int _counter, unsigned int _viewerId=0)
Set the start index for the snapshot counter.
Definition: Core.cc:1512
void textureGetImage(QString _textureName, QImage &_image, int _id)
fetch texture image
void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for a global scripting function
Definition: Core.cc:1403
void aboutToRestore(int _objectId)
Backup Plugin tells other Plugins that a restore will happen.
void slotSetSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for one of the plugin's public slots
Definition: Core.cc:1364
void slotMouseEventIdentify(QMouseEvent *_event)
Handle Mouse events when in Identifier mode.
Definition: Core.cc:777
void readGUIOptions(INIFile &_ini)
Read Options that needs the GUI to be set up completely.
void addTexture(QString, QImage, uint)
The texture with the given name and image has been added.
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when volume lasso selection operation has been performed.
void init()
Second initialization stage.
Definition: Core.cc:192
void loadObjectFinished(const QString &_filename)
Vector storing filenames from commandline to be opened after application startup (objects)
void getCurrentTexture(int _id, QString &_textureName)
get current texture
QString splashMessage_
Last Splash message;.
Definition: Core.hh:1658
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
void finishSplash()
exit the current application
Definition: Core.cc:2090
void snapshot(unsigned int _viewerId=0, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int _numSamples=1)
Definition: Core.cc:1525
void closestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard closest boundary selection has been performe...
void loadSelection(const INIFile &_file)
SelectionInterface: This signal is emitted when a selection should be loaded from a file.
void slotLoad(QString _filename, DataType _type, int &_id)
A plugin wants to load a given file.
void resetScenegraph(bool _resetTrackBall)
void slotStartJob(QString _jobId, QString _description, int _min, int _max, bool _blocking)
A job has been started by a plugin.
Definition: process.cc:64
void slotSwitchTexture(const QString &_textureName, int _id)
Tells Plugins to switch to the given Texture.
void saveOptions()
Save the current options to the standard ini file.
void startVideoCapture(const QString &_baseName, int _fps, bool _captureViewers)
Start video capturing.
Definition: Video.cc:63
void enableOpenMeshErrorLog(bool _state)
Enable or disable OpenMesh error logging.
Definition: Core.cc:1121
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType &_typeHandle)
SelectionInterface: This signal is emitted when a selection plugin should handle a new primitive type...
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
Definition: Core.cc:1544
void registerType(QString _handleName, DataType _type)
SelectionInterface: This signal is emitted when a data type should be registered for a selection mode...
void saveObjects(IdList _ids, QString _filename, int _pluginID)
QScriptEngine scriptEngine_
Core scripting engine.
Definition: Core.hh:1344
void slotGetCurrentRenderer(unsigned int _viewer, QString &_rendererName)
called to get the currently active renderer renderer for a specific viewer
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when sphere selection operation has been performed.
void surfaceLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard surface lasso selection has been performed.
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when lasso selection operation has been performed.
void toggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard toggle selection has been performed.
void deleteObject(int _id)
Called to delete an object.
Definition: Core.cc:1813
void slotCancelJob(QString _jobId)
A job state has been canceled by a plugin.
Definition: process.cc:212
void textureChangeImage(QString _textureName, QImage &_image, int _id)
Change the image for a given texture.
void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard flood fill selection is required.
void slotGetValue(const QString &_expression, QVariant &_result)
Definition: Core.hh:1478
void slotScriptInfo(const QString &_pluginName, const QString &_functionName)
Core scripting engine.
Definition: scripting.cc:67
bool checkLibraryVersions()
Checks for library inconsistencies.
Definition: Core.cc:1947
void writeVersionNumbers(QString _filename)
write the current versions of all plugins to ini file
Definition: Core.cc:1592
QList< JobInfo > currentJobs
A job has been started by a plugin.
Definition: Core.hh:1543
SeparatorNode * root_node_scenegraph_global_
Seperator node for global nodes.
Definition: Core.hh:1082
void slotPluginExists(const QString &_pluginName, bool &_exists)
Check if a plugin exists.
Definition: RPC.cc:63
void slotExecuteAfterStartup()
Executed after loading core completly to load files from commandline.
void viewerSnapshot()
Take a snapshot from all viewers.
Definition: Core.cc:1550
void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard lasso selection is required.
QTimer videoTimer_
Slot called everytime the view is updated.
Definition: Core.hh:931
std::vector< PluginLogger * > loggers_
Logger interfaces between plugins and core logger.
Definition: Core.hh:1642
void applicationSnapshot()
Take a snapshot from the whole app.
Definition: Core.cc:1538
void slotUpdateTexture(const QString &_name, int _identifier)
Tell the plugins to update the given texture.
void slotAddEmptyObject(DataType _type, int &_id)
Slot adding empty object of a given type.
void createWidget(const QString &_objectName, const QString &_uiFilename, bool _show=true)
Create an script object from a ui file.
Definition: scripting.cc:134
ProcessManagerWidget * processManager_
A job has been started by a plugin.
Definition: Core.hh:1545
void setMaxFrameRate(int _rate)
set the maximal framerate ( automatically enables framerate restriction )
Definition: Core.cc:1055
SeparatorNode * root_node_scenegraph_
Scenegraphs root node.
Definition: Core.hh:1079
void slotObjectUpdated(int _identifier, const UpdateType &_type=UPDATE_ALL)
Called by the plugins if they changed something in the object list (deleted, added,...
void floodFillSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard flood fill selection has been performed.
void addMultiTexture(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
The texture with the given name and filename has been added.
void slotExecuteFileScript(const QString &_filename)
Definition: scripting.cc:83
void slotVisibilityChanged(int _id)
Called when a plugin changes the visibility of an object.
void updateView()
Called when a plugin requests an update in the viewer.
Definition: Core.cc:966
void switchTexture(QString)
Switch Texture Plugins to a given Mode.
void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier, DataType _objectTypeRestriction)
Signal send to plugins when whole scene is cleared.
void setView(QString view)
Called when a plugin requests an update in the viewer.
Definition: scripting.cc:369
void slotShowPlugins()
Show Plugins Dialog.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
void textureIndexPropertyName(int _id, QString &_propertyName)
get the texture index property name
void PluginWheelEvent(QWheelEvent *, const std::string &)
When this Signal is emitted when a Wheel Event occures.
QFile * logFile_
logfile
Definition: Core.hh:1210
void slotAddSelectionParameters(const QString &_handleName, QWidget *_widget, const QString &_category, SelectionInterface::PrimitiveType _type)
SelectionInterface: Called in order to add interactive parameters for a specific primitive type.
void slotSaveSelection(INIFile &_file)
SelectionInterface: Called when a selection should be stored into a file.
void restoreKeyBindings()
Restore key assignments from configs files.
int getObjectId(QString _filename)
Get object id from filename.
Definition: scripting.cc:176
void getActiveDataTypes(SelectionInterface::TypeList &_types)
SelectionInterface: This signal is emitted when the active (selected) data types should be fetched.
void exitApplication()
exit the current application
Definition: Core.cc:1083
void slotSurfaceLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when surface lasso selection operation has been performed.
void setViewMode(QString _viewMode)
Set the active ViewMode.
Definition: scripting.cc:183
void slotJobCancelRequested(const QString &_jobId)
Called by dialogs if cancel button is pressed.
Definition: process.cc:268
void slotTextureFilename(int _id, const QString &_textureName, QString &_textureFilename)
Called by plugins if texture name should be fetched.
void activateToolbox(QString _pluginName, QString _toolboxName, bool activate)
expand or collapse a toolbox
Definition: scripting.cc:294
void executePythonScript(const QString &_script)
execute the given string as a python script
Definition: scripting.cc:493
void slotAddHiddenPickMode(const std::string &_mode)
Add a new and invisible picking mode to the examiner_widget_.
Definition: Core.cc:955
void viewUpdated()
Slot called everytime the view is updated.
Definition: Video.cc:123
void slotFileOpened(int _id)
Called when a file has been opened.
void slotAddSelectionEnvironment(const QString &_modeName, const QString &_description, const QString &_icon, QString &_handleName)
SelectionInterface: Called when a new selection type button should be added to the toolbar.
void redo(int _objectid)
Signal send to plugins when whole scene is cleared.
void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the texture's filename
int toolboxindex_
Index of Plugins toolbox widget.
Definition: Core.hh:1243
void textureChangeImage(QString _textureName, QImage &_image)
Change the image for a given texture.
void loggerState(int _state)
Change the logging window state.
Definition: Core.cc:1110
void slotSetRenderer(unsigned int _viewer, QString _rendererName)
called to switch the renderer for a specific viewer
void slotMouseEventLight(QMouseEvent *_event)
Handle Mouse events when in Light mode.
Definition: Core.cc:828
void slotUnBlockPlugin(const QString &_rpcName)
Function for UnBlocking Plugins. Plugins will not loaded automatically.
void scriptLogFunction(const QString &_output)
stream for logging to file
Definition: scripting.cc:130
void textureGetImage(QString _textureName, QImage &_image)
fetch texture image
void slotRecentOpen(QAction *_action)
Open Recent file.
Definition: Core.cc:1172
void loadSettings()
Load status from file.
void restored(int _objectId)
Backup Plugin tells other Plugins that a restore has happened.
prototypeMatrix4x4 matrix4x4Prototype_
Prototype for the Matrix type.
Definition: Core.hh:1365
void slotExit()
Exit Application.
Definition: Core.cc:1240
void addMultiTexture(QString _textureGroup, QString _name, QImage _image, int _id, int &_textureId)
The texture with the given name and image has been added.
void multiViewMode(int _mode)
Switch the multiView Mode.
Definition: Core.cc:1158
void slotGetCurrentTexture(int _id, QString &_textureName)
Called by plugins if current texture should be retrieved.
void clearObjectComment(int objId, QString key)
Called when a plugin requests an update in the viewer.
Definition: Core.cc:1894
prototypeVec3d vec3dPrototype_
Prototype for the Vector type.
Definition: Core.hh:1356
void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard closest boundary selection is required.
void slotGetActivePrimitiveType(SelectionInterface::PrimitiveType &_type)
SelectionInterface: Called when active primitive type should be fetched.
bool capture_
Slot called everytime the view is updated.
Definition: Core.hh:936
int nextBackupId_
Id for the next backup.
Definition: Core.hh:1636
QString getCurrentViewMode()
Get current view mode.
Definition: scripting.cc:191
void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, const QString &_customIdentifier, bool _deselect)
SelectionInterface: Called when custom selection operation has been performed.
void slotGetScriptingEngine(QScriptEngine *&_engine)
Core scripting engine.
Definition: scripting.cc:76
void writeObjFile(QString _filename, bool _relativePaths, bool _targetOnly, std::map< int, QString > &_fileMapping)
Write current status to obj file (Application and File Options)
Definition: ParseObj.cc:65
void slotAddCustomSelectionMode(const QString &_handleName, const QString &_modeName, const QString &_description, const QString &_icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier)
SelectionInterface: Add new selection mode for specified type.
void stopVideoCapture()
Stop video capturing.
Definition: Video.cc:109
void slotTextureChangeImage(const QString &_textureName, QImage &_image)
Called by plugins if texture image should be changed.
void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: This signal is emitted when a type selection plugin wants to listen to a key even...
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when closest boundary selection operation has been performed.
QString serializeMaterialProperties(int _objId)
Serialize material properties.
Definition: Core.cc:1861
void pluginsInitialized(QVector< QPair< QString, QString > > const &)
Called after all plugins are loaded and additionally passes command line plugin options.
int nextBackupGroupId_
Id for the next backup group.
Definition: Core.hh:1639
QList< SlotInfo > globalFunctions_
Core scripting engine.
Definition: Core.hh:1424
void updateUI()
process events during script execution to keep the ui alive
Definition: Core.cc:1017
void jobCanceled(QString _jobId)
A job has been started by a plugin.
void slotGetSubTextures(int _id, const QString &_multiTextureName, QStringList &_subTextures)
Called by plugins if a multi-texture's sub textures should be fetched.
void slotShowVolumeLassoSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide volume lasso selection operation for specific selection mode.
void slotRegisterType(const QString &_handleName, DataType _type)
SelectionInterface: Called when a data type is added for a specific selection type.
QList< int > objectList(QString _selection, QStringList _types)
return the list of available object that has the given selection and type
Definition: Core.cc:1619
bool saveObject(int _id, QString _filename)
Save an object.
void setObjectComment(int objId, QString key, QString comment)
Called when a plugin requests an update in the viewer.
Definition: Core.cc:1881
void signalObjectUpdated(int)
When this Signal is emitted all Plugins are informed that the object list changed.
bool getJob(QString _jobId, int &_index)
Find a job in the jobslist.
Definition: process.cc:124
void externalLog(Logtype _type, QString _message)
This signal is emitted to send log data to a plugin.
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
void lassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard lasso selection has been performed.
void slotTargetObjectsOnly(bool &_targetsOnly)
SelectionInterface: Called when target restriction state should be fetched.
SeparatorNode * dataSeparatorNode_
Toplevel Nodes for data objects.
Definition: Core.hh:1089
int addEmptyObject(DataType _type)
std::vector< QString > commandLineScriptNames_
Vector storing filenames from commandline to be opened after application startup (script files)
Definition: Core.hh:891
void setTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
Definition: Core.hh:1652
bool checkOpenGLCapabilities()
OpenGL capability check.
Definition: Core.cc:2011
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
Definition: Core.cc:1102
void openIniFile(QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
Load information from an ini file.
Definition: ParseIni.cc:400
void addTexture(QString, QString, uint)
The texture with the given name and filename has been added.
void slotShowSphereSelectionMode(const QString &_handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide sphere selection operation for specific selection mode.
Predefined datatypes.
Definition: DataTypes.hh:83
Class for the handling of simple configuration files.
Definition: INIFile.hh:100
Interface class for type definitions.
Update type class.
Definition: UpdateType.hh:59
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.