Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 
52 
53 //=============================================================================
54 //
55 // CLASS Core
56 //
57 //=============================================================================
58 
64 #ifndef MVIEWWIDGET_HH
65 #define MVIEWWIDGET_HH
66 
67 
68 //== INCLUDES =================================================================
69 
70 #include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
71 
72 // QT INCLUDES
73 #include <QVariant>
74 #include <QMainWindow>
75 #include <QToolBox>
76 #include <QStackedWidget>
77 #include <QSplashScreen>
78 
79 #include <QDockWidget>
80 #include <QVector>
81 #include <QProgressDialog>
82 
83 #include <QtScript/QScriptEngine>
84 #include <QtScript/QtScript>
85 
86 #include "OpenFlipper/INIFile/INIFile.hh"
87 
90 
91 // Prototypes for scripting
92 #include "OpenFlipper/Scripting/scriptPrototypes/prototypeVec3d.hh"
93 #include "OpenFlipper/Scripting/scriptPrototypes/prototypeVec4d.hh"
94 #include "OpenFlipper/Scripting/scriptPrototypes/prototypeMatrix4x4.hh"
95 #include "OpenFlipper/Scripting/scriptPrototypes/prototypeDataType.hh"
96 #include <OpenFlipper/Scripting/scriptWrappers/vec3dWrapper.hh>
97 #include <OpenFlipper/Scripting/scriptWrappers/vec4dWrapper.hh>
98 #include <OpenFlipper/Scripting/scriptWrappers/matrix4x4Wrapper.hh>
99 #include <OpenFlipper/Scripting/scriptWrappers/DataTypeWrapper.hh>
100 // #include <OpenFlipper/Scripting/scriptWrappers/ObjectIdWrapper.hh>
101 
102 // Required Interface definition ( Some variables were defined there )
108 #include "OpenFlipper/BasePlugin/SelectionInterface.hh" // -> for SelectionInterface::PrimitiveType
110 
112 
113 // Process manager widget
114 #include <OpenFlipper/widgets/processManagerWidget/processManagerWidget.hh>
115 
117 
118 #include <OpenFlipper/Core/PluginInfo.hh>
119 
120 #include <ACG/Scenegraph/CoordsysNode.hh>
121 
122 #include <OpenFlipper/threads/JobInfo.hh>
123 
125 #include <OpenFlipper/common/InformationPlugins.hh>
126 #include "SpinBoxEventFilter.hh"
127 
128 //== CLASS DEFINITION =========================================================
129 
130 
131 struct dataTypes {
132  QString name;
133  DataType type;
134  TypeInterface* plugin;
135 };
136 
139 class Core : public QObject
140 {
141  Q_OBJECT
142 
143 public:
144 
146  Core();
147 
148  void init();
149 
151  ~Core();
152 
154  bool add_sync_host(const QString& _name);
155 
156 
157 private slots:
158 
160  void slotMouseEventIdentify( QMouseEvent* _event );
161 
163  void slotMouseEventLight( QMouseEvent* _event );
164 
165 protected:
166 
167  //===========================================================================
170  //===========================================================================
171 signals:
173  void allCleared();
174 
176  void signalObjectUpdated(int);
177 
179  void signalObjectUpdated(int, const UpdateType&);
180 
182  void PluginWheelEvent(QWheelEvent * , const std::string & );
183 
185  void PluginMouseEvent(QMouseEvent* );
186 
188  void PluginMouseEventLight( QMouseEvent* );
189 
191  void objectSelectionChanged( int );
192 
194  void pluginViewChanged();
195 
197  void pluginSceneDrawn();
198 
200  void addTexture( QString, QString , uint, int );
201 
203  void addTexture( QString, QString , uint );
204 
206  void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId );
207 
209  void updateTexture( QString , int );
210 
212  void updateAllTextures( );
213 
215  void updatedTextures( QString , int );
216 
218  void setTextureMode(QString _textureName ,QString _mode, int _id);
219 
221  void setTextureMode(QString _textureName ,QString _mode);
222 
224  void switchTexture( QString, int );
225 
227  void switchTexture( QString );
228 
230  void textureChangeImage( QString _textureName , QImage& _image );
231 
233  void textureChangeImage( QString _textureName , QImage& _image , int _id );
234 
236  void textureGetImage( QString _textureName , QImage& _image );
237 
239  void textureGetImage( QString _textureName , QImage& _image , int _id );
240 
242  void textureIndex( QString _textureName, int _id, int& _index);
243 
245  void textureIndexPropertyName( int _id, QString& _propertyName);
246 
248  void textureName( int _id, int _textureIndex, QString& _textureName);
249 
251  void textureFilename( int _id, QString _textureName, QString& _textureFilename);
252 
254  void getCurrentTexture( int _id, QString& _textureName );
255 
257  void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
258 
260  void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
261 
263  void registerType(QString _handleName, DataType _type);
264 
266  void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
267 
269  void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
270  SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
271  void addCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
272  SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
273  DataType _objectTypeRestriction);
274 
276  void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type);
277 
279  void selectionOperation(QString _operation);
280 
282  void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
283 
285  void showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
286 
288  void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
289 
291  void showSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
292 
294  void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
295 
297  void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
298 
300  void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
301 
303  void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
304 
306  void toggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
307 
309  void lassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
310 
312  void volumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
313 
315  void surfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
316 
318  void sphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
319 
321  void closestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
322 
324  void floodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
325 
327  void componentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
328 
330  void customSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
331 
333  void getActiveDataTypes(SelectionInterface::TypeList& _types);
334 
336  void getActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
337 
339  void targetObjectsOnly(bool& _targetsOnly);
340 
342  void loadSelection(const INIFile& _file);
343 
345  void saveSelection(INIFile& _file);
346 
348  void registerKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers);
349 
351  void keyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers = Qt::NoModifier);
352 
354  void iniLoad( INIFile&, int );
355 
357  void iniSave( INIFile& _ini ,int _id );
358 
360  void iniSaveOptions( INIFile& _ini );
361 
363  void iniLoadOptions( INIFile& _ini );
364 
366  void iniLoadOptionsLast( INIFile& _ini );
367 
369  void saveOnExit( INIFile& _ini );
370 
372  void createBackup( int _objectid, QString _name, UpdateType _type = UPDATE_ALL);
373  void createBackup( IdList _objectids, QString _name, std::vector<UpdateType> _types);
374 
376  void undo(int _objectid);
377  void redo(int _objectid);
378  void undo();
379  void redo();
380 
382  void aboutToRestore(int _objectId);
383 
385  void restored( int _objectId);
386 
388  void openedFile( int _id );
389 
391  void emptyObjectAdded( int _id);
392 
394  void pluginsInitialized();
395 
397  void visibilityChanged(int _id);
398 
400  void objectPropertiesChanged( int _id );
401 
403  void objectDeleted( int );
404 
407  //===========================================================================
410  //===========================================================================
411  private slots :
412 
414  void slotObjectUpdated(int _identifier, const UpdateType& _type = UPDATE_ALL);
415 
417  void slotVisibilityChanged(int _id);
418 
420  void slotObjectPropertiesChanged( int _id );
421 
423  void slotObjectSelectionChanged( int _id);
424 
426  void slotAddPickMode( const std::string& _mode );
427 
429  void slotAddHiddenPickMode( const std::string& _mode );
430 
432  void slotAddTexture( QString _textureName , QString _filename , uint _dimension , int _id );
433 
435  void slotAddTexture( QString _textureName , QString _filename , uint _dimension );
436 
438  void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId );
439  void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int* _textureId );
440 
442  void slotUpdateTexture( QString _name , int _identifier);
443 
445  void slotUpdateAllTextures( );
446 
448  void slotTextureUpdated( QString _textureName , int _identifier );
449 
451  void slotSetTextureMode(QString _textureName ,QString _mode, int _id);
452 
454  void slotSetTextureMode(QString _textureName ,QString _mode);
455 
457  void slotSwitchTexture( QString _textureName, int _id );
458 
460  void slotSwitchTexture( QString _textureName );
461 
463  void slotTextureChangeImage( QString _textureName , QImage& _image );
464 
466  void slotTextureChangeImage( QString _textureName , QImage& _image , int _id );
467 
469  void slotTextureGetImage( QString _textureName , QImage& _image );
470 
472  void slotTextureGetImage( QString _textureName , QImage& _image , int _id );
473 
475  void slotTextureIndex( QString _textureName, int _id, int& _index);
476 
478  void slotTextureIndexPropertyName( int _id, QString& _propertyName);
479 
481  void slotTextureName( int _id, int _textureIndex, QString& _textureName);
482 
484  void slotTextureFilename( int _id, QString _textureName, QString& _textureFilename);
485 
487  void slotGetCurrentTexture( int _id, QString& _textureName );
488 
490  void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
491 
493  void slotLoad(QString _filename, DataType _type, int& _id);
494 
496  void slotLoad(QStringList _filenames, IdList _pluginIDs);
497 
499  void slotFileOpened ( int _id );
500 
502  void slotEmptyObjectAdded ( int _id );
503 
505  void slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName);
506 
508  void slotRegisterType(QString _handleName, DataType _type);
509 
511  void slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
512 
522  void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
523  SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier);
524 
535  void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
536  SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
537  DataType _objectTypeRestriction);
538 
540  void slotAddSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type);
541 
543  void slotSelectionOperation(QString _operation);
544 
546  void slotShowToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
547 
549  void slotShowLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
550 
552  void slotShowVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
553 
555  void slotShowSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
556 
558  void slotShowSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
559 
561  void slotShowClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
562 
564  void slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
565 
567  void slotShowComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
568 
570  void slotToggleSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
571 
573  void slotLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
574 
576  void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
577 
579  void slotSurfaceLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
580 
582  void slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
583 
585  void slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
586 
588  void slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
589 
591  void slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
592 
594  void slotCustomSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect);
595 
597  void slotGetActiveDataTypes(SelectionInterface::TypeList& _types);
598 
600  void slotGetActivePrimitiveType(SelectionInterface::PrimitiveType& _type);
601 
603  void slotTargetObjectsOnly(bool& _targetsOnly);
604 
606  void slotLoadSelection(const INIFile& _file);
607 
609  void slotSaveSelection(INIFile& _file);
610 
612  void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers);
613 
615  void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers);
616 
624  void slotGetAllFilters ( QStringList& _list);
625 
626 
628  void slotDeleteAllObjects( );
629 
631  void slotCrossPluginConnect( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot);
632 
634  void slotSetRenderer(unsigned int _viewer, QString _rendererName);
635 
637  void slotGetCurrentRenderer(unsigned int _viewer, QString& _rendererName);
638 
640  // void slotGetPlugin(QString _name, QObject* & _plugin );
641 
644  //===========================================================================
647  //===========================================================================
648 public slots:
649 
651  void updateView();
652 
654  void blockScenegraphUpdates(bool _block);
655 
657  void updateUI();
658 
660  void clearAll();
661 
663  void deleteObject( int _id );
664 
665  void setObjectComment(int objId, QString key, QString comment);
666  void clearObjectComment(int objId, QString key);
667  void clearAllComments(int objId);
668 
670  void fullscreen( bool _state );
671 
673  void showViewModeControls( bool _show );
674 
676  void loggerState(int _state);
677 
679  void enableOpenMeshErrorLog(bool _state);
680 
682  void showToolbox( bool _state );
683 
685  void showStatusBar( bool _state );
686 
688  void multiViewMode( int _mode );
689 
691  void restrictFrameRate( bool _enable );
692 
694  void setMaxFrameRate( int _rate );
695 
698  void snapshotBaseFileName(QString _fname, unsigned int _viewerId = 0);
699 
701  void snapshotFileType(QString _type, unsigned int _viewerId = 0);
702 
704  void snapshotCounterStart(const int _counter, unsigned int _viewerId = 0);
705 
711  void snapshot(unsigned int _viewerId = 0, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int _numSamples = 1);
712 
714  void applicationSnapshot();
715 
717  void applicationSnapshotName(QString _name);
718 
720  void viewerSnapshot();
721 
723  void viewerSnapshot(QString file_name, bool store_comments,
724  bool comments_visible_only, bool comments_targeted_only,
725  bool store_material_info, int snapshot_width, int snapshot_height,
726  bool snapshot_transparent, bool hide_coord_sys,
727  int snapshot_multisampling, bool store_view);
728 
730  void resizeViewers(int _width, int _height );
731 
733  void resizeApplication(int _width, int _height );
734 
736  void writeVersionNumbers(QString _filename);
737 
739  QList<int> objectList (QString _selection, QStringList _types);
740 
742  void blockSceneGraphUpdates();
743 
746 
747  void setView(QString view);
748  void setViewAndWindowGeometry(QString view);
749 
752  //===========================================================================
755  //===========================================================================
756 
757 public slots:
763  void addViewModeToolboxes(QString _modeName, QString _toolboxList);
764 
771  void addViewModeToolbars(QString _modeName, QString _toolbarList);
772 
778  void addViewModeContextMenus(QString _modeName, QString _contextMenuList);
779 
784  void addViewModeIcon(QString _modeName, QString _iconName);
785 
790  void setToolBoxSide(QString _side);
791 
797  void setToolBoxActive(QString _toolBoxName, bool _active);
798 
801  //===========================================================================
804  //===========================================================================
805 public slots:
814  int loadObject ( QString _filename );
815 
816 private slots:
817  void loadObjectFinished(QString _filename);
818 
823  void resetScenegraph( bool _resetTrackBall );
824 
825  public :
826 
838  void commandLineOpen(const char* _filename, bool _asPolyMesh );
839 
850  void commandLineScript(const char* _filename );
851 
852  private slots:
853 
861 
862  private:
864  std::vector< std::pair < std::string , bool > > commandLineFileNames_;
865 
867  std::vector< std::string > commandLineScriptNames_;
868 
869  public:
870 
874  int addEmptyObject( DataType _type );
875 
883  int loadObject( DataType _type, QString _filename);
884 
887  //===========================================================================
890  //===========================================================================
891  private slots:
893  void viewUpdated();
894 
896  void captureVideo();
897 
898  public slots:
899 
901  void startVideoCapture(QString _baseName, int _fps, bool _captureViewers);
902 
904  void stopVideoCapture();
905 
906  private:
907  QTimer videoTimer_;
909 
911 
912  bool capture_;
913 
916 
918  //===========================================================================
921  //===========================================================================
922 
923  public slots:
924 
928  bool saveObject( int _id, QString _filename );
929 
930  void saveObject( int _id, QString _filename, int _pluginID );
931 
932  void saveObjects( IdList _ids, QString _filename, int _pluginID );
933 
938  bool saveObjectTo( int _id, QString _filename );
939 
940  bool saveObjectsTo( IdList _ids, QString _filename );
941 
943  void saveAllObjects();
944 
946  void saveAllObjectsTo();
947 
949  void saveSettings();
950 
952  void saveSettings(QString filePath, bool is_saveObjectInfo, bool is_targetOnly, bool is_saveAll,
953  bool is_askOverwrite, bool is_saveProgramSettings, bool is_savePluginSettings);
954 
956  void loadObject();
957 
959  void loadSettings();
960 
962  void loadSettings(QString _filename);
963 
965  int getObjectId(QString _filename);
966 
972  void deserializeMaterialProperties(int _objId, QString _props);
973 
979  QString serializeMaterialProperties(int _objId);
980 
983  //===========================================================================
986  //===========================================================================
987  private slots :
988 
990  void slotMouseEvent( QMouseEvent* _event );
991 
993  void slotWheelEvent( QWheelEvent * _event, const std::string & _mode);
994 
999  void slotAddEmptyObjectMenu();
1000 
1002  void slotAddEmptyObject( DataType _type , int& _id );
1003  void slotAddEmptyObject( DataType _type, int* _id);
1004 
1006  void slotCopyObject( int _oldId , int& _newId );
1007 
1009  void slotExit();
1010 
1012  void slotRecentOpen(QAction* _action);
1013 
1015  void slotGenerateBackup( int _id, QString _name, UpdateType _type );
1016 
1017  public slots:
1018 
1020  void addToolbox(QString _name ,QWidget* _widget);
1021 
1023  void addToolbox(QString _name ,QWidget* _widget, QIcon* _icon);
1024 
1026  void addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
1027  QWidget* _headerAreaWidget);
1028 
1036  QWidget *getToolbox(QString _pluginName, QString _toolboxName);
1037 
1038  void activateToolbox(QString _pluginName, QString _toolboxName, bool activate);
1039 
1040  private :
1041 
1042  //===========================================================================
1045  //===========================================================================
1046 
1047  private:
1050 
1053 
1056 
1057 
1060 
1063 
1066 
1069 
1072  //===========================================================================
1075  //===========================================================================
1076 
1078  void setupOptions();
1079 
1081  void readGUIOptions(INIFile& _ini);
1082 
1084  void readApplicationOptions(INIFile& _ini);
1085 
1087  void writeApplicationOptions(INIFile& _ini);
1088 
1090  void restoreKeyBindings();
1091 
1092  public slots:
1093 
1095  void saveOptions();
1096 
1098  void applyOptions();
1099 
1110  void openIniFile( QString _filename,
1111  bool _coreSettings ,
1112  bool _perPluginSettings,
1113  bool _loadObjects );
1114 
1115  private:
1116 
1129  void writeIniFile( QString _filename,
1130  bool _relativePaths,
1131  bool _targetOnly,
1132  bool _saveSystemSettings,
1133  bool _savePluginSettings ,
1134  bool _saveObjectInfo,
1135  std::map<int,QString>& _fileMapping);
1136 
1141  void writeObjFile(QString _filename, bool _relativePaths, bool _targetOnly, std::map<int,QString>& _fileMapping);
1142 
1144  void writeOnExit();
1145 
1149  //===========================================================================
1152  //===========================================================================
1153 
1154  signals:
1156  void log(Logtype _type , QString _message );
1157 
1159  void log(QString _message );
1160 
1162  void scriptLog(QString _message);
1163 
1165  void externalLog(Logtype _type , QString _message);
1166 
1167  private slots:
1168 
1170  void slotLog(Logtype _type, QString _message);
1171 
1173  void slotLogToFile(Logtype _type, QString _message);
1174 
1175  private:
1177  QTextStream* logStream_;
1178 
1180  QFile* logFile_;
1181 
1182  public :
1183  void scriptLogFunction( QString _output);
1184 
1188  //===========================================================================
1191  //===========================================================================
1192 
1193  private :
1195  bool checkSlot(QObject* _plugin , const char* _slotSignature);
1196 
1198  bool checkSignal(QObject* _plugin , const char* _signalSignature);
1199 
1202  //===========================================================================
1205  //===========================================================================
1206 
1207  public :
1208  const std::vector<PluginInfo> plugins() const {return plugins_; };
1209 
1210  private:
1212  std::vector<PluginInfo> plugins_;
1213 
1216 
1218  void loadPlugins();
1219  private slots:
1221  void slotShowPlugins();
1222 
1224  void loadPlugin(const QString& _filename,const bool _silent, QString& _licenseErrors , QObject* _plugin = 0 );
1225 
1227  void slotLoadPlugin();
1228 
1230  void slotBlockPlugin(const QString &_rpcName);
1231 
1233  void slotUnBlockPlugin(const QString &_rpcName);
1234 
1237  //===========================================================================
1240  //===========================================================================
1241  signals:
1242  void genericMetadataDeserialized(QString key, QString value);
1243  void objectMetadataDeserialized(QString object_name, QString value);
1244 #if QT_VERSION >= 0x050000
1245  void objectMetadataDeserializedJson(
1246  QString object_name, QJsonDocument value);
1247 #endif
1248 
1249  private slots:
1250  void slotMetadataDeserialized( const QVector<QPair<QString, QString> > &data);
1251 
1255  //===========================================================================
1258  //===========================================================================
1259 
1260  signals:
1261 
1262  void scriptInfo( QString _pluginName , QString _functionName );
1263 
1264  void executeScript( QString _script );
1265 
1266  void executeFileScript( QString _filename );
1267 
1268  void setSlotDescription(QString _slotName, QString _slotDescription,
1269  QStringList _parameters, QStringList _descriptions);
1270 
1271  public slots:
1279  void createWidget(QString _objectName, QString _uiFilename, bool _show = true);
1280 
1282  void setViewMode(QString _viewMode);
1283 
1285  QString getCurrentViewMode();
1286 
1288  void setViewModeIcon(QString _mode, QString _iconName);
1289 
1291  void moveToolBoxToTop(QString _name);
1292 
1294  void moveToolBoxToBottom(QString _name);
1295 
1296  void showReducedMenuBar(bool reduced);
1297 
1298 
1299 
1300  private :
1302  QScriptEngine scriptEngine_;
1303 
1305  std::vector<ScriptingWrapper*> scriptingWrappers_;
1306 
1308  QStringList scriptingFunctions_;
1309 
1312 
1315 
1318 
1321 
1322 
1323  private slots:
1324  void slotScriptInfo( QString _pluginName , QString _functionName );
1325 
1326 
1331  void slotExecuteScript( QString _script );
1332 
1337  void slotExecuteFileScript( QString _filename );
1338 
1339  void slotGetScriptingEngine( QScriptEngine*& _engine );
1340 
1341  void slotGetAllAvailableFunctions( QStringList& _functions );
1342 
1344  void slotSetSlotDescription(QString _slotName, QString _slotDescription,
1345  QStringList _parameters, QStringList _descriptions);
1346 
1348  void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription,
1349  QStringList _parameters, QStringList _descriptions);
1350 
1352  void slotGetDescription(QString _function, QString& _fnDescription,
1353  QStringList& _parameters, QStringList& _descriptions );
1354 
1355  void slotScriptError(const QScriptValue &error);
1356 
1357  private:
1358 
1359  QList< SlotInfo > coreSlots_;
1360  QList< SlotInfo > globalFunctions_;
1361 
1362  void setDescriptions();
1363 
1366  //===========================================================================
1369  //===========================================================================
1370  private slots:
1371 
1377  void slotPluginExists( QString _pluginName , bool& _exists );
1378 
1385  void slotFunctionExists( QString _pluginName , QString _functionName , bool& _exists );
1386 
1393  void slotCall( QString _pluginName , QString _functionName , bool& _success );
1394 
1400  void slotCall( QString _expression , bool& _success );
1401 
1412  void slotGetValue(QString _expression, QVariant& _result );
1413 
1416  //===========================================================================
1419  //===========================================================================
1420 
1421  private slots:
1422 
1424  void checkScenegraphDirty();
1425 
1426  private:
1427 
1430 
1432  QTime *redrawTime_;
1433 
1437  //===========================================================================
1440  //===========================================================================
1441 
1442  private:
1443 
1444  QList< JobInfo > currentJobs;
1445 
1447 
1449  bool getJob(QString _jobId, int& _index);
1450 
1451  private slots:
1452 
1454  void slotStartJob( QString _jobId, QString _description , int _min , int _max,bool _blocking );
1455 
1457  void slotSetJobState(QString _jobId, int _value );
1458 
1460  void slotSetJobName(QString _jobId, QString _name );
1461 
1463  void slotSetJobDescription(QString _jobId, QString _text );
1464 
1466  void slotCancelJob(QString _jobId );
1467 
1469  void slotFinishJob(QString _jobId );
1470 
1472  void slotJobCancelRequested(QString _jobId);
1473 
1474  signals:
1475 
1476  void jobCanceled( QString _jobId );
1477 
1480  //===========================================================================
1483  //===========================================================================
1484 
1485  private slots:
1486 
1488  void newObject(int _objectId);
1489 
1491  void deletedObject(int _objectId);
1492 
1495  //===========================================================================
1498  //===========================================================================
1499 
1500  public slots:
1501 
1503  void exitApplication();
1504 
1510  void exitFailure();
1511 
1512  void finishSplash();
1513 
1514 
1517  private:
1523  bool checkOpenGLCapabilities();
1524 
1529  bool checkLibraryVersions();
1530 
1531  void hookUpEventFilter(QWidget *widget);
1532 
1533 
1534  private :
1535 
1538 
1541 
1543  std::vector<PluginLogger*> loggers_;
1544 
1546  std::vector<dataTypes> supportedDataTypes_;
1547 
1548  private :
1551 
1554 
1556  QSplashScreen* splash_;
1557 
1560 
1562  QVector<ViewMode*> viewModes_;
1563 
1565  QTimer* redrawTimer_;
1566 
1567  SpinBoxEventFilter spinBoxEventFilter_;
1568 
1569 
1570 };
1571 
1573 QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine);
1574 
1576 QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine);
1577 
1579 QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine);
1580 
1581 //=============================================================================
1582 #endif // MVIEWWIDGET_HH defined
1583 //=============================================================================
1584 
void setObjectComment(int objId, QString key, QString comment)
Called when a plugin requests an update in the viewer.
Definition: Core.cc:1789
void viewerSnapshot()
Take a snapshot from all viewers.
Definition: Core.cc:1459
void resizeApplication(int _width, int _height)
resize the whole Application
Definition: Core.cc:1491
void jobCanceled(QString _jobId)
A job has been started by a plugin.
void iniLoadOptionsLast(INIFile &_ini)
This signal is used to tell the plugins to load their new status after objects are loaded...
bool getJob(QString _jobId, int &_index)
Find a job in the jobslist.
Definition: process.cc:130
bool saveObject(int _id, QString _filename)
Save an object.
void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
Called by a plugin if it creates a multitexture.
SeparatorNode * root_node_scenegraph_global_
Seperator node for global nodes.
Definition: Core.hh:1052
void restrictFrameRate(bool _enable)
Enable or disable framerate restriction.
Definition: Core.cc:970
void slotShowLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide lasso selection operation for specific selection mode.
void addViewModeToolbars(QString _modeName, QString _toolbarList)
Scripting function to set toolbars in a view mode.
Definition: scripting.cc:200
void slotLog(Logtype _type, QString _message)
Console logger.
Definition: Logging.cc:97
void slotShowPlugins()
Show Plugins Dialog.
void slotScriptInfo(QString _pluginName, QString _functionName)
Core scripting engine.
Definition: scripting.cc:70
void PluginMouseEventLight(QMouseEvent *)
Emitted when an light event occurs.
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 showLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard lasso selection is required.
QString splashMessage_
Last Splash message;.
Definition: Core.hh:1559
void setupOptions()
Get all ini files and set basic paths and options.
void snapshotCounterStart(const int _counter, unsigned int _viewerId=0)
Set the start index for the snapshot counter.
Definition: Core.cc:1421
void slotCancelJob(QString _jobId)
A job state has been canceled by a plugin.
Definition: process.cc:218
void slotCrossPluginConnect(QString _pluginName1, const char *_signal, QString _pluginName2, const char *_slot)
Called to create inter plugin connections.
void getActiveDataTypes(SelectionInterface::TypeList &_types)
SelectionInterface: This signal is emitted when the active (selected) data types should be fetched...
void signalObjectUpdated(int)
When this Signal is emitted all Plugins are informed that the object list changed.
void showVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard volume lasso selection is required...
void clearAll()
Clear all data objects.
Definition: Core.cc:987
void targetObjectsOnly(bool &_targetsOnly)
SelectionInterface: This signal is emitted if the current target restriction state is requested...
void createWidget(QString _objectName, QString _uiFilename, bool _show=true)
Create an script object from a ui file.
Definition: scripting.cc:94
void viewUpdated()
Slot called everytime the view is updated.
Definition: Video.cc:124
void saveSettings()
Save current status to a settings file. Solicit file name through dialog.
Definition: saveSettings.cc:56
void slotClosestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when closest boundary selection operation has been performed.
void slotCopyObject(int _oldId, int &_newId)
Slot copying an object.
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard toggle selection is required.
std::vector< std::pair< std::string, bool > > commandLineFileNames_
Vector storing filenames from commandline to be opened after application startup (objects) ...
Definition: Core.hh:864
void slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier)
SelectionInterface: Add new selection mode for specified type.
const std::vector< PluginInfo > plugins() const
List of all loaded plugins_.
Definition: Core.hh:1208
void slotUpdateTexture(QString _name, int _identifier)
Tell the plugins to update the given texture.
void allCleared()
Signal send to plugins when whole scene is cleared.
void slotSelectionOperation(QString _operation)
SelectionInterface: Called when a non-interactive operation has been performed.
void setTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
void switchTexture(QString, int)
Switch Texture Plugins to a given Mode.
void slotFileOpened(int _id)
Called when a file has been opened.
void slotAddEmptyObject(DataType _type, int &_id)
Slot adding empty object of a given type.
void addMultiTexture(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
The texture with the given name and filename has been added.
void blockScenegraphUpdates(bool _block)
Called when a plugin wants to lock or unlock scenegraph updates.
Definition: Core.cc:944
Logtype
Log types for Message Window.
QList< int > objectList(QString _selection, QStringList _types)
return the list of available object that has the given selection and type
Definition: Core.cc:1528
void setToolBoxSide(QString _side)
Scripting function to set the side of the main window on which the toolbox should be displayed...
Definition: scripting.cc:220
ACG::SceneGraph::MaterialNode * coordsysMaterialNode_
Node for coordsys Material.
Definition: Core.hh:1065
void slotSaveSelection(INIFile &_file)
SelectionInterface: Called when a selection should be stored into a file.
int nextBackupId_
Id for the next backup.
Definition: Core.hh:1537
void showSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard surface lasso selection is required...
void captureVideo()
Function called for every frame when capturing video.
Definition: Video.cc:93
void enableOpenMeshErrorLog(bool _state)
Enable or disable OpenMesh error logging.
Definition: Core.cc:1038
void slotObjectUpdated(int _identifier, const UpdateType &_type=UPDATE_ALL)
Called by the plugins if they changed something in the object list (deleted, added, or other property changes)
void startVideoCapture(QString _baseName, int _fps, bool _captureViewers)
Start video capturing.
Definition: Video.cc:69
int addEmptyObject(DataType _type)
void init()
Second initialization stage.
Definition: Core.cc:193
void slotAddPickMode(const std::string &_mode)
Add a new picking mode to the examiner_widget_.
Definition: Core.cc:867
QVector< ViewMode * > viewModes_
List of available draw modes.
Definition: Core.hh:1562
void unblockSceneGraphUpdates()
Unblock the scenegraph updates.
Definition: scripting.cc:319
int lastHeight_
Slot called everytime the view is updated.
Definition: Core.hh:915
void iniSave(INIFile &_ini, int _id)
This signal is used to tell the plugins to save the data of _id to the given file.
int toolboxindex_
Index of Plugins toolbox widget.
Definition: Core.hh:1215
void addSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString &_handleName)
SelectionInterface: This signal is emitted when a new toolbutton should be added. ...
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void slotGetSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
Called by plugins if a multi-texture's sub textures should be fetched.
void deserializeMaterialProperties(int _objId, QString _props)
Serialize material properties.
Definition: Core.cc:1750
void checkScenegraphDirty()
Called to check if the scenegraph needs to be redrawn.
Definition: Core.cc:955
void setToolBoxActive(QString _toolBoxName, bool _active)
Scripting function to activate or deactivate a toolbox.
Definition: scripting.cc:306
void deleteObject(int _id)
Called to delete an object.
Definition: Core.cc:1721
Update type class.
Definition: UpdateType.hh:70
void resizeViewers(int _width, int _height)
resize the examinerViewer
Definition: Core.cc:1480
void setDescriptions()
set the descriptions for scriptable slots of the core
Definition: Core.cc:1549
void updateUI()
process events during script execution to keep the ui alive
Definition: Core.cc:938
void iniLoadOptions(INIFile &_ini)
This signal is used to tell the plugins to load their new status.
void moveToolBoxToBottom(QString _name)
Move selected toolbox to bottom of side area.
Definition: scripting.cc:183
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
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:71
int getObjectId(QString _filename)
Get object id from filename.
Definition: scripting.cc:133
void setView(QString view)
Called when a plugin requests an update in the viewer.
Definition: scripting.cc:323
void sphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard sphere selection has been performed...
void slotGetAllAvailableFunctions(QStringList &_functions)
Core scripting engine.
Definition: scripting.cc:86
void slotShowSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide sphere selection operation for specific selection mode.
prototypeDataType DataTypePrototype_
Prototype for the DataType.
Definition: Core.hh:1317
void setSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
Core scripting engine.
void commandLineOpen(const char *_filename, bool _asPolyMesh)
Load an object from the commandline on application start.
void applicationSnapshot()
Take a snapshot from the whole app.
Definition: Core.cc:1447
bool add_sync_host(const QString &_name)
Synchronise two viewers.
QTimer * scenegraphCheckTimer_
Timer that starts scenegraph check.
Definition: Core.hh:1429
void toggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard toggle selection has been performed...
BaseObject * objectRoot_
Pointer to the data rootNode;.
Definition: Core.hh:1550
void slotDeleteAllObjects()
Called when a plugin wants to delete all objects.
Definition: Core.cc:1829
void scriptLog(QString _message)
Logging signal for ScriptEngine.
prototypeVec4d vec4dPrototype_
Prototype for the Vector type.
Definition: Core.hh:1314
prototypeVec3d vec3dPrototype_
Prototype for the Vector type.
Definition: Core.hh:1311
SeparatorNode * dataSeparatorNode_
Toplevel Nodes for data objects.
Definition: Core.hh:1059
void slotExecuteAfterStartup()
Executed after loading core completly to load files from commandline.
void slotFinishJob(QString _jobId)
A job state has been finished by a plugin.
Definition: process.cc:244
void applicationSnapshotName(QString _name)
Set the baseName for the application snapshot.
Definition: Core.cc:1453
void selectionOperation(QString _operation)
SelectionInterface: This signal is emitted when a non-interactive operation has been performed...
void slotAddEmptyObjectMenu()
Open the add Empty dialog.
QStringList scriptingFunctions_
List of all registered scripting functions.
Definition: Core.hh:1308
void slotGetActivePrimitiveType(SelectionInterface::PrimitiveType &_type)
SelectionInterface: Called when active primitive type should be fetched.
Definition: Core.hh:139
void slotSphereSelection(QMouseEvent *_event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when sphere selection operation has been performed.
bool saveObjectTo(int _id, QString _filename)
void componentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard connected components selection has been perf...
void showComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard connected components selection is required...
void addToolbox(QString _name, QWidget *_widget)
Add a Toolbox from a plugin or from scripting.
Definition: scripting.cc:256
void slotGetValue(QString _expression, QVariant &_result)
Definition: RPC.cc:152
QScriptEngine scriptEngine_
Core scripting engine.
Definition: Core.hh:1302
void slotGetDescription(QString _function, QString &_fnDescription, QStringList &_parameters, QStringList &_descriptions)
get available descriptions for a given public slot
Definition: Core.cc:1325
void saveAllObjects()
Slot for saving objects from Menu.
QScriptValue printToFileFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for sending output to a file.
Definition: scripting.cc:357
int nextBackupGroupId_
Id for the next backup group.
Definition: Core.hh:1540
void slotShowVolumeLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide volume lasso selection operation for specific selection mode...
void addViewModeContextMenus(QString _modeName, QString _contextMenuList)
Scripting function to set context menus in a view mode.
Definition: scripting.cc:208
void textureIndexPropertyName(int _id, QString &_propertyName)
get the texture index property name
void loadObject()
Open Load Widget.
void updateAllTextures()
Update all textures in the plugins.
void surfaceLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard surface lasso selection has been performed...
void stopVideoCapture()
Stop video capturing.
Definition: Video.cc:110
int captureType_
Slot called everytime the view is updated.
Definition: Core.hh:910
void slotGetCurrentRenderer(unsigned int _viewer, QString &_rendererName)
called to get the currently active renderer renderer for a specific viewer
void visibilityChanged(int _id)
Tell plugins that the visibility of an object has changed.
void slotTargetObjectsOnly(bool &_targetsOnly)
SelectionInterface: Called when target restriction state should be fetched.
void setViewMode(QString _viewMode)
Set the active ViewMode.
Definition: scripting.cc:140
void pluginSceneDrawn()
This signal is emitted after the scene has been drawn.
void pluginsInitialized()
Called after all plugins are loaded.
void slotGenerateBackup(int _id, QString _name, UpdateType _type)
Slot for generating type specific backups.
void slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString &_handleName)
SelectionInterface: Called when a new selection type button should be added to the toolbar...
bool checkOpenGLCapabilities()
OpenGL capability check.
Definition: Core.cc:1918
void slotTextureChangeImage(QString _textureName, QImage &_image)
Called by plugins if texture image should be changed.
void lassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard lasso selection has been performed...
void objectSelectionChanged(int)
This signal is emitted if the object has been changed (source/target)
void getCurrentTexture(int _id, QString &_textureName)
get current texture
void slotFunctionExists(QString _pluginName, QString _functionName, bool &_exists)
Check if a function exists.
Definition: RPC.cc:81
QTextStream * logStream_
stream for logging to file
Definition: Core.hh:1177
void addViewModeToolboxes(QString _modeName, QString _toolboxList)
Scripting function to set toolboxes in a view mode.
Definition: scripting.cc:192
void slotShowSurfaceLassoSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide surface lasso selection operation for specific selection mode...
void restored(int _objectId)
Backup Plugin tells other Plugins that a restore has happened.
void pluginViewChanged()
This signal is emitted if one of the viewers updated its view.
void slotWheelEvent(QWheelEvent *_event, const std::string &_mode)
Gets called by examiner widget when Wheel is moved in picking mode.
Definition: Core.cc:842
void slotAddHiddenPickMode(const std::string &_mode)
Add a new and invisible picking mode to the examiner_widget_.
Definition: Core.cc:876
std::vector< ScriptingWrapper * > scriptingWrappers_
Wrappers for plugin scripting.
Definition: Core.hh:1305
void customSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
SelectionInterface: This signal is emitted when a custom selection operation has been performed...
bool capture_
Slot called everytime the view is updated.
Definition: Core.hh:912
void resetScenegraph(bool _resetTrackBall)
void multiViewMode(int _mode)
Switch the multiView Mode.
Definition: Core.cc:1075
void slotUpdateAllTextures()
Update all textures in the plugins.
Class for the handling of simple configuration files.
Definition: INIFile.hh:105
void saveSelection(INIFile &_file)
SelectionInterface: This signal is emitted when a selection should be written into a file...
void updatedTextures(QString, int)
This Signal is send to the plugins if a texture has been updated.
void aboutToRestore(int _objectId)
Backup Plugin tells other Plugins that a restore will happen.
void executeScript(QString _script)
Core scripting engine.
void registerType(QString _handleName, DataType _type)
SelectionInterface: This signal is emitted when a data type should be registered for a selection mode...
void showSphereSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard sphere selection is required.
std::vector< PluginInfo > plugins_
List of all loaded plugins_.
Definition: Core.hh:1208
QList< SlotInfo > globalFunctions_
Core scripting engine.
Definition: Core.hh:1360
void slotGetAllFilters(QStringList &_list)
Called when a plugin requests a list of file-filters.
void slotTextureIndex(QString _textureName, int _id, int &_index)
Called by plugins if texture index should be fetched.
void saveOptions()
Save the current options to the standard ini file.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:192
void setViewModeIcon(QString _mode, QString _iconName)
Set the icon of a viewMode.
Definition: scripting.cc:154
void slotKeyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: Called when a key event occurred.
void textureIndex(QString _textureName, int _id, int &_index)
get the texture index
void slotStartJob(QString _jobId, QString _description, int _min, int _max, bool _blocking)
A job has been started by a plugin.
Definition: process.cc:70
QTimer * redrawTimer_
If enabled, this timer will block screen refresh if done more then 30 times per second.
Definition: Core.hh:1565
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
void slotExit()
Exit Application.
Definition: Core.cc:1157
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...
int lastWidth_
Slot called everytime the view is updated.
Definition: Core.hh:914
void restoreKeyBindings()
Restore key assignments from configs files.
void slotComponentsSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when connected components selection operation has been performed...
void saveOnExit(INIFile &_ini)
This signal is emitted before the core deletes its data and exits.
void slotSurfaceLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when surface lasso selection operation has been performed.
void slotCustomSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, QString _customIdentifier, bool _deselect)
SelectionInterface: Called when custom selection operation has been performed.
void openedFile(int _id)
Tell the plugins that a file has been opened ( -> Database)
void volumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard volume lasso selection has been performed...
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
void slotRegisterType(QString _handleName, DataType _type)
SelectionInterface: Called when a data type is added for a specific selection type.
void slotShowFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide flood fill selection operation for specific selection mode...
void slotSetTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
bool checkLibraryVersions()
Checks for library inconsistencies.
Definition: Core.cc:1855
void loadSelection(const INIFile &_file)
SelectionInterface: This signal is emitted when a selection should be loaded from a file...
void readApplicationOptions(INIFile &_ini)
Get and set Application options from ini file.
Definition: ParseIni.cc:78
void slotUnBlockPlugin(const QString &_rpcName)
Function for UnBlocking Plugins. Plugins will not loaded automatically.
void showViewModeControls(bool _show)
Show or Hide the viewmode control widget.
Definition: Core.cc:1019
std::vector< std::string > commandLineScriptNames_
Vector storing filenames from commandline to be opened after application startup (script files) ...
Definition: Core.hh:867
void moveToolBoxToTop(QString _name)
Move selected toolbox to top of side area.
Definition: scripting.cc:174
void PluginMouseEvent(QMouseEvent *)
When this Signal is emitted when a Mouse Event occures.
void exitFailure()
Aborts the application with an error code.
Definition: Core.cc:1208
void writeOnExit()
Called if app is closed and writes all information to ini file.
Definition: Core.cc:1120
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 readGUIOptions(INIFile &_ini)
Read Options that needs the GUI to be set up completely.
void closestBoundarySelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard closest boundary selection has been performe...
QWidget * getToolbox(QString _pluginName, QString _toolboxName)
Definition: scripting.cc:233
void blockSceneGraphUpdates()
Block the scenegraph updates.
Definition: scripting.cc:314
QFile * logFile_
logfile
Definition: Core.hh:1180
void slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType &_typeHandle)
SelectionInterface: Called when a new, non-standard primitive type should be handled.
QList< SlotInfo > coreSlots_
Core scripting engine.
Definition: Core.hh:1359
void showFloodFillSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard flood fill selection is required.
void slotSetSlotDescriptionGlobalFunction(QString _functionName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for a global scripting function
Definition: Core.cc:1312
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
void snapshot(unsigned int _viewerId=0, int _width=0, int _height=0, bool _alpha=false, bool _hideCoordsys=false, int _numSamples=1)
Definition: Core.cc:1434
ProcessManagerWidget * processManager_
A job has been started by a plugin.
Definition: Core.hh:1446
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...
QString serializeMaterialProperties(int _objId)
Serialize material properties.
Definition: Core.cc:1769
void slotBlockPlugin(const QString &_rpcName)
Function for Blocking Plugins. Blocked plugins will unloaded and not loaded wthin the next starts...
void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the texture's filename
~Core()
destructor
Definition: Core.cc:697
void clearAllComments(int objId)
Called when a plugin requests an update in the viewer.
Definition: Core.cc:1815
void externalLog(Logtype _type, QString _message)
This signal is emitted to send log data to a plugin.
void slotSetJobDescription(QString _jobId, QString _text)
A job's widget's status text has been updated by a plugin.
Definition: process.cc:194
void executeFileScript(QString _filename)
Core scripting engine.
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
void loggerState(int _state)
Change the logging window state.
Definition: Core.cc:1027
void slotVisibilityChanged(int _id)
Called when a plugin changes the visibility of an object.
void iniSaveOptions(INIFile &_ini)
This signal is used to tell the plugins to save their current status.
QTimer videoTimer_
Slot called everytime the view is updated.
Definition: Core.hh:907
void showClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: This signal is emitted when standard closest boundary selection is required...
void showToolbox(bool _state)
Show or hide toolbox.
Definition: Core.cc:1061
void snapshotBaseFileName(QString _fname, unsigned int _viewerId=0)
Definition: Core.cc:1394
void slotSwitchTexture(QString _textureName, int _id)
Tells Plugins to switch to the given Texture.
void slotExecuteScript(QString _script)
Definition: scripting.cc:74
void objectPropertiesChanged(int _id)
Tell plugins that object properties such as object names have been changed.
SeparatorNode * dataRootNode_
Root Node for data objects.
Definition: Core.hh:1062
void applyOptions()
after ini-files have been loaded and core is up or if options have been changed -> apply Options ...
void snapshotFileType(QString _type, unsigned int _viewerId=0)
Set the file type for snapshots.
Definition: Core.cc:1407
void slotToggleSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when toggle selection operation has been performed.
void slotAddSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type)
SelectionInterface: Called in order to add non-interactive operations for a specific primitive type...
void slotRegisterKeyShortcut(int _key, Qt::KeyboardModifiers _modifiers)
SelectionInterface: Called when a key shortcut is to be registered.
QSplashScreen * splash_
SplashScreen, only used in gui mode.
Definition: Core.hh:1556
void emptyObjectAdded(int _id)
Tell the plugins that an empty object has been added.
void objectDeleted(int)
Called after an object has been deleted.
void slotTextureUpdated(QString _textureName, int _identifier)
A Texture has been updated.
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
Definition: Core.hh:1553
void floodFillSelection(QMouseEvent *_event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: This signal is emitted when standard flood fill selection has been performed...
void activateToolbox(QString _pluginName, QString _toolboxName, bool activate)
Gets called by examiner widget when mouse is moved in picking mode.
Definition: scripting.cc:251
void slotLoadPlugin()
Load Plugins from menu.
void slotScriptError(const QScriptValue &error)
Core scripting engine.
Definition: scripting.cc:335
void slotShowToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide toggle selection operation for specific selection mode.
void commandLineScript(const char *_filename)
Load a script from the commandline on application start.
void loadObjectFinished(QString _filename)
Vector storing filenames from commandline to be opened after application startup (objects) ...
QList< JobInfo > currentJobs
A job has been started by a plugin.
Definition: Core.hh:1444
QTime lastVideoTime_
Slot called everytime the view is updated.
Definition: Core.hh:908
Core()
constructor
Definition: Core.cc:110
void slotObjectPropertiesChanged(int _id)
Called by plugins if object properties like names have changed.
void slotAddTexture(QString _textureName, QString _filename, uint _dimension, int _id)
Called by a plugin if it creates a texture.
void slotSetSlotDescription(QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
set a description for one of the plugin's public slots
Definition: Core.cc:1273
prototypeMatrix4x4 matrix4x4Prototype_
Prototype for the Matrix type.
Definition: Core.hh:1320
void exitApplication()
exit the current application
Definition: Core.cc:1000
void slotShowComponentsSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide connected components selection operation for specific selection mode...
std::vector< PluginLogger * > loggers_
Logger interfaces between plugins and core logger.
Definition: Core.hh:1543
QScriptValue helpFunction(QScriptContext *context, QScriptEngine *engine)
Function to print help about scripting functions.
Definition: scripting.cc:383
void finishSplash()
exit the current application
Definition: Core.cc:2043
void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
Called by plugins if texture name should be fetched.
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:546
ACG::SceneGraph::CoordsysNode * coordsysNode_
Node for the coordinate system.
Definition: Core.hh:1068
void slotShowClosestBoundarySelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes)
SelectionInterface: Provide closest boundary selection operation for specific selection mode...
void slotLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when lasso selection operation has been performed.
std::vector< dataTypes > supportedDataTypes_
Type-Plugins.
Definition: Core.hh:1546
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
void setViewAndWindowGeometry(QString view)
Called when a plugin requests an update in the viewer.
Definition: scripting.cc:327
QScriptValue myPrintFunction(QScriptContext *context, QScriptEngine *engine)
Special print function for core logger.
Definition: scripting.cc:339
void slotLogToFile(Logtype _type, QString _message)
log to file
Definition: Core.cc:1231
Predefined datatypes.
Definition: DataTypes.hh:96
void slotRecentOpen(QAction *_action)
Open Recent file.
Definition: Core.cc:1089
void undo()
Signal send to plugins when whole scene is cleared.
void textureName(int _id, int _textureIndex, QString &_textureName)
get the texture name
void slotSetJobState(QString _jobId, int _value)
A job state has been updated by a plugin.
Definition: process.cc:147
bool saveObjectsTo(IdList _ids, QString _filename)
void slotVolumeLassoSelection(QMouseEvent *_event, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when volume lasso selection operation has been performed.
void slotTextureGetImage(QString _textureName, QImage &_image)
Called by plugins if texture image should be fetched.
void slotMouseEventLight(QMouseEvent *_event)
Handle Mouse events when in Light mode.
Definition: Core.cc:765
void showStatusBar(bool _state)
Show or hide Status Bar.
Definition: Core.cc:1068
void slotLoadSelection(const INIFile &_file)
SelectionInterface: Called when a selection should be loaded from a file.
void saveObjects(IdList _ids, QString _filename, int _pluginID)
void slotObjectSelectionChanged(int _id)
Called by Plugins if they changed the active object.
Interface class for type definitions.
void slotLoad(QString _filename, DataType _type, int &_id)
A plugin wants to load a given file.
void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Called by plugins if texture index property name should be fetched.
void showReducedMenuBar(bool reduced)
Core scripting engine.
Definition: Core.cc:2039
bool checkSlot(QObject *_plugin, const char *_slotSignature)
Check if a plugin has a slot.
void keyShortcutEvent(int _key, Qt::KeyboardModifiers _modifiers=Qt::NoModifier)
SelectionInterface: This signal is emitted when a key shortcut has been pressed.
void slotSetJobName(QString _jobId, QString _name)
A job's widget caption has been updated by a plugin.
Definition: process.cc:171
void addViewModeIcon(QString _modeName, QString _iconName)
Scripting function to set an icon for a view mode.
Definition: scripting.cc:214
void scriptInfo(QString _pluginName, QString _functionName)
Core scripting engine.
void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get a multi-texture's sub textures
void writeApplicationOptions(INIFile &_ini)
Write Application options to ini file.
Definition: ParseIni.cc:291
QTime * redrawTime_
Holds the time since last redraw.
Definition: Core.hh:1432
void clearObjectComment(int objId, QString key)
Called when a plugin requests an update in the viewer.
Definition: Core.cc:1802
void slotGetScriptingEngine(QScriptEngine *&_engine)
Core scripting engine.
Definition: scripting.cc:82
QString getCurrentViewMode()
Get current view mode.
Definition: scripting.cc:148
void slotJobCancelRequested(QString _jobId)
Called by dialogs if cancel button is pressed.
Definition: process.cc:274
void loadSettings()
Load status from file.
void slotMouseEvent(QMouseEvent *_event)
Gets called by examiner widget when mouse is moved in picking mode.
Definition: Core.cc:795
void textureGetImage(QString _textureName, QImage &_image)
fetch texture image
void setMaxFrameRate(int _rate)
set the maximal framerate ( automatically enables framerate restriction )
Definition: Core.cc:976
void updateView()
Called when a plugin requests an update in the viewer.
Definition: Core.cc:887
void addTexture(QString, QString, uint, int)
The texture with the given name and filename has been added.
void iniLoad(INIFile &, int)
If an ini File is opened, this signal is send to Plugins capable of handling ini files.
SeparatorNode * root_node_scenegraph_
Scenegraphs root node.
Definition: Core.hh:1049
void fullscreen(bool _state)
set fullscreen mode
Definition: Core.cc:1012
void PluginWheelEvent(QWheelEvent *, const std::string &)
When this Signal is emitted when a Wheel Event occures.
void slotPluginExists(QString _pluginName, bool &_exists)
Check if a plugin exists.
Definition: RPC.cc:69
void getActivePrimitiveType(SelectionInterface::PrimitiveType &_type)
SelectionInterface: This signal is emitted when the active (selected) primitive type should be fetche...
void slotTextureName(int _id, int _textureIndex, QString &_textureName)
Called by plugins if texture name should be fetched.
void writeVersionNumbers(QString _filename)
write the current versions of all plugins to ini file
Definition: Core.cc:1501
void openIniFile(QString _filename, bool _coreSettings, bool _perPluginSettings, bool _loadObjects)
Load information from an ini file.
Definition: ParseIni.cc:406
void slotSetRenderer(unsigned int _viewer, QString _rendererName)
called to switch the renderer for a specific viewer
void slotExecuteFileScript(QString _filename)
Definition: scripting.cc:78
void createBackup(int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
Tell backup-plugin to create a backup.
SeparatorNode * core_nodes_
Separator Node holding all core scenegraph nodes.
Definition: Core.hh:1055
void slotEmptyObjectAdded(int _id)
Called when an empty object has been Added.
void slotGetCurrentTexture(int _id, QString &_textureName)
Called by plugins if current texture should be retrieved.
void slotMouseEventIdentify(QMouseEvent *_event)
Handle Mouse events when in Identifier mode.
Definition: Core.cc:716
void slotFloodFillSelection(QMouseEvent *_event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect)
SelectionInterface: Called when flood fill selection operation has been performed.
void saveAllObjectsTo()
Slot for saving objects to a new location.
void scriptLogFunction(QString _output)
stream for logging to file
Definition: scripting.cc:90
void updateTexture(QString, int)
Tell the plugins to update the given texture.
void redo()
Signal send to plugins when whole scene is cleared.
void slotCall(QString _pluginName, QString _functionName, bool &_success)
Definition: RPC.cc:100
void textureChangeImage(QString _textureName, QImage &_image)
Change the image for a given texture.
void slotGetActiveDataTypes(SelectionInterface::TypeList &_types)
SelectionInterface: Called when active (selected) data types should be fetched.