From 0502b958a1a44d689feee1535dccf548d459fbd4 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 15 Jun 2006 08:33:53 +0000 Subject: [PATCH] Merge from BR_DEBUG_3_2_0b1 --- INSTALL | 4 +- Makefile.in | 63 +- adm_local/unix/make_commence.in | 66 +- bin/VERSION | 1 - bin/runLightSalome.sh | 18 + build_configure | 8 +- configure.in.base | 200 ++- doc/Makefile.in | 29 + doc/salome/GUI_index.html | 95 -- doc/salome/GUI_index_v3.1.0.html | 95 -- doc/salome/Makefile.in | 53 +- .../tui/GUI/sources/Application-About.png | Bin 19226 -> 19225 bytes doc/salome/tui/Makefile.in | 46 +- doc/salome/tui/SUIT/doxyfile | 229 --- .../tui/SUIT/sources/Application-About.png | Bin 19226 -> 0 bytes doc/salome/tui/SUIT/sources/application.gif | Bin 2602 -> 0 bytes doc/salome/tui/SUIT/sources/html_comments.gif | Bin 156 -> 0 bytes doc/salome/tui/SUIT/sources/logocorp.gif | Bin 1792 -> 0 bytes doc/salome/tui/SUIT/sources/myheader.html | 24 - idl/SalomeApp_Engine.idl | 2 +- src/CAF/CAF.h | 2 +- src/CAF/CAF_Application.cxx | 37 +- src/CAF/CAF_Application.h | 8 +- src/CAF/CAF_Operation.cxx | 15 +- src/CAF/CAF_Operation.h | 8 +- src/CAF/CAF_Study.cxx | 80 +- src/CAF/CAF_Study.h | 8 +- src/CAF/CAF_Tools.cxx | 8 +- src/CAF/CAF_Tools.h | 6 +- src/CAF/Makefile.in | 18 + src/CAF/resources/CAF_images.po | 18 + src/CAF/resources/CAF_msg_en.po | 18 + src/CAM/CAM.h | 2 +- src/CAM/CAM_Application.cxx | 38 +- src/CAM/CAM_Application.h | 9 +- src/CAM/CAM_DataModel.cxx | 8 +- src/CAM/CAM_DataModel.h | 7 +- src/CAM/CAM_DataObject.cxx | 2 +- src/CAM/CAM_DataObject.h | 6 +- src/CAM/CAM_Module.cxx | 67 +- src/CAM/CAM_Module.h | 15 +- src/CAM/CAM_RootObject.cxx | 2 +- src/CAM/CAM_RootObject.h | 2 +- src/CAM/CAM_Study.cxx | 2 +- src/CAM/CAM_Study.h | 8 +- src/CAM/Makefile.in | 18 + src/CAM/resources/CAM_msg_en.po | 21 +- src/DDS/DDS.h | 18 + src/DDS/DDS_DicGroup.cxx | 28 +- src/DDS/DDS_DicGroup.h | 18 + src/DDS/DDS_DicItem.cxx | 33 +- src/DDS/DDS_DicItem.h | 18 + src/DDS/DDS_Dictionary.cxx | 18 + src/DDS/DDS_Dictionary.h | 18 + src/DDS/DDS_KeyWords.cxx | 18 + src/DDS/DDS_KeyWords.h | 18 + src/DDS/Makefile.in | 18 + src/Event/Event.h | 20 + src/Event/Makefile.in | 4 +- src/Event/SALOME_Event.cxx | 36 +- src/Event/SALOME_Event.hxx | 71 +- src/GLViewer/GLViewer.h | 2 +- src/GLViewer/GLViewer_AspectLine.cxx | 79 +- src/GLViewer/GLViewer_AspectLine.h | 8 +- src/GLViewer/GLViewer_BaseDrawers.cxx | 65 +- src/GLViewer/GLViewer_BaseDrawers.h | 19 +- src/GLViewer/GLViewer_BaseObjects.cxx | 365 ++++- src/GLViewer/GLViewer_BaseObjects.h | 25 +- src/GLViewer/GLViewer_Compass.cxx | 101 +- src/GLViewer/GLViewer_Compass.h | 7 +- src/GLViewer/GLViewer_Context.cxx | 200 ++- src/GLViewer/GLViewer_Context.h | 19 +- src/GLViewer/GLViewer_CoordSystem.cxx | 108 +- src/GLViewer/GLViewer_CoordSystem.h | 6 +- src/GLViewer/GLViewer_Defs.h | 2 +- src/GLViewer/GLViewer_Drawer.cxx | 343 +++-- src/GLViewer/GLViewer_Drawer.h | 30 +- src/GLViewer/GLViewer_Geom.cxx | 88 +- src/GLViewer/GLViewer_Geom.h | 2 +- src/GLViewer/GLViewer_Grid.cxx | 73 +- src/GLViewer/GLViewer_Grid.h | 2 +- src/GLViewer/GLViewer_Group.cxx | 76 +- src/GLViewer/GLViewer_Group.h | 2 +- src/GLViewer/GLViewer_MimeSource.cxx | 37 +- src/GLViewer/GLViewer_MimeSource.h | 8 +- src/GLViewer/GLViewer_Object.cxx | 45 +- src/GLViewer/GLViewer_Object.h | 10 +- src/GLViewer/GLViewer_Selector.cxx | 9 +- src/GLViewer/GLViewer_Selector.h | 14 +- src/GLViewer/GLViewer_Selector2d.cxx | 51 +- src/GLViewer/GLViewer_Selector2d.h | 13 +- src/GLViewer/GLViewer_Text.cxx | 32 +- src/GLViewer/GLViewer_Text.h | 9 +- src/GLViewer/GLViewer_ToolTip.cxx | 44 +- src/GLViewer/GLViewer_ToolTip.h | 12 +- src/GLViewer/GLViewer_Tools.cxx | 171 ++- src/GLViewer/GLViewer_Tools.h | 25 +- src/GLViewer/GLViewer_ViewFrame.cxx | 111 +- src/GLViewer/GLViewer_ViewFrame.h | 16 +- src/GLViewer/GLViewer_ViewManager.cxx | 10 +- src/GLViewer/GLViewer_ViewManager.h | 2 +- src/GLViewer/GLViewer_ViewPort.cxx | 23 +- src/GLViewer/GLViewer_ViewPort.h | 15 +- src/GLViewer/GLViewer_ViewPort2d.cxx | 131 +- src/GLViewer/GLViewer_ViewPort2d.h | 4 +- src/GLViewer/GLViewer_Viewer.cxx | 32 +- src/GLViewer/GLViewer_Viewer.h | 16 +- src/GLViewer/GLViewer_Viewer2d.cxx | 214 +-- src/GLViewer/GLViewer_Viewer2d.h | 21 +- src/GLViewer/GLViewer_Widget.cxx | 247 ++-- src/GLViewer/GLViewer_Widget.h | 9 +- src/GLViewer/Makefile.in | 20 +- src/GLViewer/resources/GLViewer_images.po | 18 + src/GLViewer/resources/GLViewer_msg_en.po | 21 +- src/LightApp/LightApp.h | 19 +- src/LightApp/LightApp_AboutDlg.cxx | 18 + src/LightApp/LightApp_AboutDlg.h | 26 +- src/LightApp/LightApp_Application.cxx | 872 ++++++++--- src/LightApp/LightApp_Application.h | 74 +- src/LightApp/LightApp_DataModel.cxx | 128 +- src/LightApp/LightApp_DataModel.h | 21 +- src/LightApp/LightApp_DataObject.cxx | 11 +- src/LightApp/LightApp_DataObject.h | 2 +- src/LightApp/LightApp_DataOwner.cxx | 12 +- src/LightApp/LightApp_DataOwner.h | 15 +- src/LightApp/LightApp_DataSubOwner.cxx | 2 +- src/LightApp/LightApp_DataSubOwner.h | 2 +- src/LightApp/LightApp_Dialog.cxx | 472 +++--- src/LightApp/LightApp_Dialog.h | 12 +- src/LightApp/LightApp_Displayer.cxx | 78 +- src/LightApp/LightApp_Displayer.h | 7 +- src/LightApp/LightApp_Driver.cxx | 91 +- src/LightApp/LightApp_Driver.h | 2 +- src/LightApp/LightApp_GLSelector.cxx | 43 +- src/LightApp/LightApp_GLSelector.h | 26 +- src/LightApp/LightApp_Module.cxx | 152 +- src/LightApp/LightApp_Module.h | 27 +- src/LightApp/LightApp_ModuleDlg.cxx | 2 +- src/LightApp/LightApp_ModuleDlg.h | 23 +- src/LightApp/LightApp_NameDlg.cxx | 5 +- src/LightApp/LightApp_NameDlg.h | 26 +- src/LightApp/LightApp_OBFilter.cxx | 2 +- src/LightApp/LightApp_OBFilter.h | 6 +- src/LightApp/LightApp_OBSelector.cxx | 7 +- src/LightApp/LightApp_OBSelector.h | 6 +- src/LightApp/LightApp_OCCSelector.cxx | 18 +- src/LightApp/LightApp_OCCSelector.h | 6 +- src/LightApp/LightApp_Operation.cxx | 24 +- src/LightApp/LightApp_Operation.h | 29 +- src/LightApp/LightApp_Preferences.cxx | 4 +- src/LightApp/LightApp_Preferences.h | 7 +- src/LightApp/LightApp_PreferencesDlg.cxx | 30 +- src/LightApp/LightApp_PreferencesDlg.h | 7 +- src/LightApp/LightApp_RootObject.h | 2 +- src/LightApp/LightApp_Selection.cxx | 15 +- src/LightApp/LightApp_Selection.h | 10 +- src/LightApp/LightApp_SelectionMgr.cxx | 56 +- src/LightApp/LightApp_SelectionMgr.h | 29 +- src/LightApp/LightApp_ShowHideOp.cxx | 49 +- src/LightApp/LightApp_ShowHideOp.h | 8 +- src/LightApp/LightApp_Study.cxx | 174 +-- src/LightApp/LightApp_Study.h | 9 +- src/LightApp/LightApp_SwitchOp.cxx | 13 +- src/LightApp/LightApp_SwitchOp.h | 15 +- src/LightApp/LightApp_UpdateFlags.h | 28 +- src/LightApp/LightApp_VTKSelector.cxx | 130 +- src/LightApp/LightApp_VTKSelector.h | 62 +- src/LightApp/LightApp_WidgetContainer.cxx | 2 +- src/LightApp/LightApp_WidgetContainer.h | 2 +- src/LightApp/Makefile.in | 140 +- src/LightApp/resources/LightApp.xml | 80 +- src/LightApp/resources/LightApp_images.po | 18 + src/LightApp/resources/LightApp_msg_en.po | 42 +- src/LightApp/resources/icon_about.png | Bin 195122 -> 79549 bytes src/LogWindow/LogWindow.cxx | 59 +- src/LogWindow/LogWindow.h | 6 +- src/LogWindow/Makefile.in | 18 + src/Makefile.in | 53 +- src/OBJECT/Handle_SALOME_AISObject.hxx | 10 +- src/OBJECT/Handle_SALOME_AISShape.hxx | 10 +- ...E_DataMapNodeOfDataMapOfIOMapOfInteger.hxx | 2 +- src/OBJECT/Handle_SALOME_Filter.hxx | 10 +- .../Handle_SALOME_InteractiveObject.hxx | 10 +- src/OBJECT/Handle_SALOME_ListNodeOfListIO.hxx | 10 +- src/OBJECT/Handle_SALOME_TypeFilter.hxx | 10 +- src/OBJECT/Makefile.in | 24 +- src/OBJECT/SALOME_AISObject.cxx | 2 +- src/OBJECT/SALOME_AISObject.hxx | 2 +- src/OBJECT/SALOME_AISObject.ixx | 2 +- src/OBJECT/SALOME_AISObject.jxx | 2 +- src/OBJECT/SALOME_AISShape.cxx | 10 +- src/OBJECT/SALOME_AISShape.hxx | 2 +- src/OBJECT/SALOME_AISShape.ixx | 2 +- src/OBJECT/SALOME_AISShape.jxx | 2 +- ...taMapIteratorOfDataMapOfIOMapOfInteger.hxx | 2 +- ...MapIteratorOfDataMapOfIOMapOfInteger_0.cxx | 2 +- ...E_DataMapNodeOfDataMapOfIOMapOfInteger.hxx | 2 +- ...DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx | 27 +- src/OBJECT/SALOME_DataMapOfIOMapOfInteger.hxx | 2 +- .../SALOME_DataMapOfIOMapOfInteger_0.cxx | 2 +- src/OBJECT/SALOME_Filter.cxx | 2 +- src/OBJECT/SALOME_Filter.hxx | 2 +- src/OBJECT/SALOME_Filter.ixx | 2 +- src/OBJECT/SALOME_Filter.jxx | 2 +- src/OBJECT/SALOME_GLOwner.cxx | 40 - src/OBJECT/SALOME_GLOwner.h | 45 - src/OBJECT/SALOME_InteractiveObject.cxx | 53 +- src/OBJECT/SALOME_InteractiveObject.hxx | 2 +- src/OBJECT/SALOME_InteractiveObject.ixx | 2 +- src/OBJECT/SALOME_InteractiveObject.jxx | 2 +- src/OBJECT/SALOME_ListIO.hxx | 6 +- src/OBJECT/SALOME_ListIO_0.cxx | 2 +- src/OBJECT/SALOME_ListIteratorOfListIO.hxx | 2 +- src/OBJECT/SALOME_ListIteratorOfListIO_0.cxx | 2 +- src/OBJECT/SALOME_ListNodeOfListIO.hxx | 7 +- src/OBJECT/SALOME_ListNodeOfListIO_0.cxx | 28 +- src/OBJECT/SALOME_Selection.h | 2 +- src/OBJECT/SALOME_TypeFilter.cxx | 10 +- src/OBJECT/SALOME_TypeFilter.hxx | 2 +- src/OBJECT/SALOME_TypeFilter.ixx | 2 +- src/OBJECT/SALOME_TypeFilter.jxx | 2 +- src/OCCViewer/Makefile.in | 18 + src/OCCViewer/OCCViewer.h | 2 +- src/OCCViewer/OCCViewer_AISSelector.cxx | 2 +- src/OCCViewer/OCCViewer_AISSelector.h | 2 +- src/OCCViewer/OCCViewer_ClippingDlg.cxx | 182 ++- src/OCCViewer/OCCViewer_ClippingDlg.h | 34 +- .../OCCViewer_CreateRestoreViewDlg.cxx | 34 +- .../OCCViewer_CreateRestoreViewDlg.h | 2 +- src/OCCViewer/OCCViewer_VService.cxx | 29 +- src/OCCViewer/OCCViewer_VService.h | 5 +- src/OCCViewer/OCCViewer_ViewManager.cxx | 20 +- src/OCCViewer/OCCViewer_ViewManager.h | 2 +- src/OCCViewer/OCCViewer_ViewModel.cxx | 181 ++- src/OCCViewer/OCCViewer_ViewModel.h | 2 +- src/OCCViewer/OCCViewer_ViewPort.cxx | 15 +- src/OCCViewer/OCCViewer_ViewPort.h | 6 +- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 15 +- src/OCCViewer/OCCViewer_ViewPort3d.h | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 328 +++-- src/OCCViewer/OCCViewer_ViewWindow.h | 10 +- src/OCCViewer/resources/OCCViewer_images.po | 2 +- src/OCCViewer/resources/OCCViewer_msg_en.po | 8 +- src/ObjBrowser/Makefile.in | 18 + src/ObjBrowser/OB.h | 2 +- src/ObjBrowser/OB_Browser.cxx | 493 ++++++- src/ObjBrowser/OB_Browser.h | 9 +- src/ObjBrowser/OB_Filter.cxx | 8 +- src/ObjBrowser/OB_Filter.h | 7 +- src/ObjBrowser/OB_ListItem.cxx | 111 +- src/ObjBrowser/OB_ListItem.h | 20 +- src/ObjBrowser/OB_ListView.cxx | 76 +- src/ObjBrowser/OB_ListView.h | 7 +- src/ObjBrowser/resources/OB_msg_en.po | 18 + src/Plot2d/Makefile.in | 18 + src/Plot2d/Plot2d.h | 2 +- src/Plot2d/Plot2d_Curve.cxx | 5 +- src/Plot2d/Plot2d_Curve.h | 2 +- src/Plot2d/Plot2d_FitDataDlg.cxx | 16 +- src/Plot2d/Plot2d_FitDataDlg.h | 2 +- src/Plot2d/Plot2d_Prs.cxx | 62 +- src/Plot2d/Plot2d_Prs.h | 2 +- src/Plot2d/Plot2d_SetupCurveDlg.cxx | 18 +- src/Plot2d/Plot2d_SetupCurveDlg.h | 27 +- src/Plot2d/Plot2d_SetupViewDlg.cxx | 16 +- src/Plot2d/Plot2d_SetupViewDlg.h | 2 +- src/Plot2d/Plot2d_ViewFrame.cxx | 80 +- src/Plot2d/Plot2d_ViewFrame.h | 5 +- src/Plot2d/Plot2d_ViewManager.cxx | 25 +- src/Plot2d/Plot2d_ViewManager.h | 2 +- src/Plot2d/Plot2d_ViewModel.cxx | 61 +- src/Plot2d/Plot2d_ViewModel.h | 2 +- src/Plot2d/Plot2d_ViewWindow.cxx | 125 +- src/Plot2d/Plot2d_ViewWindow.h | 7 +- src/Plot2d/resources/Plot2d_images.po | 18 + src/Plot2d/resources/Plot2d_msg_en.po | 21 +- src/Prs/Makefile.in | 18 + src/Prs/SALOME_Prs.cxx | 242 +-- src/Prs/SALOME_Prs.h | 78 +- src/PyInterp/Makefile.in | 2 +- src/PyInterp/PyInterp.h | 2 +- src/PyInterp/PyInterp_Dispatcher.cxx | 30 +- src/PyInterp/PyInterp_Dispatcher.h | 28 +- src/PyInterp/PyInterp_Watcher.h | 2 +- src/PyInterp/PyInterp_base.cxx | 26 +- src/PyInterp/PyInterp_base.h | 19 +- src/PythonConsole/Makefile.in | 18 + src/PythonConsole/PythonConsole.h | 2 +- src/PythonConsole/PythonConsole_PyConsole.cxx | 24 +- src/PythonConsole/PythonConsole_PyConsole.h | 2 +- src/PythonConsole/PythonConsole_PyEditor.cxx | 9 +- src/PythonConsole/PythonConsole_PyEditor.h | 2 +- src/PythonConsole/PythonConsole_PyInterp.cxx | 16 +- src/PythonConsole/PythonConsole_PyInterp.h | 2 +- src/QDS/Makefile.in | 18 + src/QDS/QDS.cxx | 18 + src/QDS/QDS.h | 18 + src/QDS/QDS_CheckBox.cxx | 18 + src/QDS/QDS_CheckBox.h | 18 + src/QDS/QDS_ComboBox.cxx | 18 + src/QDS/QDS_ComboBox.h | 18 + src/QDS/QDS_Datum.cxx | 18 + src/QDS/QDS_Datum.h | 18 + src/QDS/QDS_LineEdit.cxx | 18 + src/QDS/QDS_LineEdit.h | 18 + src/QDS/QDS_RadioBox.cxx | 18 + src/QDS/QDS_RadioBox.h | 18 + src/QDS/QDS_SpinBox.cxx | 18 + src/QDS/QDS_SpinBox.h | 18 + src/QDS/QDS_SpinBoxDbl.cxx | 18 + src/QDS/QDS_SpinBoxDbl.h | 18 + src/QDS/QDS_TextEdit.cxx | 18 + src/QDS/QDS_TextEdit.h | 18 + src/QDS/QDS_Validator.cxx | 18 + src/QDS/QDS_Validator.h | 18 + src/QDS/resources/QDS_msg_en.po | 18 + src/Qtx/Makefile.in | 30 +- src/Qtx/Qtx.cxx | 2 +- src/Qtx/Qtx.h | 6 +- src/Qtx/QtxAction.cxx | 243 +++- src/Qtx/QtxAction.h | 9 +- src/Qtx/QtxActionMenuMgr.cxx | 673 +++++++-- src/Qtx/QtxActionMenuMgr.h | 50 +- src/Qtx/QtxActionMgr.cxx | 158 +- src/Qtx/QtxActionMgr.h | 22 +- src/Qtx/QtxActionToolMgr.cxx | 209 ++- src/Qtx/QtxActionToolMgr.h | 20 +- src/Qtx/QtxColorScale.cxx | 528 +++---- src/Qtx/QtxColorScale.h | 10 +- src/Qtx/QtxComboBox.cxx | 55 +- src/Qtx/QtxComboBox.h | 2 +- src/Qtx/QtxDblSpinBox.cxx | 146 +- src/Qtx/QtxDblSpinBox.h | 6 +- src/Qtx/QtxDblValidator.cxx | 17 +- src/Qtx/QtxDblValidator.h | 2 +- src/Qtx/QtxDialog.cxx | 90 +- src/Qtx/QtxDialog.h | 2 +- src/Qtx/QtxDirListEditor.cxx | 35 +- src/Qtx/QtxDirListEditor.h | 4 +- src/Qtx/QtxDockAction.cxx | 58 +- src/Qtx/QtxDockAction.h | 4 +- src/Qtx/QtxDockWindow.cxx | 79 +- src/Qtx/QtxDockWindow.h | 2 +- src/Qtx/QtxGroupBox.cxx | 87 +- src/Qtx/QtxGroupBox.h | 2 +- src/Qtx/QtxIntSpinBox.cxx | 40 +- src/Qtx/QtxIntSpinBox.h | 2 +- src/Qtx/QtxListAction.cxx | 87 +- src/Qtx/QtxListAction.h | 10 +- src/Qtx/QtxListBox.cxx | 121 +- src/Qtx/QtxListBox.h | 2 +- src/Qtx/QtxListOfOperations.cxx | 136 +- src/Qtx/QtxListOfOperations.h | 15 +- src/Qtx/QtxListResourceEdit.cxx | 461 +++++- src/Qtx/QtxListResourceEdit.h | 118 +- src/Qtx/QtxListView.cxx | 94 +- src/Qtx/QtxListView.h | 2 +- src/Qtx/QtxLogoMgr.cxx | 15 +- src/Qtx/QtxLogoMgr.h | 2 +- src/Qtx/QtxMRUAction.cxx | 2 +- src/Qtx/QtxMRUAction.h | 2 +- src/Qtx/QtxMainWindow.cxx | 76 +- src/Qtx/QtxMainWindow.h | 2 +- src/Qtx/QtxMenuButton.cxx | 105 +- src/Qtx/QtxMenuButton.h | 2 +- src/Qtx/QtxOperations.cxx | 23 +- src/Qtx/QtxOperations.h | 6 +- src/Qtx/QtxParser.cxx | 224 +-- src/Qtx/QtxParser.h | 60 +- src/Qtx/QtxPathDialog.cxx | 244 ++-- src/Qtx/QtxPathDialog.h | 2 +- src/Qtx/QtxPopupMenu.cxx | 80 +- src/Qtx/QtxPopupMenu.h | 2 +- src/Qtx/QtxPopupMgr.cxx | 328 +++-- src/Qtx/QtxPopupMgr.h | 6 +- src/Qtx/QtxResourceEdit.cxx | 257 +++- src/Qtx/QtxResourceEdit.h | 12 +- src/Qtx/QtxResourceMgr.cxx | 321 +++- src/Qtx/QtxResourceMgr.h | 5 +- src/Qtx/QtxStdOperations.cxx | 301 ++-- src/Qtx/QtxStdOperations.h | 51 +- src/Qtx/QtxTable.cxx | 87 +- src/Qtx/QtxTable.h | 2 +- src/Qtx/QtxToolBar.cxx | 74 +- src/Qtx/QtxToolBar.h | 2 +- src/Qtx/QtxToolTip.cxx | 57 +- src/Qtx/QtxToolTip.h | 2 +- src/Qtx/QtxWorkspaceAction.cxx | 113 +- src/Qtx/QtxWorkspaceAction.h | 2 +- src/Qtx/QtxWorkstack.cxx | 661 ++++++++- src/Qtx/QtxWorkstack.h | 11 +- src/Qtx/QtxWorkstackAction.cxx | 101 +- src/Qtx/QtxWorkstackAction.h | 2 +- src/RegistryDisplay/HelpWindow.cxx | 5 +- src/RegistryDisplay/HelpWindow.hxx | 2 +- src/RegistryDisplay/IntervalWindow.cxx | 34 +- src/RegistryDisplay/IntervalWindow.hxx | 18 +- src/RegistryDisplay/Makefile.in | 6 +- src/RegistryDisplay/RegWidget.cxx | 29 +- src/RegistryDisplay/RegWidget.h | 2 +- src/RegistryDisplay/RegWidgetFactory.cxx | 2 +- src/ResExporter/Makefile.in | 18 + src/ResExporter/ResourceExporter.cxx | 80 +- src/SALOME_PY/Makefile.in | 4 +- src/SALOME_PY/SalomePy.cxx | 20 +- src/SALOME_PYQT/Makefile.in | 2 +- src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile.in | 19 +- .../SALOME_PYQT_GUI/SALOME_PYQT_GUI.h | 2 +- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx | 1064 ++++++++++---- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.h | 80 +- .../SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.cxx | 18 +- .../SALOME_PYQT_GUI/SALOME_PYQT_PyInterp.h | 10 +- src/SALOME_PYQT/SalomePyQt/Makefile.in | 21 +- src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 209 ++- src/SALOME_PYQT/SalomePyQt/SalomePyQt.h | 19 +- src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip | 13 +- src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip | 18 +- src/SALOME_SWIG/Makefile.in | 6 +- src/SALOME_SWIG/SALOMEGUI_Swig.cxx | 117 +- src/SALOME_SWIG/SALOMEGUI_Swig.hxx | 2 +- src/SALOME_SWIG/SALOMEGUI_Swig.i | 2 +- src/SALOME_SWIG/SALOMEGUI_shared_modules.py | 21 + src/SALOME_SWIG/examplevtk1.py | 2 +- src/SALOME_SWIG/libSALOME_Swig.i | 2 +- src/SALOME_SWIG/salome_test.py | 486 ------- src/SALOME_SWIG/supervisionexample.py | 18 + src/SALOME_SWIG/supervisiongeomexample.py | 18 + src/SALOME_SWIG/test_big_table.py | 16 +- src/SALOME_SWIG/test_many_objects.py | 16 +- src/SALOME_SWIG/test_remove_ref.py | 2 +- src/SALOME_SWIG/test_table.py | 16 +- src/SALOME_SWIG/testattr.py | 2 +- src/SOCC/Makefile.in | 18 + src/SOCC/SOCC.h | 2 +- src/SOCC/SOCC_Prs.cxx | 53 +- src/SOCC/SOCC_Prs.h | 2 +- src/SOCC/SOCC_ViewModel.cxx | 139 +- src/SOCC/SOCC_ViewModel.h | 2 +- src/SOCC/SOCC_ViewWindow.cxx | 20 +- src/SOCC/SOCC_ViewWindow.h | 4 +- src/SPlot2d/Makefile.in | 34 +- src/SPlot2d/SPlot2d.h | 2 +- src/SPlot2d/SPlot2d_Curve.cxx | 25 +- src/SPlot2d/SPlot2d_Curve.h | 2 +- src/SPlot2d/SPlot2d_Prs.cxx | 26 +- src/SPlot2d/SPlot2d_Prs.h | 2 +- src/SPlot2d/SPlot2d_ViewModel.cxx | 61 +- src/SPlot2d/SPlot2d_ViewModel.h | 2 +- src/STD/Makefile.in | 18 + src/STD/STD.h | 2 +- src/STD/STD_Application.cxx | 64 +- src/STD/STD_Application.h | 18 +- src/STD/STD_CloseDlg.cxx | 5 +- src/STD/STD_CloseDlg.h | 2 +- src/STD/STD_LoadStudiesDlg.cxx | 2 +- src/STD/STD_LoadStudiesDlg.h | 2 +- src/STD/STD_MDIDesktop.cxx | 4 +- src/STD/STD_MDIDesktop.h | 3 +- src/STD/STD_SDIDesktop.cxx | 2 +- src/STD/STD_SDIDesktop.h | 2 +- src/STD/STD_TabDesktop.cxx | 4 +- src/STD/STD_TabDesktop.h | 3 +- src/STD/resources/STD_images.po | 18 + src/STD/resources/STD_msg_en.po | 36 +- src/SUIT/Makefile.in | 18 + src/SUIT/SUIT.h | 2 +- src/SUIT/SUIT_Accel.cxx | 116 +- src/SUIT/SUIT_Accel.h | 32 +- src/SUIT/SUIT_ActionOperation.cxx | 2 +- src/SUIT/SUIT_ActionOperation.h | 2 +- src/SUIT/SUIT_Application.cxx | 308 +++- src/SUIT/SUIT_Application.h | 5 +- src/SUIT/SUIT_Convertor.h | 3 +- src/SUIT/SUIT_DataObject.cxx | 12 +- src/SUIT/SUIT_DataObject.h | 13 +- src/SUIT/SUIT_DataObjectIterator.cxx | 2 +- src/SUIT/SUIT_DataObjectIterator.h | 12 +- src/SUIT/SUIT_DataObjectKey.cxx | 2 +- src/SUIT/SUIT_DataObjectKey.h | 2 +- src/SUIT/SUIT_DataOwner.cxx | 78 +- src/SUIT/SUIT_DataOwner.h | 8 +- src/SUIT/SUIT_Desktop.cxx | 2 +- src/SUIT/SUIT_Desktop.h | 7 +- src/SUIT/SUIT_ExceptionHandler.cxx | 7 +- src/SUIT/SUIT_ExceptionHandler.h | 2 +- src/SUIT/SUIT_FileDlg.cxx | 92 +- src/SUIT/SUIT_FileDlg.h | 2 +- src/SUIT/SUIT_FileValidator.cxx | 19 +- src/SUIT/SUIT_FileValidator.h | 24 +- src/SUIT/SUIT_MessageBox.cxx | 15 +- src/SUIT/SUIT_MessageBox.h | 13 +- src/SUIT/SUIT_Operation.cxx | 35 +- src/SUIT/SUIT_Operation.h | 14 +- src/SUIT/SUIT_OverrideCursor.cxx | 2 +- src/SUIT/SUIT_OverrideCursor.h | 2 +- src/SUIT/SUIT_ParserSettings.cxx | 2 +- src/SUIT/SUIT_ParserSettings.h | 2 +- src/SUIT/SUIT_PopupClient.cxx | 2 +- src/SUIT/SUIT_PopupClient.h | 2 +- src/SUIT/SUIT_ResourceMgr.cxx | 53 +- src/SUIT/SUIT_ResourceMgr.h | 6 +- src/SUIT/SUIT_SelectionFilter.cxx | 2 +- src/SUIT/SUIT_SelectionFilter.h | 2 +- src/SUIT/SUIT_SelectionMgr.cxx | 2 +- src/SUIT/SUIT_SelectionMgr.h | 2 +- src/SUIT/SUIT_Selector.cxx | 2 +- src/SUIT/SUIT_Selector.h | 9 +- src/SUIT/SUIT_Session.cxx | 6 +- src/SUIT/SUIT_Session.h | 2 +- src/SUIT/SUIT_SmartPtr.h | 2 +- src/SUIT/SUIT_Study.cxx | 24 +- src/SUIT/SUIT_Study.h | 5 +- src/SUIT/SUIT_ToolButton.cxx | 2 +- src/SUIT/SUIT_ToolButton.h | 2 +- src/SUIT/SUIT_Tools.cxx | 2 +- src/SUIT/SUIT_Tools.h | 6 +- src/SUIT/SUIT_TreeSync.h | 117 +- src/SUIT/SUIT_ViewManager.cxx | 4 +- src/SUIT/SUIT_ViewManager.h | 2 +- src/SUIT/SUIT_ViewModel.cxx | 3 +- src/SUIT/SUIT_ViewModel.h | 2 +- src/SUIT/SUIT_ViewWindow.cxx | 62 +- src/SUIT/SUIT_ViewWindow.h | 13 +- src/SUIT/resources/SUIT_images.po | 18 + src/SUIT/resources/SUIT_msg_en.po | 27 +- src/SUIT/utilities.h | 10 +- src/SUITApp/Makefile.in | 18 + src/SUITApp/SUITApp.cxx | 65 +- src/SUITApp/SUITApp_Application.cxx | 21 +- src/SUITApp/SUITApp_Application.h | 2 +- src/SUITApp/resources/SUITApp_msg_en.po | 18 + src/SUPERVGraph/Makefile.in | 22 +- src/SUPERVGraph/SUPERVGraph.cxx | 8 +- src/SUPERVGraph/SUPERVGraph.h | 2 +- src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx | 61 +- src/SUPERVGraph/SUPERVGraph_ViewFrame.h | 2 +- src/SUPERVGraph/SUPERVGraph_ViewManager.cxx | 16 +- src/SUPERVGraph/SUPERVGraph_ViewManager.h | 2 +- src/SUPERVGraph/SUPERVGraph_ViewModel.cxx | 12 +- src/SUPERVGraph/SUPERVGraph_ViewModel.h | 2 +- .../resources/SUPERVGraph_images.po | 18 + .../resources/SUPERVGraph_msg_en.po | 18 + src/SUPERVGraph/resources/view_pan.png | Bin 545 -> 544 bytes src/SUPERVGraph/resources/view_reset.png | Bin 477 -> 476 bytes src/SVTK/Makefile.in | 29 +- src/SVTK/SALOME_Actor.cxx | 175 ++- src/SVTK/SALOME_Actor.h | 8 +- src/SVTK/SVTK.cxx | 2 +- src/SVTK/SVTK.h | 21 +- src/SVTK/SVTK_Actor.cxx | 27 +- src/SVTK/SVTK_Actor.h | 2 +- src/SVTK/SVTK_CubeAxesActor2D.cxx | 59 +- src/SVTK/SVTK_CubeAxesActor2D.h | 5 +- src/SVTK/SVTK_CubeAxesDlg.cxx | 188 +-- src/SVTK/SVTK_CubeAxesDlg.h | 26 +- src/SVTK/SVTK_DeviceActor.cxx | 139 +- src/SVTK/SVTK_DeviceActor.h | 29 +- src/SVTK/SVTK_Event.h | 2 +- src/SVTK/SVTK_FontWidget.cxx | 36 +- src/SVTK/SVTK_FontWidget.h | 2 +- src/SVTK/SVTK_Functor.h | 2 +- .../SVTK_GenericRenderWindowInteractor.cxx | 40 +- src/SVTK/SVTK_GenericRenderWindowInteractor.h | 10 +- src/SVTK/SVTK_InteractorStyle.cxx | 283 ++-- src/SVTK/SVTK_InteractorStyle.h | 7 +- src/SVTK/SVTK_MainWindow.cxx | 248 +++- src/SVTK/SVTK_MainWindow.h | 33 +- src/SVTK/SVTK_NonIsometricDlg.cxx | 94 +- src/SVTK/SVTK_NonIsometricDlg.h | 15 +- src/SVTK/SVTK_Prs.cxx | 45 +- src/SVTK/SVTK_Prs.h | 2 +- src/SVTK/SVTK_RectPicker.cxx | 73 +- src/SVTK/SVTK_RectPicker.h | 32 +- src/SVTK/SVTK_RenderWindowInteractor.cxx | 234 ++- src/SVTK/SVTK_RenderWindowInteractor.h | 8 +- src/SVTK/SVTK_Renderer.cxx | 168 ++- src/SVTK/SVTK_Renderer.h | 32 +- src/SVTK/SVTK_Selection.h | 2 +- src/SVTK/SVTK_SelectionEvent.h | 2 +- src/SVTK/SVTK_Selector.cxx | 136 +- src/SVTK/SVTK_Selector.h | 6 +- src/SVTK/SVTK_SelectorDef.h | 2 +- src/SVTK/SVTK_SpaceMouse.cxx | 28 +- src/SVTK/SVTK_SpaceMouse.h | 2 +- src/SVTK/SVTK_Trihedron.cxx | 12 +- src/SVTK/SVTK_Trihedron.h | 2 +- src/SVTK/SVTK_View.cxx | 191 ++- src/SVTK/SVTK_View.h | 22 +- src/SVTK/SVTK_ViewManager.cxx | 22 +- src/SVTK/SVTK_ViewManager.h | 4 +- src/SVTK/SVTK_ViewModel.cxx | 170 ++- src/SVTK/SVTK_ViewModel.h | 8 +- src/SVTK/SVTK_ViewModelBase.h | 18 + src/SVTK/SVTK_ViewWindow.cxx | 507 ++++++- src/SVTK/SVTK_ViewWindow.h | 26 +- src/SVTK/resources/SVTK_msg_en.po | 132 +- src/SalomeApp/Makefile.in | 28 +- src/SalomeApp/SalomeApp.h | 18 + src/SalomeApp/SalomeApp_Application.cxx | 347 ++++- src/SalomeApp/SalomeApp_Application.h | 37 +- src/SalomeApp/SalomeApp_CheckFileDlg.cxx | 2 +- src/SalomeApp/SalomeApp_CheckFileDlg.h | 2 +- src/SalomeApp/SalomeApp_DataModel.cxx | 200 +-- src/SalomeApp/SalomeApp_DataModel.h | 23 +- src/SalomeApp/SalomeApp_DataObject.cxx | 62 +- src/SalomeApp/SalomeApp_DataObject.h | 42 +- src/SalomeApp/SalomeApp_Displayer.cxx | 49 +- src/SalomeApp/SalomeApp_Displayer.h | 2 +- src/SalomeApp/SalomeApp_EventFilter.cxx | 5 +- src/SalomeApp/SalomeApp_EventFilter.h | 2 +- src/SalomeApp/SalomeApp_ExceptionHandler.cxx | 46 +- src/SalomeApp/SalomeApp_ExceptionHandler.h | 2 +- src/SalomeApp/SalomeApp_Filter.cxx | 2 +- src/SalomeApp/SalomeApp_Filter.h | 2 +- src/SalomeApp/SalomeApp_ImportOperation.cxx | 2 +- src/SalomeApp/SalomeApp_ImportOperation.h | 2 +- src/SalomeApp/SalomeApp_ListView.cxx | 719 ++++----- src/SalomeApp/SalomeApp_ListView.h | 27 +- src/SalomeApp/SalomeApp_Module.cxx | 56 + src/SalomeApp/SalomeApp_Module.h | 23 +- src/SalomeApp/SalomeApp_PyInterp.cxx | 10 +- src/SalomeApp/SalomeApp_PyInterp.h | 2 +- src/SalomeApp/SalomeApp_Study.cxx | 300 ++-- src/SalomeApp/SalomeApp_Study.h | 12 +- .../SalomeApp_StudyPropertiesDlg.cxx | 18 +- src/SalomeApp/SalomeApp_StudyPropertiesDlg.h | 19 +- src/SalomeApp/SalomeApp_Tools.cxx | 2 +- src/SalomeApp/SalomeApp_Tools.h | 2 +- src/SalomeApp/SalomeApp_TypeFilter.cxx | 4 +- src/SalomeApp/SalomeApp_TypeFilter.h | 2 +- src/SalomeApp/resources/SalomeApp.xml | 286 +--- src/SalomeApp/resources/SalomeApp_images.po | 18 + src/SalomeApp/resources/SalomeApp_msg_en.po | 66 +- src/Session/InquireServersQThread.cxx | 56 +- src/Session/InquireServersQThread.h | 26 +- src/Session/Makefile.in | 12 +- src/Session/SALOME_Session_Server.cxx | 250 +++- src/Session/SalomeApp_Engine_i.cxx | 11 +- src/Session/SalomeApp_Engine_i.hxx | 2 +- src/Session/Session_ServerCheck.hxx | 8 +- src/Session/Session_ServerLauncher.cxx | 76 +- src/Session/Session_ServerLauncher.hxx | 18 +- src/Session/Session_ServerThread.cxx | 100 +- src/Session/Session_ServerThread.hxx | 7 +- src/Session/Session_Session_i.cxx | 97 +- src/Session/Session_Session_i.hxx | 2 +- src/Session/Session_SignalsHandler.cxx | 45 - src/Style/Makefile.in | 20 +- src/Style/SalomeStyle.cxx | 108 +- src/Style/SalomeStyle.h | 2 +- src/TOOLSGUI/Makefile.in | 8 +- src/TOOLSGUI/ToolsGUI.cxx | 25 +- src/TOOLSGUI/ToolsGUI.h | 2 +- src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx | 108 +- src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h | 6 +- src/TOOLSGUI/ToolsGUI_HelpWindow.cxx | 5 +- src/TOOLSGUI/ToolsGUI_HelpWindow.h | 2 +- src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx | 42 +- src/TOOLSGUI/ToolsGUI_IntervalWindow.h | 18 +- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 31 +- src/TOOLSGUI/ToolsGUI_RegWidget.h | 2 +- src/TOOLSGUI/resources/ToolsGUI_msg_en.po | 2 +- src/VTKViewer/Makefile.in | 88 +- src/VTKViewer/VTKViewer.cxx | 2 +- src/VTKViewer/VTKViewer.h | 25 +- src/VTKViewer/VTKViewer_Actor.cxx | 239 ++- src/VTKViewer/VTKViewer_Actor.h | 38 +- src/VTKViewer/VTKViewer_Algorithm.h | 2 +- src/VTKViewer/VTKViewer_AppendFilter.cxx | 307 ++-- src/VTKViewer/VTKViewer_AppendFilter.h | 59 +- src/VTKViewer/VTKViewer_CellRectPicker.cxx | 2 +- src/VTKViewer/VTKViewer_CellRectPicker.h | 2 +- src/VTKViewer/VTKViewer_ConvexTool.cxx | 1296 +++++++---------- src/VTKViewer/VTKViewer_ConvexTool.h | 195 ++- .../VTKViewer_ExtractUnstructuredGrid.cxx | 9 +- .../VTKViewer_ExtractUnstructuredGrid.h | 2 +- src/VTKViewer/VTKViewer_Filter.cxx | 2 +- src/VTKViewer/VTKViewer_Filter.h | 2 +- src/VTKViewer/VTKViewer_Functor.h | 2 +- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 361 +---- src/VTKViewer/VTKViewer_GeometryFilter.h | 2 +- src/VTKViewer/VTKViewer_InteractorStyle.cxx | 84 +- src/VTKViewer/VTKViewer_InteractorStyle.h | 8 +- src/VTKViewer/VTKViewer_PassThroughFilter.cxx | 2 +- src/VTKViewer/VTKViewer_PassThroughFilter.h | 2 +- src/VTKViewer/VTKViewer_RectPicker.cxx | 12 +- src/VTKViewer/VTKViewer_RectPicker.h | 2 +- src/VTKViewer/VTKViewer_RenderWindow.cxx | 4 +- src/VTKViewer/VTKViewer_RenderWindow.h | 2 +- .../VTKViewer_RenderWindowInteractor.cxx | 45 +- .../VTKViewer_RenderWindowInteractor.h | 2 +- src/VTKViewer/VTKViewer_ShrinkFilter.cxx | 6 +- src/VTKViewer/VTKViewer_ShrinkFilter.h | 2 +- src/VTKViewer/VTKViewer_Transform.cxx | 2 +- src/VTKViewer/VTKViewer_Transform.h | 2 +- src/VTKViewer/VTKViewer_TransformFilter.cxx | 2 +- src/VTKViewer/VTKViewer_TransformFilter.h | 2 +- src/VTKViewer/VTKViewer_Trihedron.cxx | 76 +- src/VTKViewer/VTKViewer_Trihedron.h | 20 +- src/VTKViewer/VTKViewer_Utilities.cxx | 201 +-- src/VTKViewer/VTKViewer_Utilities.h | 36 +- src/VTKViewer/VTKViewer_VectorText.cxx | 7 +- src/VTKViewer/VTKViewer_VectorText.h | 2 +- src/VTKViewer/VTKViewer_ViewManager.cxx | 2 +- src/VTKViewer/VTKViewer_ViewManager.h | 2 +- src/VTKViewer/VTKViewer_ViewModel.cxx | 2 +- src/VTKViewer/VTKViewer_ViewModel.h | 2 +- src/VTKViewer/VTKViewer_ViewWindow.cxx | 69 +- src/VTKViewer/VTKViewer_ViewWindow.h | 5 +- src/VTKViewer/resources/VTKViewerM_images.po | 40 - src/VTKViewer/resources/VTKViewerM_msg_en.po | 109 -- src/VTKViewer/resources/VTKViewer_images.po | 2 +- src/VTKViewer/resources/VTKViewer_msg_en.po | 5 +- src/VTKViewer/resources/view_update_rate.png | Bin 972 -> 971 bytes 714 files changed, 22302 insertions(+), 10926 deletions(-) delete mode 100755 bin/VERSION delete mode 100755 doc/salome/GUI_index.html delete mode 100755 doc/salome/GUI_index_v3.1.0.html delete mode 100755 doc/salome/tui/SUIT/doxyfile delete mode 100755 doc/salome/tui/SUIT/sources/Application-About.png delete mode 100755 doc/salome/tui/SUIT/sources/application.gif delete mode 100755 doc/salome/tui/SUIT/sources/html_comments.gif delete mode 100755 doc/salome/tui/SUIT/sources/logocorp.gif delete mode 100755 doc/salome/tui/SUIT/sources/myheader.html delete mode 100644 src/OBJECT/SALOME_GLOwner.cxx delete mode 100644 src/OBJECT/SALOME_GLOwner.h delete mode 100755 src/SALOME_SWIG/salome_test.py delete mode 100755 src/Session/Session_SignalsHandler.cxx delete mode 100644 src/VTKViewer/resources/VTKViewerM_images.po delete mode 100644 src/VTKViewer/resources/VTKViewerM_msg_en.po diff --git a/INSTALL b/INSTALL index 2f6965076..31600814e 100644 --- a/INSTALL +++ b/INSTALL @@ -1,3 +1 @@ -This is the version 3.2.0a1 of SALOMEGUI -Compatible with : - - KERNEL 3.2.0a1 +SALOME2 : GUI module diff --git a/Makefile.in b/Makefile.in index 989c6a476..81a618ac4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # # Author : Patrick GOLDBRONN (CEA) @@ -14,7 +32,7 @@ VPATH=.:@srcdir@:@top_srcdir@/bin:./bin/salome:@top_srcdir@/resources:./bin:@top @COMMENCE@ -SUBDIRS = idl src doc +SUBDIRS = src doc adm_local RESOURCES_FILES = \ back.xpm \ @@ -81,22 +99,25 @@ runLightSalome.sh # copy header files in common directory OWN_CONFIG_H=@OWN_CONFIG_H@ +include_list = include/salome/SALOMEconfig.h \ + include/salome/GUI_version.h + ifeq ($(OWN_CONFIG_H),yes) - ifeq ($(HAVE_SSTREAM),yes) - include_list=include/salome/SALOMEconfig.h include/salome/config.h - else - include_list=include/salome/SALOMEconfig.h include/salome/config.h include/salome/sstream - endif -else - ifeq ($(HAVE_SSTREAM),yes) - include_list=include/salome/SALOMEconfig.h - else - include_list=include/salome/SALOMEconfig.h include/salome/sstream - endif + include_list += include/salome/config.h +endif + +ifneq ($(HAVE_SSTREAM),yes) + include_list += include/salome/sstream endif inc: idl $(include_list) +bin: bin/salome/VERSION + +bin/salome/VERSION : bin/VERSION + -$(RM) $@ + $(LN_S) ../../$< $@ + include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref -$(RM) $@ $(LN_S) ../../$< $@ @@ -118,10 +139,14 @@ include/salome/sstream: salome_adm/unix/sstream -$(RM) $@ $(LN_S) ../../$< $@ -depend: depend_idl +include/salome/GUI_version.h: GUI_version.h + -$(RM) $@ + $(LN_S) ../../$< $@ -depend_idl: - (cd idl ; $(MAKE) $@) || exit 1 +depend: +#depend: depend_idl +#depend_idl: +# (cd idl ; $(MAKE) $@) || exit 1 # doc is already build : if you want to had documents, go manually to doc and run 'make doc' #doc: @@ -150,10 +175,10 @@ install-bin: $(BIN_SCRIPT) $(INSTALL) -d $(bindir) $(INSTALL_PROGRAM) $^ $(bindir) -uninstall: uninstall-idl - -uninstall-idl: - $(RM) $(idldir)/*.idl +uninstall: +#uninstall: uninstall-idl +#uninstall-idl: +# $(RM) $(idldir)/*.idl distclean: distclean-other diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index cb1d7e470..0a5de34a2 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -1,6 +1,14 @@ # common directories to put headerfiles inc_builddir=$(top_builddir)/include/salome +GUI_DISABLE_CORBA=@GUI_DISABLE_CORBA@ +DISABLE_GLVIEWER=@DISABLE_GLVIEWER@ +DISABLE_PYCONSOLE=@DISABLE_PYCONSOLE@ +DISABLE_PLOT2DVIEWER=@DISABLE_PLOT2DVIEWER@ +DISABLE_SUPERVGRAPHVIEWER=@DISABLE_SUPERVGRAPHVIEWER@ +DISABLE_OCCVIEWER=@DISABLE_OCCVIEWER@ +DISABLE_VTKVIEWER=@DISABLE_VTKVIEWER@ +DISABLE_SALOMEOBJECT=@DISABLE_SALOMEOBJECT@ @SET_MAKE@ SHELL=/bin/sh @@ -11,8 +19,8 @@ HAVE_SSTREAM=@HAVE_SSTREAM@ LIBS=@LIBS@ LIBSFORBIN=@LIBS@ -LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome -LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib/salome +LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome +LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome # add libstdc++ to link c++ library with libtool ! LDFLAGS+= -lstdc++ LDFLAGSFORBIN+= -lstdc++ @@ -54,8 +62,8 @@ PYTHONHOME = @PYTHONHOME@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ -PYTHON_SITE = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages -PYTHON_SITE_INSTALL = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome +PYTHON_SITE = $(prefix)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages +PYTHON_SITE_INSTALL = $(prefix)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome # QT QT_ROOT = @QT_ROOT@ @@ -108,12 +116,6 @@ HDF5_MT_LIBS=@HDF5_MT_LIBS@ OCC_INCLUDES=@CAS_CPPFLAGS@ OCC_CXXFLAGS=@CAS_CXXFLAGS@ -#OCC_KERNEL_LIBS=@CAS_KERNEL@ -#OCC_OCAF_LIBS=@CAS_OCAF@ -#OCC_VIEWER_LIBS=@CAS_VIEWER@ -#OCC_MODELER_LIBS=@CAS_MODELER@ -#OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@ -#OCC_LIBS=@CAS_LDFLAGS@ CAS_KERNEL=@CAS_KERNEL@ CAS_MATH=@CAS_MATH@ CAS_OCAF=@CAS_OCAF@ @@ -123,6 +125,7 @@ CAS_VIEWER=@CAS_VIEWER@ CAS_MODELER=@CAS_MODELER@ CAS_DATAEXCHANGE=@CAS_DATAEXCHANGE@ CAS_LDPATH=@CAS_LDPATH@ + # MPICH MPICH_INCLUDES=@MPICH_INCLUDES@ @@ -175,11 +178,9 @@ IDL_SRV_OBJ = @IDL_SRV_OBJ@ CPPFLAGS+= $(CORBA_INCLUDES) CXXFLAGS+= $(CORBA_CXXFLAGS) -# add corba libs when link salome application ! -#LDFLAGS+= $(CORBA_LIBS) -#LIBS+=$(CORBA_LIBS) - DOXYGEN = @DOXYGEN@ +DOXYGEN_WITH_PYTHON = @DOXYGEN_WITH_PYTHON@ +DOXYGEN_WITH_STL = @DOXYGEN_WITH_STL@ ## Shared libraries LT_STATIC_EXEC=@LT_STATIC_EXEC@ @@ -201,16 +202,22 @@ INSTALL_DATA=@INSTALL_DATA@ # create a symbolic link (or a copie ?) LN_S=@LN_S@ +KERNEL_ROOT_DIR=@KERNEL_ROOT_DIR@ +KERNEL_SITE_DIR=@KERNEL_SITE_DIR@ + +KERNEL_LDFLAGS=@KERNEL_LDFLAGS@ +KERNEL_CXXFLAGS=@KERNEL_CXXFLAGS@ + ## Installation points prefix=@prefix@ exec_prefix=@exec_prefix@ -bindir=@bindir@/salome -libdir=@libdir@/salome +bindir=@exec_prefix@/bin/salome +libdir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/salome # warning : if user give this path in configure we could have salome/salome :-( includedir=@includedir@/salome datadir=@datadir@/salome idldir=${prefix}/idl/salome -sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules +sharedpydir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules incmakedir=${prefix}/salome_adm/unix docdir=${prefix}/doc/salome @@ -238,7 +245,13 @@ all: Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in cd $(top_builddir) ; ./config.status -$(top_builddir)/config.status: $(top_srcdir)/configure +LOCAL_MAKE = make_commence make_conclude make_omniorb + +KERNEL_MAKE = make_module depend SALOMEconfig.h F77config.h sstream envScript + +$(top_builddir)/config.status: $(top_srcdir)/configure \ + $(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \ + $(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in) cd $(top_builddir) ; ./config.status --recheck # VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) @@ -254,14 +267,9 @@ $(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base ACLOCAL_SRC = \ -ac_cxx_bool.m4 check_corba.m4 check_vtk.m4 \ -ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ -ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ -ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ -ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \ -ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ -ac_cc_warnings.m4 check_qt.m4 check_swig.m4 \ -check_boost.m4 check_msg2qm.m4 - -$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) - cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files +check_qt.m4 check_vtk.m4 check_qwt.m4 \ +check_sip.m4 check_msg2qm.m4 check_pyqt.m4 \ +check_opengl.m4 + +$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=$(top_srcdir)/adm_local/unix/config_files/%) + cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files diff --git a/bin/VERSION b/bin/VERSION deleted file mode 100755 index e7134d951..000000000 --- a/bin/VERSION +++ /dev/null @@ -1 +0,0 @@ -THIS IS SALOME - SALOMEGUI VERSION: 3.2.0a1 diff --git a/bin/runLightSalome.sh b/bin/runLightSalome.sh index f99a8125f..b2f67d65e 100755 --- a/bin/runLightSalome.sh +++ b/bin/runLightSalome.sh @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# #!/bin/bash -f if [ -z "$SUITRoot" ] ; then diff --git a/build_configure b/build_configure index ec5cce644..b36fde32a 100755 --- a/build_configure +++ b/build_configure @@ -124,10 +124,10 @@ echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_omniorb \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_conclude:${ABS_CONF_DIR}/adm_local/unix/make_conclude.in \\" >> configure.in_tmp1 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1 \rm -f configure.in_tmp2 configure.in_tmp3 @@ -202,7 +202,7 @@ else echo -n "Creating 'configure' script ... " fi -aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files +aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files if autoconf then echo "done" diff --git a/configure.in.base b/configure.in.base index e6be9b20d..4b7af75f9 100644 --- a/configure.in.base +++ b/configure.in.base @@ -23,8 +23,45 @@ AC_CANONICAL_HOST PACKAGE=salome AC_SUBST(PACKAGE) -VERSION=0.0.1 +VERSION=3.2.0 +XVERSION=0x030200 AC_SUBST(VERSION) +AC_SUBST(XVERSION) + +######################################################################## +# Check --disable-corba-gen and other --disable-* options + +GUI_DISABLE_CORBA="no" +DISABLE_PYCONSOLE="no" +DISABLE_GLVIEWER="no" +DISABLE_PLOT2DVIEWER="no" +DISABLE_SUPERVGRAPHVIEWER="no" +DISABLE_OCCVIEWER="no" +DISABLE_VTKVIEWER="no" +DISABLE_SALOMEOBJECT="no" + +for option +do + case $option in + -disable-corba-gen=yes | --disable-corba-gen=yes | -disable-corba-gen | --disable-corba-gen) + GUI_DISABLE_CORBA="yes";; + -disable-pyConsole=yes | --disable-pyConsole=yes | -disable-pyConsole | --disable-pyConsole) + DISABLE_PYCONSOLE="yes";; + -disable-glViewer=yes | --disable-glViewer=yes | -disable-glViewer | --disable-glViewer) + DISABLE_GLVIEWER="yes";; + -disable-plot2dViewer=yes | --disable-plot2dViewer=yes | -disable-plot2dViewer | --disable-plot2dViewer) + DISABLE_PLOT2DVIEWER="yes";; + -disable-supervGraphViewer=yes | --disable-supervGraphViewer=yes | \ + -disable-supervGraphViewer | --disable-supervGraphViewer) + DISABLE_SUPERVGRAPHVIEWER="yes";; + -disable-occViewer=yes | --disable-occViewer=yes | -disable-occViewer | --disable-occViewer) + DISABLE_OCCVIEWER="yes";; + -disable-vtkViewer=yes | --disable-vtkViewer=yes | -disable-vtkViewer | --disable-vtkViewer) + DISABLE_VTKVIEWER="yes";; + -disable-salomeObject=yes | --disable-salomeObject=yes | -disable-salomeObject | --disable-salomeObject) + DISABLE_SALOMEOBJECT="yes";; + esac +done dnl dnl Initialize source and build root directories @@ -151,6 +188,17 @@ dnl echo dnl CHECK_JAVA +echo +echo --------------------------------------------- +echo Testing Disable Corba +echo --------------------------------------------- +echo + +CHECK_DISABLE_CORBA +echo "GUI_DISABLE_CORBA = "$GUI_DISABLE_CORBA + +if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then + echo echo --------------------------------------------- echo testing swig @@ -158,6 +206,7 @@ echo --------------------------------------------- echo CHECK_SWIG +fi echo echo --------------------------------------------- @@ -167,6 +216,7 @@ echo ENABLE_PTHREADS +if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then echo echo --------------------------------------------- echo testing omniORB @@ -190,12 +240,20 @@ echo --------------------------------------------- echo DEFAULT_ORB=omniORB + +echo +echo --------------------------------------------- +echo testing Corba +echo --------------------------------------------- +echo + CHECK_CORBA AC_SUBST_FILE(CORBA) corba=make_$ORB CORBA=adm_local/unix/$corba +fi echo echo --------------------------------------------- echo testing openGL @@ -276,6 +334,100 @@ echo CHECK_QWT +echo +echo --------------------------------------------- +echo Testing PyConsole +echo --------------------------------------------- +echo + +CHECK_PYCONSOLE +echo "DISABLE_PYCONSOLE = "$DISABLE_PYCONSOLE + +echo +echo --------------------------------------------- +echo Testing GlViewer +echo --------------------------------------------- +echo + +CHECK_GLVIEWER +echo "DISABLE_GLVIEWER = "$DISABLE_GLVIEWER + +echo +echo --------------------------------------------- +echo Testing Plot2dViewer +echo --------------------------------------------- +echo + +CHECK_PLOT2DVIEWER +echo "DISABLE_PLOT2DVIEWER = "$DISABLE_PLOT2DVIEWER + +echo +echo --------------------------------------------- +echo Testing SupervGraphViewer +echo --------------------------------------------- +echo + +CHECK_SUPERVGRAPHVIEWER +echo "DISABLE_SUPERVGRAPHVIEWER = "$DISABLE_SUPERVGRAPHVIEWER + +echo +echo --------------------------------------------- +echo Testing OCCViewer +echo --------------------------------------------- +echo + +CHECK_OCCVIEWER +echo "DISABLE_OCCVIEWER = "$DISABLE_OCCVIEWER + +echo +echo --------------------------------------------- +echo Testing VTKViewer +echo --------------------------------------------- +echo + +CHECK_VTKVIEWER +echo "DISABLE_VTKVIEWER = "$DISABLE_VTKVIEWER + +echo +echo --------------------------------------------- +echo Testing SalomeObject +echo --------------------------------------------- +echo + +CHECK_SALOMEOBJECT +echo "DISABLE_SALOMEOBJECT = "$DISABLE_SALOMEOBJECT + +if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then + if test "x${DISABLE_PYCONSOLE}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable PyConsole !" + exit + fi + if test "x${DISABLE_GLVIEWER}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable GlViewer !" + exit + fi + if test "x${DISABLE_PLOT2DVIEWER}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable Plot2dViewer !" + exit + fi + if test "x${DISABLE_SUPERVGRAPHVIEWER}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable SupervGraphViewer !" + exit + fi + if test "x${DISABLE_OCCVIEWER}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable OCCViewer !" + exit + fi + if test "x${DISABLE_VTKVIEWER}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable VTKViewer !" + exit + fi + if test "x${DISABLE_SALOMEOBJECT}" == "xyes" ; then + echo "failed : for full configuration of GUI module necessary enable SalomeObject !" + exit + fi +fi + echo echo --------------------------------------------- echo Testing html generators @@ -289,17 +441,34 @@ echo --------------------------------------------- echo Testing Kernel echo --------------------------------------------- echo - CHECK_KERNEL +echo +echo --------------------------------------------- +echo Testing CPPUNIT only required for unit testing +echo --------------------------------------------- +echo + +CHECK_CPPUNIT + echo echo --------------------------------------------- echo Summary echo --------------------------------------------- echo -echo Configure +if test "$GUI_DISABLE_CORBA" == "yes"; then + echo "Configure (without Corba)" +else + echo Configure +fi + + +if test "$GUI_DISABLE_CORBA" != "yes"; then variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok" +else +variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok" +fi for var in $variables do @@ -307,14 +476,27 @@ do eval echo \$$var done +echo "---Optional:" +variables="cppunit_ok" + +for var in $variables +do + eval toto=\$$var + if test x$toto != "x"; then + printf " %10s : " `echo \$var | sed -e "s,_ok,,"` + eval echo \$$var + fi +done + +if test "$GUI_DISABLE_CORBA" != "yes"; then echo echo "Default ORB : $DEFAULT_ORB" echo - +fi dnl generals files which could be included in every makefile AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence -AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude +AC_SUBST_FILE(CONCLUDE) CONCLUDE=adm_local/unix/make_conclude AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module dnl les dependences @@ -329,7 +511,13 @@ else fi # make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl +if test "$GUI_DISABLE_CORBA" == "yes"; then + dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl" +else + dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources" +fi + +for rep in $dir_variables do # if test ! -d $rep ; then # eval mkdir $rep diff --git a/doc/Makefile.in b/doc/Makefile.in index 7295ede75..4a62d64a2 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # @@ -19,6 +37,17 @@ docs: @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done + +usr_docs: + @@SETX@; for d in $(SUBDIRS); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done + +dev_docs: + @@SETX@; for d in $(SUBDIRS); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done + clean: @@SETX@; for d in $(SUBDIRS); do \ (cd $$d && $(MAKE) $@) || exit 1; \ diff --git a/doc/salome/GUI_index.html b/doc/salome/GUI_index.html deleted file mode 100755 index 465e3ea9d..000000000 --- a/doc/salome/GUI_index.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Gui Module Documentation - - - -
  -
-
                   -   
- - - - - - - - - -
- - - -
- -
-
-
-

GUI MODULE Documentation

-
-
- - - - - -
-
- -
-

Application-About.png -     

-
- -
- - - - -
-
-
-
-
- -
- -
GUI Documentation
- -
- -
- -

-
- -
- -
TUI Documentation
- -
- -
- -

-
-
-
-
-
-
- - diff --git a/doc/salome/GUI_index_v3.1.0.html b/doc/salome/GUI_index_v3.1.0.html deleted file mode 100755 index 465e3ea9d..000000000 --- a/doc/salome/GUI_index_v3.1.0.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Gui Module Documentation - - - -
  -
-
                   -   
- - - - - - - - - -
- - - -
- -
-
-
-

GUI MODULE Documentation

-
-
- - - - - -
-
- -
-

Application-About.png -     

-
- -
- - - - -
-
-
-
-
- -
- -
GUI Documentation
- -
- -
- -

-
- -
- -
TUI Documentation
- -
- -
- -

-
-
-
-
-
-
- - diff --git a/doc/salome/Makefile.in b/doc/salome/Makefile.in index ca1d6f282..72b2d98ad 100644 --- a/doc/salome/Makefile.in +++ b/doc/salome/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # -* Makefile *- # @@ -12,33 +30,48 @@ srcdir=@srcdir@ VPATH=.:@srcdir@ SUBDIRS= tui gui +SUBDIRSTUI= tui +SUBDIRSGUI= gui @COMMENCE@ -docs: - @@SETX@; for d in $(SUBDIRS); do \ +usr_docs: + @@SETX@; for d in $(SUBDIRSGUI); do \ + (cd $$d && $(MAKE) $@) || exit 1; \ + done; \ + +docs: usr_docs + +dev_docs: + @@SETX@; for d in $(SUBDIRSTUI); do \ (cd $$d && $(MAKE) $@) || exit 1; \ done; \ - cp -f $(srcdir)/GUI_index_v3.1.0.html GUI_index_v3.1.0.html clean: @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ + if test -d $$d/GUI; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ done distclean: clean @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ + if test -d $$d/GUI; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ done install: $(MAKE) docs - (cd tui && $(MAKE) install); - (cd gui && $(MAKE) install); - cp -f GUI_index_v3.1.0.html $(docdir) + @@SETX@; for d in $(SUBDIRS); do \ + if test -d $$d/GUI; then \ + (cd $$d && $(MAKE) $@); \ + fi; \ + done uninstall: @@SETX@; for d in $(SUBDIRS); do \ - (cd $$d && $(MAKE) $@) || exit 1; \ + if test -d $$d/GUI; then \ + (cd $$d && $(MAKE) $@) || exit 1; \ + fi; \ done; \ - rm -fr $(docdir)/GUI_index_v3.1.0.html diff --git a/doc/salome/tui/GUI/sources/Application-About.png b/doc/salome/tui/GUI/sources/Application-About.png index 7b58330d50856e28562e8f9ed80dae72d6e6dda3..df0d5a187398c59271c45249950a92cd9cec68bb 100755 GIT binary patch delta 15 WcmbO=jdA8QMwZS1KlhESqTT>383gJ8 delta 16 XcmbO^jd9jAM%K;%KX=}ZETY~3Ffs)9 diff --git a/doc/salome/tui/Makefile.in b/doc/salome/tui/Makefile.in index 0372e6a1f..dc94bcbb7 100644 --- a/doc/salome/tui/Makefile.in +++ b/doc/salome/tui/Makefile.in @@ -1,11 +1,24 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D # +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # File : Makefile.in # Author : Vasily Rusyaev (Open Cascade NN) # Module : doc -# $Header: top_srcdir=@top_srcdir@ top_builddir=../../.. @@ -16,18 +29,35 @@ doxygen=@DOXYGEN@ @COMMENCE@ -docs: - cp -fr $(srcdir)/SUIT ./INPUT; \ +dev_docs: + cp -fr $(srcdir)/GUI ./INPUT; \ + cp -f ./GUI/doxyfile ./INPUT; \ cd INPUT; \ sed 's|../../../share/salome|$(root_srcdir)|' ./doxyfile > ./doxyfile1; \ + sed 's|../../build/salome|$(top_builddir)|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + echo "DOXYGEN SUPPORT PYTHON - @DOXYGEN_WITH_PYTHON@"; \ + if( test "x@DOXYGEN_WITH_PYTHON@" = "xyes"); then \ + sed 's|python_extension_must_be_here|*.py|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + $(doxygen) -u ./doxyfile1; \ + else \ + sed 's|python_extension_must_be_here||' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + fi; \ + if( test "x@DOXYGEN_WITH_STL@" = "xyes"); then \ + sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + fi; \ mv -f doxyfile1 doxyfile; \ + echo "Running doxygen in directory:"`pwd`; \ $(doxygen) ./doxyfile; \ cd ../; \ - cp -fr $(srcdir)/SUIT/sources/ SUIT ; \ + cp -fr $(srcdir)/GUI/sources/ GUI ; \ rm -fr INPUT clean: - rm -fr SUIT + rm -fr GUI distclean: clean rm -fr INPUT @@ -35,7 +65,7 @@ distclean: clean install: $(INSTALL) -d $(docdir); \ mkdir -p $(docdir)/tui - cp -fr SUIT $(docdir)/tui + cp -fr GUI $(docdir)/tui uninstall: - rm -fr $(docdir)/tui/SUIT + rm -fr $(docdir)/tui/GUI diff --git a/doc/salome/tui/SUIT/doxyfile b/doc/salome/tui/SUIT/doxyfile deleted file mode 100755 index bb5e49fb6..000000000 --- a/doc/salome/tui/SUIT/doxyfile +++ /dev/null @@ -1,229 +0,0 @@ -# Doxyfile 1.3.7 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME v.3.2.0a1" -PROJECT_NUMBER = id#1.1 -OUTPUT_DIRECTORY = ../ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 5 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = YES -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 25 -SHOW_USED_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = log.txt - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ../../../share/salome/src \ - ../../../share/salome/idl -FILE_PATTERNS = *.idl *.h *.hh *.hxx *.c *.cc *.cxx *.ixx *.jxx -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = YES -IMAGE_PATH = sources/ -INPUT_FILTER = -FILTER_SOURCE_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = SUIT -HTML_FILE_EXTENSION = .html -HTML_HEADER = sources/myheader.html -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = NO - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = NO -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = jpg -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1200 -MAX_DOT_GRAPH_DEPTH = 0 -GENERATE_LEGEND = NO -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/doc/salome/tui/SUIT/sources/Application-About.png b/doc/salome/tui/SUIT/sources/Application-About.png deleted file mode 100755 index 7b58330d50856e28562e8f9ed80dae72d6e6dda3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19226 zcmd3NW1D8nvTb*Dq06>y+g-M8+qP}nwr$(CZMk`Se*^t}dY$LT{`eujCnm_J=(>KDWfO|El5}c= zL){8uRT>QM7yv~P`-j@l78b=YcnNGu0GDeR5@#>SRJ50KEZ~yOPf%R<03Uaf4N{F9 zwlf`?=nQ%=63T*TfDy+F&gOxS4!c$klc*R3r3M7WF#xRn542V;Xb;EpcKc&bd-G1{Bck4UzwWpx-U|N7l#O<50w~*lYc`;1bSfyq{Gbf@YyniNxQfxEk|B2_ z-q$K-7OYQzIOyF;%6TVQt=4q8{Ya^rl8eu9_JE zxeQP*pLD=(=wT)*y1!bv#+veou|ADWb33!*rkOirf;mT~uD>4PDu)j61VYVNs=~Y% zzNrm-*gR@CJT)?JJJjjiA2qBW%b<>4a!aaw6?k85f2Lx7@91>vdDD3Hu+<$Sdpioq zFr>CRLJUJ}+|Wu@29eVV**lr+Xtv&!vL_=RCN`<;;%K$ox}P=GZC2ubdsMv*d4D`< zdSP!DrufK4w|uI)2LbwYE-+ibcyBXmW-@Yax)j13Bnu$x&-dRuIAw-E7{vO&-v=nh zrbTHGbC2Nu=Z-2gW7#{59LbztS(}^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0hHSLOstHBc z2p=%3&u96YxeS>bktgh7J}aBf$+6{%G-U^B!de@_Bt+>MZM~unISNh_&rFnzZP`Jm KJ9x`c0029x$~vY1 diff --git a/doc/salome/tui/SUIT/sources/logocorp.gif b/doc/salome/tui/SUIT/sources/logocorp.gif deleted file mode 100755 index 7697e0837777ed6aa775741b68962a9533f62caa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1792 zcmV+b2mkm-Nk%w1VT%AS0M!5hoSdBI=H|`K&1h+9yr%&i92}?s9Q4@(`}_LWPNmY) z(&*@(Mny)&y^n7I4{B!vuhPw}5?2IXir|z73~g1|qP6eq%$#@+9iPydLQ8d@5mkyJ+Hc*mQgIAO1%kNT04UJv^Xbjgu+dWmns}MAyYSKDkey3~zS-CTdiC?|VXDsV z?d^iw_xI-Rw^eTF^5`PJ@#MM6alNa@g__&l+iiR_0!%suKW6s!_KJ#%u&}WA_xAt* z0RH~|A^8LV00000EC2ui0E+-G000L6z*cWaEEFMdcUl8%k6r< z;IMd1E}O}{fWnGByWjA*T%KNE=i^n!GwFL42zY{nZ*^>hTQ53UFBcbmep(_Th?SOE zhIfM}6$ufa2{khhq>dLJA}%tkt1fMquyC2LZ!MHr03W&$x*ru47a5Ko78?>EAQ;LR zlsynM5HYdSVzXyGA}K7$$tgND9|gU-Gg%fED_O=l6359lG$r!$(A4%@)?Wxcfm$Z) z+}cSnp@6}-4=_%6F(H9MJ7g>%P{2W9o;(`&GUn6L2mz)+Fwufcx-*5n z@S9e57v2cMNN|`;0+1OSJ2C?x832H11!4j05dFhO7aal;cOEccbmAW^GY8IM0|4vM zhksbPEnti2(ORrz9?he0i{HaDW6G*2O9saoP)wdqokZ?102s91F@Ql~9t>;`7(2i- zfFG>61YiJqy^r_r8JI>7e@7Mp4B*GdRX~4%9gFk;Ujg$Cpq~!~Fd%>q{T=ATa(2-2 z0yq)CaDxWaO{c+z(ue{79uHb{#sC7~{jdUS1AwT-4h0Ob#d@IS7ax2B=+HugJ}~e@ z4?DbzJjJh0`Z8sx@TKUyeIKw9A87XWzTiFV$eUnaR;06o6Prl|-ND&qjL4msWr z4JIiZ4=XT8=m-F=1ptGaX!3yE z9WH>MhsQqu;KHmES)|GT*?<|$ydU1;59BgPK3Vaqg06dts+nHOeQ0fXKj!BaGW5yrqS)CJ^53@nK7h&4>24SnH6jU+IN4Il=mK7d6eYO#a{$YB?sI3=~j1U z#t5qaagB`mA|f(i!x7H$j}mkM4ey9YSnv=IaO~qB7a0N?MxcO&q>CO2kw`@{@`w>A zMyi3R{9CN;T9OC0hId_1Ed%V>ZMK(dsTIHem}kjgq@F#;8UjC{3wKSIW|sy7Z+T iFpX*a^t7Gi*z~42&8bdz%F~|u^rt`#YI0B%1OPi{2poO@ diff --git a/doc/salome/tui/SUIT/sources/myheader.html b/doc/salome/tui/SUIT/sources/myheader.html deleted file mode 100755 index 83ca543cd..000000000 --- a/doc/salome/tui/SUIT/sources/myheader.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Main Page - - - -  -
- - - - - - -
-
-
- - - - diff --git a/idl/SalomeApp_Engine.idl b/idl/SalomeApp_Engine.idl index d52b2eac2..abce369ff 100644 --- a/idl/SalomeApp_Engine.idl +++ b/idl/SalomeApp_Engine.idl @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SalomeApp_Engine.idl // Author : Alexander SLADKOV diff --git a/src/CAF/CAF.h b/src/CAF/CAF.h index 0eee94656..d70c01d80 100755 --- a/src/CAF/CAF.h +++ b/src/CAF/CAF.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAF_H #define CAF_H diff --git a/src/CAF/CAF_Application.cxx b/src/CAF/CAF_Application.cxx index 823d09355..78bc1d566 100755 --- a/src/CAF/CAF_Application.cxx +++ b/src/CAF/CAF_Application.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAF_Application.h" @@ -45,31 +45,50 @@ extern "C" CAF_EXPORT SUIT_Application* createApplication() return new CAF_Application(); } +/*! + Default constructor +*/ CAF_Application::CAF_Application() : STD_Application() { } -CAF_Application::CAF_Application( const Handle(TDocStd_Application)& app ) +/*! + Constructor with OCAF application + \param app - OCAF application +*/ +CAF_Application::CAF_Application( const Handle( TDocStd_Application )& app ) : STD_Application(), myStdApp( app ) { } +/*! + Destructor +*/ CAF_Application::~CAF_Application() { } +/*! + \return application name +*/ QString CAF_Application::applicationName() const { return QString( "CAFApplication" ); } -Handle(TDocStd_Application) CAF_Application::stdApp() const +/*! + \return OCAF application +*/ +Handle( TDocStd_Application ) CAF_Application::stdApp() const { return myStdApp; } +/*! + \return file filters for open/save document +*/ QString CAF_Application::getFileFilter() const { if ( stdApp().IsNull() ) @@ -118,6 +137,9 @@ QString CAF_Application::getFileFilter() const return filters.join( ";;" ); } +/*! + Creates actions of application +*/ void CAF_Application::createActions() { STD_Application::createActions(); @@ -255,16 +277,25 @@ void CAF_Application::updateCommandsStatus() redo->setEnabled( cafStudy && cafStudy->canRedo() ); } +/*! + SLOT: called by clicking on Help->About in main menu +*/ void CAF_Application::onHelpAbout() { SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" ); } +/*! + Creates new study +*/ SUIT_Study* CAF_Application::createNewStudy() { return new CAF_Study( this ); } +/*! + Sets OCAF application +*/ void CAF_Application::setStdApp( const Handle(TDocStd_Application)& app ) { myStdApp = app; diff --git a/src/CAF/CAF_Application.h b/src/CAF/CAF_Application.h index 1ec88331d..81a16413d 100755 --- a/src/CAF/CAF_Application.h +++ b/src/CAF/CAF_Application.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAF_APPLICATION_H #define CAF_APPLICATION_H @@ -35,6 +35,12 @@ class CAF_Study; #pragma warning ( disable: 4251 ) #endif +/*! + \class CAF_Application + Defines application configuration and behaviour for application with + link to standard OCC OCAF data model. Allows to use OCC OCAF serives + (for example, undo/redo) +*/ class CAF_EXPORT CAF_Application : public STD_Application { Q_OBJECT diff --git a/src/CAF/CAF_Operation.cxx b/src/CAF/CAF_Operation.cxx index 24bc5ecd8..67fd2785f 100755 --- a/src/CAF/CAF_Operation.cxx +++ b/src/CAF/CAF_Operation.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAF_Operation.h" @@ -23,19 +23,24 @@ #include -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - +/*! + Default constructor +*/ CAF_Operation::CAF_Operation(SUIT_Application* theApp) :SUIT_Operation(theApp) { } +/*! + Destructor +*/ CAF_Operation::~CAF_Operation() { } +/*! + \return OCAF document +*/ Handle(TDocStd_Document) CAF_Operation::stdDoc() const { Handle(TDocStd_Document) doc; diff --git a/src/CAF/CAF_Operation.h b/src/CAF/CAF_Operation.h index f49e315d7..d6ae43694 100755 --- a/src/CAF/CAF_Operation.h +++ b/src/CAF/CAF_Operation.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAF_OPERATION_H #define CAF_OPERATION_H @@ -29,8 +29,14 @@ #include class CAF_Study; +//! OCC OCAF Std document class Handle(TDocStd_Document); +/*! + \class CAF_Operation + Base operation for all operations used in CAF package + Operation has link to OCC OCAF std document +*/ class CAF_EXPORT CAF_Operation : public SUIT_Operation { Q_OBJECT diff --git a/src/CAF/CAF_Study.cxx b/src/CAF/CAF_Study.cxx index 176023a1f..7acc291dc 100755 --- a/src/CAF/CAF_Study.cxx +++ b/src/CAF/CAF_Study.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAF_Study.h" @@ -33,16 +33,18 @@ #include -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - +/*! + Constructor +*/ CAF_Study::CAF_Study(SUIT_Application* theApp) : SUIT_Study( theApp ), myModifiedCnt( 0 ) { } +/*! + Constructor +*/ CAF_Study::CAF_Study(SUIT_Application* theApp, Handle (TDocStd_Document)& aStdDoc) : SUIT_Study( theApp ), myStdDoc( aStdDoc ), @@ -50,20 +52,33 @@ myModifiedCnt( 0 ) { } +/*! + Destructor +*/ CAF_Study::~CAF_Study() { } +/*! + \return OCAF document +*/ Handle(TDocStd_Document) CAF_Study::stdDoc() const { return myStdDoc; } +/*! + Sets new OCAF document + \param aStdDoc - new OCAF document +*/ void CAF_Study::setStdDoc( Handle(TDocStd_Document)& aStdDoc ) { myStdDoc = aStdDoc; } +/*! + Custom document initialization +*/ void CAF_Study::createDocument() { SUIT_Study::createDocument(); @@ -82,6 +97,9 @@ void CAF_Study::createDocument() } } +/*! + Close document +*/ void CAF_Study::closeDocument( bool permanent ) { Handle(TDocStd_Application) app = stdApp(); @@ -91,6 +109,10 @@ void CAF_Study::closeDocument( bool permanent ) SUIT_Study::closeDocument( permanent ); } +/*! + Open document + \param fname - name of file +*/ bool CAF_Study::openDocument( const QString& fname ) { Handle(TDocStd_Application) app = stdApp(); @@ -108,6 +130,10 @@ bool CAF_Study::openDocument( const QString& fname ) return status && SUIT_Study::openDocument( fname ); } +/*! + Save document with other name + \param fname - name of file +*/ bool CAF_Study::saveDocumentAs( const QString& fname ) { Handle(TDocStd_Application) app = stdApp(); @@ -149,9 +175,12 @@ bool CAF_Study::saveDocumentAs( const QString& fname ) return status; } +/*! + Open OCAF transaction +*/ bool CAF_Study::openTransaction() { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return false; bool res = true; @@ -168,13 +197,16 @@ bool CAF_Study::openTransaction() return res; } +/*! + Abort OCAF transaction +*/ bool CAF_Study::abortTransaction() { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return false; bool res = true; - try { + try { myStdDoc->AbortCommand(); update(); } @@ -184,13 +216,16 @@ bool CAF_Study::abortTransaction() return res; } +/*! + Commit OCAF transaction +*/ bool CAF_Study::commitTransaction( const QString& name ) { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return false; bool res = true; - try { + try { myStdDoc->CommitCommand(); if ( canUndo() ) @@ -206,31 +241,34 @@ bool CAF_Study::commitTransaction( const QString& name ) return res; } +/*! + \return true, if there is opened OCAF transaction +*/ bool CAF_Study::hasTransaction() const { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return false; return myStdDoc->HasOpenCommand(); } /*! - Returns whether the document was saved in file. [ public ] + \return whether the document was saved in file. [ public ] */ bool CAF_Study::isSaved() const { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return false; return myStdDoc->IsSaved(); } /*! - Returns whether the document is modified. [ public ] + \return whether the document is modified. [ public ] */ bool CAF_Study::isModified() const { - if ( myStdDoc.IsNull() ) + if ( myStdDoc.IsNull() ) return false; // return myStdDoc->IsModified(); @@ -311,7 +349,7 @@ bool CAF_Study::redo() } /*! - Check if possible to perform 'undo' command. [ public ] + \return true if possible to perform 'undo' command. [ public ] */ bool CAF_Study::canUndo() const { @@ -322,7 +360,7 @@ bool CAF_Study::canUndo() const } /*! - Check if possible to perform 'redo' command. [ public ] + \return true if possible to perform 'redo' command. [ public ] */ bool CAF_Study::canRedo() const { @@ -333,7 +371,7 @@ bool CAF_Study::canRedo() const } /*! - Returns the list of names of 'undo' actions available. [ public ] + \return the list of names of 'undo' actions available. [ public ] */ QStringList CAF_Study::undoNames() const { @@ -347,7 +385,7 @@ QStringList CAF_Study::undoNames() const } /*! - Returns the list of names of 'redo' actions available. [ public ] + \return the list of names of 'redo' actions available. [ public ] */ QStringList CAF_Study::redoNames() const { @@ -361,7 +399,7 @@ QStringList CAF_Study::redoNames() const } /*! - Returns the standard OCAF application from owner application. [ protected ] + \return the standard OCAF application from owner application. [ protected ] */ Handle(TDocStd_Application) CAF_Study::stdApp() const { @@ -373,7 +411,7 @@ Handle(TDocStd_Application) CAF_Study::stdApp() const } /*! - Returns the application casted to type CAF_Application. [ protected ] + \return the application casted to type CAF_Application. [ protected ] */ CAF_Application* CAF_Study::cafApplication() const { diff --git a/src/CAF/CAF_Study.h b/src/CAF/CAF_Study.h index fe47c5b0b..0e5980cc9 100755 --- a/src/CAF/CAF_Study.h +++ b/src/CAF/CAF_Study.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAF_STUDY_H #define CAF_STUDY_H @@ -34,6 +34,12 @@ class CAF_Application; #pragma warning ( disable: 4251 ) #endif +/*! + \class CAF_Study + Represents study for using in CAF, contains reference + to OCAF std document and allows to use OCAF services. + Provides necessary functionality for OCC transactions management. +*/ class CAF_EXPORT CAF_Study : public SUIT_Study { Q_OBJECT diff --git a/src/CAF/CAF_Tools.cxx b/src/CAF/CAF_Tools.cxx index c32d4a27e..f637a3e87 100755 --- a/src/CAF/CAF_Tools.cxx +++ b/src/CAF/CAF_Tools.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : CAF_Tools.cxx // Author : UI team @@ -62,6 +62,9 @@ TCollection_ExtendedString CAF_Tools::toExtString ( const QString& src ) return result; } +/*! + Converts Qt color to OCC color +*/ Quantity_Color CAF_Tools::color( const QColor& c ) { Quantity_Color aColor; @@ -71,6 +74,9 @@ Quantity_Color CAF_Tools::color( const QColor& c ) return aColor; } +/*! + Converts OCC color to Qt color +*/ QColor CAF_Tools::color( const Quantity_Color& c ) { return QColor ( int( c.Red() * 255 ), diff --git a/src/CAF/CAF_Tools.h b/src/CAF/CAF_Tools.h index e04d1c9d8..c0183586e 100755 --- a/src/CAF/CAF_Tools.h +++ b/src/CAF/CAF_Tools.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : CAF_Tools.h // Author : UI team @@ -33,6 +33,10 @@ #include #include +/*! + \class CAF_Tools + Prodives set of auxiliary static methods +*/ class CAF_EXPORT CAF_Tools : public SUIT_Tools { public: diff --git a/src/CAF/Makefile.in b/src/CAF/Makefile.in index 8aae89d85..d50233a40 100755 --- a/src/CAF/Makefile.in +++ b/src/CAF/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Vladimir Klyachin (OCN) # Module : caf diff --git a/src/CAF/resources/CAF_images.po b/src/CAF/resources/CAF_images.po index a624b35c7..083e77506 100755 --- a/src/CAF/resources/CAF_images.po +++ b/src/CAF/resources/CAF_images.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". diff --git a/src/CAF/resources/CAF_msg_en.po b/src/CAF/resources/CAF_msg_en.po index 59119c241..de9372fed 100755 --- a/src/CAF/resources/CAF_msg_en.po +++ b/src/CAF/resources/CAF_msg_en.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". diff --git a/src/CAM/CAM.h b/src/CAM/CAM.h index 427fb53ce..b953c9927 100755 --- a/src/CAM/CAM.h +++ b/src/CAM/CAM.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_H #define CAM_H diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index ef7cd09e4..baabb3970 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAM_Application.h" @@ -179,9 +179,13 @@ void CAM_Application::loadModules() CAM_Module* mod = loadModule( (*it).title ); if ( mod ) addModule( mod ); - else - SUIT_MessageBox::error1( desktop(), tr( "Loading modules" ), - tr( "Can not load module %1" ).arg( (*it).title ), tr( "Ok" ) ); + else { + if ( desktop() && desktop()->isShown() ) + SUIT_MessageBox::error1( desktop(), tr( "Loading modules" ), + tr( "Can not load module %1" ).arg( (*it).title ), tr( "Ok" ) ); + else + qWarning( tr( "Can not load module %1" ).arg( (*it).title ).latin1() ); + } } } @@ -250,13 +254,17 @@ CAM_Module* CAM_Application::loadModule( const QString& modName ) module->setName( moduleName( modName ) ); } - if ( !err.isEmpty() ) - SUIT_MessageBox::warn1( desktop(), tr( "Error" ), err, tr( "Ok" ) ); + if ( !err.isEmpty() ) { + if ( desktop() && desktop()->isShown() ) + SUIT_MessageBox::warn1( desktop(), tr( "Error" ), err, tr( "Ok" ) ); + else + qWarning( err.latin1() ); + } return module; } -/**@name Activate module group.*/ +/*! @name Activate module group. */ //@{ /*!Activate module with name \a modName. *\param modName - module name. @@ -315,7 +323,10 @@ bool CAM_Application::activateModule( CAM_Module* mod ) { myModule->setMenuShown( false ); myModule->setToolShown( false ); - SUIT_MessageBox::error1( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ), tr( "BUT_OK" ) ); + if ( desktop() && desktop()->isShown() ) + SUIT_MessageBox::error1( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ), tr( "BUT_OK" ) ); + else + qWarning( tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ).latin1() ); myModule = 0; return false; } @@ -484,8 +495,12 @@ void CAM_Application::readModuleList() myInfoList.append( inf ); } - if ( myInfoList.isEmpty() ) - SUIT_MessageBox::error1( 0, tr( "Error" ), tr( "Can not load modules configuration file " ), tr( "Ok" ) ); + if ( myInfoList.isEmpty() ) { + if ( desktop() && desktop()->isShown() ) + SUIT_MessageBox::warn1( desktop(), tr( "Warning" ), tr( "Modules list is empty" ), tr( "&OK" ) ); + else + qWarning( tr( "Modules list is empty" ).latin1() ); + } } /*!Add common items for popup menu ( if they are exist ) @@ -503,7 +518,6 @@ void CAM_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopu /*!Create empty study.*/ void CAM_Application::createEmptyStudy() { - SUIT_Study* study = activeStudy(); - + /*SUIT_Study* study = */activeStudy(); STD_Application::createEmptyStudy(); } diff --git a/src/CAM/CAM_Application.h b/src/CAM/CAM_Application.h index d19bde645..c31e90523 100755 --- a/src/CAM/CAM_Application.h +++ b/src/CAM/CAM_Application.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_APPLICATION_H #define CAM_APPLICATION_H @@ -31,6 +31,13 @@ class QPopupMenu; #pragma warning( disable:4251 ) #endif +/*! + \class CAM_Application + Defines application configuration and behaviour for application with modules. + Every module has own data model, necessary windows and viewers, etc. + Application provides all necessary functionality for module management + (loading of modules/activation/deactivation, etc) +*/ class CAM_EXPORT CAM_Application : public STD_Application { Q_OBJECT diff --git a/src/CAM/CAM_DataModel.cxx b/src/CAM/CAM_DataModel.cxx index 187ec6368..559901279 100755 --- a/src/CAM/CAM_DataModel.cxx +++ b/src/CAM/CAM_DataModel.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAM_DataModel.h" @@ -33,10 +33,12 @@ CAM_DataModel::~CAM_DataModel() { } +/*! + Default implementation, does nothing. + Can be used for creation of root object. +*/ void CAM_DataModel::initialize() { - //! Default implementation, does nothing.\n - //! Can be used for creation of root object. } /*!Get root object. diff --git a/src/CAM/CAM_DataModel.h b/src/CAM/CAM_DataModel.h index 0724916cd..4cbc8ab93 100755 --- a/src/CAM/CAM_DataModel.h +++ b/src/CAM/CAM_DataModel.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_DATAMODEL_H #define CAM_DATAMODEL_H @@ -29,6 +29,11 @@ class CAM_DataObject; class CAM_Study; class SUIT_DataObject; +/*! + \class CAM_DataModel + Base class for all data models used in CAM-based applications. + Represents data model of CAM module. Provides necessary interface (default implementation is empty) +*/ class CAM_EXPORT CAM_DataModel : public QObject { Q_OBJECT diff --git a/src/CAM/CAM_DataObject.cxx b/src/CAM/CAM_DataObject.cxx index 2109bccac..62a3d3b13 100755 --- a/src/CAM/CAM_DataObject.cxx +++ b/src/CAM/CAM_DataObject.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAM_DataObject.h" diff --git a/src/CAM/CAM_DataObject.h b/src/CAM/CAM_DataObject.h index 1b89a8e60..1e4e414b2 100755 --- a/src/CAM/CAM_DataObject.h +++ b/src/CAM/CAM_DataObject.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_DATAOBJECT_H #define CAM_DATAOBJECT_H @@ -26,6 +26,10 @@ class CAM_Module; class CAM_DataModel; +/*! + \class CAM_DataObject + Provides only additional link to CAM_DataModel +*/ class CAM_EXPORT CAM_DataObject : public SUIT_DataObject { public: diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index 885f6e05d..9b37b3347 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAM_Module.h" @@ -26,6 +26,9 @@ #include #include +#include +#include + /*!Icon.*/ static const char* ModuleIcon[] = { "20 20 2 1", @@ -84,6 +87,11 @@ CAM_Module::~CAM_Module() void CAM_Module::initialize( CAM_Application* app ) { myApp = app; + if (myApp) { + SUIT_Session* aSession = SUIT_Session::session(); + connect(aSession, SIGNAL( applicationClosed( SUIT_Application* ) ), + this, SLOT( onApplicationClosed( SUIT_Application* ) )); + } } /*!\retval Module icon.*/ @@ -159,6 +167,13 @@ void CAM_Module::studyChanged( SUIT_Study* , SUIT_Study* ) { } +/*!Public slot, nullify application pointer if the application was closed.*/ +void CAM_Module::onApplicationClosed( SUIT_Application* theApp ) +{ + if (myApp == theApp) + myApp = NULL; +} + /*!Create and return new instance of CAM_DataModel.*/ CAM_DataModel* CAM_Module::createDataModel() { @@ -254,9 +269,8 @@ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const /*! Create tool. * Insert QAction with id \a id from action map(myActionMap) to tool manager. - *\param a - QAction - *\param tBar - integer *\param id - integer + *\param tBar - integer *\param idx - integer *\retval integer id of new action in tool manager. *\retval Return -1 if something wrong. @@ -272,9 +286,8 @@ int CAM_Module::createTool( const int id, const int tBar, const int idx ) /*! Create tool. * Insert QAction with id \a id from action map(myActionMap) to tool manager. - *\param a - QAction - *\param tBar - QString& *\param id - integer + *\param tBar - QString& *\param idx - integer *\retval integer id of new action in tool manager. *\retval Return -1 if something wrong. @@ -299,12 +312,13 @@ int CAM_Module::createTool( const int id, const QString& tBar, const int idx ) *\retval Return -1 if something wrong. */ int CAM_Module::createMenu( const QString& subMenu, const int menu, - const int id, const int group, const int index ) + const int id, const int group, const int index, + const bool enableEmpty ) { if ( !menuMgr() ) return -1; - return menuMgr()->insert( subMenu, menu, group, index ); + return menuMgr()->insert( subMenu, menu, group, id, index, enableEmpty ); } /*! Create menu. @@ -318,12 +332,13 @@ int CAM_Module::createMenu( const QString& subMenu, const int menu, *\retval Return -1 if something wrong. */ int CAM_Module::createMenu( const QString& subMenu, const QString& menu, - const int id, const int group, const int index ) + const int id, const int group, const int index, + const bool enableEmpty ) { if ( !menuMgr() ) return -1; - return menuMgr()->insert( subMenu, menu, group, index ); + return menuMgr()->insert( subMenu, menu, group, id, index, enableEmpty ); } @@ -572,6 +587,40 @@ int CAM_Module::registerAction( const int id, QAction* a ) return ident; } +/*! Unregister an action. + * \param id - id for action. + * \retval true if succeded, false if action is used + */ +bool CAM_Module::unregisterAction( const int id ) +{ + return unregisterAction( action( id ) ); +} + +/*! Unregister an action. + * \param a - action + * \retval true if succeded, false if action is used + */ +bool CAM_Module::unregisterAction( QAction* a ) +{ + if ( !a ) + return false; + if ( menuMgr() ) { + int id = menuMgr()->actionId( a ); + if ( id != -1 && menuMgr()->containsMenu( id, -1 ) ) + return false; + } + if ( toolMgr() ) { + int id = toolMgr()->actionId( a ); + if ( id != -1 && toolMgr()->containsAction( id ) ) + return false; + } + if ( menuMgr() ) + menuMgr()->unRegisterAction( menuMgr()->actionId( a ) ); + if ( toolMgr() ) + toolMgr()->unRegisterAction( toolMgr()->actionId( a ) ); + return true; +} + /*! Return qt action manager separator.*/ QAction* CAM_Module::separator() { diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index 7b525996c..3409905e7 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_MODULE_H #define CAM_MODULE_H @@ -28,6 +28,7 @@ class QAction; class SUIT_Study; +class SUIT_Application; class CAM_Study; class CAM_DataModel; class CAM_Application; @@ -65,14 +66,14 @@ public: /** @name Set Menu Shown*/ //@{ - void setMenuShown( const bool ); + virtual void setMenuShown( const bool ); void setMenuShown( QAction*, const bool ); void setMenuShown( const int, const bool ); //@} /** @name Set Tool Shown*/ //@{ - void setToolShown( const bool ); + virtual void setToolShown( const bool ); void setToolShown( QAction*, const bool ); void setToolShown( const int, const bool ); //@} @@ -86,6 +87,8 @@ public slots: virtual void studyClosed( SUIT_Study* ); virtual void studyChanged( SUIT_Study*, SUIT_Study* ); + virtual void onApplicationClosed( SUIT_Application* ); + protected: virtual CAM_DataModel* createDataModel(); @@ -106,8 +109,8 @@ protected: /** @name Create menu methods.*/ //@{ - int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 ); - int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 ); + int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1, const bool = false ); + int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1, const bool = false ); int createMenu( const int, const int, const int = -1, const int = -1 ); int createMenu( const int, const QString&, const int = -1, const int = -1 ); int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 ); @@ -123,6 +126,8 @@ protected: //@} int registerAction( const int, QAction* ); + bool unregisterAction( const int ); + bool unregisterAction( QAction* ); QAction* createAction( const int, const QString&, const QIconSet&, const QString&, const QString&, const int, QObject* = 0, const bool = false, QObject* = 0, const char* = 0 ); diff --git a/src/CAM/CAM_RootObject.cxx b/src/CAM/CAM_RootObject.cxx index a45fcadeb..e1d9771e3 100755 --- a/src/CAM/CAM_RootObject.cxx +++ b/src/CAM/CAM_RootObject.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAM_RootObject.h" diff --git a/src/CAM/CAM_RootObject.h b/src/CAM/CAM_RootObject.h index 3ab434021..8456e7628 100755 --- a/src/CAM/CAM_RootObject.h +++ b/src/CAM/CAM_RootObject.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_ROOTOBJECT_H #define CAM_ROOTOBJECT_H diff --git a/src/CAM/CAM_Study.cxx b/src/CAM/CAM_Study.cxx index 26f7504b3..d874e5a3f 100755 --- a/src/CAM/CAM_Study.cxx +++ b/src/CAM/CAM_Study.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "CAM_Study.h" diff --git a/src/CAM/CAM_Study.h b/src/CAM/CAM_Study.h index 29106776b..18839617a 100755 --- a/src/CAM/CAM_Study.h +++ b/src/CAM/CAM_Study.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef CAM_STUDY_H #define CAM_STUDY_H @@ -31,6 +31,12 @@ #pragma warning( disable:4251 ) #endif +/*! + \class CAM_Study + Represents study for using in CAM, contains list of + data model references from all modules. Provides + necessary functionality for data models management. +*/ class CAM_EXPORT CAM_Study : public SUIT_Study { Q_OBJECT diff --git a/src/CAM/Makefile.in b/src/CAM/Makefile.in index 4473bc99f..6c02e685b 100755 --- a/src/CAM/Makefile.in +++ b/src/CAM/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Vladimir Klyachin (OCN) # Module : CAM diff --git a/src/CAM/resources/CAM_msg_en.po b/src/CAM/resources/CAM_msg_en.po index a1b9d0854..4377dfc56 100755 --- a/src/CAM/resources/CAM_msg_en.po +++ b/src/CAM/resources/CAM_msg_en.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". @@ -14,6 +32,3 @@ msgstr "Error" msgid "ERROR_ACTIVATE_MODULE_MSG" msgstr "Failed to activate module %1" - -msgid "BUT_OK" -msgstr "Ok" diff --git a/src/DDS/DDS.h b/src/DDS/DDS.h index 35c38aaf4..4e32211d2 100644 --- a/src/DDS/DDS.h +++ b/src/DDS/DDS.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef DDS_H #define DDS_H diff --git a/src/DDS/DDS_DicGroup.cxx b/src/DDS/DDS_DicGroup.cxx index ac7f4ad6b..4ecf18b3e 100644 --- a/src/DDS/DDS_DicGroup.cxx +++ b/src/DDS/DDS_DicGroup.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "DDS_DicGroup.h" #include "DDS_Dictionary.h" @@ -76,7 +94,10 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM LDOM_NodeList systemList = systems.getElementsByTagName( DDS_Dictionary::KeyWord( "UNIT_SYSTEM" ) ); for ( Standard_Integer i = 0; i < systemList.getLength(); i++ ) { - LDOM_Element aSystem = (const LDOM_Element &)systemList.item( i ); + //const LDOM_Element& aSystem = (const LDOM_Element &)systemList.item( i ); + LDOM_Node aNode = systemList.item( i ); + const LDOM_Element& anElem = (const LDOM_Element&) aNode; + LDOM_Element aSystem(anElem); TCollection_AsciiString aName = aSystem.getAttribute( DDS_Dictionary::KeyWord( "UNIT_SYSTEM_NAME" ) ); TCollection_ExtendedString aLabel = aSystem.getAttribute( DDS_Dictionary::KeyWord( "UNIT_SYSTEM_LABEL" ) ); @@ -103,7 +124,10 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM for ( Standard_Integer i = 0; i < aData.getLength(); i++ ) { - LDOM_Element aQuantity = (const LDOM_Element&)aData.item( i ); + //LDOM_Element aQuantity = (const LDOM_Element&)aData.item( i ); + LDOM_Node aNode = aData.item( i ); + const LDOM_Element& anElem = (const LDOM_Element&) aNode; + LDOM_Element aQuantity(anElem); // 1. Attributes (id,label,units?,format?,required?) TCollection_AsciiString anID = aQuantity.getAttribute( DDS_Dictionary::KeyWord( "DATUM_ID" ) ); diff --git a/src/DDS/DDS_DicGroup.h b/src/DDS/DDS_DicGroup.h index d1c633fab..a804776ea 100644 --- a/src/DDS/DDS_DicGroup.h +++ b/src/DDS/DDS_DicGroup.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef DDS_DICGROUP_H #define DDS_DICGROUP_H diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index 0c8b01c6d..1582aab3f 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "DDS_DicItem.h" #include "DDS_Dictionary.h" @@ -506,7 +524,10 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element if ( aListValueID.IsIntegerValue() ) { // Read the text in the element "value" - LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); + //LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); + LDOM_Node aNode = aListItemValue.getFirstChild(); + const LDOM_Text& aText = (const LDOM_Text&) aNode; + LDOM_Text aListItemTxt(aText); if ( !aListItemTxt.isNull() ) { // adding ID and text value to sequence @@ -533,7 +554,10 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element if ( !aShDescr.isNull() ) { // text is always a sub-node of element, containing it - LDOM_Text aShDescrTxt = (const LDOM_Text&)aShDescr.getFirstChild(); + //LDOM_Text aShDescrTxt = (const LDOM_Text&)aShDescr.getFirstChild(); + LDOM_Node aNode = aShDescr.getFirstChild(); + const LDOM_Text& aText = (const LDOM_Text&) aNode; + LDOM_Text aShDescrTxt(aText); if ( !aShDescrTxt.isNull() ) aShortD = aShDescrTxt.getData(); } @@ -543,7 +567,10 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element if ( !aLDescr.isNull() ) { // text is always a sub-node of element, containing it - LDOM_Text aLDescrTxt = (const LDOM_Text&)aLDescr.getFirstChild(); + //LDOM_Text aLDescrTxt = (const LDOM_Text&)aLDescr.getFirstChild(); + LDOM_Node aNode = aLDescr.getFirstChild(); + const LDOM_Text& aText = (const LDOM_Text&) aNode; + LDOM_Text aLDescrTxt(aText); if ( !aLDescrTxt.isNull() ) aLongD = aLDescrTxt.getData(); } diff --git a/src/DDS/DDS_DicItem.h b/src/DDS/DDS_DicItem.h index dbbedc0a7..36b30811e 100644 --- a/src/DDS/DDS_DicItem.h +++ b/src/DDS/DDS_DicItem.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef DDS_DICITEM_H #define DDS_DICITEM_H diff --git a/src/DDS/DDS_Dictionary.cxx b/src/DDS/DDS_Dictionary.cxx index 3656a3949..adaff0469 100644 --- a/src/DDS/DDS_Dictionary.cxx +++ b/src/DDS/DDS_Dictionary.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "DDS_Dictionary.h" #include "DDS_KeyWords.h" diff --git a/src/DDS/DDS_Dictionary.h b/src/DDS/DDS_Dictionary.h index d58a15f76..427e08e1e 100644 --- a/src/DDS/DDS_Dictionary.h +++ b/src/DDS/DDS_Dictionary.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef DDS_DICTIONARY_H #define DDS_DICTIONARY_H diff --git a/src/DDS/DDS_KeyWords.cxx b/src/DDS/DDS_KeyWords.cxx index 2f53d2a92..8ea7f6a97 100644 --- a/src/DDS/DDS_KeyWords.cxx +++ b/src/DDS/DDS_KeyWords.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "DDS_KeyWords.h" IMPLEMENT_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared) diff --git a/src/DDS/DDS_KeyWords.h b/src/DDS/DDS_KeyWords.h index 2c1faf914..daee727ba 100644 --- a/src/DDS/DDS_KeyWords.h +++ b/src/DDS/DDS_KeyWords.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef DDS_KEYWORDS_H #define DDS_KEYWORDS_H diff --git a/src/DDS/Makefile.in b/src/DDS/Makefile.in index a3b9eb89f..1d42a6c75 100755 --- a/src/DDS/Makefile.in +++ b/src/DDS/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Alexander SOLOVYOV (OCN) # Module : DDS diff --git a/src/Event/Event.h b/src/Event/Event.h index 9bed806af..8df1a71b1 100755 --- a/src/Event/Event.h +++ b/src/Event/Event.h @@ -1,3 +1,23 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// // File: SalomeApp.h // Created: November, 2004 // Author: OCC team diff --git a/src/Event/Makefile.in b/src/Event/Makefile.in index b9fde9c86..02aaa2bca 100755 --- a/src/Event/Makefile.in +++ b/src/Event/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -45,7 +45,7 @@ EXPORT_PYSCRIPTS = LIB = libEvent.la LIB_SRC = SALOME_Event.cxx -CPPFLAGS+=$(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS+=$(QT_INCLUDES) $(KERNEL_CXXFLAGS) LDFLAGS+=$(QT_MT_LIBS) @CONCLUDE@ diff --git a/src/Event/SALOME_Event.cxx b/src/Event/SALOME_Event.cxx index 84928f623..928cd2341 100755 --- a/src/Event/SALOME_Event.cxx +++ b/src/Event/SALOME_Event.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -51,6 +51,9 @@ static DWORD myThread; static pthread_t myThread; #endif +/*! + \return thread id +*/ void SALOME_Event::GetSessionThread(){ #ifdef WIN32 myThread = ::GetCurrentThreadId(); @@ -59,6 +62,9 @@ void SALOME_Event::GetSessionThread(){ #endif } +/*! + \return true if it is session thread +*/ bool SALOME_Event::IsSessionThread(){ bool aResult = false; #ifdef WIN32 @@ -71,12 +77,9 @@ bool SALOME_Event::IsSessionThread(){ } -//=========================================================== /*! - * SALOME_Event::SALOME_Event - * Constructor - */ -//=========================================================== + Constructor +*/ SALOME_Event::SALOME_Event(){ // if(MYDEBUG) MESSAGE( "SALOME_Event::SALOME_Event(): this = "< 0 ) @@ -106,10 +103,12 @@ int GLViewer_AspectLine::setLineWidth( const float width ) return 1; } -//======================================================================= -// Function: getLineColors -// Purpose : -//======================================================================= +/*! + \return colors of line + \param nc - variable for normal color + \param hc - variable for hilighting color + \param sc - variable for selection color +*/ void GLViewer_AspectLine::getLineColors( QColor& nc, QColor& hc, QColor& sc ) const { nc = myNColor; @@ -117,10 +116,9 @@ void GLViewer_AspectLine::getLineColors( QColor& nc, QColor& hc, QColor& sc ) co sc = mySColor; } -//======================================================================= -// Function: getByteCopy -// Purpose : -//======================================================================= +/*! + \return binary representation of line aspect +*/ QByteArray GLViewer_AspectLine::getByteCopy() const { int anISize = sizeof( int ); @@ -174,10 +172,9 @@ QByteArray GLViewer_AspectLine::getByteCopy() const return aResult; } -//======================================================================= -// Function: fromByteCopy -// Purpose : -//======================================================================= +/*! + Sets line aspect from binary representation +*/ GLViewer_AspectLine* GLViewer_AspectLine::fromByteCopy( QByteArray theBytes ) { diff --git a/src/GLViewer/GLViewer_AspectLine.h b/src/GLViewer/GLViewer_AspectLine.h index 800b166bb..99cdbcd97 100644 --- a/src/GLViewer/GLViewer_AspectLine.h +++ b/src/GLViewer/GLViewer_AspectLine.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -34,9 +34,9 @@ #endif /*! - * Class GLViewer_AspectLine - * Substitution of Prs2d_AspectLine for OpenGL - */ + \Class GLViewer_AspectLine + Substitution of Prs2d_AspectLine for OpenGL +*/ class GLVIEWER_API GLViewer_AspectLine { diff --git a/src/GLViewer/GLViewer_BaseDrawers.cxx b/src/GLViewer/GLViewer_BaseDrawers.cxx index a43a5930e..80dfa1329 100644 --- a/src/GLViewer/GLViewer_BaseDrawers.cxx +++ b/src/GLViewer/GLViewer_BaseDrawers.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -33,16 +33,12 @@ #include #endif -/*************************************************************************** -** Class: GLViewer_MarkerDrawer -** Descr: Drawer for GLViewer_MarkerSet -** Module: GLViewer -** Created: UI team, 03.10.01 -****************************************************************************/ - GLfloat sin_table[SEGMENTS]; GLfloat cos_table[SEGMENTS]; +/*! + Default constructor +*/ GLViewer_MarkerDrawer::GLViewer_MarkerDrawer() : GLViewer_Drawer() { @@ -56,10 +52,18 @@ GLViewer_MarkerDrawer::GLViewer_MarkerDrawer() myObjectType = "GLViewer_MarkerSet"; } +/*! + Destructor +*/ GLViewer_MarkerDrawer::~GLViewer_MarkerDrawer() { } +/*! Draws object in GLViewer + \param xScale - current scale along X-direction + \param yScale - current scale along Y-direction + \param onlyUpdate - = true if only update highlight-select information +*/ void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate ) { QValueList::Iterator it; @@ -134,6 +138,13 @@ void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate } } +/*! Draws marker + \param theXCoord - X position + \param theYCoord - Y position + \param theRadius - radius + \param theColor - color + \param theAspectLine - line aspect +*/ void GLViewer_MarkerDrawer::drawMarker( float& theXCoord, float& theYCoord, float& theRadius, QColor& theColor, GLViewer_AspectLine* theAspectLine ) { @@ -154,23 +165,28 @@ void GLViewer_MarkerDrawer::drawMarker( float& theXCoord, float& theYCoord, glEnd(); } -/*************************************************************************** -** Class: GLViewer_PolylineDrawer -** Descr: Drawer for GLViewer_Polyline -** Module: GLViewer -** Created: UI team, 03.10.01 -****************************************************************************/ +/*! + Default constructor +*/ GLViewer_PolylineDrawer::GLViewer_PolylineDrawer() :GLViewer_Drawer() { myObjectType = "GLViewer_Polyline"; } +/*! + Destructor +*/ GLViewer_PolylineDrawer::~GLViewer_PolylineDrawer() { } +/*! Draws object in GLViewer + \param xScale - current scale along X-direction + \param yScale - current scale along Y-direction + \param onlyUpdate - = true if only update highlight-select information +*/ void GLViewer_PolylineDrawer::create( float xScale, float yScale, bool onlyUpdate ) { QValueList::Iterator aObjectIt = myObjects.begin(); @@ -239,23 +255,27 @@ void GLViewer_PolylineDrawer::create( float xScale, float yScale, bool onlyUpdat } } -/*************************************************************************** -** Class: GLViewer_TextDrawer -** Descr: -** Module: GLViewer -** Created: UI team, 27.02.04 -****************************************************************************/ - +/*! + Default constructor +*/ GLViewer_TextDrawer::GLViewer_TextDrawer() : GLViewer_Drawer() { myObjectType = "GLViewer_TextObject"; } +/*! + Destructor +*/ GLViewer_TextDrawer::~GLViewer_TextDrawer() { } +/*! Draws object in GLViewer + \param xScale - current scale along X-direction + \param yScale - current scale along Y-direction + \param onlyUpdate - = true if only update highlight-select information +*/ void GLViewer_TextDrawer::create( float xScale, float yScale, bool onlyUpdate ) { QValueList::Iterator aObjectIt = myObjects.begin(); @@ -297,6 +317,9 @@ void GLViewer_TextDrawer::create( float xScale, float yScale, bool onlyUpdate ) } } +/*! + Updates objects after updating font +*/ void GLViewer_TextDrawer::updateObjects() { QValueList::Iterator aObjectIt = myObjects.begin(); diff --git a/src/GLViewer/GLViewer_BaseDrawers.h b/src/GLViewer/GLViewer_BaseDrawers.h index ce98aa867..d06311cf3 100644 --- a/src/GLViewer/GLViewer_BaseDrawers.h +++ b/src/GLViewer/GLViewer_BaseDrawers.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -40,9 +40,10 @@ class GLViewer_AspectLine; #pragma warning( disable:4251 ) #endif -/*! Class GLViewer_MarkerDrawer -* Drawer for GLViewer_MarkerSet - */ +/*! + \class GLViewer_MarkerDrawer + Drawer for GLViewer_MarkerSet +*/ class GLVIEWER_API GLViewer_MarkerDrawer : public GLViewer_Drawer { @@ -58,8 +59,9 @@ private: void drawMarker( float& x, float& y, float& radius, QColor& color, GLViewer_AspectLine* aspect ); }; -/*! Class GLViewer_PolylineDrawer -* Drawer for GLViewer_Polyline +/*! + \class GLViewer_PolylineDrawer + Drawer for GLViewer_Polyline */ class GLVIEWER_API GLViewer_PolylineDrawer : public GLViewer_Drawer @@ -71,8 +73,9 @@ public: virtual void create( float, float, bool ); }; -/* Class GLViewer_TextDrawer -* Drawer for GLViewer_Text +/*! + \class GLViewer_TextDrawer + Drawer for GLViewer_Text */ class GLVIEWER_API GLViewer_TextDrawer: public GLViewer_Drawer diff --git a/src/GLViewer/GLViewer_BaseObjects.cxx b/src/GLViewer/GLViewer_BaseObjects.cxx index e5489fdcb..338543ee3 100644 --- a/src/GLViewer/GLViewer_BaseObjects.cxx +++ b/src/GLViewer/GLViewer_BaseObjects.cxx @@ -14,18 +14,11 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // -/*************************************************************************** -** Class: GLViewer_BaseObjects -** Descr: Internal OpenGL Objects -** Module: GLViewer -** Created: UI team, 02.09.02 -****************************************************************************/ - //#include #include "GLViewer_BaseObjects.h" #include "GLViewer_BaseDrawers.h" @@ -39,13 +32,9 @@ //#include //using namespace std; -/*************************************************************************** -** Class: GLViewer_MarkerSet -** Descr: OpenGL MarkerSet -** Module: GLViewer -** Created: UI team, 03.09.02 -****************************************************************************/ - +/*! + Constructor +*/ GLViewer_MarkerSet::GLViewer_MarkerSet( int number, float size, const QString& toolTip ) : GLViewer_Object(), myNumber( 0 ), @@ -67,6 +56,9 @@ GLViewer_MarkerSet::GLViewer_MarkerSet( int number, float size, const QString& t setNumMarkers( number ); } +/*! + Destructor +*/ GLViewer_MarkerSet::~GLViewer_MarkerSet() { if ( myXCoord ) @@ -75,6 +67,16 @@ GLViewer_MarkerSet::~GLViewer_MarkerSet() delete[] myYCoord; } +/*! + Adds coords to text buffer in HPGL format + \param buffer - text buffer + \param command - command to be added with coords + \param aViewerCS - viewer co-ordinates system + \param aPaperCS - paper co-ordinates system + \param x - x co-ordinate + \param y - y co-ordinate + \param NewLine - adds new line to buffer +*/ void AddCoordsToHPGL( QString& buffer, QString command, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPaperCS, double x, double y, bool NewLine = true ) { @@ -87,6 +89,16 @@ void AddCoordsToHPGL( QString& buffer, QString command, GLViewer_CoordSystem* aV buffer += ";\n"; } +/*! + Adds coords to text buffer in PostScript format + \param buffer - text buffer + \param command - command to be added with coords + \param aViewerCS - viewer co-ordinates system + \param aPaperCS - paper co-ordinates system + \param x - x co-ordinate + \param y - y co-ordinate + \param NewLine - adds new line to buffer +*/ void AddCoordsToPS( QString& buffer, QString command, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPaperCS, double x, double y, bool NewLine = true ) { @@ -99,6 +111,13 @@ void AddCoordsToPS( QString& buffer, QString command, GLViewer_CoordSystem* aVie buffer += "\n"; } +/*! + Adds line aspect description to text buffer in PostScript format + \param buffer - text buffer + \param anAspect - line aspect + \param aViewerCS - viewer co-ordinates system + \param aPaperCS - paper co-ordinates system +*/ void AddLineAspectToPS( QString& buffer, GLViewer_AspectLine* anAspect, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPaperCS ) { @@ -129,6 +148,13 @@ void AddLineAspectToPS( QString& buffer, GLViewer_AspectLine* anAspect, } #ifdef WIN32 +/*! + Adds line aspect description EMF image + \param hDC - descriptor of EMF + \param anAspect - line aspect + \param aViewerCS - viewer co-ordinates system + \param aPaperCS - paper co-ordinates system +*/ HPEN AddLineAspectToEMF( HDC hDC, GLViewer_AspectLine* anAspect, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPaperCS ) { @@ -150,6 +176,12 @@ HPEN AddLineAspectToEMF( HDC hDC, GLViewer_AspectLine* anAspect, } #endif +/*! + Saves to file PostScript set of markers + \param hFile - file instance + \param aViewerCS - viewer co-ordinates system + \param aPSCS - paper co-ordinates system +*/ bool GLViewer_MarkerSet::translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS ) { int noPoints = 20; @@ -187,6 +219,12 @@ bool GLViewer_MarkerSet::translateToPS( QFile& hFile, GLViewer_CoordSystem* aVie return true; } +/*! + Saves to file HPGL set of markers + \param hFile - file instance + \param aViewerCS - viewer co-ordinates system + \param aHPGLCS - paper co-ordinates system +*/ bool GLViewer_MarkerSet::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aHPGLCS ) { @@ -221,6 +259,12 @@ bool GLViewer_MarkerSet::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aV } #ifdef WIN32 +/*! + Saves to EMF image set of markers + \param dc - EMF image descriptor + \param aViewerCS - viewer co-ordinates system + \param aEMFCS - paper co-ordinates system +*/ bool GLViewer_MarkerSet::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ) { int noPoints = 20; @@ -256,7 +300,9 @@ bool GLViewer_MarkerSet::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS } #endif - +/*! + Computes all necessary information about object for presentation in drawer +*/ void GLViewer_MarkerSet::compute() { // cout << "GLViewer_MarkerSet::compute" << endl; @@ -282,13 +328,23 @@ void GLViewer_MarkerSet::compute() myRect->setBottom( ya - myYGap ); } +/*! + Creates corresponding drawer +*/ GLViewer_Drawer* GLViewer_MarkerSet::createDrawer() { // cout << "GLViewer_MarkerSet::createDrawer" << endl; return myDrawer = new GLViewer_MarkerDrawer(); } - +/*! + Computes highlight presentation + \param x - x coord + \param y - y coord + \param tol - tolerance of detecting + \param isCircle - true if sensitive area of detection is round + \return true if highlight status is changed +*/ GLboolean GLViewer_MarkerSet::highlight( GLfloat x, GLfloat y, GLfloat tol, GLboolean isCircle ) { if( !myIsVisible ) @@ -342,6 +398,9 @@ GLboolean GLViewer_MarkerSet::highlight( GLfloat x, GLfloat y, GLfloat tol, GLbo return update; } +/*! + Unhilights object +*/ GLboolean GLViewer_MarkerSet::unhighlight() { if( !myHNumbers.isEmpty() ) @@ -356,6 +415,15 @@ GLboolean GLViewer_MarkerSet::unhighlight() return GL_FALSE; } +/*! + Selects marker set + /param x, y - co-ordinates of mouse + /param tol - tolerance + /param rect - rectangle (in case of rectangular selection) + /param isFull - if it is true, then object may selected only if it lays whole in selection zone + \param isCircle - true if sensitive area of detection is round + \param isShift - true if selection exec with append option +*/ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull, GLboolean isCircle, GLboolean isShift ) { @@ -480,6 +548,9 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe return myIsSel; } +/*! + Unselects marker set +*/ GLboolean GLViewer_MarkerSet::unselect() { if( !mySelNumbers.isEmpty() ) @@ -493,6 +564,10 @@ GLboolean GLViewer_MarkerSet::unselect() return GL_FALSE; } +/*! + \return update object rectangle + Does not equal getRect() if object have a persistence to some viewer transformations +*/ GLViewer_Rect* GLViewer_MarkerSet::getUpdateRect() { GLViewer_Rect* rect = new GLViewer_Rect(); @@ -510,7 +585,11 @@ GLViewer_Rect* GLViewer_MarkerSet::getUpdateRect() return rect; } - +/*! + Sets array of x coords of points + \param xCoord - array of co-ordinates + \param size - array size +*/ void GLViewer_MarkerSet::setXCoord( GLfloat* xCoord, int size ) { myXCoord = new GLfloat[ size ]; @@ -518,6 +597,11 @@ void GLViewer_MarkerSet::setXCoord( GLfloat* xCoord, int size ) myXCoord[i] = xCoord[i]; } +/*! + Sets array of y coords of points + \param yCoord - array of co-ordinates + \param size - array size +*/ void GLViewer_MarkerSet::setYCoord( GLfloat* yCoord, int size ) { myYCoord = new GLfloat[ size ]; @@ -525,6 +609,10 @@ void GLViewer_MarkerSet::setYCoord( GLfloat* yCoord, int size ) myYCoord[i] = yCoord[i]; } +/*! + Sets number of markers + \param number - new number of markers +*/ void GLViewer_MarkerSet::setNumMarkers( GLint number ) { if ( myNumber == number ) @@ -540,22 +628,10 @@ void GLViewer_MarkerSet::setNumMarkers( GLint number ) myXCoord = new GLfloat[ myNumber ]; myYCoord = new GLfloat[ myNumber ]; } -/* -void GLViewer_MarkerSet::onSelectionDone( bool append) -{ - mySelectedIndexes.Clear(); - QValueList::Iterator it; - //for( it = myMarkers->mySelNumbers.begin(); it != myMarkers->mySelNumbers.end(); ++it ) - // mySelectedIndexes.Append( *it / 2 ); //!!! - emit dvMarkersSelected( mySelectedIndexes ); -} -void GLViewer_MarkerSet::onSelectionCancel() -{ - mySelectedIndexes.Clear(); - emit dvMarkersSelected( mySelectedIndexes ); -} +/*! + Export numbers of highlighted/selected lines */ void GLViewer_MarkerSet::exportNumbers( QValueList& highlight, QValueList& unhighlight, @@ -570,6 +646,10 @@ void GLViewer_MarkerSet::exportNumbers( QValueList& highlight, myUHNumbers = myHNumbers; } +/*! + Adds or remove selected number + \param index - selected index +*/ bool GLViewer_MarkerSet::addOrRemoveSelected( int index ) { if( index < 0 || index > myNumber ) @@ -588,6 +668,10 @@ bool GLViewer_MarkerSet::addOrRemoveSelected( int index ) return TRUE; } +/*! + Adds some selected numbers + \param seq - sequence of indices +*/ void GLViewer_MarkerSet::addSelected( const TColStd_SequenceOfInteger& seq ) { for ( int i = 1; i <= seq.Length(); i++ ) @@ -595,6 +679,10 @@ void GLViewer_MarkerSet::addSelected( const TColStd_SequenceOfInteger& seq ) mySelNumbers.append( seq.Value( i ) - 1 ); } +/*! + Sets some numbers as selected + \param seq - sequence of indices +*/ void GLViewer_MarkerSet::setSelected( const TColStd_SequenceOfInteger& seq ) { // for( QValueList::Iterator it = mySelNumbers.begin(); it != mySelNumbers.end(); ++it ) @@ -608,6 +696,11 @@ void GLViewer_MarkerSet::setSelected( const TColStd_SequenceOfInteger& seq ) mySelNumbers.append( seq.Value( i ) - 1 ); } +/*! Moves object by recomputing + \param dx - moving along X coord + \param dy - moving along Y coord + \param fromGroup - is true if this method called from group +*/ void GLViewer_MarkerSet::moveObject( float theX, float theY, bool fromGroup ) { if( !fromGroup && myGroup) @@ -623,6 +716,10 @@ void GLViewer_MarkerSet::moveObject( float theX, float theY, bool fromGroup ) compute(); } +/*! + Codes marker set as byte copy + \return byte array +*/ QByteArray GLViewer_MarkerSet::getByteCopy() { int i = 0; @@ -655,6 +752,10 @@ QByteArray GLViewer_MarkerSet::getByteCopy() return aResult; } +/*! + Initialize marker set by byte array + \param theArray - byte array +*/ bool GLViewer_MarkerSet::initializeFromByteCopy( QByteArray theArray ) { int i = 0; @@ -701,16 +802,20 @@ bool GLViewer_MarkerSet::initializeFromByteCopy( QByteArray theArray ) return true; } -/*************************************************************************** -** Class: GLViewer_Polyline -** Descr: OpenGL Polyline -** Module: GLViewer -** Created: UI team, 03.09.02 -****************************************************************************/ +/*! + \class GLViewer_Polyline + OpenGL Polyline +*/ #define SECTIONS 100 #define DISTANTION 5 +/*! + Constructor + \param number - number of segments + \param size - size of polyline + \param toolTip - tool tip of polyline +*/ GLViewer_Polyline::GLViewer_Polyline( int number, float size, const QString& toolTip ): GLViewer_Object(), myNumber( 0 ), @@ -732,6 +837,9 @@ GLViewer_Polyline::GLViewer_Polyline( int number, float size, const QString& too myToolTipText = toolTip; } +/*! + Destructor, destroys internal arrays of co-ordinates +*/ GLViewer_Polyline::~GLViewer_Polyline() { if ( myXCoord ) @@ -740,6 +848,12 @@ GLViewer_Polyline::~GLViewer_Polyline() delete[] myYCoord; } +/*! + Saves polyline to file PostScript + \param hFile - file instance + \param aViewerCS - viewer co-ordinates system + \param aPSCS - paper co-ordinates system +*/ bool GLViewer_Polyline::translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS ) { QString aBuffer = "newpath\n"; @@ -762,6 +876,12 @@ bool GLViewer_Polyline::translateToPS( QFile& hFile, GLViewer_CoordSystem* aView return true; } +/*! + Saves polyline to file HPGL + \param hFile - file instance + \param aViewerCS - viewer co-ordinates system + \param aHPGLCS - paper co-ordinates system +*/ bool GLViewer_Polyline::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aHPGLCS ) { QString aBuffer = ""; @@ -783,6 +903,12 @@ bool GLViewer_Polyline::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aVi } #ifdef WIN32 +/*! + Saves polyline to EMF image + \param dc - EMF image descriptor + \param aViewerCS - viewer co-ordinates system + \param aEMFCS - paper co-ordinates system +*/ bool GLViewer_Polyline::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ) { if( !aViewerCS || !aEMFCS ) @@ -819,6 +945,9 @@ bool GLViewer_Polyline::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, } #endif +/*! + Computes all necessary information about object for presentation in drawer +*/ void GLViewer_Polyline::compute() { // cout << "GLViewer_MarkerSet::compute" << endl; @@ -844,6 +973,10 @@ void GLViewer_Polyline::compute() myRect->setBottom( ya - yGap ); } +/*! + \return update object rectangle + Does not equal getRect() if object have a persistence to some viewer transformations +*/ GLViewer_Rect* GLViewer_Polyline::getUpdateRect() { GLViewer_Rect* rect = new GLViewer_Rect(); @@ -856,12 +989,23 @@ GLViewer_Rect* GLViewer_Polyline::getUpdateRect() return rect; } +/*! + Creates corresponding drawer +*/ GLViewer_Drawer* GLViewer_Polyline::createDrawer() { // cout << "GLViewer_MarkerSet::createDrawer" << endl; return myDrawer = new GLViewer_PolylineDrawer(); } +/*! + Computes highlight presentation + \param x - x coord + \param y - y coord + \param tol - tolerance of detecting + \param isCircle - true if sensitive area of detection is round + \return true if highlight status is changed +*/ GLboolean GLViewer_Polyline::highlight( GLfloat x, GLfloat y, GLfloat tol, GLboolean isCircle ) { if( !myIsVisible ) @@ -916,6 +1060,9 @@ GLboolean GLViewer_Polyline::highlight( GLfloat x, GLfloat y, GLfloat tol, GLboo return update; } +/*! + Unhilights object +*/ GLboolean GLViewer_Polyline::unhighlight() { // if( !myHNumbers.isEmpty() ) @@ -934,6 +1081,15 @@ GLboolean GLViewer_Polyline::unhighlight() return GL_FALSE; } +/*! + Selects polyline + /param x, y - co-ordinates of mouse + /param tol - tolerance + /param rect - rectangle (in case of rectangular selection) + /param isFull - if it is true, then object may selected only if it lays whole in selection zone + \param isCircle - true if sensitive area of detection is round + \param isShift - true if selection exec with append option +*/ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull, GLboolean isCircle, GLboolean isShift ) { @@ -994,6 +1150,9 @@ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer return myIsSel; } +/*! + Unselects polyline +*/ GLboolean GLViewer_Polyline::unselect() { // if( !mySelNumbers.isEmpty() ) @@ -1013,6 +1172,11 @@ GLboolean GLViewer_Polyline::unselect() return GL_FALSE; } +/*! + Sets array of abscisses for points of polyline + \param xCoord - array of of abscisses + \param size - size of array +*/ void GLViewer_Polyline::setXCoord( GLfloat* xCoord, int size ) { myXCoord = new GLfloat[ size ]; @@ -1020,6 +1184,11 @@ void GLViewer_Polyline::setXCoord( GLfloat* xCoord, int size ) myXCoord[i] = xCoord[i]; } +/*! + Sets array of ordinates for points of polyline + \param xCoord - array of of ordinates + \param size - size of array +*/ void GLViewer_Polyline::setYCoord( GLfloat* yCoord, int size ) { myYCoord = new GLfloat[ size ]; @@ -1027,6 +1196,10 @@ void GLViewer_Polyline::setYCoord( GLfloat* yCoord, int size ) myYCoord[i] = yCoord[i]; } +/*! + Sets number of points + \param number - new number of points +*/ void GLViewer_Polyline::setNumber( GLint number ) { if ( myNumber == number ) @@ -1042,19 +1215,9 @@ void GLViewer_Polyline::setNumber( GLint number ) myXCoord = new GLfloat[ myNumber ]; myYCoord = new GLfloat[ myNumber ]; } -/* -void GLViewer_Polyline::onSelectionDone( bool append) -{ - mySelectedIndexes.Clear(); - QValueList::Iterator it; - //for( it = myMarkers->mySelNumbers.begin(); it != myMarkers->mySelNumbers.end(); ++it ) - // mySelectedIndexes.Append( *it / 2 ); //!!! -} -void GLViewer_Polyline::onSelectionCancel() -{ - mySelectedIndexes.Clear(); -} +/*! + Export numbers of highlighted/selected lines */ void GLViewer_Polyline::exportNumbers( QValueList& highlight, QValueList& unhighlight, @@ -1067,6 +1230,12 @@ void GLViewer_Polyline::exportNumbers( QValueList& highlight, unselect = myUSelNumbers; } +/*! + Moves object by recomputing + \param dx - moving along X coord + \param dy - moving along Y coord + \param fromGroup - is true if this method called from group +*/ void GLViewer_Polyline::moveObject( float theX, float theY, bool fromGroup ) { if( !fromGroup && myGroup) @@ -1082,6 +1251,10 @@ void GLViewer_Polyline::moveObject( float theX, float theY, bool fromGroup ) compute(); } +/*! + Codes polyline as byte copy + \return byte array +*/ QByteArray GLViewer_Polyline::getByteCopy() { int i = 0; @@ -1118,6 +1291,10 @@ QByteArray GLViewer_Polyline::getByteCopy() } +/*! + Initialize polyline by byte array + \param theArray - byte array +*/ bool GLViewer_Polyline::initializeFromByteCopy( QByteArray theArray ) { int i = 0; @@ -1167,13 +1344,16 @@ bool GLViewer_Polyline::initializeFromByteCopy( QByteArray theArray ) return true; } -/*************************************************************************** -** Class: GLViewer_TextObject -** Descr: Text as Object for OpenGL -** Module: GLViewer -** Created: UI team, 12.02.04 -****************************************************************************/ + +/*! + Constructor + \param theStr - text string + \param xPos - x position + \param yPos - y position + \param color - color of text + \param toolTip - tooltip of text object +*/ GLViewer_TextObject::GLViewer_TextObject( const QString& theStr, float xPos, float yPos, const QColor& color, const QString& toolTip ) : GLViewer_Object() @@ -1186,12 +1366,22 @@ GLViewer_TextObject::GLViewer_TextObject( const QString& theStr, float xPos, flo myToolTipText = toolTip; } + +/*! + Destructor +*/ GLViewer_TextObject::~GLViewer_TextObject() { if ( myGLText ) delete myGLText; } +/*! + Saves text object to file PostScript + \param hFile - file instance + \param aViewerCS - viewer co-ordinates system + \param aPSCS - paper co-ordinates system +*/ bool GLViewer_TextObject::translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS ) { QString aText = myGLText->getText(); @@ -1209,6 +1399,12 @@ bool GLViewer_TextObject::translateToPS( QFile& hFile, GLViewer_CoordSystem* aVi return true; } +/*! + Saves text object to file HPGL + \param hFile - file instance + \param aViewerCS - viewer co-ordinates system + \param aHPGLCS - paper co-ordinates system +*/ bool GLViewer_TextObject::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aHPGLCS ) { QString aText = myGLText->getText(); @@ -1226,6 +1422,12 @@ bool GLViewer_TextObject::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* a } #ifdef WIN32 +/*! + Saves text object to EMF image + \param dc - EMF image descriptor + \param aViewerCS - viewer co-ordinates system + \param aEMFCS - paper co-ordinates system +*/ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ) { QString aText = myGLText->getText(); @@ -1276,6 +1478,9 @@ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerC } #endif +/*! + Creates corresponding drawer +*/ GLViewer_Drawer* GLViewer_TextObject::createDrawer() { myDrawer = new GLViewer_TextDrawer(); @@ -1283,6 +1488,9 @@ GLViewer_Drawer* GLViewer_TextObject::createDrawer() return myDrawer; } +/*! + Computes all necessary information about object for presentation in drawer +*/ void GLViewer_TextObject::compute() { float xPos, yPos; @@ -1297,12 +1505,20 @@ void GLViewer_TextObject::compute() myRect->setBottom( yPos ); } +/*! + Installing already exist drawer with same type + \param theDrawer - new drawer +*/ void GLViewer_TextObject::setDrawer( GLViewer_Drawer* theDrawer ) { myDrawer = theDrawer; //compute(); } +/*! + \return update object rectangle + Does not equal getRect() if object have a persistence to some viewer transformations +*/ GLViewer_Rect* GLViewer_TextObject::getUpdateRect() { GLViewer_Rect* rect = new GLViewer_Rect(); @@ -1319,6 +1535,14 @@ GLViewer_Rect* GLViewer_TextObject::getUpdateRect() return rect; } +/*! + Computes highlight presentation + \param x - x coord + \param y - y coord + \param tol - tolerance of detecting + \param isCircle - true if sensitive area of detection is round + \return true if highlight status is changed +*/ GLboolean GLViewer_TextObject::highlight( GLfloat theX, GLfloat theY, GLfloat theTol, GLboolean isCircle ) { if( !myIsVisible ) @@ -1366,6 +1590,9 @@ GLboolean GLViewer_TextObject::highlight( GLfloat theX, GLfloat theY, GLfloat th return myIsHigh; } +/*! + Unhilights object +*/ GLboolean GLViewer_TextObject::unhighlight() { if( myIsHigh ) @@ -1377,6 +1604,15 @@ GLboolean GLViewer_TextObject::unhighlight() return GL_FALSE; } +/*! + Selects text object + /param x, y - co-ordinates of mouse + /param tol - tolerance + /param rect - rectangle (in case of rectangular selection) + /param isFull - if it is true, then object may selected only if it lays whole in selection zone + \param isCircle - true if sensitive area of detection is round + \param isShift - true if selection exec with append option +*/ GLboolean GLViewer_TextObject::select( GLfloat theX, GLfloat theY, GLfloat theTol, GLViewer_Rect rect, GLboolean isFull, GLboolean isCircle, GLboolean isShift ) { @@ -1415,6 +1651,9 @@ GLboolean GLViewer_TextObject::select( GLfloat theX, GLfloat theY, GLfloat theTo return myIsSel; } +/*! + Unselects text object +*/ GLboolean GLViewer_TextObject::unselect() { if( myIsSel ) @@ -1426,6 +1665,12 @@ GLboolean GLViewer_TextObject::unselect() return GL_FALSE; } +/*! + Moves object by recomputing + \param dx - moving along X coord + \param dy - moving along Y coord + \param fromGroup - is true if this method called from group +*/ void GLViewer_TextObject::moveObject( float theX, float theY, bool fromGroup ) { if( !fromGroup && myGroup) @@ -1441,6 +1686,10 @@ void GLViewer_TextObject::moveObject( float theX, float theY, bool fromGroup ) compute(); } +/*! + Codes text object as byte copy + \return byte array +*/ QByteArray GLViewer_TextObject::getByteCopy() { QByteArray aObject = GLViewer_Object::getByteCopy(); @@ -1448,6 +1697,10 @@ QByteArray GLViewer_TextObject::getByteCopy() return aObject; } +/*! + Initialize text object by byte array + \param theArray - byte array +*/ bool GLViewer_TextObject::initializeFromByteCopy( QByteArray theArray ) { if( !GLViewer_Object::initializeFromByteCopy( theArray ) || myType != "GLViewer_TextObject" ) diff --git a/src/GLViewer/GLViewer_BaseObjects.h b/src/GLViewer/GLViewer_BaseObjects.h index 6e464ef04..c0f45d328 100644 --- a/src/GLViewer/GLViewer_BaseObjects.h +++ b/src/GLViewer/GLViewer_BaseObjects.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -38,10 +38,9 @@ #endif /*! - * Class GLViewer_MarkerSet - * OpenGL MarkerSet - */ - + \class GLViewer_MarkerSet + OpenGL MarkerSet +*/ class GLVIEWER_API GLViewer_MarkerSet : public GLViewer_Object { public: @@ -120,10 +119,9 @@ protected: }; /*! - * Class GLViewer_Polyline - * OpenGL Polyline - */ - + \class GLViewer_Polyline + OpenGL Polyline +*/ class GLVIEWER_API GLViewer_Polyline: public GLViewer_Object { public: @@ -178,7 +176,7 @@ public: //! Checks highlight as whole object status GLboolean isHighSelAll() const { return myHighSelAll; } - //! Export numbers of heghlighted/selected lines + //! Export numbers of highlighted/selected lines void exportNumbers( QValueList& high, QValueList& unhigh, QValueList& sel, QValueList& unsel ); @@ -203,9 +201,10 @@ protected: GLboolean myHighFlag; }; -// Class: GLViewer_TextObject -// Descr: Text as Object for OpenGL - +/*! + \class GLViewer_TextObject + Text as Object for OpenGL +*/ class GLVIEWER_API GLViewer_TextObject : public GLViewer_Object { public: diff --git a/src/GLViewer/GLViewer_Compass.cxx b/src/GLViewer/GLViewer_Compass.cxx index 919641e7c..00fae1c1f 100644 --- a/src/GLViewer/GLViewer_Compass.cxx +++ b/src/GLViewer/GLViewer_Compass.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,18 +22,19 @@ // File: GLViewer_Compass.cxx // Created: November, 2004 -//================================================================ -// Class : GLViewer_Compass -// Description : Class implement representatiof of compass in one of corner in GLViewer -//================================================================ - #include "GLViewer_Compass.h" #include "GLViewer_Drawer.h" -//======================================================================= -// Function: GLViewer_Compass -// Purpose : -//======================================================================= +/*! + Constructor + \param color - a color of compass + \param size - a diameter of compass + \param pos - a position + \param WidthTop - width of wide part of arrow + \param WidthBottom - width of base part of arrow + \param HeightTop - height of arrow header + \param HeightBottom - height of arrow cut on bottom +*/ GLViewer_Compass::GLViewer_Compass ( const QColor& color, const int size, const Position pos, const int WidthTop, const int WidthBottom, const int HeightTop, const int HeightBottom ) @@ -52,19 +53,20 @@ GLViewer_Compass::GLViewer_Compass ( const QColor& color, const int size, const //myFont->generateTexture(); } -//======================================================================= -// Function: ~GLViewer_Compass -// Purpose : -//======================================================================= +/*! + Destructor +*/ GLViewer_Compass::~GLViewer_Compass() { delete myFont; } -//======================================================================= -// Function: setCompass -// Purpose : -//======================================================================= +/*! + Sets parameters of compass + \param color - a color of compass + \param size - a diameter of compass + \param pos - a position +*/ void GLViewer_Compass::setCompass( const QColor& color, const int size, const Position pos ) { myCol = color; @@ -72,29 +74,29 @@ void GLViewer_Compass::setCompass( const QColor& color, const int size, const Po myPos = pos; } -//======================================================================= -// Function: setVisible -// Purpose : -//======================================================================= +/*! + Sets visibility of compass + \param vis - new visibility state +*/ void GLViewer_Compass::setVisible( const bool vis ) { myIsVisible = vis; } -//======================================================================= -// Function: setSize -// Purpose : -//======================================================================= +/*! + Sets size of compass + \param size - new size +*/ void GLViewer_Compass::setSize( const int size ) { if( size > 0 ) mySize=size; } -//======================================================================= -// Function: setArrowWidthTop -// Purpose : -//======================================================================= +/*! + Sets arrow width top + \param WidthTop - new arrow width top +*/ void GLViewer_Compass::setArrowWidthTop( const int WidthTop ) { if( WidthTop < myArrowWidthBottom || WidthTop > mySize ) @@ -102,10 +104,10 @@ void GLViewer_Compass::setArrowWidthTop( const int WidthTop ) myArrowWidthTop=WidthTop; } -//======================================================================= -// Function: setArrowWidthBottom -// Purpose : -//======================================================================= +/*! + Sets arrow width bottom + \param WidthBot - new arrow width bottom +*/ void GLViewer_Compass::setArrowWidthBottom( const int WidthBot ) { if( WidthBot > myArrowWidthTop || WidthBot < 1 ) @@ -113,10 +115,10 @@ void GLViewer_Compass::setArrowWidthBottom( const int WidthBot ) myArrowWidthBottom=WidthBot; } -//======================================================================= -// Function: setArrowHeightTop -// Purpose : -//======================================================================= +/*! + Sets arrow height top + \param HeightTop - new arrow height top +*/ void GLViewer_Compass::setArrowHeightTop( const int HeightTop ) { if( HeightTop > (2*mySize-myArrowHeightBottom ) || HeightTop < 1 ) @@ -124,10 +126,10 @@ void GLViewer_Compass::setArrowHeightTop( const int HeightTop ) myArrowHeightTop=HeightTop; } -//======================================================================= -// Function: setArrowHeightBottom -// Purpose : -//======================================================================= +/*! + Sets arrow height bottom + \param HeightBot - new arrow height bottom +*/ void GLViewer_Compass::setArrowHeightBottom( const int HeightBot ) { if( HeightBot > ( 2*mySize-myArrowHeightTop ) || HeightBot < 1) @@ -135,10 +137,9 @@ void GLViewer_Compass::setArrowHeightBottom( const int HeightBot ) myArrowHeightBottom=HeightBot; } -//======================================================================= -// Function: getFont -// Purpose : -//======================================================================= +/*! + \return font of compass +*/ GLViewer_TexFont* GLViewer_Compass::getFont() { if(!isGenereted) @@ -149,10 +150,10 @@ GLViewer_TexFont* GLViewer_Compass::getFont() return myFont; } -//======================================================================= -// Function: setFont -// Purpose : -//======================================================================= +/*! + Sets font of compass + \param theFont - new font +*/ void GLViewer_Compass::setFont( QFont theFont ) { delete myFont; diff --git a/src/GLViewer/GLViewer_Compass.h b/src/GLViewer/GLViewer_Compass.h index abdec0e01..62dd4f257 100644 --- a/src/GLViewer/GLViewer_Compass.h +++ b/src/GLViewer/GLViewer_Compass.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -33,14 +33,13 @@ #pragma warning( disable:4251 ) #endif +class GLViewer_TexFont; + /*! Class GLViewer_Compass * Class implement representatiof of compass in one of corner in GLViewer. * Compass it's a some round visual pointer rotated with view window and * located in fixed place (in one fixed corner) */ - -class GLViewer_TexFont; - class GLVIEWER_API GLViewer_Compass { public: diff --git a/src/GLViewer/GLViewer_Context.cxx b/src/GLViewer/GLViewer_Context.cxx index 7fc5fcf20..0383b0325 100644 --- a/src/GLViewer/GLViewer_Context.cxx +++ b/src/GLViewer/GLViewer_Context.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,10 +22,10 @@ // File: GLViewer_Context.cxx // Created: November, 2004 -//================================================================ -// Class : GLViewer_AspectLine -// Description : Class for manage of presentations in GLViewer -//================================================================ +/*! + \class GLViewer_AspectLine + \brief Class for manage of presentations in GLViewer +*/ #include "GLViewer_Context.h" @@ -38,10 +38,9 @@ #define TOLERANCE 12 -//======================================================================= -// Function: GLViewer_Context -// Purpose : -//======================================================================= +/*! + Constructor +*/ GLViewer_Context::GLViewer_Context( GLViewer_Viewer2d* v ) : myGLViewer2d( v ), myHighlightColor( Quantity_NOC_CYAN1 ), @@ -59,10 +58,9 @@ GLViewer_Context::GLViewer_Context( GLViewer_Viewer2d* v ) : mySelCurIndex = 0; } -//======================================================================= -// Function: ~GLViewer_Context -// Purpose : -//======================================================================= +/*! + Destructor +*/ GLViewer_Context::~GLViewer_Context() { myActiveObjects.clear(); @@ -70,10 +68,13 @@ GLViewer_Context::~GLViewer_Context() mySelectedObjects.clear(); } -//======================================================================= -// Function: MoveTo -// Purpose : -//======================================================================= +/*! + Hiilights objects under cursor + \param x - X coord of mouse cursor + \param y - Y coord of mouse cursor + \param byCircle - true if needs round sensitive area around mouse cursor, else rectangle + function search object rectangle which intersect with sensitive area and call object highlight method +*/ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle ) { GLfloat x = (GLfloat)xi; @@ -180,10 +181,10 @@ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle ) return 0; } -//======================================================================= -// Function: Select -// Purpose : -//======================================================================= +/*! Selects already highlighting object by calling object method select + \param Append - true if new selection will be append to existing selection, false - another + \param byCircle - true if needs round selection area in complex object +*/ int GLViewer_Context::Select( bool Append, bool byCircle ) { ObjList::Iterator it, itEnd, oit, oitEnd; @@ -322,10 +323,11 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) return SS_NoChanged; } -//======================================================================= -// Function: SelectByRect -// Purpose : -//======================================================================= +/*! Selects objects on scene by rectangle + \param theRect - rectangle of selection + \param Append - true if new selection will be append to existing selection, false - another + function search object rectangle which intersect with theRect and call object select method +*/ int GLViewer_Context::SelectByRect( const QRect& theRect, bool Append ) { GLfloat aXScale; @@ -384,10 +386,10 @@ int GLViewer_Context::SelectByRect( const QRect& theRect, bool Append ) return status; } -//======================================================================= -// Function: SetHighlightColor -// Purpose : -//======================================================================= +/*! + Sets color of hilighting + \param aCol - new color of highlighting +*/ void GLViewer_Context::SetHighlightColor( Quantity_NameOfColor aCol ) { myHighlightColor = aCol; @@ -407,10 +409,10 @@ void GLViewer_Context::SetHighlightColor( Quantity_NameOfColor aCol ) myGLViewer2d->updateColors( colH, colS); } -//======================================================================= -// Function: SetSelectionColor -// Purpose : -//======================================================================= +/*! + Sets color of selection + \param aCol - new color of selection +*/ void GLViewer_Context::SetSelectionColor( Quantity_NameOfColor aCol ) { mySelectionColor = aCol; @@ -430,37 +432,33 @@ void GLViewer_Context::SetSelectionColor( Quantity_NameOfColor aCol ) myGLViewer2d->updateColors( colH, colS); } -//======================================================================= -// Function: NbSelected -// Purpose : -//======================================================================= +/*! + \return number of selected objects +*/ int GLViewer_Context::NbSelected() { return mySelectedObjects.count(); } -//======================================================================= -// Function: InitSelected -// Purpose : -//======================================================================= +/*! + Inits iteration through selected objects +*/ void GLViewer_Context::InitSelected() { mySelCurIndex = 0; } -//======================================================================= -// Function: MoreSelected -// Purpose : -//======================================================================= +/*! + Checks if iteration through selected objects may be continued +*/ bool GLViewer_Context::MoreSelected() { return ( mySelCurIndex < NbSelected() ); } -//======================================================================= -// Function: NextSelected -// Purpose : -//======================================================================= +/*! + Iterates to next selected object +*/ bool GLViewer_Context::NextSelected() { if ( mySelCurIndex >= 0 && mySelCurIndex < NbSelected() ) @@ -472,28 +470,28 @@ bool GLViewer_Context::NextSelected() return FALSE; } -//======================================================================= -// Function: SelectedObject -// Purpose : -//======================================================================= +/*! + \return current selected object (must be used only in cycle as "for( InitSelected(); MoreSelected(); NextSelected() ) {...}" ) +*/ GLViewer_Object* GLViewer_Context::SelectedObject() { return mySelectedObjects[ mySelCurIndex ]; } -//======================================================================= -// Function: isSelected -// Purpose : -//======================================================================= +/*! + \return true if object is selected + \param theObj - object to be checked +*/ bool GLViewer_Context::isSelected( GLViewer_Object* theObj ) { return mySelectedObjects.contains( theObj ); } -//======================================================================= -// Function: insertObject -// Purpose : -//======================================================================= +/*! Inserts new object in context + \param theObject - object to be inserted + \param display - true if needs display object immediatly after inserting, else false + \param isActive - true if needs inserting object in active list +*/ int GLViewer_Context::insertObject( GLViewer_Object* object, bool display, bool isActive ) { // cout << "GLViewer_Context::insertObject" << endl; @@ -517,10 +515,11 @@ int GLViewer_Context::insertObject( GLViewer_Object* object, bool display, bool return myActiveObjects.count() + myInactiveObjects.count(); } -//======================================================================= -// Function: replaceObject -// Purpose : -//======================================================================= +/*! + Replaces object in context + \param oldObject - object to be replaced + \param newObject - object for replacing +*/ bool GLViewer_Context::replaceObject( GLViewer_Object* oldObject, GLViewer_Object* newObject ) { if( !oldObject || !newObject ) @@ -543,10 +542,9 @@ bool GLViewer_Context::replaceObject( GLViewer_Object* oldObject, GLViewer_Objec return false; } -//======================================================================= -// Function: updateScales -// Purpose : -//======================================================================= +/*! + Updates scales of all objects in context +*/ void GLViewer_Context::updateScales( GLfloat scX, GLfloat scY ) { if( scX <= 0 || scY <= 0 ) @@ -561,10 +559,10 @@ void GLViewer_Context::updateScales( GLfloat scX, GLfloat scY ) (*it)->setScale( scX, scY ); } -//======================================================================= -// Function: clearHighlighted -// Purpose : -//======================================================================= +/*! + Clears hilighting of objects + \param updateViewer - if it is true, viewer must be updated +*/ void GLViewer_Context::clearHighlighted( bool updateViewer ) { if( myHFlag && myLastPicked ) @@ -577,10 +575,10 @@ void GLViewer_Context::clearHighlighted( bool updateViewer ) } } -//======================================================================= -// Function: clearSelected -// Purpose : -//======================================================================= +/*! + Clears selection of objects + \param updateViewer - if it is true, viewer must be updated +*/ void GLViewer_Context::clearSelected( bool updateViewer ) { if( !mySFlag ) @@ -600,10 +598,10 @@ void GLViewer_Context::clearSelected( bool updateViewer ) mySelectedObjects.clear(); } -//======================================================================= -// Function: setSelected -// Purpose : -//======================================================================= +/*! + Selects object, other selected objects are left as selected + \param updateViewer - if it is true, viewer must be updated +*/ void GLViewer_Context::setSelected( GLViewer_Object* object, bool updateViewer ) { if( !object ) @@ -619,10 +617,10 @@ void GLViewer_Context::setSelected( GLViewer_Object* object, bool updateViewer ) myGLViewer2d->activateDrawer( object, TRUE, TRUE ); } -//======================================================================= -// Function: remSelected -// Purpose : -//======================================================================= +/*! + Unselects object, other selected objects are left as selected + \param updateViewer - if it is true, viewer must be updated +*/ void GLViewer_Context::remSelected( GLViewer_Object* object, bool updateViewer ) { if( !object || !mySelectedObjects.contains( object ) ) @@ -635,10 +633,10 @@ void GLViewer_Context::remSelected( GLViewer_Object* object, bool updateViewer ) myGLViewer2d->activateDrawer( object, TRUE, TRUE ); } -//======================================================================= -// Function: eraseObject -// Purpose : -//======================================================================= +/*! + Erases object in viewer + \param theUpdateViewer - if it is true, viewer must be updated +*/ void GLViewer_Context::eraseObject( GLViewer_Object* theObject, bool theUpdateViewer ) { if( !theObject || !myActiveObjects.contains( theObject ) ) @@ -652,10 +650,10 @@ void GLViewer_Context::eraseObject( GLViewer_Object* theObject, bool theUpdateVi myGLViewer2d->updateAll(); } -//======================================================================= -// Function: deleteObject -// Purpose : -//======================================================================= +/*! + Deletes object in + \param updateViewer - if it is true, viewer must be updated +*/ void GLViewer_Context::deleteObject( GLViewer_Object* theObject, bool updateViewer ) { if( !theObject || @@ -683,10 +681,10 @@ void GLViewer_Context::deleteObject( GLViewer_Object* theObject, bool updateView myGLViewer2d->updateAll(); } -//======================================================================= -// Function: setActive -// Purpose : -//======================================================================= +/*! + Installs active status to object + \param theObject +*/ bool GLViewer_Context::setActive( GLViewer_Object* theObject ) { if( !theObject || !myInactiveObjects.contains( theObject ) ) @@ -697,10 +695,10 @@ bool GLViewer_Context::setActive( GLViewer_Object* theObject ) return true; } -//======================================================================= -// Function: setInactive -// Purpose : -//======================================================================= +/*! + Installs inactive status to object + \param theObject +*/ bool GLViewer_Context::setInactive( GLViewer_Object* theObject ) { if( !theObject || !myActiveObjects.contains( theObject ) ) diff --git a/src/GLViewer/GLViewer_Context.h b/src/GLViewer/GLViewer_Context.h index f8c76eb50..5a9df2ceb 100644 --- a/src/GLViewer/GLViewer_Context.h +++ b/src/GLViewer/GLViewer_Context.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -23,10 +23,6 @@ // Created: November, 2004 -/*! Class GLViewer_Context - * Class for manage of presentations in GLViewer - */ - #ifndef GLVIEWER_CONTEXT_H #define GLVIEWER_CONTEXT_H @@ -52,6 +48,9 @@ class GLViewer_Viewer2d; #pragma warning( disable:4251 ) #endif +/*! \class GLViewer_Context + * Class for manage of presentations in GLViewer + */ class GLVIEWER_API GLViewer_Context { public: @@ -73,14 +72,12 @@ public: *function search object rectangle which intersect with sensitive area and call object highlight method */ int MoveTo( int x, int y, bool byCircle = FALSE ); - //! A function selecting already highlighting object by calling object method select - /*! + /*! A function selecting already highlighting object by calling object method select *\param Append - true if new selection will be append to existing selection, false - another *\param byCircle - true if needs round selection area in complex object */ int Select( bool Append = FALSE, bool byCircle = FALSE ); - //! A function selecting objects on scene by rectangle - /*! + /*! A function selecting objects on scene by rectangle *\param theRect - rectangle of selection *\param Append - true if new selection will be append to existing selection, false - another *function search object rectangle which intersect with theRect and call object select method @@ -119,7 +116,7 @@ public: int insertObject( GLViewer_Object* theObject, bool display = false, bool isActive = true ); //! Replacing objects in context /*! - * Function search activ and incative objects + * Function search active and incative objects */ bool replaceObject( GLViewer_Object* oldObject, GLViewer_Object* newObject ); //! A function updating scales of all objects in context @@ -129,7 +126,7 @@ public: //! Returns list of context objects /*! - * Returns active objects if isActive = true, else inactive objects + * \return active objects if isActive = true, else inactive objects */ const ObjList& getObjects( bool isActive = true ) { return isActive ? myActiveObjects : myInactiveObjects; } diff --git a/src/GLViewer/GLViewer_CoordSystem.cxx b/src/GLViewer/GLViewer_CoordSystem.cxx index 947ac6036..3889bdfe5 100644 --- a/src/GLViewer/GLViewer_CoordSystem.cxx +++ b/src/GLViewer/GLViewer_CoordSystem.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,17 +22,18 @@ // File: GLViewer_Context.cxx // Created: November, 2004 -//================================================================ -// Class : GLViewer_CoordSystem -// Description : Class implementing mathematical model of 2D coordinate system -//================================================================ #include "GLViewer_CoordSystem.h" #include -//======================================================================= -// Function: GLViewer_CoordSystem -// Purpose : -//======================================================================= +/*! + Constructor + \param aType - type of CS + \param X0 - X of origin in reference CS + \param Y0 - Y of origin in reference CS + \param XUnit - X unit in reference CS + \param YUnit - Y unit in reference CS + \param Rotation - rotation relative reference CS +*/ GLViewer_CoordSystem::GLViewer_CoordSystem( CSType aType, double X0, double Y0, double XUnit, double YUnit, double Rotation ) { @@ -42,40 +43,36 @@ GLViewer_CoordSystem::GLViewer_CoordSystem( CSType aType, double X0, double Y0, setRotation( Rotation ); } -//======================================================================= -// Function: getOrigin -// Purpose : -//======================================================================= +/*! + \return origin in reference CS +*/ void GLViewer_CoordSystem::getOrigin( double& x, double& y ) const { x = myX0; y = myY0; } -//======================================================================= -// Function: setOrigin -// Purpose : -//======================================================================= +/*! + Sets origin in reference CS +*/ void GLViewer_CoordSystem::setOrigin( double x, double y ) { myX0 = x; myY0 = y; } -//======================================================================= -// Function: getUnits -// Purpose : -//======================================================================= +/*! + \return units +*/ void GLViewer_CoordSystem::getUnits( double& x, double& y ) const { x = myXUnit; y = myYUnit; } -//======================================================================= -// Function: setUnits -// Purpose : -//======================================================================= +/*! + Sets units +*/ void GLViewer_CoordSystem::setUnits( double x, double y ) { if( x>0 ) @@ -88,46 +85,43 @@ void GLViewer_CoordSystem::setUnits( double x, double y ) else myYUnit = 1.0; } -//======================================================================= -// Function: getRotation -// Purpose : -//======================================================================= + +/*! + \return rotation +*/ double GLViewer_CoordSystem::getRotation() const { return myRotation; } -//======================================================================= -// Function: setRotation -// Purpose : -//======================================================================= +/*! + Sets rotation +*/ void GLViewer_CoordSystem::setRotation( double rotation ) { myRotation = rotation; } -//======================================================================= -// Function: getType -// Purpose : -//======================================================================= +/*! + \return type +*/ GLViewer_CoordSystem::CSType GLViewer_CoordSystem::getType() const { return myType; } -//======================================================================= -// Function: setType -// Purpose : -//======================================================================= +/*! + Sets type +*/ void GLViewer_CoordSystem::setType( CSType type ) { myType = type; } -//======================================================================= -// Function: toReference -// Purpose : -//======================================================================= +/*! + Recalculate co-ordinates to reference co-ordinates + \param x, y - co-ordinates +*/ void GLViewer_CoordSystem::toReference( double& x, double& y ) { if( myType==Cartesian ) @@ -145,10 +139,10 @@ void GLViewer_CoordSystem::toReference( double& x, double& y ) } } -//======================================================================= -// Function: fromReference -// Purpose : -//======================================================================= +/*! + Recalculate co-ordinates from reference co-ordinates + \param x, y - co-ordinates +*/ void GLViewer_CoordSystem::fromReference( double& x, double& y ) { x = (x - myX0) / myXUnit; @@ -185,20 +179,20 @@ void GLViewer_CoordSystem::fromReference( double& x, double& y ) } } -//======================================================================= -// Function: transform -// Purpose : -//======================================================================= +/*! + Recalculate co-ordinates to co-ordinates of other CS + \param aSystem - other CS + \param x, y - co-ordinates +*/ void GLViewer_CoordSystem::transform( GLViewer_CoordSystem& aSystem, double& x, double& y ) { toReference( x, y ); aSystem.fromReference( x, y ); } -//======================================================================= -// Function: getStretching -// Purpose : -//======================================================================= +/*! + \return stretching of CS along X and Y axis +*/ void GLViewer_CoordSystem::getStretching( GLViewer_CoordSystem& aSystem, double& theX, double& theY ) { theX = myXUnit / aSystem.myXUnit; diff --git a/src/GLViewer/GLViewer_CoordSystem.h b/src/GLViewer/GLViewer_CoordSystem.h index ca571daab..6db89583b 100644 --- a/src/GLViewer/GLViewer_CoordSystem.h +++ b/src/GLViewer/GLViewer_CoordSystem.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -35,6 +35,10 @@ #pragma warning( disable:4251 ) #endif +/*! + \class GLViewer_CoordSystem + \brief Class implementing mathematical model of 2D coordinate system +*/ class GLVIEWER_API GLViewer_CoordSystem { public: diff --git a/src/GLViewer/GLViewer_Defs.h b/src/GLViewer/GLViewer_Defs.h index 68d1f7d3f..411fb4a7a 100644 --- a/src/GLViewer/GLViewer_Defs.h +++ b/src/GLViewer/GLViewer_Defs.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index 2da866512..d0001a49c 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -48,10 +48,7 @@ GLfloat modelMatrix[16]; -//================================================================ -// Class : GLViewer_TexFont -// Description : -//================================================================ + //! code of first font symbol static int FirstSymbolNumber = 32; //! code of last font symbol @@ -60,10 +57,9 @@ static int LastSymbolNumber = 127; QMap GLViewer_TexFont::TexFontBase; QMap GLViewer_TexFont::BitmapFontCache; -//======================================================================= -// Function: clearTextBases -// Purpose : -//======================================================================= +/*! + Clears all generated fonts +*/ void GLViewer_TexFont::clearTextBases() { //cout << "Clear font map" << endl; @@ -71,10 +67,9 @@ void GLViewer_TexFont::clearTextBases() BitmapFontCache.clear(); } -//====================================================================== -// Function: GLViewer_TexFont -// Purpose : -//======================================================================= +/*! + Default constructor +*/ GLViewer_TexFont::GLViewer_TexFont() : myMaxRowWidth( 0 ), myFontHeight( 0 ) { @@ -86,10 +81,13 @@ GLViewer_TexFont::GLViewer_TexFont() init(); } -//====================================================================== -// Function: GLViewer_TexFont -// Purpose : -//======================================================================= +/*! + Constructor + \param theFont - a base font + \param theSeparator - separator between letters + \param theIsResizeable - specifies whether text drawn by this object can be scaled along with the scene + \param theMinMagFilter - min/mag filter, affects text sharpness +*/ GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator, bool theIsResizeable, GLuint theMinMagFilter ) : myMaxRowWidth( 0 ), myFontHeight( 0 ) { @@ -101,20 +99,18 @@ GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator, bool theIs init(); } -//====================================================================== -// Function: ~GLViewer_TexFont -// Purpose : -//======================================================================= +/*! + Destructor +*/ GLViewer_TexFont::~GLViewer_TexFont() { delete[] myWidths; delete[] myPositions; } -//====================================================================== -// Function: init -// Purpose : -//======================================================================= +/*! + Initializes font parameters +*/ void GLViewer_TexFont::init() { myNbSymbols = LastSymbolNumber - FirstSymbolNumber + 1; @@ -148,10 +144,9 @@ void GLViewer_TexFont::init() myTexFontHeight = 0; } -//====================================================================== -// Function: generateTexture -// Purpose : -//======================================================================= +/*! + Generating font texture +*/ bool GLViewer_TexFont::generateTexture() { GLViewer_TexFindId aFindFont; @@ -160,7 +155,7 @@ bool GLViewer_TexFont::generateTexture() aFindFont.myIsItal = myQFont.italic(); aFindFont.myIsUndl = myQFont.underline(); aFindFont.myPointSize = myQFont.pointSize(); - aFindFont.myViewPortId = (int)QGLContext::currentContext(); + aFindFont.myViewPortId = size_t(QGLContext::currentContext()); if( TexFontBase.contains( aFindFont ) ) { @@ -265,10 +260,13 @@ bool GLViewer_TexFont::generateTexture() return true; } -//====================================================================== -// Function: drawString -// Purpose : -//======================================================================= +/*! + Drawing string in viewer + \param theStr - string to be drawn + \param theX - X position + \param theY - Y position + \param theScale - scale coefficient +*/ void GLViewer_TexFont::drawString( QString theStr, GLdouble theX , GLdouble theY, GLfloat theScale ) { // Adding some pixels to have a gap between rows @@ -334,10 +332,9 @@ void GLViewer_TexFont::drawString( QString theStr, GLdouble theX , GLdouble theY glPopAttrib(); } -//====================================================================== -// Function: getStringWidth -// Purpose : -//======================================================================= +/*! + \return width of string in pixels +*/ int GLViewer_TexFont::getStringWidth( QString theStr ) { int aWidth = 0; @@ -351,17 +348,18 @@ int GLViewer_TexFont::getStringWidth( QString theStr ) return aWidth; } -//====================================================================== -// Function: getStringHeight -// Purpose : -//======================================================================= +/*! + \return height of string in pixels +*/ int GLViewer_TexFont::getStringHeight() { QFontMetrics aFM( myQFont ); return aFM.height(); } -//! function for generation list base for bitmap fonts +/*! + Generates list base for bitmap fonts +*/ static GLuint displayListBase( QFont* theFont ) { if ( !theFont ) @@ -421,7 +419,7 @@ static GLuint displayListBase( QFont* theFont ) return aList; } - aFindFont.myViewPortId = (int)aCont; + aFindFont.myViewPortId = size_t(aCont); if ( GLViewer_TexFont::BitmapFontCache.contains( aFindFont ) ) aList = GLViewer_TexFont::BitmapFontCache[aFindFont]; @@ -431,7 +429,7 @@ static GLuint displayListBase( QFont* theFont ) QMap::iterator it = GLViewer_TexFont::BitmapFontCache.begin(); for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it ) { - if ( it.key().myViewPortId == (int)aCont && it.data() > listBase ) + if ( it.key().myViewPortId == size_t(aCont) && it.data() > listBase ) listBase = it.data(); } listBase += 256; @@ -473,16 +471,9 @@ static GLuint displayListBase( QFont* theFont ) return aList; } -/*************************************************************************** -** Class: GLViewer_Drawer -** Descr: Drawer for GLViewer_Object -** Module: GLViewer -** Created: UI team, 01.10.01 -****************************************************************************/ -//====================================================================== -// Function: GLViewer_Drawer -// Purpose : -//======================================================================= +/*! + Default constructor +*/ GLViewer_Drawer::GLViewer_Drawer() : myFont( "Helvetica", 10, QFont::Bold ) { @@ -495,20 +486,18 @@ GLViewer_Drawer::GLViewer_Drawer() myTextScale = 0.125; } -//====================================================================== -// Function: ~GLViewer_Drawer -// Purpose : -//======================================================================= +/*! + Destructor +*/ GLViewer_Drawer::~GLViewer_Drawer() { myObjects.clear(); glDeleteLists( myTextList, 1 ); } -//====================================================================== -// Function: destroyAllTextures -// Purpose : -//======================================================================= +/*! + Clears all generated textures +*/ void GLViewer_Drawer::destroyAllTextures() { QMap::Iterator anIt= GLViewer_TexFont::TexFontBase.begin(); @@ -518,10 +507,10 @@ void GLViewer_Drawer::destroyAllTextures() glDeleteTextures( 1, &(anIt.data().myTexFontId) ); } -//======================================================================= -// Function: setAntialiasing -// Purpose : The function enables and disables antialiasing in Open GL (for points, lines and polygons). -//======================================================================= +/*! + Enables and disables antialiasing in Open GL (for points, lines and polygons). + \param on - if it is true, antialiasing is enabled +*/ void GLViewer_Drawer::setAntialiasing(const bool on) { if (on) @@ -545,10 +534,12 @@ void GLViewer_Drawer::setAntialiasing(const bool on) } } -//====================================================================== -// Function: loadTexture -// Purpose : -//======================================================================= +/*! Loads texture from file + \param fileName - the name of texture file + \param x_size - the horizontal size of picture ( less or equal texture horizontal size ) + \param y_size - the vertical size of picture ( less or equal texture vertical size ) + \param t_size - the size of texture ( texture vertical size equals texture horizontal size ) +*/ GLuint GLViewer_Drawer::loadTexture( const QString& fileName, GLint* x_size, GLint* y_size, @@ -620,10 +611,12 @@ GLuint GLViewer_Drawer::loadTexture( const QString& fileName, return texture; } -//====================================================================== -// Function: drawTexture -// Purpose : -//======================================================================= +/*! Draw square texture + \param texture - the texture ID + \param size - the size of square texture + \param x - x coord + \param y - y coord +*/ void GLViewer_Drawer::drawTexture( GLuint texture, GLint size, GLfloat x, GLfloat y ) { /*float xScale = myXScale; @@ -660,10 +653,13 @@ void GLViewer_Drawer::drawTexture( GLuint texture, GLint size, GLfloat x, GLfloa drawTexture( texture, size, size, x, y ); } -//====================================================================== -// Function: drawTexture -// Purpose : -//======================================================================= +/*! Draw texture + \param texture - the texture ID + \param x_size - the horizontal size of texture + \param y_size - the vertical size of texture + \param x - x coord + \param y - y coord +*/ void GLViewer_Drawer::drawTexture( GLuint texture, GLint x_size, GLint y_size, GLfloat x, GLfloat y ) { /*float xScale = myXScale; @@ -699,10 +695,16 @@ void GLViewer_Drawer::drawTexture( GLuint texture, GLint x_size, GLint y_size, G drawTexturePart( texture, 1.0, 1.0, x_size, y_size, x, y ); } -//====================================================================== -// Function: drawTexture -// Purpose : -//======================================================================= +/*! Draw texture part + \param texture - the texture ID + \param x_ratio - the horizontal ratio of texture part + \param y_ratio - the vertical ratio of texture part + \param x_size - the horizontal size of texture + \param y_size - the vertical size of texture + \param x - x coord + \param y - y coord + \param scale - common scale factor ( if = 0, use drawer scales ) +*/ void GLViewer_Drawer::drawTexturePart( GLuint texture, GLfloat x_ratio, GLfloat y_ratio, @@ -750,10 +752,16 @@ void GLViewer_Drawer::drawTexturePart( GLuint texture, glDisable( GL_TEXTURE_2D ); } -//====================================================================== -// Function: drawText -// Purpose : -//======================================================================= +/*! + Draw text + \param text - text to be drawn + \param xPos - x position + \param yPos - y position + \param color - color of text + \param theFont - font of text + \param theSeparator - letter separator + \param theFormat - text format (by default DTF_BITMAP) +*/ void GLViewer_Drawer::drawText( const QString& text, GLfloat xPos, GLfloat yPos, const QColor& color, QFont* theFont, int theSeparator, DisplayTextFormat theFormat ) { @@ -781,10 +789,9 @@ void GLViewer_Drawer::drawText( const QString& text, GLfloat xPos, GLfloat yPos, } } -//====================================================================== -// Function: drawText -// Purpose : -//======================================================================= +/*! + Draws object-text +*/ void GLViewer_Drawer::drawText( GLViewer_Object* theObject ) { if( !theObject ) @@ -801,16 +808,21 @@ void GLViewer_Drawer::drawText( GLViewer_Object* theObject ) drawText( aText->getText(), aPosX, aPosY, aText->getColor(), &aTmpVarFont, aText->getSeparator(), aText->getDisplayTextFormat() ); } -//====================================================================== -// Function: drawGLText -// Purpose : -//======================================================================= +/*! Draw text + \param text - the text string + \param x - x coord + \param y - y coord + \param hPosition - horizontal alignment + \param vPosition - vertical alignment + \param color - text color + \param smallFont - font format +*/ void GLViewer_Drawer::drawGLText( QString text, float x, float y, int hPosition, int vPosition, QColor color, bool smallFont ) { QFont aFont( myFont ); if( smallFont ) - aFont.setPointSize( aFont.pointSize() * 0.8 ); + aFont.setPointSize( int(aFont.pointSize() * 0.8) ); GLfloat scale = textScale() > 0. ? textScale() : 1.; @@ -838,10 +850,9 @@ void GLViewer_Drawer::drawGLText( QString text, float x, float y, drawText( text, x, y, color, &aFont, 2, myTextFormat ); } -//====================================================================== -// Function: textRect -// Purpose : -//======================================================================= +/*! + \return a rectangle of text (without viewer scale) +*/ GLViewer_Rect GLViewer_Drawer::textRect( const QString& text ) const { GLfloat scale = textScale() > 0. ? textScale() : 1.; @@ -853,10 +864,11 @@ GLViewer_Rect GLViewer_Drawer::textRect( const QString& text ) const return GLViewer_Rect( 0, width, height, 0 ); } -//====================================================================== -// Function: drawRectangle -// Purpose : -//======================================================================= +/*! + Draws rectangle + \param rect - instance of primitive + \param color - color of primitive +*/ void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, QColor color ) { if( !rect ) @@ -880,10 +892,12 @@ void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, QColor color ) glEnd(); } -//====================================================================== -// Function: translateToHPGL -// Purpose : -//======================================================================= +/*! + Saves object to file with format of HPGL + \param hFile - file + \param aViewerCS - viewer co-ordinate system + \param aHPGLCS - paper co-ordinate system +*/ bool GLViewer_Drawer::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aHPGLCS ) { bool result = true; @@ -892,10 +906,12 @@ bool GLViewer_Drawer::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aView return result; } -//====================================================================== -// Function: translateToPS -// Purpose : -//======================================================================= +/*! + Saves object to file with format of PostScript + \param hFile - file + \param aViewerCS - viewer co-ordinate system + \param aPSCS - paper co-ordinate system +*/ bool GLViewer_Drawer::translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS ) { bool result = true; @@ -905,10 +921,12 @@ bool GLViewer_Drawer::translateToPS( QFile& hFile, GLViewer_CoordSystem* aViewer } #ifdef WIN32 -//====================================================================== -// Function: translateToEMF -// Purpose : -//======================================================================= +/*! + Saves object to file with format of EMF + \param hFile - file + \param aViewerCS - viewer co-ordinate system + \param aEMFCS - paper co-ordinate system +*/ bool GLViewer_Drawer::translateToEMF( HDC hDC, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ) { bool result = true; @@ -918,10 +936,15 @@ bool GLViewer_Drawer::translateToEMF( HDC hDC, GLViewer_CoordSystem* aViewerCS, } #endif -//====================================================================== -// Function: drawRectangle -// Purpose : -//======================================================================= +/*! + Draws rectangle + \param rect - instance of primitive + \param lineWidth - width of line + \param gap - gap of rectangle + \param color - color of primitive + \param filled - if it is true, then rectangle will be drawn filled with color "fillingColor" + \param fillingColor - color of filling +*/ void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, GLfloat lineWidth, GLfloat gap, QColor color, bool filled, QColor fillingColor ) { @@ -959,10 +982,12 @@ void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, GLfloat lineWidth, GLf glEnd(); } -//====================================================================== -// Function: drawContour -// Purpose : -//======================================================================= +/*! + Draws contour + \param pntList - list of points + \param color - color of contour + \param lineWidth - width of line +*/ void GLViewer_Drawer::drawContour( const GLViewer_PntList& pntList, QColor color, GLfloat lineWidth ) { glColor3f( ( GLfloat )color.red() / 255, @@ -977,10 +1002,14 @@ void GLViewer_Drawer::drawContour( const GLViewer_PntList& pntList, QColor color glEnd(); } -//====================================================================== -// Function: drawContour -// Purpose : -//======================================================================= +/*! + Draws rectangular contour + \param rect - instance of rectangle + \param color - color of primitive + \param lineWidth - width of line + \param pattern - pattern of line + \param isStripe - enables line stipple +*/ void GLViewer_Drawer::drawContour( GLViewer_Rect* rect, QColor color, GLfloat lineWidth, GLushort pattern, bool isStripe ) { @@ -1011,10 +1040,11 @@ void GLViewer_Drawer::drawContour( GLViewer_Rect* rect, QColor color, GLfloat li glDisable( GL_LINE_STIPPLE ); } -//====================================================================== -// Function: drawPolygon -// Purpose : -//======================================================================= +/*! + Draws polygon + \param pntList - list of points + \param color - color of polygon +*/ void GLViewer_Drawer::drawPolygon( const GLViewer_PntList& pntList, QColor color ) { glColor3f( ( GLfloat )color.red() / 255, @@ -1027,10 +1057,13 @@ void GLViewer_Drawer::drawPolygon( const GLViewer_PntList& pntList, QColor color glEnd(); } -//====================================================================== -// Function: drawPolygon -// Purpose : -//======================================================================= +/*! + Draws rectangle + \param rect - instance of rectangle + \param color - color of polygon + \param pattern - pattern of line + \param isStripe - enables line stipple +*/ void GLViewer_Drawer::drawPolygon( GLViewer_Rect* rect, QColor color, GLushort pattern, bool isStripe ) { @@ -1058,11 +1091,14 @@ void GLViewer_Drawer::drawPolygon( GLViewer_Rect* rect, QColor color, glDisable( GL_LINE_STIPPLE ); } -//====================================================================== -// Function: drawVertex -// Purpose : -//======================================================================= GLubyte rasterVertex[5] = { 0x70, 0xf8, 0xf8, 0xf8, 0x70 }; + +/*! + Draws vertex + \param x - x position + \param y - y position + \param color - color of vertex +*/ void GLViewer_Drawer::drawVertex( GLfloat x, GLfloat y, QColor color ) { glColor3f( ( GLfloat )color.red() / 255, ( GLfloat )color.green() / 255, ( GLfloat )color.blue() / 255 ); @@ -1070,11 +1106,14 @@ void GLViewer_Drawer::drawVertex( GLfloat x, GLfloat y, QColor color ) glBitmap( 5, 5, 2, 2, 0, 0, rasterVertex ); } -//====================================================================== -// Function: drawCross -// Purpose : -//======================================================================= GLubyte rasterCross[7] = { 0x82, 0x44, 0x28, 0x10, 0x28, 0x44, 0x82 }; + +/*! + Draws cross + \param x - x position + \param y - y position + \param color - color of cross +*/ void GLViewer_Drawer::drawCross( GLfloat x, GLfloat y, QColor color ) { glColor3f( ( GLfloat )color.red() / 255, ( GLfloat )color.green() / 255, ( GLfloat )color.blue() / 255 ); @@ -1082,10 +1121,18 @@ void GLViewer_Drawer::drawCross( GLfloat x, GLfloat y, QColor color ) glBitmap( 7, 7, 3, 3, 0, 0, rasterCross ); } -//====================================================================== -// Function: drawArrow -// Purpose : -//======================================================================= +/*! + Draws arrow + \param red, green, blue - components of color + \param lineWidth - width of line + \param staff - + \param length - length of arrow + \param width - width of arrow + \param x - x position + \param y - y position + \param angle - angle of arrow + \param filled - drawn as filled +*/ void GLViewer_Drawer::drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue, GLfloat lineWidth, GLfloat staff, GLfloat length, GLfloat width, diff --git a/src/GLViewer/GLViewer_Drawer.h b/src/GLViewer/GLViewer_Drawer.h index 4b66e7b20..21c6386ce 100644 --- a/src/GLViewer/GLViewer_Drawer.h +++ b/src/GLViewer/GLViewer_Drawer.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -98,17 +98,11 @@ struct GLVIEWER_API GLViewer_TexFindId } }; -/*************************************************************************** -** Class: GLViewer_TexFont -** Descr: Font for GLViewer_Drawer -** Module: GLViewer -** Created: UI team, 03.10.01 -****************************************************************************/ +/*! + \class GLViewer_TexFont + Font for GLViewer_Drawer, Drawing bitmap and texture fonts in GLViewer +*/ -/*! - * Class GLViewer_TexFont - * Drawing bitmap and texture fonts in GLViewer - */ class GLVIEWER_API GLViewer_TexFont { public: @@ -185,17 +179,11 @@ private: int myMaxRowWidth; }; -/*************************************************************************** -** Class: GLViewer_Drawer -** Descr: Drawer for GLObject -** Module: GLViewer -** Created: UI team, 03.10.01 -****************************************************************************/ /*! - * Class GLViewer_Drawer - * Drawer for GLViewer_Objects. - * Drawer creates only one times per one type of object - */ + \class GLViewer_Drawer + Drawer for GLViewer_Objects. + Drawer creates only one times per one type of object +*/ class GLVIEWER_API GLViewer_Drawer { public: diff --git a/src/GLViewer/GLViewer_Geom.cxx b/src/GLViewer/GLViewer_Geom.cxx index cd0ef5cae..ebd777e22 100644 --- a/src/GLViewer/GLViewer_Geom.cxx +++ b/src/GLViewer/GLViewer_Geom.cxx @@ -14,28 +14,20 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // -/*************************************************************************** -** Class: GLViewer_Geom -** Descr: -** Module: GLViewer -** Created: UI team, 16.11.04 -****************************************************************************/ - //#include #include #define FAR_POINT 1e10 // Value used as a "very distant" co-ordinate #define TOLERANCE 1e-3 -//================================================================ -// Function : GLViewer_Segment -// Purpose : constructs a real segment bounded by two points -//================================================================ +/*! + constructs a real segment bounded by two points +*/ GLViewer_Segment::GLViewer_Segment( const GLViewer_Pnt& thePnt1, const GLViewer_Pnt& thePnt2 ) : myPnt1( thePnt1 ), @@ -46,11 +38,9 @@ GLViewer_Segment::GLViewer_Segment( const GLViewer_Pnt& thePnt1, myC = myPnt1.x() * myPnt2.y() - myPnt2.x() * myPnt1.y(); } -//================================================================ -// Function : GLViewer_Segment -// Purpose : constructs a ray starting at and directed -// along positive X axis direction (or Y axis if vertical ) -//================================================================ +/*! + constructs a ray starting at and directed along positive X axis direction (or Y axis if vertical ) +*/ GLViewer_Segment::GLViewer_Segment( const GLViewer_Pnt& thePnt, const GLfloat theA, const GLfloat theB, @@ -66,18 +56,16 @@ GLViewer_Segment::GLViewer_Segment( const GLViewer_Pnt& thePnt, myPnt2 = GLViewer_Pnt( FAR_POINT, - myA / myB * FAR_POINT - myC / myB ); } -//================================================================ -// Function : GLViewer_Segment -// Purpose : destructor, does nothing -//================================================================ +/*! + destructor, does nothing +*/ GLViewer_Segment::~GLViewer_Segment() { } -//================================================================ -// Function : HasIntersection -// Purpose : detects intersection with segment -//================================================================ +/*! + detects intersection with segment +*/ bool GLViewer_Segment::HasIntersection( const GLViewer_Segment& theOther ) const { bool aRes = false; @@ -113,27 +101,24 @@ bool GLViewer_Segment::HasIntersection( const GLViewer_Segment& theOther ) const return aRes; } -//================================================================ -// Function : GLViewer_Poly -// Purpose : constructs a closed polygon from the given ordered list of points -//================================================================ +/*! + constructs a closed polygon from the given ordered list of points +*/ GLViewer_Poly::GLViewer_Poly( const GLViewer_PntList* thePoints ) : myPoints( (GLViewer_PntList*)thePoints ) { } -//================================================================ -// Function : ~GLViewer_Poly -// Purpose : destructor, mustn't be deleted here! -//================================================================ +/*! + destructor, mustn't be deleted here! +*/ GLViewer_Poly::~GLViewer_Poly() { } -//================================================================ -// Function : IsIn -// Purpose : returns true if lies within this polygon -//================================================================ +/*! + \return true if lies within this polygon +*/ bool GLViewer_Poly::IsIn( const GLViewer_Pnt& thePnt ) const { if ( !myPoints ) @@ -159,11 +144,10 @@ bool GLViewer_Poly::IsIn( const GLViewer_Pnt& thePnt ) const return ( aNbInter % 2 == 1 ); } +/*! + \return true if lies within this polygon +*/ /* -//================================================================ -// Function : IsIn -// Purpose : returns true if lies within this polygon -//================================================================ bool GLViewer_Poly::IsIn( const GLViewer_Pnt& thePnt, const float tolerance ) const { if ( !myPoints ) @@ -184,10 +168,9 @@ bool GLViewer_Poly::IsIn( const GLViewer_Pnt& thePnt, const float tolerance ) co return res; } */ -//================================================================ -// Function : IsCovers -// Purpose : returns true if covers this polygon -//================================================================ +/*! + \return true if covers this polygon +*/ bool GLViewer_Poly::IsCovers( const GLViewer_Poly& thePoly ) const { if ( !myPoints || !thePoly.Count() ) @@ -204,10 +187,9 @@ bool GLViewer_Poly::IsCovers( const GLViewer_Poly& thePoly ) const return true; } -//================================================================ -// Function : IsCovers -// Purpose : returns true if covers this polygon -//================================================================ +/*! + \return true if covers this polygon +*/ bool GLViewer_Poly::IsCovers( const GLViewer_Rect& theRect ) const { if ( !myPoints ) //needs check for @@ -224,10 +206,10 @@ bool GLViewer_Poly::IsCovers( const GLViewer_Rect& theRect ) const return IsCovers( GLViewer_Poly( &aList ) ); } -//================================================================ -// Function : HasIntersection -// Purpose : looks for any -//================================================================ +/*! + \return true if polygon has intersection with segment or ray + \param theSegment - segment to check intersection +*/ bool GLViewer_Poly::HasIntersection( const GLViewer_Segment& theSegment ) const { if ( !myPoints ) diff --git a/src/GLViewer/GLViewer_Geom.h b/src/GLViewer/GLViewer_Geom.h index 3551ce86f..7ba4db69f 100644 --- a/src/GLViewer/GLViewer_Geom.h +++ b/src/GLViewer/GLViewer_Geom.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // diff --git a/src/GLViewer/GLViewer_Grid.cxx b/src/GLViewer/GLViewer_Grid.cxx index 85dfac4ba..13a661caf 100644 --- a/src/GLViewer/GLViewer_Grid.cxx +++ b/src/GLViewer/GLViewer_Grid.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -29,6 +29,9 @@ #include #include +/*! + Default constructor +*/ GLViewer_Grid::GLViewer_Grid() : myGridList( 0 ), myGridHeight( (GLfloat)0.0 ), myGridWidth( (GLfloat)0.0 ), myWinW( (GLfloat)0.0 ), myWinH( (GLfloat)0.0 ), myXSize( (GLfloat)0.0 ), myYSize( (GLfloat)0.0 ), @@ -44,6 +47,14 @@ GLViewer_Grid::GLViewer_Grid() : myAxisColor[2] = 0.75; } +/*! + Constructor + \param width and \param height - width and height of grid + \param winW and \param winH - width and height of window + \param xSize and \param ySize - steps along x and y direction + \param xPan and \param yPan - offsets along x and y direction + \param xScale and \param yScal - scale factors along x and y direction +*/ GLViewer_Grid::GLViewer_Grid( GLfloat width, GLfloat height, GLfloat winW, GLfloat winH, GLfloat xSize, GLfloat ySize, @@ -63,10 +74,16 @@ GLViewer_Grid::GLViewer_Grid( GLfloat width, GLfloat height, myAxisColor[2] = 0.75; } +/*! + Destructor +*/ GLViewer_Grid::~GLViewer_Grid() { } +/*! + Performs OpenGL drawing +*/ void GLViewer_Grid::draw() { if ( myGridList == 0 || myIsUpdate ) @@ -75,6 +92,10 @@ void GLViewer_Grid::draw() glCallList( myGridList ); } +/*! + Changes color of grid + \param r, g, b - components of color +*/ void GLViewer_Grid::setGridColor( GLfloat r, GLfloat g, GLfloat b ) { if( myGridColor[0] == r && myGridColor[1] == g && myGridColor[2] == b ) @@ -86,6 +107,10 @@ void GLViewer_Grid::setGridColor( GLfloat r, GLfloat g, GLfloat b ) myIsUpdate = GL_TRUE; } +/*! + Changes color of axis + \param r, g, b - components of color +*/ void GLViewer_Grid::setAxisColor( GLfloat r, GLfloat g, GLfloat b ) { if( myAxisColor[0] == r && myAxisColor[1] == g && myAxisColor[2] == b ) @@ -97,6 +122,10 @@ void GLViewer_Grid::setAxisColor( GLfloat r, GLfloat g, GLfloat b ) myIsUpdate = GL_TRUE; } +/*! + Changes grid width + \param w - new grid width +*/ void GLViewer_Grid::setGridWidth( float w ) { if( myGridWidth == w ) @@ -106,6 +135,10 @@ void GLViewer_Grid::setGridWidth( float w ) myIsUpdate = GL_TRUE; } +/*! + Sets Radius of center point( begin coords ) + \param r - new radius +*/ void GLViewer_Grid::setCenterRadius( int r ) { if( myCenterRadius == r ) @@ -115,6 +148,11 @@ void GLViewer_Grid::setCenterRadius( int r ) myIsUpdate = GL_TRUE; } +/*! + Sets grid size along X and Y axis + \param xSize - size along X axis + \param ySize - size along Y axis +*/ void GLViewer_Grid::setSize( float xSize, float ySize ) { if( myXSize == xSize && myYSize == ySize ) @@ -125,6 +163,11 @@ void GLViewer_Grid::setSize( float xSize, float ySize ) myIsUpdate = GL_TRUE; } +/*! + Sets panning of grid + \param xPan - panning along X axis + \param yPan - panning along Y axis +*/ void GLViewer_Grid::setPan( float xPan, float yPan ) { if( myXPan == xPan && myYPan == yPan ) @@ -135,6 +178,10 @@ void GLViewer_Grid::setPan( float xPan, float yPan ) myIsUpdate = GL_TRUE; } +/*! + Sets zoom + \param zoom - new coefficient of zooming +*/ bool GLViewer_Grid::setZoom( float zoom ) { if( zoom == 1.0 ) @@ -160,6 +207,12 @@ bool GLViewer_Grid::setZoom( float zoom ) return true; } +/*! + Sets parameters of grid by zoom coefficient and window size + \param WinW - window width + \param WinH - window height + \param zoom - zoom coefficient +*/ void GLViewer_Grid::setResize( float WinW, float WinH, float zoom ) { if( myWinW == WinW && myWinH == WinH && zoom == 1.0 ) @@ -173,24 +226,42 @@ void GLViewer_Grid::setResize( float WinW, float WinH, float zoom ) myIsUpdate = GL_TRUE; } +/*! + \return grid size along x and y axis + \param xSize - for size along x axis + \param ySize - for size along y axis +*/ void GLViewer_Grid::getSize( float& xSize, float& ySize ) const { xSize = myXSize; ySize = myYSize; } +/*! + \return panning along x and y axis + \param xPan - for panning along x axis + \param yPan - for panning along y axis +*/ void GLViewer_Grid::getPan( float& xPan, float& yPan ) const { xPan = myXPan; yPan = myYPan; } +/*! + \return scaling along x and y axis + \param xScale - for scaling along x axis + \param yScale - for scaling along y axis +*/ void GLViewer_Grid::getScale( float& xScale, float& yScale ) const { xScale = myXScale; yScale = myYScale; } +/*! + Initialize grid display list +*/ bool GLViewer_Grid::initList() { myIsUpdate = GL_FALSE; diff --git a/src/GLViewer/GLViewer_Grid.h b/src/GLViewer/GLViewer_Grid.h index 39858916b..d4a4567e4 100644 --- a/src/GLViewer/GLViewer_Grid.h +++ b/src/GLViewer/GLViewer_Grid.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // diff --git a/src/GLViewer/GLViewer_Group.cxx b/src/GLViewer/GLViewer_Group.cxx index 6377e9ecd..646750490 100644 --- a/src/GLViewer/GLViewer_Group.cxx +++ b/src/GLViewer/GLViewer_Group.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -26,52 +26,40 @@ #include "GLViewer_Group.h" #include "GLViewer_Object.h" -/*************************************************************************** -** Class: GLViewer_Group -** Descr: Group of GLViewer_Objects -** Module: GLViewer -** Created: UI team, 25.03.05 -****************************************************************************/ - -//-------------------------------------------------------------------------- -//Function: GLViewer_Group() -//Description: constructor -//-------------------------------------------------------------------------- +/*! + constructor +*/ GLViewer_Group::GLViewer_Group() { mySelObjNum = 0; } -//-------------------------------------------------------------------------- -//Function: GLViewer_Group() -//Description: destructor -//-------------------------------------------------------------------------- +/*! + destructor +*/ GLViewer_Group::~GLViewer_Group() { } -//-------------------------------------------------------------------------- -//Function: isEmpty -//Description: detection of empty group -//-------------------------------------------------------------------------- +/*! + detection of empty group +*/ bool GLViewer_Group::isEmpty() { return myList.empty(); } -//-------------------------------------------------------------------------- -//Function: count -//Description: number of elements -//-------------------------------------------------------------------------- +/*! + \return number of elements +*/ int GLViewer_Group::count() { return myList.size(); } -//-------------------------------------------------------------------------- -//Function: contains -//Description: return the position of object, else -1 -//-------------------------------------------------------------------------- +/*! + \return the position of object if group contains it, else -1 +*/ int GLViewer_Group::contains( GLViewer_Object* theObject ) { if( !theObject ) @@ -86,10 +74,9 @@ int GLViewer_Group::contains( GLViewer_Object* theObject ) return -1; } -//-------------------------------------------------------------------------- -//Function: addObject -//Description: adding object to group -//-------------------------------------------------------------------------- +/*! + adding object to group +*/ int GLViewer_Group::addObject( GLViewer_Object* theObject ) { if( theObject && contains( theObject ) == -1 ) @@ -100,10 +87,9 @@ int GLViewer_Group::addObject( GLViewer_Object* theObject ) return count(); } -//-------------------------------------------------------------------------- -//Function: removeObject -//Description: removing object from group -//-------------------------------------------------------------------------- +/*! + removing object from group +*/ int GLViewer_Group::removeObject( GLViewer_Object* theObject ) { if( theObject ) @@ -122,10 +108,11 @@ int GLViewer_Group::removeObject( GLViewer_Object* theObject ) return count(); } -//-------------------------------------------------------------------------- -//Function: dragingObjects -//Description: -//-------------------------------------------------------------------------- +/*! + Dragging operation + \param Once is true, if this operation calls only one time for all object + \param x, y - dragging position +*/ void GLViewer_Group::dragingObjects( float x, float y, bool once ) { if( !once ) @@ -154,10 +141,11 @@ void GLViewer_Group::dragingObjects( float x, float y, bool once ) (*it)->moveObject( x, y, true ); } -//-------------------------------------------------------------------------- -//Function: updateZoom -//Description: -//-------------------------------------------------------------------------- +/*! + Updates zoom of object + \param sender - object to be updated + \param zoom - zoom coefficient +*/ void GLViewer_Group::updateZoom( GLViewer_Object* sender, float zoom ) { OGIterator it = myList.begin(); diff --git a/src/GLViewer/GLViewer_Group.h b/src/GLViewer/GLViewer_Group.h index 8856166a5..4382b06c9 100644 --- a/src/GLViewer/GLViewer_Group.h +++ b/src/GLViewer/GLViewer_Group.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // diff --git a/src/GLViewer/GLViewer_MimeSource.cxx b/src/GLViewer/GLViewer_MimeSource.cxx index e43ee5f51..ca82fbacd 100644 --- a/src/GLViewer/GLViewer_MimeSource.cxx +++ b/src/GLViewer/GLViewer_MimeSource.cxx @@ -14,18 +14,11 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // -/*************************************************************************** -** Class: GLViewer_MimeSource -** Descr: Needs for a work with QClipboard -** Module: GLViewer -** Created: UI team, 22.03.04 -****************************************************************************/ - //#include #include "GLViewer_MimeSource.h" #include "GLViewer_BaseObjects.h" @@ -33,10 +26,17 @@ //#include //using namespace std; +/*! + Destructor +*/ GLViewer_MimeSource::~GLViewer_MimeSource() { } +/*! + Translate objects to byte array + \param theObjects - list of objects +*/ bool GLViewer_MimeSource::setObjects( QValueList theObjects ) { if( !theObjects.empty() ) @@ -109,9 +109,12 @@ bool GLViewer_MimeSource::setObjects( QValueList theObjects ) return false; } -//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -//If you want to use new class, following two method must be redefined -//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +/*! + Creates object by it's representation (byte array) + \param theArray - byte array + \param theType - type of object +*/ GLViewer_Object* GLViewer_MimeSource::getObject( QByteArray theArray, QString theType ) { if( !theArray.isEmpty() ) @@ -139,6 +142,11 @@ GLViewer_Object* GLViewer_MimeSource::getObject( QByteArray theArray, QString th return NULL; } +/*! + Creates list of objects by its representation (byte array) + \param theArray - byte array + \param theType - type of object +*/ QValueList GLViewer_MimeSource::getObjects( QByteArray theArray, QString theType ) { if( !theArray.isEmpty() ) @@ -210,6 +218,10 @@ QValueList GLViewer_MimeSource::getObjects( QByteArray theArra return QValueList(); } +/*! + \return format by index + \param theIndex - index +*/ const char* GLViewer_MimeSource::format( int theIndex ) const { switch( theIndex ) @@ -223,6 +235,9 @@ const char* GLViewer_MimeSource::format( int theIndex ) const } +/*! + \return internal byte array +*/ QByteArray GLViewer_MimeSource::encodedData( const char* theObjectType ) const { if( theObjectType == "GLViewer_Objects" ) diff --git a/src/GLViewer/GLViewer_MimeSource.h b/src/GLViewer/GLViewer_MimeSource.h index 4fca3c9d7..55262d1d1 100644 --- a/src/GLViewer/GLViewer_MimeSource.h +++ b/src/GLViewer/GLViewer_MimeSource.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -40,10 +40,10 @@ class GLViewer_Object; -/*! Class GLViewer_MimeSource -* Needs for a work with QClipboard +/*! + \class GLViewer_MimeSource + Needs for a work with QClipboard */ - class GLVIEWER_API GLViewer_MimeSource: public QMimeSource { public: diff --git a/src/GLViewer/GLViewer_Object.cxx b/src/GLViewer/GLViewer_Object.cxx index 38124a22e..cb0920108 100644 --- a/src/GLViewer/GLViewer_Object.cxx +++ b/src/GLViewer/GLViewer_Object.cxx @@ -14,18 +14,11 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // -/*************************************************************************** -** Class: GLViewer_Object -** Descr: OpenGL Object -** Module: GLViewer -** Created: UI team, 03.09.02 -****************************************************************************/ - //#include #include "GLViewer_Object.h" #include "GLViewer_Drawer.h" @@ -37,6 +30,9 @@ //#include //using namespace std; +/*! + Default constructor +*/ GLViewer_Object::GLViewer_Object() { myXScale = 1.0; @@ -65,6 +61,9 @@ GLViewer_Object::GLViewer_Object() myGroup = NULL; } +/*! + Destructor +*/ GLViewer_Object::~GLViewer_Object() { if( myRect ) @@ -80,16 +79,27 @@ GLViewer_Object::~GLViewer_Object() delete myAspectLine; } +/*! + \return priority of object +*/ int GLViewer_Object::getPriority() const { return myDrawer ? myDrawer->getPriority() : 0; } +/*! + \return true if object is inside rectangle + \param theRect - rectangle +*/ GLboolean GLViewer_Object::isInside( GLViewer_Rect theRect ) { return theRect.toQRect().contains( myRect->toQRect() ); } +/*! + Sets zoom factor + \param zoom - zoom factor +*/ GLboolean GLViewer_Object::setZoom( GLfloat zoom, bool, bool ) { if( myZoom == zoom ) @@ -99,6 +109,10 @@ GLboolean GLViewer_Object::setZoom( GLfloat zoom, bool, bool ) return GL_TRUE; } +/*! + Performs zoom change by step + \param zoomIn - to increase to decrease zoom +*/ GLboolean GLViewer_Object::updateZoom( bool zoomIn ) { float newZoom; @@ -118,6 +132,10 @@ GLboolean GLViewer_Object::updateZoom( bool zoomIn ) return setZoom( newZoom, true ); } +/*! + Codes object as byte copy + \return byte array +*/ QByteArray GLViewer_Object::getByteCopy() { int i = 0; @@ -185,6 +203,10 @@ QByteArray GLViewer_Object::getByteCopy() return aResult; } +/*! + Initialize object by byte array + \param theArray - byte array +*/ bool GLViewer_Object::initializeFromByteCopy( QByteArray theArray ) { int i = 0; @@ -281,6 +303,10 @@ bool GLViewer_Object::initializeFromByteCopy( QByteArray theArray ) return true; } +/*! + Sets object's group + \param theGroup - group +*/ void GLViewer_Object::setGroup( GLViewer_Group* theGroup ) { if ( myGroup == theGroup ) @@ -294,6 +320,9 @@ void GLViewer_Object::setGroup( GLViewer_Group* theGroup ) myGroup->addObject( this ); } +/*! + \return object's group +*/ GLViewer_Group* GLViewer_Object::getGroup() const { return myGroup; diff --git a/src/GLViewer/GLViewer_Object.h b/src/GLViewer/GLViewer_Object.h index 6cd21b294..49373a8cc 100644 --- a/src/GLViewer/GLViewer_Object.h +++ b/src/GLViewer/GLViewer_Object.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -45,10 +45,6 @@ #pragma warning( disable:4251 ) #endif -/*! - * Class GLViewer_Object - * Base Object for GLViewer - */ class GLViewer_Drawer; class GLViewer_AspectLine; class GLViewer_Group; @@ -56,6 +52,10 @@ class GLViewer_CoordSystem; class GLViewer_Text; class GLViewer_Owner; +/*! + * Class GLViewer_Object + * Base Object for all GLViewer objects + */ class GLVIEWER_API GLViewer_Object { public: diff --git a/src/GLViewer/GLViewer_Selector.cxx b/src/GLViewer/GLViewer_Selector.cxx index 5df29eb89..4e4c91aea 100644 --- a/src/GLViewer/GLViewer_Selector.cxx +++ b/src/GLViewer/GLViewer_Selector.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,13 +22,6 @@ // File: GLViewer_Selector.cxx // Created: November, 2004 -/**************************************************************************** -** Class: GLViewer_Selector -** Descr: Base class for object selection in QAD-based application -** Module: GLViewer -** Created: UI team, 22.09.00 -*****************************************************************************/ - //#include #include "GLViewer_Selector.h" diff --git a/src/GLViewer/GLViewer_Selector.h b/src/GLViewer/GLViewer_Selector.h index ad40ab124..6c0672843 100644 --- a/src/GLViewer/GLViewer_Selector.h +++ b/src/GLViewer/GLViewer_Selector.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,12 +22,6 @@ // File: GLViewer_Selector.h // Created: November, 2004 -/**************************************************************************** -** Class: GLViewer_Selector -** Descr: Base class for object selection in QAD-based application -** Module: GLViewer -** Created: UI team, 22.09.00 -*****************************************************************************/ #ifndef GLVIEWER_SELECTOR_H #define GLVIEWER_SELECTOR_H @@ -41,10 +35,10 @@ class GLViewer_Viewer; -/*! Class GLViewer_Selector -* Based select manager for GLViewer +/*! + \Class GLViewer_Selector + Base class for object selection in SUIT-based application */ - class GLVIEWER_API GLViewer_Selector : public QObject { Q_OBJECT diff --git a/src/GLViewer/GLViewer_Selector2d.cxx b/src/GLViewer/GLViewer_Selector2d.cxx index e8a414d46..067b29541 100644 --- a/src/GLViewer/GLViewer_Selector2d.cxx +++ b/src/GLViewer/GLViewer_Selector2d.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,19 +22,15 @@ // File: GLViewer_Selector2d.cxx // Created: November, 2004 -/**************************************************************************** -** Class: GLViewer_Selector2d -** Descr: OpenGL Selector 2D -** Module: GLViewer -** Created: UI team, 20.09.02 -*****************************************************************************/ - //#include #include "GLViewer_Selector2d.h" #include "GLViewer_Viewer2d.h" #include "GLViewer_Context.h" #include "GLViewer_ViewPort2d.h" +/*! + Constructor +*/ GLViewer_Selector2d::GLViewer_Selector2d( GLViewer_Viewer2d* v2d, GLViewer_Context* glc ) : GLViewer_Selector( v2d ), myGLContext( glc ) @@ -43,20 +39,35 @@ myGLContext( glc ) // myGLContext->SetSelectionColor( Quantity_NOC_RED ); } +/*! + Destructor +*/ GLViewer_Selector2d::~GLViewer_Selector2d() { } +/*! + Changes hilight color of context + \param color - new hilight color +*/ void GLViewer_Selector2d::setHilightColor( Quantity_NameOfColor color ) { myGLContext->SetHighlightColor( color ); } +/*! + Changes selection color of context + \param color - new selection color +*/ void GLViewer_Selector2d::setSelectColor( Quantity_NameOfColor color ) { myGLContext->SetSelectionColor( color ); } +/*! + Detects object at point + \param x, y - point co-ordinates +*/ void GLViewer_Selector2d::detect( int x, int y ) { //cout << "GLViewer_Selector2d : detect ( " << x << " , " << y << " )" << endl; @@ -71,6 +82,9 @@ void GLViewer_Selector2d::detect( int x, int y ) myGLContext->MoveTo( x, y ); } +/*! + Undetects all objects +*/ void GLViewer_Selector2d::undetectAll() { if ( myLocked || !myGLContext || !myViewer || !myViewer->getActiveView() || @@ -84,6 +98,10 @@ void GLViewer_Selector2d::undetectAll() myGLContext->clearHighlighted( true ); } +/*! + Selects previously hilighted objects + \param append - append objects to selection +*/ void GLViewer_Selector2d::select( bool append ) { //cout << "GLViewer_Selector2d : select ( " << (int)append << " )" << endl; @@ -104,6 +122,11 @@ void GLViewer_Selector2d::select( bool append ) checkSelection( selBefore, append, status ); } +/*! + Selects objects in rectangle + \param selRect - selection rectangle + \param append - append objects to selection +*/ void GLViewer_Selector2d::select( const QRect& selRect, bool append ) { GLViewer_Viewer::SelectionMode selMode = myViewer->getSelectionMode(); @@ -123,6 +146,9 @@ void GLViewer_Selector2d::select( const QRect& selRect, bool append ) checkSelection( selBefore, append, aStatus ); } +/*! + Unselects all objects +*/ void GLViewer_Selector2d::unselectAll() { if ( myLocked || !myViewer ) @@ -137,8 +163,10 @@ void GLViewer_Selector2d::unselectAll() if ( hadSelection ) emit selSelectionCancel(); } -/* Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel' - Should be called by after non-interactive selection. */ +/*! + Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel' + Should be called by after non-interactive selection. +*/ void GLViewer_Selector2d::checkSelection( int selBefore, bool append, int aStatus ) { int selAfter = numSelected(); @@ -158,6 +186,9 @@ void GLViewer_Selector2d::checkSelection( int selBefore, bool append, int aStatu } } +/*! + \return number of selected objects +*/ int GLViewer_Selector2d::numSelected() const { return myGLContext->NbSelected(); diff --git a/src/GLViewer/GLViewer_Selector2d.h b/src/GLViewer/GLViewer_Selector2d.h index cce3cc37e..34da93d59 100644 --- a/src/GLViewer/GLViewer_Selector2d.h +++ b/src/GLViewer/GLViewer_Selector2d.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,12 +22,6 @@ // File: GLViewer_Selector2d.h // Created: November, 2004 -/**************************************************************************** -** Class: GLViewer_Selector2d -** Descr: OpenGL Selector 2D -** Module: GLViewer -** Created: UI team, 20.09.02 -*****************************************************************************/ #ifndef GLVIEWER_SELECTOR2D_H #define GLVIEWER_SELECTOR2D_H @@ -42,8 +36,9 @@ class GLViewer_Viewer2d; class GLViewer_Context; -/*! Class GLViewer_Selector2d -* 2D select manager for GLViewer +/*! + \class GLViewer_Selector2d + 2D select manager for GLViewer */ class GLVIEWER_API GLViewer_Selector2d : public GLViewer_Selector { diff --git a/src/GLViewer/GLViewer_Text.cxx b/src/GLViewer/GLViewer_Text.cxx index bafa33ec1..f4dba3a47 100644 --- a/src/GLViewer/GLViewer_Text.cxx +++ b/src/GLViewer/GLViewer_Text.cxx @@ -14,21 +14,17 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // -/*************************************************************************** -** Class: GLViewer_Text -** Descr: Substitution of Prs3d_Text for OpenGL -** Module: GLViewer -** Created: UI team, 10.07.03 -****************************************************************************/ - //#include #include "GLViewer_Text.h" +/*! + Constructor +*/ GLViewer_Text::GLViewer_Text( const QString& text, float xPos, float yPos, const QColor& color ) { myText = text; @@ -40,6 +36,9 @@ GLViewer_Text::GLViewer_Text( const QString& text, float xPos, float yPos, const myDTF = DTF_BITMAP; } +/*! + Constructor +*/ GLViewer_Text::GLViewer_Text( const QString& text, float xPos, float yPos, const QColor& color, QFont theFont, int theSeparator ) { myText = text; @@ -51,10 +50,16 @@ GLViewer_Text::GLViewer_Text( const QString& text, float xPos, float yPos, const myDTF = DTF_BITMAP; } +/*! + Destructor +*/ GLViewer_Text::~GLViewer_Text() { } +/*! + \return width of text +*/ int GLViewer_Text::getWidth() { int aResult = 0; @@ -64,12 +69,19 @@ int GLViewer_Text::getWidth() return aResult; } +/*! + \return height of text +*/ int GLViewer_Text::getHeight() { QFontMetrics aFM( myQFont ); return aFM.height(); } +/*! + Codes object as byte copy + \return byte array +*/ QByteArray GLViewer_Text::getByteCopy() const { int i; @@ -121,6 +133,10 @@ QByteArray GLViewer_Text::getByteCopy() const return aResult; } +/*! + Initialize text from binary representation + \param theBuf - byte array +*/ GLViewer_Text* GLViewer_Text::fromByteCopy( QByteArray theBuf ) { int i = 0; diff --git a/src/GLViewer/GLViewer_Text.h b/src/GLViewer/GLViewer_Text.h index ef3512ca9..edf680e7b 100644 --- a/src/GLViewer/GLViewer_Text.h +++ b/src/GLViewer/GLViewer_Text.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -43,9 +43,10 @@ #pragma warning( disable:4251 ) #endif -/* Class GLViewer_Text -* Substitution of Prs3d_Text for OpenGL */ - +/*! + \class GLViewer_Text + Substitution of Prs3d_Text for OpenGL +*/ class GLVIEWER_API GLViewer_Text { public: diff --git a/src/GLViewer/GLViewer_ToolTip.cxx b/src/GLViewer/GLViewer_ToolTip.cxx index 0521ff19f..c4449265c 100644 --- a/src/GLViewer/GLViewer_ToolTip.cxx +++ b/src/GLViewer/GLViewer_ToolTip.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -34,17 +34,9 @@ #include #include -/*************************************************************************** -** Class: GLViewer_ToolTip -** Descr: ToolTip of GLViewer_Objects -** Module: GLViewer -** Created: UI team, 25.03.05 -****************************************************************************/ - -//-------------------------------------------------------------------------- -//Function: GLViewer_ToolTip() -//Description: constructor -//-------------------------------------------------------------------------- +/*! + constructor +*/ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent ) :QObject(), myText(), @@ -69,10 +61,9 @@ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent ) connect( mypTimer, SIGNAL( timeout() ), this, SLOT( showTip() ) ); } -//-------------------------------------------------------------------------- -//Function: GLViewer_ToolTip() -//Description: destructor -//-------------------------------------------------------------------------- +/*! + destructor +*/ GLViewer_ObjectTip::~GLViewer_ObjectTip() { // delete mypRect; @@ -87,10 +78,10 @@ GLViewer_ObjectTip::~GLViewer_ObjectTip() } -//-------------------------------------------------------------------------- -//Function: GLViewer_ToolTip() -//Description: destructor -//-------------------------------------------------------------------------- +/*! + It is called when there is a possibility that a tool tip should be shown + \param p - position of tooltip +*/ bool GLViewer_ObjectTip::maybeTip( const QPoint &p ) { @@ -138,6 +129,9 @@ bool GLViewer_ObjectTip::maybeTip( const QPoint &p ) */ } +/*! + Custom event filter +*/ bool GLViewer_ObjectTip::eventFilter( QObject* theObj, QEvent* e ) { hideTipAndSleep(); @@ -175,7 +169,9 @@ bool GLViewer_ObjectTip::eventFilter( QObject* theObj, QEvent* e ) return false; } - +/*! + Hides tooltip and stops timer +*/ void GLViewer_ObjectTip::hideTipAndSleep() { //if( mypPoint ) @@ -191,6 +187,9 @@ void GLViewer_ObjectTip::hideTipAndSleep() mypTimer->stop(); } +/*! + Shows tooltip +*/ void GLViewer_ObjectTip::showTip() { if( maybeTip( myPoint ) ) @@ -218,6 +217,9 @@ void GLViewer_ObjectTip::showTip() } } +/*! + Restarts timer +*/ void GLViewer_ObjectTip::wakeup( int theTime ) { if( mypTimer->isActive() ) diff --git a/src/GLViewer/GLViewer_ToolTip.h b/src/GLViewer/GLViewer_ToolTip.h index 9dcb71f68..508679b6a 100644 --- a/src/GLViewer/GLViewer_ToolTip.h +++ b/src/GLViewer/GLViewer_ToolTip.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -35,12 +35,10 @@ class GLViewer_ViewPort2d; class QLabel; -/*************************************************************************** -** Class: GLViewer_ObjectTip -** Descr: ToolTip of GLViewer_Objects -** Module: GLViewer -** Created: UI team, 28.03.05 -****************************************************************************/ +/*! + \class GLViewer_ObjectTip + ToolTip of GLViewer_Objects +*/ class GLVIEWER_API GLViewer_ObjectTip: public QObject//QToolTip//QtxToolTip { Q_OBJECT diff --git a/src/GLViewer/GLViewer_Tools.cxx b/src/GLViewer/GLViewer_Tools.cxx index ec7c00920..1f270a253 100644 --- a/src/GLViewer/GLViewer_Tools.cxx +++ b/src/GLViewer/GLViewer_Tools.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -28,12 +28,10 @@ #include -/**************************************************************************** -** Class: GLViewer_LineList -** Descr: Tools for distinct line -** Module: GLViewer -** Created: UI team, 27.10.05 -*****************************************************************************/ +/*! + Constructor + \param size - size of internal array +*/ GLViewer_LineList::GLViewer_LineList( int size ) { myRealSize = 2*size; @@ -51,11 +49,18 @@ GLViewer_LineList::GLViewer_LineList( int size ) memset( myArray, 0, myRealSize*sizeof(double) ); } +/*! + Destructor +*/ GLViewer_LineList::~GLViewer_LineList() { delete myArray; } +/*! + Adds new line segment to list + \param coord1, coord2 - co-ordinates of points +*/ bool GLViewer_LineList::addSegment( double coord1, double coord2 ) { if( coord1 > coord2 ) @@ -157,6 +162,11 @@ bool GLViewer_LineList::addSegment( double coord1, double coord2 ) return true; } +/*! + Gets info about segment + \param theIndex - index of segment + \param coord1, coord2 - co-ordinates of points +*/ bool GLViewer_LineList::readSegment( int theIndex, double& coord1, double& coord2 ) { if( theIndex > mySegmentNumber || !myArray) @@ -168,6 +178,10 @@ bool GLViewer_LineList::readSegment( int theIndex, double& coord1, double& coord return true; } +/*! + \return true if line list covers point + \param thePoint - point co-ordinate +*/ int GLViewer_LineList::contains( double thePoint ) const { if( !myArray || mySegmentNumber == 0 ) @@ -181,6 +195,10 @@ int GLViewer_LineList::contains( double thePoint ) const } +/*! + Removes segment + \param theIndex - segment index +*/ bool GLViewer_LineList::removeSegment( int theIndex ) { if( theIndex > mySegmentNumber || !myArray) @@ -197,6 +215,10 @@ bool GLViewer_LineList::removeSegment( int theIndex ) return true; } +/*! + Removes segment from line list + \param coord1, coord2 - co-ordinates of points +*/ bool GLViewer_LineList::removeSegment( double coord1, double coord2 ) { if( coord1 > coord2 ) @@ -349,12 +371,18 @@ bool GLViewer_LineList::removeSegment( double coord1, double coord2 ) return true; } +/*! + Clears line list +*/ void GLViewer_LineList::clear() { if( myArray ) memset( myArray, 0, myRealSize*sizeof(double) ); } +/*! + Prints debug info about line list +*/ void GLViewer_LineList::print() { std::cout << "MainCoord: " << myMainCoord <<" SIZE: " << myRealSize << " ENum: " << mySegmentNumber << " :::"; @@ -364,6 +392,10 @@ void GLViewer_LineList::print() std::cout << std::endl; } +/*! + Draws line list with help of OpenGL + \param theDim - dimension +*/ void GLViewer_LineList::show( FieldDim theDim ) { if( !myArray ) @@ -392,12 +424,10 @@ void GLViewer_LineList::show( FieldDim theDim ) } } -/**************************************************************************** -** Class: GLViewer_LineField -** Descr: Tools for solving -** Module: GLViewer -** Created: UI team, 27.10.05 -*****************************************************************************/ + +/*! + Constructor +*/ GLViewer_LineField::GLViewer_LineField() { myCurArrayIndex = 0; @@ -411,6 +441,10 @@ GLViewer_LineField::GLViewer_LineField() myXLineArray = NULL; myYLineArray = NULL; } + +/*! + Constructor +*/ GLViewer_LineField::GLViewer_LineField( const int theMAXSize, const int theXN, const int theYN ) { myCurArrayIndex = 0; @@ -442,6 +476,9 @@ GLViewer_LineField::GLViewer_LineField( const int theMAXSize, const int theXN, c } } +/*! + Destructor +*/ GLViewer_LineField::~GLViewer_LineField() { if( myXLineArray ) @@ -467,11 +504,21 @@ GLViewer_LineField::~GLViewer_LineField() delete myGraphArray2; } +/*! + Adds line +*/ void GLViewer_LineField::addLine( FieldDim theDim, GLViewer_LineList* ) { //not implemented } +/*! + Adds line + \param theDim - dimension + \param theMC - main co-ordinate + \param theBegin - start co-ordinate + \param theEnd - end co-ordinate +*/ void GLViewer_LineField:: addLine( FieldDim theDim, double theMC, double theBegin, double theEnd ) { GLViewer_LineList* aLL = new GLViewer_LineList( 1 ); @@ -480,7 +527,12 @@ void GLViewer_LineField:: addLine( FieldDim theDim, double theMC, double theBegi addLine( theDim, aLL ); } - +/*! + Adds line + \param theDim - dimension + \param theLL - main co-ordinate + \param thePosition - index in list +*/ int GLViewer_LineField::insertLine( FieldDim theDim, GLViewer_LineList* theLL, int thePosition ) { if( !myXLineArray || !myYLineArray ) @@ -532,6 +584,14 @@ int GLViewer_LineField::insertLine( FieldDim theDim, GLViewer_LineList* theLL, i return -1; } +/*! + Adds line + \param theDim - dimension + \param theMainCoord - main co-ordinate + \param theBegin - start co-ordinate + \param theEnd - end co-ordinate + \param thePosition - index in list +*/ int GLViewer_LineField::insertLine( FieldDim theDim, double theMainCoord, double theBegin, double theEnd, int thePosition ) { GLViewer_LineList* aLL = new GLViewer_LineList( 1 ); @@ -540,7 +600,9 @@ int GLViewer_LineField::insertLine( FieldDim theDim, double theMainCoord, double return insertLine( theDim, aLL, thePosition ); } - +/*! + \return other dimension +*/ FieldDim GLViewer_LineField::invertDim( FieldDim theFD ) { if( theFD == FD_X ) @@ -549,6 +611,11 @@ FieldDim GLViewer_LineField::invertDim( FieldDim theFD ) return FD_X; } +/*! + \return line list + \param theIndex - index in list + \param tehFD - dimension +*/ GLViewer_LineList* GLViewer_LineField::getLine( int theIndex, FieldDim theFD ) { if( !myXLineArray || !myYLineArray ) @@ -572,6 +639,11 @@ GLViewer_LineList* GLViewer_LineField::getLine( int theIndex, FieldDim theFD ) return NULL; } +/*! + Sets borders of field + \param X1, X2 - minimal and maximal abscisses + \param Y1, Y2 - minimal and maximal ordinates +*/ void GLViewer_LineField::setBorders( double X1, double X2, double Y1, double Y2 ) { if( !myXLineArray || !myYLineArray ) @@ -592,6 +664,11 @@ void GLViewer_LineField::setBorders( double X1, double X2, double Y1, double Y2 } } +/*! + Adds rectangle + \param top, right - a corner of rectangle + \param bottom, left - other corner of rectangle +*/ void GLViewer_LineField::addRectangle( double top, double right, double bottom, double left ) { if( !myXLineArray || !myYLineArray ) @@ -611,6 +688,9 @@ void GLViewer_LineField::addRectangle( double top, double right, double bottom, } } +/*! + Prints debug info about line field +*/ void GLViewer_LineField::print() { std::cout << "My X matrix Number: " << myXSize << std::endl; @@ -622,6 +702,9 @@ void GLViewer_LineField::print() myYLineArray[j]->print(); } +/*! + Draws field with help of OpenGL +*/ void GLViewer_LineField::show() { for( int i = 0; i < myXSize; i++ ) @@ -643,6 +726,10 @@ void GLViewer_LineField::show() std::cout << "Show function" << std::endl; } +/*! + \return size + \param theDim - dimension +*/ int GLViewer_LineField::getDimSize( FieldDim theDim ) { if( theDim == FD_X ) @@ -653,6 +740,13 @@ int GLViewer_LineField::getDimSize( FieldDim theDim ) return -1; } +/*! + \return array of intersected indexes + \param theDim - dimension + \param theIndex - index + \param theLL - line with that intersection is checked + \param theSize - to return value of array size +*/ int* GLViewer_LineField::intersectIndexes( FieldDim theDim, int theIndex, const GLViewer_LineList* theLL, int& theSize ) { theSize = 0; @@ -677,7 +771,11 @@ int* GLViewer_LineField::intersectIndexes( FieldDim theDim, int theIndex, const return anArray; } - +/*! + Sets start/end search point + \param thePoint - type of point (start: FP_Start; end: FP_End ) + \param theX, theY - point co-ordinates +*/ bool GLViewer_LineField::setPoint( FieldPoint thePoint, double theX, double theY ) { if( !myXLineArray || !myYLineArray ) @@ -729,6 +827,9 @@ bool GLViewer_LineField::setPoint( FieldPoint thePoint, double theX, double theY return false; } +/*! + \return number of segments +*/ int GLViewer_LineField::segmentNumber() { if( !(myXLineArray || myYLineArray) ) @@ -742,6 +843,9 @@ int GLViewer_LineField::segmentNumber() return aNumber; } +/*! + Removes all multiple segments +*/ void GLViewer_LineField::optimize() { if( !myXLineArray || !myYLineArray ) @@ -789,6 +893,10 @@ void GLViewer_LineField::optimize() } } +/*! + Some prepare actions + Needs call setPoint before +*/ void GLViewer_LineField::initialize() { if( !myXLineArray || !myYLineArray ) @@ -842,6 +950,9 @@ void GLViewer_LineField::initialize() } } +/*! + One iteration of algorithm +*/ void GLViewer_LineField::iteration() { int aParam = myCurCount; @@ -873,6 +984,9 @@ void GLViewer_LineField::iteration() delete[] aNodes; } +/*! + Checks for complete status +*/ GLViewer_LineField::IterationStatus GLViewer_LineField::checkComplete() { if( !myXLineArray || !myYLineArray || !myGraphArray1 || !myGraphArray2 ) @@ -923,6 +1037,9 @@ GLViewer_LineField::IterationStatus GLViewer_LineField::checkComplete() return IS_NOT_SOLVED; } +/*! + Finds LineList by counts and returns indexes +*/ int* GLViewer_LineField::findByCount( int& theParam ) { if( !myXLineArray || !myYLineArray || !myGraphArray1 || !myGraphArray2 ) @@ -947,6 +1064,9 @@ int* GLViewer_LineField::findByCount( int& theParam ) return anArray; } +/*! + Finds LineList by segment and dimension +*/ int GLViewer_LineField::findBySegment( FieldDim theDim, int theLineIndex, int theSegment, bool inCurArray ) { if( !myXLineArray || !myYLineArray || !myGraphArray1 || !myGraphArray2 || getDimSize( theDim ) <= theLineIndex ) @@ -968,6 +1088,9 @@ int GLViewer_LineField::findBySegment( FieldDim theDim, int theLineIndex, int th return -1; } +/*! + Main method, performs algorithm execution +*/ GLViewer_LineField::EndStatus GLViewer_LineField::startAlgorithm() { if( !myXLineArray || !myYLineArray || !myGraphArray1 || !myGraphArray2 ) @@ -989,6 +1112,9 @@ GLViewer_LineField::EndStatus GLViewer_LineField::startAlgorithm() return ES_SOLVED; } +/*! + \return solution and size of solution +*/ double* GLViewer_LineField::solution( int& theSize ) { if( !myXLineArray || !myYLineArray || !myGraphArray1 || !myGraphArray2 ) @@ -1032,6 +1158,9 @@ double* GLViewer_LineField::solution( int& theSize ) return anArray; } +/*! + \return current solution array +*/ GraphNode* GLViewer_LineField::getCurArray() { if( !myGraphArray1 || !myGraphArray2 ) @@ -1043,6 +1172,9 @@ GraphNode* GLViewer_LineField::getCurArray() return myGraphArray2; } +/*! + \return other solution array +*/ GraphNode* GLViewer_LineField::getSecArray() { if( !myGraphArray1 || !myGraphArray2 ) @@ -1054,6 +1186,9 @@ GraphNode* GLViewer_LineField::getSecArray() return myGraphArray1; } +/*! + \return maximum segment number +*/ int GLViewer_LineField::maxSegmentNum() { if( !myXLineArray || !myYLineArray ) @@ -1073,6 +1208,10 @@ int GLViewer_LineField::maxSegmentNum() return max_num; } +/*! + \return list of LileList by dimension + \param theDim - dimension +*/ GLViewer_LineList** GLViewer_LineField::getLLArray( FieldDim theDim ) { if( theDim == FD_X ) diff --git a/src/GLViewer/GLViewer_Tools.h b/src/GLViewer/GLViewer_Tools.h index 3acdd879b..b9add1f19 100644 --- a/src/GLViewer/GLViewer_Tools.h +++ b/src/GLViewer/GLViewer_Tools.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -34,12 +34,10 @@ class GLViewer_LineField; -/**************************************************************************** -** Class: GLViewer_Tools -** Descr: Tools for Viewer -** Module: GLViewer -** Created: UI team, 27.10.05 -*****************************************************************************/ +/*! + \class GLViewer_Tools + Tools for Viewer +*/ class GLVIEWER_API GLViewer_Tools { public: @@ -57,7 +55,7 @@ enum FieldDim }; /*! - Class GLViewer_LineList + \class GLViewer_LineList Tools for distinct line This class implmented interface for segment operations: add, cut, remove and etc. @@ -122,9 +120,10 @@ struct SearchPoint int mySolveIndex; }; -/*! Class GLViewer_LineField -* Tools for solving algorithm of finding shortest path on rare grid with minimum of -* line turns number +/*! + \class GLViewer_LineField + Tools for solving algorithm of finding shortest path on rare grid with minimum of + line turns number */ class GLViewer_LineField { @@ -212,9 +211,9 @@ protected: //! Checks for complete status IterationStatus checkComplete(); - //! Finds LileList by counts and returns indexes + //! Finds LineList by counts and returns indexes int* findByCount( int& theParam ); - //! Finds LileList by segment and dimension + //! Finds LineList by segment and dimension int findBySegment( FieldDim, int coord1, int coord2, bool inCurArray = true ); //! Returns current solution array diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 6600bb35f..d89922d48 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,13 +22,6 @@ // File: GLViewer_ViewFrame.cxx // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_ViewFrame -** Descr: Frame window for viewport in QAD-based application -** Module: QAD -** Created: UI team, 05.09.00 -****************************************************************************/ - //#include #include "GLViewer_ViewFrame.h" #include "GLViewer_Viewer.h" @@ -82,10 +75,9 @@ GLViewer_ViewFrame::~GLViewer_ViewFrame() { } -//================================================================ -// Function : createActions -// Purpose : -//================================================================ +/*! + Creates actions of GL view frame +*/ void GLViewer_ViewFrame::createActions() { if (!myActionsMap.isEmpty()) return; @@ -148,10 +140,9 @@ void GLViewer_ViewFrame::createActions() myActionsMap[ ResetId ] = aAction; } -//================================================================ -// Function : createToolBar -// Purpose : -//================================================================ +/*! + Creates toolbar of GL view frame +*/ void GLViewer_ViewFrame::createToolBar() { myActionsMap[DumpId]->addTo(myToolBar); @@ -248,7 +239,7 @@ QSize GLViewer_ViewFrame::sizeHint() const { QWidget* p = parentWidget(); if ( p && p->inherits( "QWorkspaceChild" ) ) - p = p->parentWidget(); /* QWorkspaceChild: internal impl class in QWorkspace */ + p = p->parentWidget(); if ( !p ) return QMainWindow::sizeHint(); return QSize( 9 * p->width() / 10 , 9 * p->height() / 10 ); @@ -263,6 +254,9 @@ void GLViewer_ViewFrame::onUpdate( int ) //#include +/*! + SLOT: called on dump view operation is activated, stores scene to raster file +*/ void GLViewer_ViewFrame::onViewDump() { GLViewer_Widget* aWidget = ((GLViewer_ViewPort2d*)myVP)->getGLWidget(); @@ -448,50 +442,73 @@ void GLViewer_ViewFrame::onViewDump() } } +/*! + Start panning +*/ void GLViewer_ViewFrame::onViewPan() { myViewer->activateTransform( GLViewer_Viewer::Pan ); } +/*! + Start zooming +*/ void GLViewer_ViewFrame::onViewZoom() { myViewer->activateTransform( GLViewer_Viewer::Zoom ); } +/*! + Start fit all +*/ void GLViewer_ViewFrame::onViewFitAll() { myViewer->activateTransform( GLViewer_Viewer::FitAll ); } +/*! + Start fit area +*/ void GLViewer_ViewFrame::onViewFitArea() { myViewer->activateTransform( GLViewer_Viewer::FitRect ); } +/*! + Start fit selected +*/ void GLViewer_ViewFrame::onViewFitSelect() { myViewer->activateTransform( GLViewer_Viewer::FitSelect ); } +/*! + Start global panning +*/ void GLViewer_ViewFrame::onViewGlobalPan() { myViewer->activateTransform( GLViewer_Viewer::PanGlobal ); } +/*! + Start rotating +*/ void GLViewer_ViewFrame::onViewRotate() { //myViewer->activateTransform( GLViewer_Viewer::Rotate ); } +/*! + Start reset default view aspects +*/ void GLViewer_ViewFrame::onViewReset() { myViewer->activateTransform( GLViewer_Viewer::Reset ); } - -//================================================================ -// Function : mouseEvent -// Purpose : dispatches mouse events -//================================================================ + +/*! + Dispatches mouse events +*/ void GLViewer_ViewFrame::mouseEvent( QMouseEvent* e ) { switch ( e->type() ) @@ -513,10 +530,9 @@ void GLViewer_ViewFrame::mouseEvent( QMouseEvent* e ) } } -//================================================================ -// Function : keyEvent -// Purpose : dispatches key events -//================================================================ +/*! + Dispatches key events +*/ void GLViewer_ViewFrame::keyEvent( QKeyEvent* e ) { switch ( e->type() ) @@ -532,10 +548,9 @@ void GLViewer_ViewFrame::keyEvent( QKeyEvent* e ) } } -//================================================================ -// Function : wheelEvent -// Purpose : dispatches wheel events -//================================================================ +/*! + Dispatches wheel events +*/ void GLViewer_ViewFrame::wheelEvent( QWheelEvent* e ) { switch ( e->type() ) @@ -547,3 +562,39 @@ void GLViewer_ViewFrame::wheelEvent( QWheelEvent* e ) break; } } + +/*! + \return the visual parameters of this view as a formated string +*/ +QString GLViewer_ViewFrame::getVisualParameters() +{ + QString retStr; + if ( myVP && myVP->inherits( "GLViewer_ViewPort2d" ) ) { + GLViewer_ViewPort2d* vp2d = (GLViewer_ViewPort2d*)myVP; + GLfloat xSc, ySc, xPan, yPan; + vp2d->getScale( xSc, ySc ); + vp2d->getPan( xPan, yPan ); + retStr.sprintf( "%.12e*%.12e*%.12e*%.12e", xSc, ySc, xPan, yPan ); + } + return retStr; +} + +/*! + The method restores visual parameters of this view from a formated string +*/ +void GLViewer_ViewFrame::setVisualParameters( const QString& parameters ) +{ + QStringList paramsLst = QStringList::split( '*', parameters, true ); + if ( myVP && myVP->inherits( "GLViewer_ViewPort2d" ) && paramsLst.size() == 4) { + GLViewer_ViewPort2d* vp2d = (GLViewer_ViewPort2d*)myVP; + + GLfloat xSc, ySc, xPan, yPan; + xSc = paramsLst[0].toDouble(); + ySc = paramsLst[1].toDouble(); + xPan = paramsLst[2].toDouble(); + yPan = paramsLst[3].toDouble(); + + vp2d->getGLWidget()->setScale( xSc, ySc, 1. ); + vp2d->getGLWidget()->setPan( xPan, yPan, 0. ); + } +} diff --git a/src/GLViewer/GLViewer_ViewFrame.h b/src/GLViewer/GLViewer_ViewFrame.h index d90dfd3f5..76b9fe55b 100644 --- a/src/GLViewer/GLViewer_ViewFrame.h +++ b/src/GLViewer/GLViewer_ViewFrame.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,12 +22,6 @@ // File: GLViewer_ViewFrame.h // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_ViewFrame -** Descr: Frame window for viewport in QAD-based application -** Module: QAD -** Created: UI team, 05.09.00 -****************************************************************************/ #ifndef GLVIEWER_VIEWFRAME_H #define GLVIEWER_VIEWFRAME_H @@ -47,8 +41,9 @@ class GLViewer_ViewPort; #pragma warning( disable:4251 ) #endif -/*! Class GLViewer_ViewFrame -* Frame window for viewport in GLViewer +/*! + \class GLViewer_ViewFrame + Frame window for viewport in QAD-based application */ class GLVIEWER_API GLViewer_ViewFrame: public SUIT_ViewWindow @@ -72,6 +67,9 @@ public: QSize sizeHint() const; virtual void onUpdate( int ); + + virtual QString getVisualParameters(); + virtual void setVisualParameters( const QString& parameters ); signals: void vfDrawExternal( QPainter* ); diff --git a/src/GLViewer/GLViewer_ViewManager.cxx b/src/GLViewer/GLViewer_ViewManager.cxx index 91150147a..b9cbff5ae 100644 --- a/src/GLViewer/GLViewer_ViewManager.cxx +++ b/src/GLViewer/GLViewer_ViewManager.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -30,7 +30,7 @@ int GLViewer_ViewManager::myMaxId = 0; -//*************************************************************** +/*!Constructor.*/ GLViewer_ViewManager::GLViewer_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop ) : SUIT_ViewManager( theStudy, theDesktop ) { @@ -38,19 +38,19 @@ GLViewer_ViewManager::GLViewer_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* setViewModel( new GLViewer_Viewer2d( "GLViewer" ) ); } -//*************************************************************** +/*!Destructor.*/ GLViewer_ViewManager::~GLViewer_ViewManager() { } -//*************************************************************** +/*!Sets view name for view window \a theView.*/ void GLViewer_ViewManager::setViewName(SUIT_ViewWindow* theView) { int aPos = myViews.find(theView); theView->setCaption( QString( "GL scene:%1 - viewer:%2" ).arg(myId).arg(aPos+1)); } -//*************************************************************** +/*!Context menu popup for \a popup.*/ void GLViewer_ViewManager::contextMenuPopup( QPopupMenu* popup ) { SUIT_ViewManager::contextMenuPopup( popup ); diff --git a/src/GLViewer/GLViewer_ViewManager.h b/src/GLViewer/GLViewer_ViewManager.h index 82038d8d6..cfc25f1f9 100644 --- a/src/GLViewer/GLViewer_ViewManager.h +++ b/src/GLViewer/GLViewer_ViewManager.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // diff --git a/src/GLViewer/GLViewer_ViewPort.cxx b/src/GLViewer/GLViewer_ViewPort.cxx index 78767afa1..07de20242 100644 --- a/src/GLViewer/GLViewer_ViewPort.cxx +++ b/src/GLViewer/GLViewer_ViewPort.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,13 +22,6 @@ // File: GLViewer_ViewPort.cxx // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_ViewPort -** Descr: Visualisation canvas of QAD-based application -** Module: QAD -** Created: UI team, 05.09.00 -****************************************************************************/ - //#include #if !(defined WNT) && !(defined QT_CLEAN_NAMESPACE) @@ -60,6 +53,11 @@ #include #include +/*! + \struct CMapEntry + Map of indexed colors + For internal purposes +*/ struct CMapEntry { CMapEntry(); @@ -69,6 +67,9 @@ struct CMapEntry XStandardColormap scmap; }; +/*! + Constructor +*/ CMapEntry::CMapEntry() { cmap = 0; @@ -76,6 +77,9 @@ CMapEntry::CMapEntry() scmap.colormap = 0; } +/*! + Destructor +*/ CMapEntry::~CMapEntry() { if ( alloc ) @@ -587,6 +591,9 @@ void GLViewer_ViewPort::onChangeBgColor() setBackgroundColor( selColor ); } +/*! + Custom context menu event handler +*/ void GLViewer_ViewPort::contextMenuEvent( QContextMenuEvent* e ) { //if ( e->reason() != QContextMenuEvent::Mouse ) diff --git a/src/GLViewer/GLViewer_ViewPort.h b/src/GLViewer/GLViewer_ViewPort.h index 02ef4edaf..b7ceaf2dc 100644 --- a/src/GLViewer/GLViewer_ViewPort.h +++ b/src/GLViewer/GLViewer_ViewPort.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,11 +22,6 @@ // File: GLViewer_ViewPort.h // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_ViewPort -** Descr: Visualisation canvas of GLViewer -** Created: UI team, 05.09.04 -****************************************************************************/ #ifndef GLVIEWER_VIEWPORT_H #define GLVIEWER_VIEWPORT_H @@ -57,10 +52,10 @@ enum BlockStatus BS_Dragging = 0x0004 }; -/*! - * Class GLViewer_ViewPort - * Visualisation canvas of GLViewer - */ +/*! + \class GLViewer_ViewPort + Visualisation canvas of GLViewer +*/ class GLVIEWER_API GLViewer_ViewPort: public QWidget { Q_OBJECT diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index b44efbc32..3055726ec 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -63,6 +63,9 @@ void rotate_point( float& theX, float& theY, float theAngle ) theY = aTempY; } +/*! + Constructor +*/ GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* theViewFrame ) : GLViewer_ViewPort( parent ), myMargin( MARGIN ), myWidth( WIDTH ), myHeight( HEIGHT ), @@ -105,6 +108,9 @@ GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* t // myGLWidget->installEventFilter( myObjectTip ); } +/*! + Destructor +*/ GLViewer_ViewPort2d::~GLViewer_ViewPort2d() { if( myCompass ) @@ -117,6 +123,9 @@ GLViewer_ViewPort2d::~GLViewer_ViewPort2d() delete myGLWidget; } +/*! + SLOT: initializes drag process +*/ void GLViewer_ViewPort2d::onStartDragObject( ) { if( myIsDragProcess == noDrag ) @@ -132,6 +141,9 @@ void GLViewer_ViewPort2d::onStartDragObject( ) } } +/*! + SLOT: cuts object to clipboard +*/ void GLViewer_ViewPort2d::onCutObject() { /*GLViewer_Object* aMovingObject = ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext()->getCurrentObject(); @@ -167,6 +179,9 @@ void GLViewer_ViewPort2d::onCutObject() } } +/*! + SLOT: copies object to clipboard +*/ void GLViewer_ViewPort2d::onCopyObject() { /*GLViewer_Object* aMovingObject = ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext()->getCurrentObject(); @@ -198,6 +213,9 @@ void GLViewer_ViewPort2d::onCopyObject() } } +/*! + SLOT: pastes object from clipboard +*/ void GLViewer_ViewPort2d::onPasteObject() { /*QClipboard *aClipboard = QApplication::clipboard(); @@ -243,6 +261,9 @@ void GLViewer_ViewPort2d::onPasteObject() */ } +/*! + SLOT: called when object is being dragged +*/ void GLViewer_ViewPort2d::onDragObject( QMouseEvent* e ) { //cout << "---GLViewer_ViewPort2d::onDragObject()---" << endl; @@ -401,6 +422,9 @@ void GLViewer_ViewPort2d::mouseReleaseEvent( QMouseEvent* e ) } } +/*! + Custom mouse double click event handler +*/ void GLViewer_ViewPort2d::mouseDoubleClickEvent( QMouseEvent * e ) { //redefined to block mouse release after mouse double click @@ -409,6 +433,10 @@ void GLViewer_ViewPort2d::mouseDoubleClickEvent( QMouseEvent * e ) GLViewer_ViewPort::mouseDoubleClickEvent( e ); } +/*! + Creates or deletes compass + \param on - if it is true, then to create +*/ void GLViewer_ViewPort2d::turnCompass( GLboolean on ) { if( on ) @@ -417,6 +445,10 @@ void GLViewer_ViewPort2d::turnCompass( GLboolean on ) delete myCompass; } +/*! + Creates or deletes grid + \param on - if it is true, then to create +*/ void GLViewer_ViewPort2d::turnGrid( GLboolean on ) { if( on ) @@ -431,6 +463,11 @@ void GLViewer_ViewPort2d::turnGrid( GLboolean on ) delete myGrid; } +/*! + Changes grid color + \param gridColor - new grid color + \param axisColor - new axis color +*/ void GLViewer_ViewPort2d::setGridColor( const QColor gridColor, const QColor axisColor ) { if( myGrid ) @@ -444,6 +481,10 @@ void GLViewer_ViewPort2d::setGridColor( const QColor gridColor, const QColor axi } } +/*! + Changes background color + \param color - new background color +*/ void GLViewer_ViewPort2d::setBackgroundColor( const QColor& color ) { GLViewer_ViewPort::setBackgroundColor( color ); @@ -454,11 +495,17 @@ void GLViewer_ViewPort2d::setBackgroundColor( const QColor& color ) myGLWidget->repaint(); } +/*! + \return background color +*/ QColor GLViewer_ViewPort2d::backgroundColor() const { return GLViewer_ViewPort::backgroundColor(); } +/*! + Resize view +*/ void GLViewer_ViewPort2d::initResize( int x, int y ) { float xa, xb, ya, yb; @@ -509,6 +556,9 @@ void GLViewer_ViewPort2d::initResize( int x, int y ) myGLWidget->setScale( myXScale, myYScale, 1.0 ); } +/*! + Custom paint event handler +*/ void GLViewer_ViewPort2d::paintEvent( QPaintEvent* e ) { //cout << "GLViewer_ViewPort2d::paintEvent" << endl; @@ -516,12 +566,18 @@ void GLViewer_ViewPort2d::paintEvent( QPaintEvent* e ) GLViewer_ViewPort::paintEvent( e ); } +/*! + Custom resize event handler +*/ void GLViewer_ViewPort2d::resizeEvent( QResizeEvent* e ) { //cout << "GLViewer_ViewPort2d::resizeEvent" << endl; GLViewer_ViewPort::resizeEvent( e ); } +/*! + Resets view to start state +*/ void GLViewer_ViewPort2d::reset() { //cout << "GLViewer_ViewPort2d::reset" << endl; @@ -557,6 +613,11 @@ void GLViewer_ViewPort2d::reset() myGLWidget->updateGL(); } +/*! + Sets offset to view + \param dx - X offset + \param dy - Y offset +*/ void GLViewer_ViewPort2d::pan( int dx, int dy ) { //cout << "GLViewer_ViewPort2d::pan " << dx << " " << dy << endl; @@ -588,6 +649,10 @@ void GLViewer_ViewPort2d::pan( int dx, int dy ) myGLWidget->updateGL(); } +/*! + Sets view center in global coords + \param x, y - global co-ordinates of center +*/ void GLViewer_ViewPort2d::setCenter( int x, int y ) { //cout << "GLViewer_ViewPort2d::setCenter" << endl; @@ -617,6 +682,9 @@ void GLViewer_ViewPort2d::setCenter( int x, int y ) myGLWidget->updateGL(); } +/*! + Process zoming transformation with mouse tracking from ( x0, y0 ) to ( x1, y1 ) +*/ void GLViewer_ViewPort2d::zoom( int x0, int y0, int x, int y ) { //cout << "GLViewer_ViewPort2d::zoom" << endl; @@ -659,6 +727,10 @@ void GLViewer_ViewPort2d::zoom( int x0, int y0, int x, int y ) } } +/*! + Transforms view by rectangle + \param rect - rectangle +*/ void GLViewer_ViewPort2d::fitRect( const QRect& rect ) { float x0, x1, y0, y1; @@ -711,6 +783,9 @@ void GLViewer_ViewPort2d::fitRect( const QRect& rect ) myGLWidget->updateGL(); } +/*! + Transforms view by selection +*/ void GLViewer_ViewPort2d::fitSelect() { GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer(); @@ -732,6 +807,10 @@ void GLViewer_ViewPort2d::fitSelect() } } +/*! + Transform view by view borders + \param keepScale - if it is true, zoom does not change +*/ void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ ) { //cout << "GLViewer_ViewPort2d::fitAll" << endl; @@ -820,11 +899,19 @@ void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ ) emit vpUpdateValues(); } +/*! + Begins rotation + \param x, y - start point +*/ void GLViewer_ViewPort2d::startRotation( int x, int y ) { myGLWidget->setRotationStart( x, y, 1.0 ); } +/*! + Performs rotation + \param intX, intY - current point +*/ void GLViewer_ViewPort2d::rotate( int intX, int intY ) { GLint val[4]; @@ -871,6 +958,9 @@ void GLViewer_ViewPort2d::rotate( int intX, int intY ) myGLWidget->updateGL(); } +/*! + Finishes rotation +*/ void GLViewer_ViewPort2d::endRotation() { float ra, rx, ry, rz; @@ -878,6 +968,9 @@ void GLViewer_ViewPort2d::endRotation() myGLWidget->setRotationAngle( ra ); } +/*! + Draws compass +*/ void GLViewer_ViewPort2d::drawCompass() { if( !myCompass->getVisible() ) @@ -1038,6 +1131,9 @@ void GLViewer_ViewPort2d::drawCompass() glCallList( aTextList ); } +/*! + \return blocking status for current started operations +*/ BlockStatus GLViewer_ViewPort2d::currentBlock() { if( myIsDragProcess == inDrag && myCurDragPosX != NULL && myCurDragPosY != NULL) @@ -1049,6 +1145,10 @@ BlockStatus GLViewer_ViewPort2d::currentBlock() return BS_NoBlock; } +/*! + Initializes rectangle selection + \param x, y - start point +*/ void GLViewer_ViewPort2d::startSelectByRect( int x, int y ) { if( !mypFirstPoint && !mypLastPoint ) @@ -1057,6 +1157,11 @@ void GLViewer_ViewPort2d::startSelectByRect( int x, int y ) mypLastPoint = new QPoint( x, y ); } } + +/*! + Draws rectangle selection + \param x, y - current point +*/ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y ) { if( mypFirstPoint && mypLastPoint ) @@ -1075,6 +1180,10 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y ) } } + +/*! + Finishes rectangle selection +*/ void GLViewer_ViewPort2d::finishSelectByRect() { if( mypFirstPoint && mypLastPoint ) @@ -1094,6 +1203,9 @@ void GLViewer_ViewPort2d::finishSelectByRect() } } +/*! + \return rectangle selection +*/ QRect GLViewer_ViewPort2d::selectionRect() { QRect aRect; @@ -1108,6 +1220,8 @@ QRect GLViewer_ViewPort2d::selectionRect() return aRect; } +/*! +*/ bool GLViewer_ViewPort2d::startPulling( GLViewer_Pnt point ) { GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer(); @@ -1131,6 +1245,8 @@ bool GLViewer_ViewPort2d::startPulling( GLViewer_Pnt point ) return false; } +/*! +*/ void GLViewer_ViewPort2d::drawPulling( GLViewer_Pnt point ) { GLViewer_Viewer2d* aViewer = (GLViewer_Viewer2d*)getViewFrame()->getViewer(); @@ -1156,6 +1272,8 @@ void GLViewer_ViewPort2d::drawPulling( GLViewer_Pnt point ) myPullingObject->pull( point, aLockedObject ); } +/*! +*/ void GLViewer_ViewPort2d::finishPulling() { myIsPulling = false; @@ -1163,6 +1281,10 @@ void GLViewer_ViewPort2d::finishPulling() setCursor( *getDefaultCursor() ); } +/*! + Convert rectangle in window co-ordinates to GL co-ordinates + \return converted rectangle +*/ GLViewer_Rect GLViewer_ViewPort2d::win2GLV( const QRect& theRect ) const { GLViewer_Rect aRect; @@ -1189,6 +1311,10 @@ GLViewer_Rect GLViewer_ViewPort2d::win2GLV( const QRect& theRect ) const return aRect; } +/*! + Convert rectangle in GL co-ordinates to window co-ordinates + \return converted rectangle +*/ QRect GLViewer_ViewPort2d::GLV2win( const GLViewer_Rect& theRect ) const { QRect aRect; @@ -1215,6 +1341,9 @@ QRect GLViewer_ViewPort2d::GLV2win( const GLViewer_Rect& theRect ) const return aRect; } +/*! + SLOT: called when tooltip should be shown +*/ void GLViewer_ViewPort2d::onMaybeTip( QPoint thePoint, QString& theText, QFont& theFont, QRect& theTextReg, QRect& theRegion ) { GLViewer_Context* aContext = ((GLViewer_Viewer2d*)getViewFrame()->getViewer())->getGLContext(); diff --git a/src/GLViewer/GLViewer_ViewPort2d.h b/src/GLViewer/GLViewer_ViewPort2d.h index 128cdbe06..76b59b6d4 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.h +++ b/src/GLViewer/GLViewer_ViewPort2d.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -178,7 +178,7 @@ protected: virtual void setCenter( int x, int y ); //! Process zoming transformation with mouse tracking from ( x0, y0 ) to ( x1, y1 ) virtual void zoom( int x0, int y0, int x1, int y1 ); - //! Transforms view by certangle + //! Transforms view by rectangle virtual void fitRect( const QRect& ); //! Transforms view by selection virtual void fitSelect(); diff --git a/src/GLViewer/GLViewer_Viewer.cxx b/src/GLViewer/GLViewer_Viewer.cxx index 9ca9ed73e..3363add16 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,13 +22,6 @@ // File: GLViewer_Viewer.cxx // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_Viewer -** Descr: Viewer for QAD-based application -** Module: QAD -** Created: UI team, 05.09.00 -****************************************************************************/ - //#include #include "GLViewer_Viewer.h" #include "GLViewer_Selector.h" @@ -66,10 +59,10 @@ GLViewer_Viewer::~GLViewer_Viewer() delete mySelector; } -//================================================================ -// Function : setViewManager -// Purpose : -//================================================================ +/*! + Sets new view manager + \param theViewManager - new view manager +*/ void GLViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) { SUIT_ViewModel::setViewManager(theViewManager); @@ -89,10 +82,9 @@ void GLViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) } } -//================================================================ -// Function : contextMenuPopup -// Purpose : -//================================================================ +/*! + Builds popup for GL viewer +*/ void GLViewer_Viewer::contextMenuPopup( QPopupMenu* thePopup ) { if( thePopup->count() > 0 ) @@ -530,10 +522,6 @@ void GLViewer_Viewer::handleWheel( QWheelEvent* e ) startOperations( e ); } -/**************************************************************** -** Class: GLViewer_ViewTransformer -** Level: Public -*****************************************************************/ int GLViewer_ViewTransformer::panBtn = Qt::MidButton; int GLViewer_ViewTransformer::zoomBtn = Qt::LeftButton; int GLViewer_ViewTransformer::fitRectBtn = Qt::LeftButton; @@ -758,10 +746,6 @@ int GLViewer_ViewTransformer::type() const } -/**************************************************************** -** Class: GLViewer_ViewSketcher -** Level: Public -*****************************************************************/ int GLViewer_ViewSketcher::sketchBtn = LeftButton; /*! diff --git a/src/GLViewer/GLViewer_Viewer.h b/src/GLViewer/GLViewer_Viewer.h index dfd16c2fa..0d68a450d 100644 --- a/src/GLViewer/GLViewer_Viewer.h +++ b/src/GLViewer/GLViewer_Viewer.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -46,9 +46,9 @@ class SUIT_ViewWindow; #endif /*! - * Class GLViewer_Object - * Base Viewer for GLViewer - */ + \class GLViewer_Object + Base Viewer for GLViewer +*/ class GLVIEWER_API GLViewer_Viewer: public SUIT_ViewModel { Q_OBJECT @@ -128,10 +128,6 @@ protected: GLViewer_ViewTransformer* myTransformer; /* transform manipulator */ }; -/**************************************************************** -** Class: GLViewer_ViewTransformer -** -*****************************************************************/ class GLVIEWER_API GLViewer_ViewTransformer : public QObject { public: @@ -188,10 +184,6 @@ protected: int myMajorBtn; }; -/**************************************************************** -** Class: GLViewer_ViewSketcher -** -*****************************************************************/ class GLVIEWER_API GLViewer_ViewSketcher : public QObject { public: diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index f98f5e2ae..7d03218ba 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,13 +22,6 @@ // File: GLViewer_Viewer2d.cxx // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_Viewer2d -** Descr: OpenGL Viewer 2D -** Module: GLViewer -** Created: UI team, 04.09.02 -****************************************************************************/ - //#include #include "GLViewer_Viewer2d.h" #include "GLViewer_Object.h" @@ -50,6 +43,10 @@ #include #include +/*! + Constructor + \param title - viewer title +*/ GLViewer_Viewer2d::GLViewer_Viewer2d( const QString& title) : GLViewer_Viewer( title ) { @@ -64,6 +61,9 @@ GLViewer_Viewer( title ) myDrawers.clear(); } +/*! + Destructor +*/ GLViewer_Viewer2d::~GLViewer_Viewer2d() { //myGLSketcher = 0; @@ -71,11 +71,18 @@ GLViewer_Viewer2d::~GLViewer_Viewer2d() GLViewer_TexFont::clearTextBases(); } +/*!Create new instance of view window on desktop \a theDesktop. + *\retval SUIT_ViewWindow* - created view window pointer. + */ SUIT_ViewWindow* GLViewer_Viewer2d::createView( SUIT_Desktop* theDesktop ) { return new GLViewer_ViewFrame( theDesktop, this ); } +/*! + Adds item for change background color + \param thePopup - menu +*/ void GLViewer_Viewer2d::addPopupItems( QPopupMenu* thePopup ) { // CTH8434. "Change background color" menu item is available if there are no selected objects @@ -87,6 +94,9 @@ void GLViewer_Viewer2d::addPopupItems( QPopupMenu* thePopup ) } } +/*! + Changes background color +*/ void GLViewer_Viewer2d::onChangeBgColor() { if( !getActiveView() ) @@ -99,6 +109,9 @@ void GLViewer_Viewer2d::onChangeBgColor() } } +/*! + Updates colors for all drawers (does not work) +*/ void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS ) { // cout << "GLViewer_Viewer2d::updateColors" << endl; @@ -126,6 +139,10 @@ void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS ) activateAllDrawers( TRUE ); } +/*! + Updates rect of global scene by adding new rectangle + \param theRect - rectangle +*/ void GLViewer_Viewer2d::updateBorders( GLViewer_Rect* theRect ) { QPtrVector views = getViewManager()->getViews(); @@ -140,6 +157,9 @@ void GLViewer_Viewer2d::updateBorders( GLViewer_Rect* theRect ) } } +/*! + Recomputes global scene rect +*/ void GLViewer_Viewer2d::updateBorders() { QPtrVector views = getViewManager()->getViews(); @@ -178,6 +198,9 @@ void GLViewer_Viewer2d::updateBorders() } } +/*! + Redraws all active objects by updating all drawers in all views +*/ void GLViewer_Viewer2d::updateAll() { if ( !getActiveView() ) @@ -188,6 +211,9 @@ void GLViewer_Viewer2d::updateAll() ( ( GLViewer_ViewPort2d* )( ( GLViewer_ViewFrame* )views[i] )->getViewPort() )->getGLWidget()->updateGL(); } +/*! + \param onlyUpdate is passed to method activateAllDrawers drawers +*/ void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat scX, GLfloat scY ) { // cout << "GLViewer_Viewer2d::updateDrawers" << endl; @@ -197,6 +223,9 @@ void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat scX, GLfloat sc activateAllDrawers( update ); } +/*! + Activates drawers for objects from list \param theObjects only +*/ void GLViewer_Viewer2d::activateDrawers( QValueList& theObjects, bool onlyUpdate, GLboolean swap ) { //cout << "GLViewer_Viewer2d::activateDrawers " << (int)onlyUpdate << " " << (int)swap << endl; @@ -282,6 +311,9 @@ void GLViewer_Viewer2d::activateDrawers( QValueList& theObject ( ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() )->getGLWidget()->makeCurrent(); } +/*! + Activates drawer for \param theObject +*/ void GLViewer_Viewer2d::activateDrawer( GLViewer_Object* theObject, bool onlyUpdate, GLboolean swap ) { ObjList aList; @@ -289,6 +321,9 @@ void GLViewer_Viewer2d::activateDrawer( GLViewer_Object* theObject, bool onlyUpd activateDrawers( aList, onlyUpdate, swap ); } +/*! + \param onlyUpdate is passed to drawers +*/ void GLViewer_Viewer2d::activateAllDrawers( bool onlyUpdate, GLboolean swap ) { if ( !getActiveView() ) @@ -306,6 +341,11 @@ void GLViewer_Viewer2d::activateAllDrawers( bool onlyUpdate, GLboolean swap ) activateDrawers( anActiveObjs, onlyUpdate, swap ); } +/*! + Creates set of marker + \param theMarkersNum - number of markers + \param theMarkersRad - radius of markers +*/ void GLViewer_Viewer2d::onCreateGLMarkers( int theMarkersNum, int theMarkersRad ) { if ( !getActiveView() ) @@ -341,6 +381,12 @@ void GLViewer_Viewer2d::onCreateGLMarkers( int theMarkersNum, int theMarkersRad delete[] anYCoord; } +/*! + Creates GL polyline + \param theAnglesNum - number of angles + \param theRadius - radius + \param thePolylineNumber - number +*/ void GLViewer_Viewer2d::onCreateGLPolyline( int theAnglesNum, int theRadius, int thePolylineNumber ) { if ( !getActiveView() ) @@ -384,6 +430,11 @@ void GLViewer_Viewer2d::onCreateGLPolyline( int theAnglesNum, int theRadius, int delete[] anYCoord; } +/*! + Creates text + \param theStr - text string + \param theTextNumber - number +*/ void GLViewer_Viewer2d::onCreateGLText( QString theStr, int theTextNumber ) { if ( !getActiveView() ) @@ -414,6 +465,10 @@ void GLViewer_Viewer2d::onCreateGLText( QString theStr, int theTextNumber ) activateAllDrawers( false ); } +/*! + Translates point from global CS to curreent viewer CS + \param x, y - co-ordinates to be translated +*/ void GLViewer_Viewer2d::transPoint( GLfloat& x, GLfloat& y ) { if ( !getActiveView() ) @@ -442,6 +497,10 @@ void GLViewer_Viewer2d::transPoint( GLfloat& x, GLfloat& y ) y -= yPan; } +/*! + \return object rect in window CS + \param theObject - object +*/ QRect* GLViewer_Viewer2d::getWinObjectRect( GLViewer_Object* theObject ) { if ( !getActiveView() ) @@ -497,6 +556,11 @@ QRect* GLViewer_Viewer2d::getWinObjectRect( GLViewer_Object* theObject ) return newRect; } +/*! + Translates rect in window CS to rect in global CS + \param theRect - rectangle to be translated + \return transformed rect +*/ GLViewer_Rect GLViewer_Viewer2d::getGLVRect( const QRect& theRect ) const { if ( !getActiveView() ) @@ -510,6 +574,11 @@ GLViewer_Rect GLViewer_Viewer2d::getGLVRect( const QRect& theRect ) const return vp->win2GLV( theRect ); } +/*! + Translates rect in global CS to rect in window CS + \param theRect - rectangle to be translated + \return transformed rect +*/ QRect GLViewer_Viewer2d::getQRect( const GLViewer_Rect& theRect ) const { if ( !getActiveView() ) @@ -523,87 +592,25 @@ QRect GLViewer_Viewer2d::getQRect( const GLViewer_Rect& theRect ) const return vp->GLV2win( theRect ); } +/*! + \return new selector +*/ GLViewer_Selector* GLViewer_Viewer2d::createSelector() { return new GLViewer_Selector2d( this, getGLContext() ); } +/*! + \return new Transformer + \param type - type of new transformer +*/ GLViewer_ViewTransformer* GLViewer_Viewer2d::createTransformer( int type ) { return new GLViewer_View2dTransformer( this, type ); } -/* -GLViewer_Sketcher* GLViewer_Viewer2d::createGLSketcher( int type ) -{ - return new GLViewer_Sketcher( this, type ); -} -void GLViewer_Viewer2d::activateGLSketching( int type ) -{ - GLViewer_ViewPort2d* vp = 0; - if ( !getActiveView() || !( vp = ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() ) ) - return; - - // Finish current sketching - if ( type == None ) - { - if ( myGLSketcher->getType() != None ) - { - myGLSketcher->setType( None ); - finishSketching(); - } - } - // Activate new sketching - else - { - activateGLSketching( None ); // concurrency not supported - myGLSketcher->setType( type ); - startSketching(); - } -} - -void GLViewer_Viewer2d::startSketching() -{ - GLViewer_ViewPort2d* avp = (GLViewer_ViewPort2d*)getActiveView()->getViewPort(); - avp->setCursor( *avp->getSketchCursor() ); - //avp->enablePopup( false ); - myGLSketcher->startSketching(); -} - -void GLViewer_Viewer2d::finishSketching() -{ - GLViewer_ViewPort2d* avp = (GLViewer_ViewPort2d*)getActiveView()->getViewPort(); - avp->setCursor( *avp->getDefaultCursor() ); - //avp->enablePopup( true ); - myGLSketcher->finishSketching(); -} - -bool GLViewer_Viewer2d::isSketchingActive() -{ - return myGLSketcher->getType() != None; -} - -int GLViewer_Viewer2d::getSketchingType() -{ - return myGLSketcher->getType(); -} - -void GLViewer_Viewer2d::onSketchDelObject() -{ - GLViewer_ViewPort2d* avp = (GLViewer_ViewPort2d*)getActiveView()->getViewPort(); - avp->setCursor( *avp->getDefaultCursor() ); - myGLSketcher->finishSketching( true ); -} - -void GLViewer_Viewer2d::onSketchUndoLast() -{ - -} - -void GLViewer_Viewer2d::onSketchFinish() -{ - finishSketching(); -} +/*! + Custom mouse event handler */ void GLViewer_Viewer2d::onMouseEvent( SUIT_ViewWindow*, QMouseEvent* e ) { @@ -626,6 +633,9 @@ void GLViewer_Viewer2d::onMouseEvent( SUIT_ViewWindow*, QMouseEvent* e ) GLViewer_Viewer::onMouseEvent( 0, e ); } +/*! + Rotation transformation +*/ bool GLViewer_Viewer2d::testRotation( QMouseEvent* e ) { if ( ( e->button() == GLViewer_View2dTransformer::rotateButton() ) && @@ -638,7 +648,11 @@ bool GLViewer_Viewer2d::testRotation( QMouseEvent* e ) return false; } - +/*! + Inserts text lines as header for file + \param aType - file type + \param hFile - file instance +*/ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile ) { if( aType == POST_SCRIPT ) @@ -671,6 +685,11 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile ) } } +/*! + Inserts text lines as ending for file + \param aType - file type + \param hFile - file instance +*/ void GLViewer_Viewer2d::insertEnding( VectorFileType aType, QFile& hFile ) { if( aType == POST_SCRIPT ) @@ -698,6 +717,13 @@ inline void mm2custom( GLViewer_Viewer2d::VectorFileType aType, double& value ) #endif } +/*! + Translates current view content to vector file + \param aType - type of file + \param FileName - name of file, + \param aPType - paper size type + \param mmLeft, mmRight, mmTop, mmBottom - margins +*/ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, PaperType aPType, double mmLeft, double mmRight, double mmTop, double mmBottom ) { @@ -821,7 +847,10 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap return true; } - +/*! + Repaints view + \param theView - view to be repainted. If it is NULL then all views will be repainted +*/ void GLViewer_Viewer2d::repaintView( GLViewer_ViewFrame* theView, bool makeCurrent ) { GLViewer_ViewFrame* aCurView; @@ -897,6 +926,9 @@ void GLViewer_Viewer2d::repaintView( GLViewer_ViewFrame* theView, bool makeCurre // ( ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() )->getGLWidget()->makeCurrent(); } +/*! + Starts some operation on mouse event +*/ void GLViewer_Viewer2d::startOperations( QMouseEvent* e ) { GLViewer_ViewPort2d* vp = ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)getActiveView())->getViewPort(); @@ -913,6 +945,9 @@ void GLViewer_Viewer2d::startOperations( QMouseEvent* e ) vp->startSelectByRect( e->x(), e->y() ); } +/*! + Updates started operation on mouse event +*/ bool GLViewer_Viewer2d::updateOperations( QMouseEvent* e ) { GLViewer_ViewPort2d* vp = ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)getActiveView())->getViewPort(); @@ -936,6 +971,9 @@ bool GLViewer_Viewer2d::updateOperations( QMouseEvent* e ) return false; } +/*! + Completes started operation on mouse event +*/ void GLViewer_Viewer2d::finishOperations( QMouseEvent* e ) { GLViewer_ViewPort2d* vp = ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)getActiveView())->getViewPort(); @@ -959,6 +997,9 @@ void GLViewer_Viewer2d::finishOperations( QMouseEvent* e ) } } +/*! + Starts some operation on mouse wheel event +*/ void GLViewer_Viewer2d::startOperations( QWheelEvent* e ) { bool zoomIn = e->delta() > 0; @@ -976,13 +1017,11 @@ void GLViewer_Viewer2d::startOperations( QWheelEvent* e ) } -/**************************************************************** -** Class: GLViewer_View2dTransformer -** -*****************************************************************/ - int GLViewer_View2dTransformer::rotateBtn = RightButton; +/*! + Constructor +*/ GLViewer_View2dTransformer::GLViewer_View2dTransformer( GLViewer_Viewer* viewer, int typ ) : GLViewer_ViewTransformer( viewer, typ ) { @@ -990,6 +1029,9 @@ GLViewer_View2dTransformer::GLViewer_View2dTransformer( GLViewer_Viewer* viewer, initTransform( true ); } +/*! + Destructor +*/ GLViewer_View2dTransformer::~GLViewer_View2dTransformer() { if ( type() == GLViewer_Viewer::Rotate ) diff --git a/src/GLViewer/GLViewer_Viewer2d.h b/src/GLViewer/GLViewer_Viewer2d.h index 21840335f..93c9d30f0 100644 --- a/src/GLViewer/GLViewer_Viewer2d.h +++ b/src/GLViewer/GLViewer_Viewer2d.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,12 +22,6 @@ // File: GLViewer_Viewer2d.h // Created: November, 2004 -/*************************************************************************** -** Class: GLViewer_Viewer2d -** Descr: OpenGL Viewer 2D -** Module: GLViewer -** Created: UI team, 04.09.04 -****************************************************************************/ #ifndef GLVIEWER_VIEWER2D_H #define GLVIEWER_VIEWER2D_H @@ -68,10 +62,11 @@ const double Sizes[2*5] = { #pragma warning( disable:4251 ) #endif -/*! - * Class GLViewer_Object - * 2D viewer for GLViewer - */ +/*! + \class GLViewer_Viewer2d + OpenGL Viewer 2D +*/ + class GLVIEWER_API GLViewer_Viewer2d : public GLViewer_Viewer { Q_OBJECT @@ -234,10 +229,6 @@ protected: //GLViewer_Sketcher* myGLSketcher; }; -/**************************************************************** -** Class: GLViewer_View2dTransformer -** -*****************************************************************/ class GLVIEWER_API GLViewer_View2dTransformer : public GLViewer_ViewTransformer { public: diff --git a/src/GLViewer/GLViewer_Widget.cxx b/src/GLViewer/GLViewer_Widget.cxx index b29a9fb52..1fc069d20 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,11 +22,6 @@ // File: GLViewer_Widget.cxx // Created: November, 2004 -//================================================================ -// Class : GLViewer_Widget -// Description : OpenGL QWidget for GLViewer -//================================================================ - #include "GLViewer_Widget.h" #include "GLViewer_ViewPort2d.h" #include "GLViewer_Viewer2d.h" @@ -49,10 +44,10 @@ using namespace std; #include #include -//======================================================================= -// Function: GLViewer_Widget -// Purpose : -//======================================================================= +/*! + A constructor + Parameters using for QOGLWidget as is +*/ GLViewer_Widget::GLViewer_Widget( QWidget* parent, const char* name ): QGLWidget( parent, 0/*, WRepaintNoErase | WResizeNoErase*/ ) { @@ -78,18 +73,16 @@ QGLWidget( parent, 0/*, WRepaintNoErase | WResizeNoErase*/ ) setMouseTracking( true ); } -//======================================================================= -// Function: GLViewer_Widget -// Purpose : -//======================================================================= +/*! + Destructor +*/ GLViewer_Widget::~GLViewer_Widget() { } -//======================================================================= -// Function: ~GLViewer_Widget -// Purpose : -//======================================================================= +/*! + \return offset parameters of Window in OpenGL global scene +*/ void GLViewer_Widget::getPan( GLfloat& xPan, GLfloat& yPan, GLfloat& zPan ) { xPan = myXPan; @@ -97,10 +90,9 @@ void GLViewer_Widget::getPan( GLfloat& xPan, GLfloat& yPan, GLfloat& zPan ) zPan = myZPan; } -//======================================================================= -// Function: setPan -// Purpose : -//======================================================================= +/*! + A function for installing the offset parameters of Window in OpenGL global scene +*/ void GLViewer_Widget::setPan( GLfloat xPan, GLfloat yPan, GLfloat zPan ) { myXPan = xPan; @@ -108,10 +100,9 @@ void GLViewer_Widget::setPan( GLfloat xPan, GLfloat yPan, GLfloat zPan ) myZPan = zPan; } -//======================================================================= -// Function: getScale -// Purpose : -//======================================================================= +/*! + \return scales on OpenGL scene along 3 directions in 2d scene zScale = 1.0 +*/ void GLViewer_Widget::getScale( GLfloat& xScale, GLfloat& yScale, GLfloat& zScale ) { xScale = myXScale; @@ -119,10 +110,9 @@ void GLViewer_Widget::getScale( GLfloat& xScale, GLfloat& yScale, GLfloat& zScal zScale = myZScale; } -//======================================================================= -// Function: setScale -// Purpose : -//======================================================================= +/*! + A function for installing the scales of OpenGL scene +*/ void GLViewer_Widget::setScale( GLfloat xScale, GLfloat yScale, GLfloat zScale ) { if ( xScale > 0 && yScale > 0 && zScale > 0 ) @@ -133,10 +123,9 @@ void GLViewer_Widget::setScale( GLfloat xScale, GLfloat yScale, GLfloat zScale ) } } -//======================================================================= -// Function: getRotationStart -// Purpose : -//======================================================================= +/*! + \return start point of curren rotation of Window in OpenGL global scene +*/ void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX, GLfloat& rotationStartY, GLfloat& rotationStartZ ) @@ -146,10 +135,9 @@ void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX, rotationStartZ = myRotationStartZ; } -//======================================================================= -// Function: setRotationStart -// Purpose : -//======================================================================= +/*! + A function for installing the rotation angle of Window in OpenGL global scene in degree (Only in 2D) +*/ void GLViewer_Widget::setRotationStart( GLfloat rotationStartX, GLfloat rotationStartY, GLfloat rotationStartZ ) @@ -159,10 +147,13 @@ void GLViewer_Widget::setRotationStart( GLfloat rotationStartX, myRotationStartZ = rotationStartZ; } -//======================================================================= -// Function: getRotation -// Purpose : -//======================================================================= +/*! + \return parameters of rotation + \param rotationAngle - angle + \param rotationCenterX - center x + \param rotationCenterY - center y + \param rotationCenterZ - center z +*/ void GLViewer_Widget::getRotation( GLfloat& rotationAngle, GLfloat& rotationCenterX, GLfloat& rotationCenterY, @@ -174,10 +165,13 @@ void GLViewer_Widget::getRotation( GLfloat& rotationAngle, rotationCenterZ = myRotationCenterZ; } -//======================================================================= -// Function: setRotation -// Purpose : -//======================================================================= +/*! + Sets parameters of rotation + \param rotationAngle - angle + \param rotationCenterX - center x + \param rotationCenterY - center y + \param rotationCenterZ - center z +*/ void GLViewer_Widget::setRotation( GLfloat rotationAngle, GLfloat rotationCenterX, GLfloat rotationCenterY, @@ -189,10 +183,11 @@ void GLViewer_Widget::setRotation( GLfloat rotationAngle, myRotationCenterZ = rotationCenterZ; } -//======================================================================= -// Function: setBackground -// Purpose : -//======================================================================= + +/*! + Sets image as background + \param filename - name of file +*/ void GLViewer_Widget::setBackground( QString filename ) { @@ -245,29 +240,28 @@ void GLViewer_Widget::setBackground( QString filename ) } } -//======================================================================= -// Function: addToolTip -// Purpose : -//======================================================================= +/*! + Adds tooltip + \param theString - tooltip text + \param theRect - tooltip rectangle +*/ void GLViewer_Widget::addToolTip( QString theString, QRect theRect ) { myToolTipRect = theRect; QToolTip::add( this, myToolTipRect, theString ); } -//======================================================================= -// Function: removeToolTip -// Purpose : -//======================================================================= +/*! + Removes tooltip +*/ void GLViewer_Widget::removeToolTip() { QToolTip::remove( this, myToolTipRect ); } -//======================================================================= -// Function: initializeGL -// Purpose : -//======================================================================= +/*! + Initialization (redefined virtual from QGLWidget) +*/ void GLViewer_Widget::initializeGL() { setAutoBufferSwap( true ); @@ -289,10 +283,9 @@ void GLViewer_Widget::initializeGL() isLoadBackground = false; } -//======================================================================= -// Function: paintGL -// Purpose : -//======================================================================= +/*! + Paints content +*/ void GLViewer_Widget::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -335,10 +328,11 @@ void GLViewer_Widget::paintGL() v->repaintView( getViewPort()->getViewFrame() ); } -//======================================================================= -// Function: resizeGL -// Purpose : -//======================================================================= +/*! + Resets OpenGl parameters after resize + \param w - new width + \param h - new height +*/ void GLViewer_Widget::resizeGL( int w, int h ) { @@ -365,10 +359,9 @@ void GLViewer_Widget::resizeGL( int w, int h ) glLoadIdentity(); } -//======================================================================= -// Function: exportRepaint -// Purpose : -//======================================================================= +/*! + Provides repaint in export mode +*/ void GLViewer_Widget::exportRepaint() { isExportMode = true; @@ -378,65 +371,59 @@ void GLViewer_Widget::exportRepaint() isExportMode = false; } -//======================================================================= -// Function: paintEvent -// Purpose : -//======================================================================= +/*! + Custom paint event handler +*/ void GLViewer_Widget::paintEvent( QPaintEvent* e ) { QApplication::sendEvent( myViewPort, e ); } -//======================================================================= -// Function: mouseMoveEvent -// Purpose : -//======================================================================= +/*! + Custom mouse move event handler +*/ void GLViewer_Widget::mouseMoveEvent( QMouseEvent* e ) { QApplication::sendEvent( myViewPort, e ); } -//======================================================================= -// Function: mousePressEvent -// Purpose : -//======================================================================= +/*! + Custom mouse press event handler +*/ void GLViewer_Widget::mousePressEvent( QMouseEvent* e ) { QApplication::sendEvent( myViewPort, e ); } -//======================================================================= -// Function: mouseReleaseEvent -// Purpose : -//======================================================================= +/*! + Custom mouse release event handler +*/ void GLViewer_Widget::mouseReleaseEvent( QMouseEvent* e ) { QApplication::sendEvent( myViewPort, e ); } -//======================================================================= -// Function: enterEvent -// Purpose : -//======================================================================= +/*! + Custom enter event handler +*/ void GLViewer_Widget::enterEvent( QEvent* e ) { updateGL(); } -//======================================================================= -// Function: leaveEvent -// Purpose : -//======================================================================= +/*! + Custom leave event handler +*/ void GLViewer_Widget::leaveEvent( QEvent* e ) { updateGL(); } -//======================================================================= -//! Function: hex -//! Purpose : Returns the hex code of digit < 16 -//======================================================================= +/*! + \return the hex code of digit < 16 + \param c - digit +*/ inline char hex( uchar c ) { if( c<=9 ) @@ -447,11 +434,23 @@ inline char hex( uchar c ) return ' '; } -//======================================================================= -//! Function: AddImagePart -//! Purpose : Translates path of image to PS format -/*! Image inside rectangle from w1 to w2 and from h2 to h1*/ -//======================================================================= +/*! + Translates part of image inside rectangle from w1 to w2 and from h2 to h1 to PS format + \param hFile - PostScript file + \param image - image to be tarnslated + \param w1 - x start position + \param w2 - x end position + \param h1 - y start position + \param h2 - y end position + \param aViewerCS - viewer co-ordinate system + \param aPSCS - paper co-ordinate system + \param a + \param b + \param c + \param d + \param dw + \param dh +*/ void AddImagePart( QFile& hFile, QImage& image, int w1, int w2, int h1, int h2, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS, double a, double b, double c, double d, double dw, double dh ) @@ -493,20 +492,21 @@ void AddImagePart( QFile& hFile, QImage& image, int w1, int w2, int h1, int h2, } } -//======================================================================= -// Function: getBackgroundRectInViewerCS -// Purpose : -//======================================================================= +/*! + \return background rectangle in viewer CS +*/ void GLViewer_Widget::getBackgroundRectInViewerCS( double& left, double& top, double& right, double& bottom ) { left = -myIW/2; right = myIW/2; top = myIH/2; bottom = -myIH/2; } -//======================================================================= -// Function: translateBackgroundToPS -// Purpose : -//======================================================================= +/*! + Translates background to PostScript + \param hFile - PostScript file + \param aViewerCS - viewer co-ordinate system + \param aPSCS - paper co-ordinate system +*/ void GLViewer_Widget::translateBackgroundToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS ) { QImage buf; @@ -553,10 +553,9 @@ void GLViewer_Widget::translateBackgroundToPS( QFile& hFile, GLViewer_CoordSyste } } -//======================================================================= -//! Function: DecodeScanLine -//! Purpose : Translate image line with one color depth to line wiht other depth -//======================================================================= +/*! + Translates image line with one color depth to line with other depth +*/ void DecodeScanLine( int width, uchar* dest, int dest_depth, uchar* source, int source_depth ) { #ifndef WIN32 @@ -620,11 +619,13 @@ typedef unsigned int WORD; } } -//======================================================================= -// Function: translateBackgroundToEMF -// Purpose : -//======================================================================= #ifdef WIN32 +/*! + Translates background to EMF + \param dc - descriptor of EMF + \param aViewerCS - viewer co-ordinate system + \param aPSCS - paper co-ordinate system +*/ void GLViewer_Widget::translateBackgroundToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS ) { QImage buf; diff --git a/src/GLViewer/GLViewer_Widget.h b/src/GLViewer/GLViewer_Widget.h index c580a9a84..637beb5fb 100644 --- a/src/GLViewer/GLViewer_Widget.h +++ b/src/GLViewer/GLViewer_Widget.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // Author : OPEN CASCADE // @@ -22,9 +22,6 @@ // File: GLViewer_Widget.h // Created: November, 2004 -/*! Class GLViewer_Widget - * Class for visualization OpenGL scene (widget) for GLViewer - */ #ifndef GLVIEWER_WIDGET_H #define GLVIEWER_WIDGET_H @@ -36,6 +33,10 @@ class GLViewer_ViewPort2d; class GLViewer_CoordSystem; +/*! + \class GLViewer_Widget + Widget for visualization of OpenGL scene +*/ class GLVIEWER_API GLViewer_Widget : public QGLWidget { Q_OBJECT diff --git a/src/GLViewer/Makefile.in b/src/GLViewer/Makefile.in index d921dd294..76869431a 100644 --- a/src/GLViewer/Makefile.in +++ b/src/GLViewer/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Vladimir Klyachin (OCN) # Module : caf @@ -98,6 +116,6 @@ CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) LDFLAGS+=$(QT_MT_LIBS) $(CAS_KERNEL) -LIBS+= -L${GUI_ROOT_DIR}/lib/salome -lsuit -L/usr/X11R6/lib -lGLU +LIBS+= -lsuit -L/usr/X11R6/lib@LIB_LOCATION_SUFFIX@ -lGLU @CONCLUDE@ diff --git a/src/GLViewer/resources/GLViewer_images.po b/src/GLViewer/resources/GLViewer_images.po index 53bac630c..256c03317 100644 --- a/src/GLViewer/resources/GLViewer_images.po +++ b/src/GLViewer/resources/GLViewer_images.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: GLViewer_images.po // Created: 10/25/2004 12:46:36 PM // Author: Sergey Anikin diff --git a/src/GLViewer/resources/GLViewer_msg_en.po b/src/GLViewer/resources/GLViewer_msg_en.po index 32d5f88cb..d51c7d3a3 100644 --- a/src/GLViewer/resources/GLViewer_msg_en.po +++ b/src/GLViewer/resources/GLViewer_msg_en.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: GLViewer_msg_en.po // Created: 10/25/2004 12:46:36 PM // Author: Sergey Anikin @@ -74,9 +92,6 @@ msgstr "Cannot save file" msgid "ERROR" msgstr "Error" -msgid "BUT_OK" -msgstr "Ok" - msgid "CHANGE_BGCOLOR" msgstr "Change background..." diff --git a/src/LightApp/LightApp.h b/src/LightApp/LightApp.h index 1d0f5e196..0fbeb1497 100644 --- a/src/LightApp/LightApp.h +++ b/src/LightApp/LightApp.h @@ -1,7 +1,24 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp.h // Created: June, 2005 // Author: OCC team -// Copyright (C) CEA 2005 // The following ifdef block is the standard way of creating macros which make exporting diff --git a/src/LightApp/LightApp_AboutDlg.cxx b/src/LightApp/LightApp_AboutDlg.cxx index 689d4165c..7dc4a48ae 100644 --- a/src/LightApp/LightApp_AboutDlg.cxx +++ b/src/LightApp/LightApp_AboutDlg.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_AboutDlg.cxx // Created: 03.06.2005 13:52:45 // Author: Sergey TELKOV diff --git a/src/LightApp/LightApp_AboutDlg.h b/src/LightApp/LightApp_AboutDlg.h index c59cc938b..8fb3b97f2 100644 --- a/src/LightApp/LightApp_AboutDlg.h +++ b/src/LightApp/LightApp_AboutDlg.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_AboutDlg.h // Created: 03.06.2005 13:49:25 // Author: Sergey TELKOV @@ -10,12 +28,12 @@ #include -/*! - Descr: LightApp help about dialog -*/ - class QLabel; +/*! + \class LightApp_AboutDlg + LightApp help about dialog +*/ class LIGHTAPP_EXPORT LightApp_AboutDlg : public QtxDialog { Q_OBJECT diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index ca93892ff..0ccc31bb4 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1,9 +1,30 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_Application.cxx // Created: 6/20/2005 18:39:45 PM // Author: Natalia Donis // Copyright (C) CEA 2005 -#include "PythonConsole_PyInterp.h" // WARNING! This include must be the first! +#ifndef DISABLE_PYCONSOLE + #include "PythonConsole_PyInterp.h" // WARNING! This include must be the first! + #include +#endif #include "LightApp_Application.h" #include "LightApp_WidgetContainer.h" @@ -17,10 +38,7 @@ #include "LightApp_OBFilter.h" -#include "LightApp_GLSelector.h" #include "LightApp_OBSelector.h" -#include "LightApp_OCCSelector.h" -#include "LightApp_VTKSelector.h" #include "LightApp_SelectionMgr.h" #include @@ -42,25 +60,50 @@ #include #include #include -#include -#include -#include +#ifndef DISABLE_GLVIEWER + #include + #include + #include "LightApp_GLSelector.h" +#endif -#include -#include -#include +#ifndef DISABLE_PLOT2DVIEWER + #include + #include +#ifndef DISABLE_SALOMEOBJECT + #include +#else + #include +#endif +#endif -#include -#include +#ifndef DISABLE_OCCVIEWER + #include +#ifndef DISABLE_SALOMEOBJECT + #include +#else + #include +#endif + #include "LightApp_OCCSelector.h" +#endif -#include -#include -#include +#ifndef DISABLE_VTKVIEWER +#ifndef DISABLE_SALOMEOBJECT + #include + #include + #include "LightApp_VTKSelector.h" +#else + #include + #include +#endif + #include +#endif -#include -#include -#include +//#ifndef DISABLE_SUPERVGRAPHVIEWER +// #include +// #include +// #include +//#endif #include @@ -78,11 +121,14 @@ #include #include #include +#include #define FIRST_HELP_ID 1000000 -#include "SALOME_InteractiveObject.hxx" -#include "SALOME_ListIO.hxx" +#ifndef DISABLE_SALOMEOBJECT + #include "SALOME_InteractiveObject.hxx" + #include "SALOME_ListIO.hxx" +#endif static const char* imageEmptyIcon[] = { "20 20 1 1", @@ -108,17 +154,28 @@ static const char* imageEmptyIcon[] = { "....................", "...................."}; +int LightApp_Application::lastStudyId = 0; + +/*! + \return last global id of study +*/ +int LightApp_Application::studyId() +{ + return LightApp_Application::lastStudyId; +} + /*!Create new instance of LightApp_Application.*/ extern "C" LIGHTAPP_EXPORT SUIT_Application* createApplication() { return new LightApp_Application(); } +/*! \var global preferences of LightApp */ LightApp_Preferences* LightApp_Application::_prefs_ = 0; -/* - Class : LightApp_Application - Description : Application containing LightApp module +/*! + \class LightApp_Application + Application containing LightApp module */ /*!Constructor.*/ @@ -146,7 +203,9 @@ myPrefs( 0 ) mySelMgr = new LightApp_SelectionMgr( this ); - myAccel = new SUIT_Accel( desktop() ); + myAccel = SUIT_Accel::getAccel(); + +#ifndef DISABLE_OCCVIEWER myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, OCCViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, OCCViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, OCCViewer_Viewer::Type() ); @@ -158,6 +217,8 @@ myPrefs( 0 ) myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, OCCViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, OCCViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, OCCViewer_Viewer::Type() ); +#endif +#ifndef DISABLE_VTKVIEWER myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, VTKViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, VTKViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, VTKViewer_Viewer::Type() ); @@ -169,8 +230,33 @@ myPrefs( 0 ) myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, VTKViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() ); +#endif connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) ); + + // Set existing font for the python console in resources + if( !aResMgr->hasValue( "PyConsole", "font" ) ) + return; + + QFont f = aResMgr->fontValue( "PyConsole", "font" ); + QFontDatabase fdb; + QStringList famdb = fdb.families(); + + if ( famdb.contains(f.family()) || !aResMgr->hasValue( "PyConsole", "additional_families" ) ) + return; + + QStringList anAddFamilies = QStringList::split( ";", aResMgr->stringValue( "PyConsole", "additional_families" ) ); + QString aFamily; + for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it ) + { + aFamily = *it; + if ( famdb.contains(aFamily) ) + { + f.setFamily( aFamily ); + aResMgr->setValue( "PyConsole", "font", f ); + break; + } + } } /*!Destructor. @@ -181,14 +267,6 @@ myPrefs( 0 ) */ LightApp_Application::~LightApp_Application() { - saveWindowsGeometry(); - - if ( resourceMgr() ) - { - if ( desktop() ) - desktop()->saveGeometry( resourceMgr(), "desktop" ); - resourceMgr()->save(); - } delete mySelMgr; } @@ -302,6 +380,10 @@ bool LightApp_Application::activateModule( const QString& modName ) return true; } +/*! + Opens other study into active Study. If Study is empty - creates it. + \param theName - name of study +*/ bool LightApp_Application::useStudy(const QString& theName) { createEmptyStudy(); @@ -320,6 +402,19 @@ LightApp_SelectionMgr* LightApp_Application::selectionMgr() const return mySelMgr; } +/*!Creat action "New window" for certain type of viewer:*/ +void LightApp_Application::createActionForViewer( const int id, + const int parentId, + const QString& suffix, + const int accel ) +{ + QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ), QIconSet(), + tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ), + tr( QString( "NEW_WINDOW_%1" ).arg( suffix ) ), + accel, desktop(), false, this, SLOT( onNewWindow() ) ); + createMenu( a, parentId, -1 ); +} + /*!Create actions:*/ void LightApp_Application::createActions() { @@ -344,22 +439,36 @@ void LightApp_Application::createActions() int id = LightApp_Application::UserID + FIRST_HELP_ID; // help for KERNEL and GUI QCString dir; - QString aFileName; + QString aFileName = "index.htm"; QString root; QAction* a; if (dir = getenv("GUI_ROOT_DIR")) { - aFileName = "GUI_index_v3.1.0.html"; - root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") ); + root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") + + Qtx::addSlash("gui") + Qtx::addSlash("GUI") ); if ( QFileInfo( root + aFileName ).exists() ) { - a = createAction( id, tr( QString("Kernel & GUI Help") ), QIconSet(), - tr( QString("Kernel && GUI Help") ), - tr( QString("Kernel & GUI Help") ), + a = createAction( id, tr( QString("GUI Help") ), QIconSet(), + tr( QString("GUI Help") ), + tr( QString("GUI Help") ), 0, desk, false, this, SLOT( onHelpContentsModule() ) ); a->setName( QString("GUI") ); createMenu( a, helpModuleMenu, -1 ); id++; } } + if (dir = getenv("KERNEL_ROOT_DIR")) { + QString aFN = "index.html"; + root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + + Qtx::addSlash("salome") ); + if ( QFileInfo( root + aFN ).exists() ) { + a = createAction( id, tr( QString("KERNEL Help") ), QIconSet(), + tr( QString("KERNEL Help") ), + tr( QString("KERNEL Help") ), + 0, desk, false, this, SLOT( onHelpContentsModule() ) ); + a->setName( QString("KERNEL") ); + createMenu( a, helpModuleMenu, -1 ); + id++; + } + } // help for other existing modules QStringList::Iterator it; for ( it = aModuleList.begin(); it != aModuleList.end(); ++it ) @@ -368,10 +477,10 @@ void LightApp_Application::createActions() continue; QString modName = moduleName( *it ); - aFileName = modName + "_index_v3.1.0.html"; if (dir = getenv( modName + "_ROOT_DIR")) { - root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") ); + root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") + + Qtx::addSlash("gui") + Qtx::addSlash(modName) ); if ( QFileInfo( root + aFileName ).exists() ) { QAction* a = createAction( id, tr( moduleTitle(modName) + QString(" Help") ), QIconSet(), @@ -434,8 +543,11 @@ void LightApp_Application::createActions() for ( it = modList.begin(); it != modList.end(); ++it ) { - if ( (*it).isEmpty() ) + if ( !isLibExists( *it ) ) + { + qDebug( QString( "Library '%1' cannot be found" ).arg( *it ) ); continue; + } QString iconName; if ( iconMap.contains( *it ) ) @@ -459,24 +571,24 @@ void LightApp_Application::createActions() SUIT_Tools::simplifySeparators( modTBar ); // New window - int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 ); + int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 ); int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 ); createMenu( separator(), windowMenu, -1, 1 ); - QMap accelMap; - accelMap[NewGLViewId] = ALT+Key_G; - accelMap[NewPlot2dId] = ALT+Key_P; - accelMap[NewOCCViewId] = ALT+Key_O; - accelMap[NewVTKViewId] = ALT+Key_K; - for ( id = NewGLViewId; id <= NewVTKViewId; id++ ) - { - QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), QIconSet(), - tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), - tr( QString( "NEW_WINDOW_%1" ).arg( id - NewGLViewId ) ), - accelMap.contains( id ) ? accelMap[id] : 0, desk, false, this, SLOT( onNewWindow() ) ); - createMenu( a, newWinMenu, -1 ); - } +#ifndef DISABLE_GLVIEWER + createActionForViewer( NewGLViewId, newWinMenu, QString::number( 0 ), ALT+Key_G ); +#endif +#ifndef DISABLE_PLOT2DVIEWER + createActionForViewer( NewPlot2dId, newWinMenu, QString::number( 1 ), ALT+Key_P ); +#endif +#ifndef DISABLE_OCCVIEWER + createActionForViewer( NewOCCViewId, newWinMenu, QString::number( 2 ), ALT+Key_O ); +#endif +#ifndef DISABLE_VTKVIEWER + createActionForViewer( NewVTKViewId, newWinMenu, QString::number( 3 ), ALT+Key_K ); +#endif + createAction( RenameId, tr( "TOT_RENAME" ), QIconSet(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ), SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) ); @@ -560,28 +672,35 @@ void LightApp_Application::onNewWindow() int id = actionId( (QAction*)obj ); switch ( id ) { +#ifndef DISABLE_GLVIEWER case NewGLViewId: type = GLViewer_Viewer::Type(); break; +#endif +#ifndef DISABLE_PLOT2DVIEWER case NewPlot2dId: type = Plot2d_Viewer::Type(); break; +#endif +#ifndef DISABLE_OCCVIEWER case NewOCCViewId: type = OCCViewer_Viewer::Type(); break; +#endif +#ifndef DISABLE_VTKVIEWER case NewVTKViewId: type = VTKViewer_Viewer::Type(); break; +#endif } if ( !type.isEmpty() ) createViewManager( type ); } -//======================================================================= -// name : onNewDoc -/*! Purpose : SLOT. Create new document*/ -//======================================================================= +/*! + SLOT: Creates new document +*/ void LightApp_Application::onNewDoc() { SUIT_Study* study = activeStudy(); @@ -597,10 +716,9 @@ void LightApp_Application::onNewDoc() } } -//======================================================================= -// name : onOpenDoc -/*! Purpose : SLOT. Open new document*/ -//======================================================================= +/*! + SLOT: Opens new document +*/ void LightApp_Application::onOpenDoc() { SUIT_Study* study = activeStudy(); @@ -616,7 +734,11 @@ void LightApp_Application::onOpenDoc() } #include "SUIT_MessageBox.h" -/*! Purpose : SLOT. Open new document with \a aName.*/ + +/*! + SLOT: Opens new document. + \param aName - name of file +*/ bool LightApp_Application::onOpenDoc( const QString& aName ) { bool isAlreadyOpen = false; @@ -683,10 +805,9 @@ bool LightApp_Application::onOpenDoc( const QString& aName ) return res; } -//======================================================================= -// name : onHelpAbout -/*! Purpose : SLOT. Display "About" message box*/ -//======================================================================= +/*! + SLOT: Displays "About" message box +*/ void LightApp_Application::onHelpAbout() { LightApp_AboutDlg* dlg = new LightApp_AboutDlg( applicationName(), applicationVersion(), desktop() ); @@ -694,7 +815,10 @@ void LightApp_Application::onHelpAbout() delete dlg; } -/*!SLOT. Load document with \a aName.*/ +/*! + SLOT: Loads document + \param aName - name of document +*/ bool LightApp_Application::onLoadDoc( const QString& aName ) { bool res = CAM_Application::onLoadDoc( aName ); @@ -711,7 +835,10 @@ bool LightApp_Application::onLoadDoc( const QString& aName ) return res; } -/*!Private SLOT. Selection.*/ +/*! + Private SLOT: Called on selection is changed + Dispatchs active module that selection is changed +*/ void LightApp_Application::onSelection() { onSelectionChanged(); @@ -720,9 +847,10 @@ void LightApp_Application::onSelection() ((LightApp_Module*)activeModule())->selectionChanged(); } -/*!Set active study. - *\param study - SUIT_Study. - */ +/*! + Sets active study. + \param study - SUIT_Study. +*/ void LightApp_Application::setActiveStudy( SUIT_Study* study ) { CAM_Application::setActiveStudy( study ); @@ -730,34 +858,57 @@ void LightApp_Application::setActiveStudy( SUIT_Study* study ) activateWindows(); } -//======================================================================= -// name : updateCommandsStatus -/*! Purpose : Enable/Disable menu items and toolbar buttons. Rebuild menu*/ -//======================================================================= +/*! + Enables/Disables menu items and toolbar buttons. Rebuild menu +*/ void LightApp_Application::updateCommandsStatus() { CAM_Application::updateCommandsStatus(); + QAction* a = 0; - for ( int id = NewGLViewId; id <= NewVTKViewId; id++ ) - { - QAction* a = action( id ); - if ( a ) - a->setEnabled( activeStudy() ); - } +#ifndef DISABLE_GLVIEWER + a = action( NewGLViewId ); + if( a ) + a->setEnabled( activeStudy() ); +#endif + +#ifndef DISABLE_PLOT2DVIEWER + a = action( NewPlot2dId ); + if( a ) + a->setEnabled( activeStudy() ); +#endif + +#ifndef DISABLE_OCCVIEWER + a = action( NewOCCViewId ); + if( a ) + a->setEnabled( activeStudy() ); +#endif + +#ifndef DISABLE_VTKVIEWER + a = action( NewVTKViewId ); + if( a ) + a->setEnabled( activeStudy() ); +#endif } -// Helps to execute command +/*! + \class RunBrowser + Runs system command in separate thread +*/ class RunBrowser: public QThread { public: - RunBrowser(QString theApp, QString theParams, QString theHelpFile, QString theContext=NULL): + RunBrowser( LightApp_Application* app, QString theApp, QString theParams, QString theHelpFile, QString theContext=NULL): myApp(theApp), myParams(theParams), #ifdef WIN32 myHelpFile("file://" + theHelpFile + theContext), #else myHelpFile("file:" + theHelpFile + theContext), #endif - myStatus(0) {}; + myStatus(0), + myLApp( app ) +{ +}; virtual void run() { @@ -769,18 +920,12 @@ public: myStatus = system(aCommand); if(myStatus != 0) { - QCustomEvent* ce2000 = new QCustomEvent (2000); - postEvent (qApp, ce2000); + QCustomEvent* ce2000 = new QCustomEvent( 2000 ); + QString* msg = new QString( QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile) ); + ce2000->setData( msg ); + postEvent( myLApp, ce2000 ); } } - if( myStatus != 0) - { - qApp->lock(); - SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").arg(myApp).arg(myHelpFile), - QObject::tr("BUT_OK")); - qApp->unlock(); - } } private: @@ -788,49 +933,80 @@ private: QString myParams; QString myHelpFile; int myStatus; - + LightApp_Application* myLApp; }; -//======================================================================= -// name : onHelpContentsModule -/*! Purpose : SLOT. Display help contents for choosen module*/ -//======================================================================= +/*! + SLOT: Displays help contents for choosen module +*/ void LightApp_Application::onHelpContentsModule() { const QAction* obj = (QAction*) sender(); QString aComponentName = obj->name(); - QString aFileName = aComponentName + "_index_v3.1.0.html"; + QString aFileName = "index.htm"; + QString aFileNameKernel = "index.html"; QCString dir = getenv( aComponentName + "_ROOT_DIR"); - QString homeDir = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") ); + QString homeDir = !aComponentName.compare(QString("KERNEL")) ? + Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") ) : + Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("doc") + Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash(aComponentName) ); + + QString helpFile = QFileInfo( homeDir + (!aComponentName.compare(QString("KERNEL")) ? aFileNameKernel : aFileName) ).absFilePath(); + SUIT_ResourceMgr* resMgr = resourceMgr(); + QString anApp = resMgr->stringValue("ExternalBrowser", "application"); + QString aParams = resMgr->stringValue("ExternalBrowser", "parameters"); + + if (!anApp.isEmpty()) { + RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile ); + rs->start(); + } + else { + if( SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"), + tr("DEFINE_EXTERNAL_BROWSER"), + tr("BUT_OK"),tr("BUT_CANCEL"),0,1,0 )==0 ) + onPreferences(); + } +} - QString helpFile = QFileInfo( homeDir + aFileName ).absFilePath(); +/*! + SLOT: Displays help contents for choosen dialog +*/ +void LightApp_Application::onHelpContextModule(const QString& theComponentName, const QString& theFileName) +{ + QCString dir = getenv( theComponentName + "_ROOT_DIR"); + QString homeDir = Qtx::addSlash(Qtx::addSlash(dir)+Qtx::addSlash("doc")+Qtx::addSlash("salome")+Qtx::addSlash("gui")+Qtx::addSlash(theComponentName)); + + QString helpFile = QFileInfo( homeDir + theFileName ).absFilePath(); SUIT_ResourceMgr* resMgr = resourceMgr(); QString anApp = resMgr->stringValue("ExternalBrowser", "application"); QString aParams = resMgr->stringValue("ExternalBrowser", "parameters"); if (!anApp.isEmpty()) { - RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile); + RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile ); rs->start(); } else { - SUIT_MessageBox::warn1(desktop(), tr("WRN_WARNING"), + if( SUIT_MessageBox::warn2(desktop(), tr("WRN_WARNING"), tr("DEFINE_EXTERNAL_BROWSER"), - tr("BUT_OK")); + tr("BUT_OK"), tr("BUT_CANCEL"),0,1,0)==0 ) + onPreferences(); } } -/*!Sets enable or disable some actions on selection changed.*/ +/*! + Sets enable or disable some actions on selection changed. +*/ void LightApp_Application::onSelectionChanged() { } -/*!Return window. - *\param flag - key for window - *\param studyId - study id - * Flag used how identificator of window in windows list. - */ +/*! + \return window by key + \param flag - key for window + \param studyId - study id + Flag used how identificator of window in windows list. +*/ QWidget* LightApp_Application::window( const int flag, const int studyId ) const { QWidget* wid = 0; @@ -850,12 +1026,13 @@ QWidget* LightApp_Application::window( const int flag, const int studyId ) const return wid; } -/*!Adds window to application. - *\param wid - QWidget - *\param flag - key wor window - *\param studyId - study id - * Flag used how identificator of window in windows list. - */ +/*! + Adds window to application. + \param wid - QWidget + \param flag - key for window + \param studyId - study id + Flag used how identificator of window in windows list. +*/ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int studyId ) { if ( !wid ) @@ -877,6 +1054,8 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st LightApp_WidgetContainer* newWC = new LightApp_WidgetContainer( flag, desktop() ); connect( newWC, SIGNAL( destroyed ( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) ); + // asv: connecting a slot for storing visibility flag of a window + connect( newWC, SIGNAL( visibilityChanged ( bool ) ), SLOT( onVisibilityChanged( bool ) ) ); myWindows.insert( flag, newWC ); if ( winMap.contains( flag ) ) desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] ); @@ -889,17 +1068,19 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st } QFont f; +#ifndef DISABLE_PYCONSOLE if( wid->inherits( "PythonConsole" ) ) { if( resourceMgr()->hasValue( "PyConsole", "font" ) ) f = resourceMgr()->fontValue( "PyConsole", "font" ); else - { - f = ( ( PythonConsole* )wid )->font(); - resourceMgr()->setValue( "PyConsole", "font", f ); - } + { + f = ( ( PythonConsole* )wid )->font(); + resourceMgr()->setValue( "PyConsole", "font", f ); + } } else +#endif f = wid->font(); myWindows[flag]->insert( sId, wid ); @@ -908,11 +1089,12 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st setWindowShown( flag, !myWindows[flag]->isEmpty() ); } -/*!Remove window from application. - *\param flag - key wor window - *\param studyId - study id - * Flag used how identificator of window in windows list. - */ +/*! + Removes window from application. + \param flag - key for window + \param studyId - study id + Flag used how identificator of window in windows list. +*/ void LightApp_Application::removeWindow( const int flag, const int studyId ) { if ( !myWindows.contains( flag ) ) @@ -934,11 +1116,12 @@ void LightApp_Application::removeWindow( const int flag, const int studyId ) setWindowShown( flag, !myWindows[flag]->isEmpty() ); } -/*!Gets window. - *\param flag - key wor window - *\param studyId - study id - * Flag used how identificator of window in windows list. - */ +/*! + Gets window. + \param flag - key for window + \param studyId - study id + Flag used how identificator of window in windows list. +*/ QWidget* LightApp_Application::getWindow( const int flag, const int studyId ) { QWidget* wid = window( flag, studyId ); @@ -948,7 +1131,10 @@ QWidget* LightApp_Application::getWindow( const int flag, const int studyId ) return wid; } -/*!Check is window visible?(with identificator \a type)*/ +/*! + \return is window visible + \param type - flag of window +*/ bool LightApp_Application::isWindowVisible( const int type ) const { bool res = false; @@ -960,10 +1146,11 @@ bool LightApp_Application::isWindowVisible( const int type ) const return res; } -/*!Sets window show or hide. - *\param type - window identificator. - *\param on - true/false (window show/hide) - */ +/*! + Sets window show or hide. + \param type - window identificator. + \param on - true/false (window show/hide) +*/ void LightApp_Application::setWindowShown( const int type, const bool on ) { if ( !desktop() || !myWindows.contains( type ) ) @@ -971,10 +1158,18 @@ void LightApp_Application::setWindowShown( const int type, const bool on ) QDockWindow* dw = myWindows[type]; desktop()->setAppropriate( dw, on ); - on ? dw->show() : dw->hide(); + if( on ) + dw->show(); + else if( dw->isShown() ) + { + dw->hide(); + myWindowsVisible[ type ] = true; + } } -/*!Gets "ObjectBrowser".*/ +/*! + \return Object Browser +*/ OB_Browser* LightApp_Application::objectBrowser() { OB_Browser* ob = 0; @@ -984,7 +1179,9 @@ OB_Browser* LightApp_Application::objectBrowser() return ob; } -/*!Gets "LogWindow".*/ +/*! + \return Log Window +*/ LogWindow* LightApp_Application::logWindow() { LogWindow* lw = 0; @@ -994,7 +1191,10 @@ LogWindow* LightApp_Application::logWindow() return lw; } -/*!Get "PythonConsole"*/ +#ifndef DISABLE_PYCONSOLE +/*! + \return Python Console +*/ PythonConsole* LightApp_Application::pythonConsole() { PythonConsole* console = 0; @@ -1003,13 +1203,21 @@ PythonConsole* LightApp_Application::pythonConsole() console = (PythonConsole*)wid; return console; } +#endif -/*!Update obect browser*/ +/*! + Updates object browser and maybe data models + \param updateModels - if it is true, then data models are updated +*/ void LightApp_Application::updateObjectBrowser( const bool updateModels ) { // update existing data models if ( updateModels ) { + const bool isAutoUpdate = objectBrowser() ? objectBrowser()->isAutoUpdate() : true; + if( objectBrowser() ) + objectBrowser()->setAutoUpdate( false ); + LightApp_Study* study = dynamic_cast(activeStudy()); if ( study ) { CAM_Study::ModelList dm_list; @@ -1020,6 +1228,9 @@ void LightApp_Application::updateObjectBrowser( const bool updateModels ) ((LightApp_DataModel*)camDM)->update(); } } + + if( objectBrowser() ) + objectBrowser()->setAutoUpdate( isAutoUpdate ); } if ( objectBrowser() ) { @@ -1028,13 +1239,19 @@ void LightApp_Application::updateObjectBrowser( const bool updateModels ) } } -/*!Gets preferences.*/ +/*! + \return preferences +*/ LightApp_Preferences* LightApp_Application::preferences() const { return preferences( false ); } -/*!Gets view manager*/ +/*! + \return first view manager of some type + \param vmType - type of view manager + \param create - is it necessary to create view manager in case, when there is no manager of such type +*/ SUIT_ViewManager* LightApp_Application::getViewManager( const QString& vmType, const bool create ) { SUIT_ViewManager* aVM = viewManager( vmType ); @@ -1056,21 +1273,32 @@ SUIT_ViewManager* LightApp_Application::getViewManager( const QString& vmType, c return aVM; } -/*!Create view manager.*/ +/*! + Creates view manager of some type + \param vmType - type of view manager +*/ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType ) { SUIT_ResourceMgr* resMgr = resourceMgr(); SUIT_ViewManager* viewMgr = 0; +#ifndef DISABLE_GLVIEWER if( vmType == GLViewer_Viewer::Type() ) { viewMgr = new GLViewer_ViewManager( activeStudy(), desktop() ); new LightApp_GLSelector( (GLViewer_Viewer2d*)viewMgr->getViewModel(), mySelMgr ); } - else if( vmType == Plot2d_Viewer::Type() ) +#endif +#ifndef DISABLE_PLOT2DVIEWER + if( vmType == Plot2d_Viewer::Type() ) { viewMgr = new Plot2d_ViewManager( activeStudy(), desktop() ); - SPlot2d_Viewer* vm = new SPlot2d_Viewer(); + Plot2d_Viewer* vm; +#ifndef DISABLE_SALOMEOBJECT + vm = new SPlot2d_Viewer(); +#else + vm = new Plot2d_Viewer(); +#endif viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface Plot2d_ViewWindow* wnd = dynamic_cast( viewMgr->getActiveView() ); if( wnd ) @@ -1079,18 +1307,23 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType frame->setBackgroundColor( resMgr->colorValue( "Plot2d", "Background", frame->backgroundColor() ) ); } } - else if( vmType == SUPERVGraph_Viewer::Type() ) - { - viewMgr = new SUPERVGraph_ViewManager( activeStudy(), desktop() ); - SUPERVGraph_Viewer* vm = new SUPERVGraph_Viewer(); - SUPERVGraph_ViewFrame* view = dynamic_cast( vm->getViewManager()->getActiveView() ); - if( view ) - view->setBackgroundColor( resMgr->colorValue( "SUPERVGraph", "Background", view->backgroundColor() ) ); - } - else if( vmType == OCCViewer_Viewer::Type() ) +#endif + //#ifndef DISABLE_SUPERVGRAPHVIEWER + // if( vmType == SUPERVGraph_Viewer::Type() ) + // { + // viewMgr = new SUPERVGraph_ViewManager( activeStudy(), desktop(), new SUPERVGraph_Viewer() ); + // } + //#endif +#ifndef DISABLE_OCCVIEWER + if( vmType == OCCViewer_Viewer::Type() ) { viewMgr = new OCCViewer_ViewManager( activeStudy(), desktop() ); - SOCC_Viewer* vm = new SOCC_Viewer(); + OCCViewer_Viewer* vm; +#ifndef DISABLE_SALOMEOBJECT + vm = new SOCC_Viewer(); +#else + vm = new OCCViewer_Viewer(); +#endif vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) ); vm->setTrihedronSize( resMgr->integerValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) ); int u( 1 ), v( 1 ); @@ -1101,17 +1334,32 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr ); } - else if ( vmType == SVTK_Viewer::Type() ) +#endif +#ifndef DISABLE_VTKVIEWER +#ifndef DISABLE_SALOMEOBJECT + if ( vmType == SVTK_Viewer::Type() ) +#else + if ( vmType == VTKViewer_Viewer::Type() ) +#endif { +#ifndef DISABLE_SALOMEOBJECT viewMgr = new SVTK_ViewManager( activeStudy(), desktop() ); SVTK_Viewer* vm = dynamic_cast( viewMgr->getViewModel() ); if( vm ) { vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) ); - vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ) ); + vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ), + resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) ); new LightApp_VTKSelector( vm, mySelMgr ); } +#else + viewMgr = new VTKViewer_ViewManager( activeStudy(), desktop() ); + VTKViewer_Viewer* vm = dynamic_cast( viewMgr->getViewModel() ); + if ( vm ) + vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) ); +#endif } +#endif if ( !viewMgr ) return 0; @@ -1122,22 +1370,21 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType if ( viewWin && desktop() ) viewWin->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) ); - connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), - this, SLOT( onCloseView( SUIT_ViewManager* ) ) ); - return viewMgr; } -//======================================================================= -// name : onCloseView -/*! Purpose : SLOT. Remove view manager from application*/ -//======================================================================= +/*! + SLOT: Removes view manager from application +*/ void LightApp_Application::onCloseView( SUIT_ViewManager* theVM ) { removeViewManager( theVM ); } -/*!Protected SLOT. On study created.*/ +/*! + Protected SLOT: On study created. + \param theStudy - just created study +*/ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy ) { SUIT_DataObject* aRoot = 0; @@ -1155,7 +1402,10 @@ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy ) activateWindows(); } -/*!Protected SLOT. On study opened.*/ +/*! + Protected SLOT: On study opened. + \param theStudy - just opened study +*/ void LightApp_Application::onStudyOpened( SUIT_Study* theStudy ) { SUIT_DataObject* aRoot = 0; @@ -1209,12 +1459,14 @@ void LightApp_Application::onDesktopActivated() */ QString LightApp_Application::getFileFilter() const { - return "(*.bin)"; - // HDF persistence not yet completed - to be uncommented later - //return "(*.hdf)"; + //return "(*.bin)"; + // HDF persistence + return "(*.hdf)"; } -/*! Gets file name*/ +/*! + Shows file dialog and return user selected file name +*/ QString LightApp_Application::getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ) { @@ -1304,12 +1556,13 @@ void LightApp_Application::updateActions() updateCommandsStatus(); } -//======================================================================= -// name : createNewStudy -/*! Purpose : Create new study*/ -//======================================================================= +/*! + Creates new study +*/ SUIT_Study* LightApp_Application::createNewStudy() { + LightApp_Application::lastStudyId++; + LightApp_Study* aStudy = new LightApp_Study( this ); // Set up processing of major study-related events @@ -1321,7 +1574,10 @@ SUIT_Study* LightApp_Application::createNewStudy() return aStudy; } -/*!Create window.*/ +/*! + Creates window by flag. + \param flag - identificator of window type +*/ QWidget* LightApp_Application::createWindow( const int flag ) { QWidget* wid = 0; @@ -1329,7 +1585,7 @@ QWidget* LightApp_Application::createWindow( const int flag ) { OB_Browser* ob = new OB_Browser( desktop() ); ob->setAutoUpdate( true ); - ob->setAutoOpenLevel( 1 ); + //ob->setAutoOpenLevel( 1 ); // commented by ASV as a fix to bug IPAL10107 ob->setCaption( tr( "OBJECT_BROWSER" ) ); OB_ListView* ob_list = dynamic_cast( const_cast( ob->listView() ) ); @@ -1346,6 +1602,7 @@ QWidget* LightApp_Application::createWindow( const int flag ) ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) ); } +#ifndef DISABLE_PYCONSOLE else if ( flag == WT_PyConsole ) { PythonConsole* pyCons = new PythonConsole( desktop() ); @@ -1353,6 +1610,7 @@ QWidget* LightApp_Application::createWindow( const int flag ) wid = pyCons; // pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) ); } +#endif else if ( flag == WT_LogWindow ) { LogWindow* logWin = new LogWindow( desktop() ); @@ -1363,25 +1621,29 @@ QWidget* LightApp_Application::createWindow( const int flag ) return wid; } -/*!Default windows(Object Browser, Python Console). - * Adds to map \a aMap. +/*! + \return default windows( Object Browser, Python Console ) + Adds to map \a aMap. */ void LightApp_Application::defaultWindows( QMap& aMap ) const { aMap.insert( WT_ObjectBrowser, Qt::DockLeft ); +#ifndef DISABLE_PYCONSOLE aMap.insert( WT_PyConsole, Qt::DockBottom ); +#endif // aMap.insert( WT_LogWindow, Qt::DockBottom ); } -/*!Default view manager.*/ +/*!Default view managers*/ void LightApp_Application::defaultViewManagers( QStringList& ) const { /*!Do nothing.*/ } -/*!Gets preferences. - * Create preferences, if \a crt = true. - */ +/*! + \return preferences. + Create preferences, if \a crt = true. +*/ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const { if ( myPrefs ) @@ -1438,7 +1700,9 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const return myPrefs; } -/*!Add new module to application.*/ +/*! + Adds new module to application +*/ void LightApp_Application::moduleAdded( CAM_Module* mod ) { CAM_Application::moduleAdded( mod ); @@ -1455,7 +1719,9 @@ void LightApp_Application::moduleAdded( CAM_Module* mod ) } } -/*!Create preferences.*/ +/*! + Create preferences +*/ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) { if ( !pref ) @@ -1469,9 +1735,6 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->addPreference( tr( "PREF_MULTI_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "multi_file" ); pref->addPreference( tr( "PREF_ASCII_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "ascii_file" ); - int undoPref = pref->addPreference( tr( "PREF_UNDO_LEVEL" ), studyGroup, LightApp_Preferences::IntSpin, "Study", "undo_level" ); - pref->setItemProperty( undoPref, "min", 1 ); - pref->setItemProperty( undoPref, "max", 100 ); pref->addPreference( tr( "PREF_STORE_POS" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" ); int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab ); @@ -1507,7 +1770,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) LightApp_Preferences::Color, "OCCViewer", "background" ); pref->setItemProperty( occTS, "min", 1 ); - pref->setItemProperty( occTS, "max", 150 ); + pref->setItemProperty( occTS, "max", 1000 ); int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup, LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" ); @@ -1614,13 +1877,18 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) "ObjectBrowser", "auto_size" ); } -/*!Changed preferences */ +/*! + Changes appearance of application according to changed preferences + \param sec - section + \param param - name of changed parameter +*/ void LightApp_Application::preferencesChanged( const QString& sec, const QString& param ) { SUIT_ResourceMgr* resMgr = resourceMgr(); if ( !resMgr ) return; +#ifndef DISABLE_OCCVIEWER if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) ) { int sz = resMgr->integerValue( sec, param, -1 ); @@ -1637,11 +1905,15 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString occVM->getAISContext()->UpdateCurrentViewer(); } } +#endif +#ifndef DISABLE_VTKVIEWER if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) ) { int sz = resMgr->integerValue( "VTKViewer", "trihedron_size", -1 ); + bool isRelative = resMgr->booleanValue( "VTKViewer", "relative_size", true ); QPtrList lst; +#ifndef DISABLE_SALOMEOBJECT viewManagers( SVTK_Viewer::Type(), lst ); for ( QPtrListIterator it( lst ); it.current() && sz >= 0; ++it ) { @@ -1652,12 +1924,15 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString SVTK_Viewer* vtkVM = dynamic_cast( vm ); if( vtkVM ) { - vtkVM->setTrihedronSize( sz ); + vtkVM->setTrihedronSize( sz, isRelative ); vtkVM->Repaint(); } } +#endif } +#endif +#ifndef DISABLE_OCCVIEWER if ( sec == QString( "OCCViewer" ) && ( param == QString( "iso_number_u" ) || param == QString( "iso_number_v" ) ) ) { QPtrList lst; @@ -1671,6 +1946,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString mgr->getOCCViewer()->setIsos( u, v ); } } +#endif if( sec=="ObjectBrowser" ) { @@ -1684,6 +1960,10 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true ); ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual ); ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual ); + if( autoSize ) + for( int i=1; ilistView()->columns(); i++ ) + if( ob->listView()->columnWidth( i )>0 ) + ob->listView()->adjustColumn( i ); updateObjectBrowser( false ); } } @@ -1694,25 +1974,51 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString updateWindows(); } +#ifndef DISABLE_PYCONSOLE if( sec=="PyConsole" ) { if( param=="font" ) if( pythonConsole() ) pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) ); } +#endif } -/*!Update desktop title.*/ +/*! + Saves preferences +*/ +void LightApp_Application::savePreferences() +{ + saveWindowsGeometry(); + + if ( resourceMgr() ) + { + if ( desktop() ) + desktop()->saveGeometry( resourceMgr(), "desktop" ); + resourceMgr()->save(); + } +} + +/*! + Updates desktop title +*/ void LightApp_Application::updateDesktopTitle() { QString aTitle = applicationName(); QString aVer = applicationVersion(); if ( !aVer.isEmpty() ) aTitle += QString( " " ) + aVer; + if ( activeStudy() ) { + QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false ); + aTitle += QString( " - [%1]" ).arg( sName ); + } + desktop()->setCaption( aTitle ); } -/*!Update windows after close document.*/ +/*! + Updates windows after close document +*/ void LightApp_Application::afterCloseDoc() { updateWindows(); @@ -1720,7 +2026,9 @@ void LightApp_Application::afterCloseDoc() CAM_Application::afterCloseDoc(); } -/*!Update module action.*/ +/*! + Updates actions of active module +*/ void LightApp_Application::updateModuleActions() { QString modName; @@ -1731,9 +2039,10 @@ void LightApp_Application::updateModuleActions() myActions[modName]->setOn( true ); } -/*!Gets current windows. - *\param winMap - output current windows map. - */ +/*! + Gets current windows. + \param winMap - output current windows map. +*/ void LightApp_Application::currentWindows( QMap& winMap ) const { winMap.clear(); @@ -1746,9 +2055,10 @@ void LightApp_Application::currentWindows( QMap& winMap ) const defaultWindows( winMap ); } -/*!Gets current view managers. - *\param lst - output current view managers list. - */ +/*! + Gets current view managers. + \param lst - output current view managers list. +*/ void LightApp_Application::currentViewManagers( QStringList& lst ) const { lst.clear(); @@ -1761,22 +2071,36 @@ void LightApp_Application::currentViewManagers( QStringList& lst ) const defaultViewManagers( lst ); } -/*!Update windows.*/ +/*! + Updates windows +*/ void LightApp_Application::updateWindows() { QMap winMap; currentWindows( winMap ); - for ( QMap::ConstIterator it = winMap.begin(); it != winMap.end(); ++it ) - getWindow( it.key() ); + if ( activeStudy() ) { + for ( QMap::ConstIterator it = winMap.begin(); it != winMap.end(); ++it ) + getWindow( it.key() ); - loadWindowsGeometry(); + loadWindowsGeometry(); + } + + // setWindowShown should be done even if no study is active (open). in this case all open windows + // will be hidden, which is neccessary in this case. + for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr ) { + + if ( myWindowsVisible.contains( itr.key() ) && + !myWindowsVisible[ itr.key() ] ) + continue; - for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr ) setWindowShown( itr.key(), !itr.data()->isEmpty() && winMap.contains( itr.key() ) ); + } } -/*!Update view managers.*/ +/*! + Updates view managers +*/ void LightApp_Application::updateViewManagers() { QStringList lst; @@ -1786,7 +2110,9 @@ void LightApp_Application::updateViewManagers() getViewManager( *it, true ); } -/*!Load windows geometry.*/ +/*! + Loads windows geometry +*/ void LightApp_Application::loadWindowsGeometry() { bool store = resourceMgr()->booleanValue( "Study", "store_positions", true ); @@ -1814,7 +2140,9 @@ void LightApp_Application::loadWindowsGeometry() dockMgr->restoreGeometry(); } -/*!Save windows geometry.*/ +/*! + Saves windows geometry +*/ void LightApp_Application::saveWindowsGeometry() { bool store = resourceMgr()->booleanValue( "Study", "store_positions", true ); @@ -1842,7 +2170,9 @@ void LightApp_Application::saveWindowsGeometry() dockMgr->saveGeometry( resourceMgr(), section, false ); } -/*!Activate windows.*/ +/*! + Activates windows +*/ void LightApp_Application::activateWindows() { if ( activeStudy() ) @@ -1852,7 +2182,9 @@ void LightApp_Application::activateWindows() } } -/*!Adds icon names for modules.*/ +/*! + Adds icon names for modules +*/ void LightApp_Application::moduleIconNames( QMap& iconMap ) const { iconMap.clear(); @@ -1880,7 +2212,9 @@ void LightApp_Application::moduleIconNames( QMap& iconMap ) co } } -/*!Insert items in popup, which necessary for current application*/ +/*! + Inserts items in popup, which necessary for current application +*/ void LightApp_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title ) { CAM_Application::contextMenuPopup( type, thePopup, title ); @@ -1893,7 +2227,9 @@ void LightApp_Application::contextMenuPopup( const QString& type, QPopupMenu* th thePopup->insertItem( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) ); } -/*!Create empty study.*/ +/*! + Create empty study +*/ void LightApp_Application::createEmptyStudy() { CAM_Application::createEmptyStudy(); @@ -1901,7 +2237,10 @@ void LightApp_Application::createEmptyStudy() objectBrowser()->updateTree(); } -/*!Activate module \a mod.*/ +/*! + Activates module + \param mod - module to be activated +*/ bool LightApp_Application::activateModule( CAM_Module* mod ) { bool res = CAM_Application::activateModule( mod ); @@ -1910,13 +2249,17 @@ bool LightApp_Application::activateModule( CAM_Module* mod ) return res; } -/*!return keyborad accelerators manager object */ +/*! + \return keyborad accelerators manager object +*/ SUIT_Accel* LightApp_Application::accel() const { return myAccel; } -/*! remove dead widget container from map */ +/*! + Removes dead widget container from map +*/ void LightApp_Application::onWCDestroyed( QObject* ob ) { // remove destroyed widget container from windows map @@ -1931,7 +2274,19 @@ void LightApp_Application::onWCDestroyed( QObject* ob ) } } -/*! redefined to remove view manager from memory */ +/*! + Connects just added view manager +*/ +void LightApp_Application::addViewManager( SUIT_ViewManager* vm ) +{ + connect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), + this, SLOT( onCloseView( SUIT_ViewManager* ) ) ); + STD_Application::addViewManager( vm ); +} + +/*! + Remove view manager from memory +*/ void LightApp_Application::removeViewManager( SUIT_ViewManager* vm ) { disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), @@ -1940,7 +2295,9 @@ void LightApp_Application::removeViewManager( SUIT_ViewManager* vm ) delete vm; } -/*! rename active window of desktop */ +/*! + Renames active window of desktop +*/ void LightApp_Application::onRenameWindow() { if( !desktop() ) @@ -1955,3 +2312,80 @@ void LightApp_Application::onRenameWindow() if( ok && !name.isEmpty() ) w->setCaption( name ); } + +/*! + \return if the library of module exists + \param moduleTitle - title of module +*/ +bool LightApp_Application::isLibExists( const QString& moduleTitle ) const +{ + if( moduleTitle.isEmpty() ) + return false; + + QString lib = moduleLibrary( moduleTitle ); + QStringList paths; +#ifdef WIN32 + paths = QStringList::split( ";", ::getenv( "PATH" ) ); +#else + paths = QStringList::split( ":", ::getenv( "LD_LIBRARY_PATH" ) ); +#endif + + QStringList::const_iterator anIt = paths.begin(), aLast = paths.end(); + for( ; anIt!=aLast; anIt++ ) + { + QFileInfo inf( Qtx::addSlash( *anIt ) + lib ); + if( inf.exists() ) + return true; + } + return false; +} + +/*! + \return default name for an active study +*/ +void LightApp_Application::setDefaultStudyName( const QString& theName ) +{ + QStringList anInfoList; + modules( anInfoList, false ); + + LightApp_Study* aStudy = (LightApp_Study*)activeStudy(); + if( anInfoList.count() == 1 && // to avoid a conflict between different modules + !aStudy->isSaved() ) + { + aStudy->setStudyName( theName ); + updateDesktopTitle(); + } +} + +/*! slot, called on show/hide of a dock window */ +void LightApp_Application::onVisibilityChanged( bool visible ) +{ + const QObject* win = sender(); + + for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr ) + if ( itr.data() == win ) + { + myWindowsVisible[ itr.key() ] = visible; + return; + } +} + +/*! + Custom event handler +*/ +bool LightApp_Application::event( QEvent* e ) +{ + if( e && e->type()==2000 ) + { + QCustomEvent* ce = ( QCustomEvent* )e; + QString* d = ( QString* )ce->data(); + if( SUIT_MessageBox::warn2(0, tr("WRN_WARNING"), + d ? *d : "", + tr("BUT_OK"), tr("BUT_CANCEL"), 0, 1, 0 )==0 ) + onPreferences(); + if( d ) + delete d; + return true; + } + return CAM_Application::event( e ); +} diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 14d2e4c23..b7131da99 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_Application.h // Created: 6/20/2005 18:39:25 PM // Author: OCC team @@ -15,7 +33,9 @@ class LogWindow; class OB_Browser; -class PythonConsole; +#ifndef DISABLE_PYCONSOLE + class PythonConsole; +#endif class STD_Application; class LightApp_WidgetContainer; class LightApp_Preferences; @@ -42,10 +62,35 @@ class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application Q_OBJECT public: - typedef enum { WT_ObjectBrowser, WT_PyConsole, WT_LogWindow, WT_User } WindowTypes; + typedef enum { WT_ObjectBrowser, +#ifndef DISABLE_PYCONSOLE + WT_PyConsole, +#endif + WT_LogWindow, + WT_User } + WindowTypes; + + enum { MenuWindowId = 6 }; - enum { NewGLViewId = CAM_Application::UserID, NewPlot2dId, NewOCCViewId, NewVTKViewId, - PreferencesId, MRUId, RenameId, UserID }; + enum { RenameId = CAM_Application::UserID, + +#ifndef DISABLE_GLVIEWER + NewGLViewId , +#endif + +#ifndef DISABLE_PLOT2DVIEWER + NewPlot2dId, +#endif + +#ifndef DISABLE_OCCVIEWER + NewOCCViewId, +#endif + +#ifndef DISABLE_VTKVIEWER + NewVTKViewId, +#endif + + PreferencesId, MRUId, UserID }; public: LightApp_Application(); virtual ~LightApp_Application(); @@ -62,7 +107,9 @@ public: LogWindow* logWindow(); OB_Browser* objectBrowser(); +#ifndef DISABLE_PYCONSOLE PythonConsole* pythonConsole(); +#endif virtual void updateObjectBrowser( const bool = true ); @@ -79,6 +126,7 @@ public: void updateActions(); SUIT_ViewManager* getViewManager( const QString&, const bool ); + virtual void addViewManager( SUIT_ViewManager* ); virtual void removeViewManager( SUIT_ViewManager* ); QWidget* getWindow( const int, const int = -1 ); QWidget* window( const int, const int = -1 ) const; @@ -96,6 +144,12 @@ public: SUIT_Accel* accel() const; + void setDefaultStudyName( const QString& theName ); + + static int studyId(); + + virtual bool event( QEvent* ); + signals: void studyOpened(); void studySaved(); @@ -103,6 +157,7 @@ signals: public slots: virtual void onHelpContentsModule(); + virtual void onHelpContextModule( const QString&, const QString& ); virtual void onNewDoc(); virtual void onOpenDoc(); virtual void onHelpAbout(); @@ -111,6 +166,10 @@ public slots: protected: virtual void createActions(); + virtual void createActionForViewer( const int id, + const int parentId, + const QString& suffix, + const int accel ); virtual SUIT_Study* createNewStudy(); virtual QWidget* createWindow( const int ); virtual void defaultWindows( QMap& ) const; @@ -128,6 +187,7 @@ protected: LightApp_Preferences* preferences( const bool ) const; virtual void createPreferences( LightApp_Preferences* ); virtual void preferencesChanged( const QString&, const QString& ); + virtual void savePreferences(); virtual void updateDesktopTitle(); protected slots: @@ -151,6 +211,7 @@ private slots: void onMRUActivated( QString ); void onPreferenceChanged( QString&, QString&, QString& ); void onRenameWindow(); + void onVisibilityChanged( bool ); protected: void updateWindows(); @@ -169,20 +230,25 @@ protected: void moduleIconNames( QMap& ) const; void activateWindows(); + bool isLibExists( const QString& ) const; protected: typedef QMap ActionMap; typedef QMap WindowMap; + typedef QMap WindowVisibilityMap; protected: LightApp_Preferences* myPrefs; LightApp_SelectionMgr* mySelMgr; ActionMap myActions; WindowMap myWindows; + WindowVisibilityMap myWindowsVisible; SUIT_Accel* myAccel; static LightApp_Preferences* _prefs_; + + static int lastStudyId; }; #ifdef WIN32 diff --git a/src/LightApp/LightApp_DataModel.cxx b/src/LightApp/LightApp_DataModel.cxx index 6ccba618b..9fe3b086a 100644 --- a/src/LightApp/LightApp_DataModel.cxx +++ b/src/LightApp/LightApp_DataModel.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_DataModel.cxx // Created: 10/25/2004 10:36:06 AM // Author: Sergey LITONIN @@ -6,95 +24,115 @@ #include "LightApp_DataModel.h" #include "LightApp_Study.h" #include "LightApp_RootObject.h" +#include "LightApp_DataObject.h" #include "LightApp_Module.h" #include "LightApp_Application.h" -#include +#include #include #include #include #include -//======================================================================= -// name : LightApp_DataModel::LightApp_DataModel -/*!Purpose : Constructor*/ -//======================================================================= +/*! + Constructor +*/ LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule ) : CAM_DataModel( theModule ) { } -//======================================================================= -// name : LightApp_DataModel::~LightApp_DataModel -/*! Purpose : Destructor*/ -//======================================================================= +/*! + Destructor +*/ LightApp_DataModel::~LightApp_DataModel() { } -//================================================================ -// Function : open -/*! Purpose : Emit opened()*/ -//================================================================ +/*! + Emit opened() +*/ bool LightApp_DataModel::open( const QString&, CAM_Study* study, QStringList ) { emit opened(); //TODO: is it really needed? to be removed maybe... return true; } -//================================================================ -// Function : save -/*! Purpose : Emit saved()*/ -//================================================================ +/*! + Emit saved() +*/ bool LightApp_DataModel::save( QStringList& ) { emit saved(); return true; } -//================================================================ -// Function : saveAs -/*! Purpose : Emit saved()*/ -//================================================================ +/*! + Emit saved() +*/ bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList& ) { emit saved(); return true; } -//================================================================ -// Function : close -/*! Purpose : Emit closed()*/ -//================================================================ +/*! + Emit closed() +*/ bool LightApp_DataModel::close() { emit closed(); return true; } -//================================================================ -// Function : update -/*! Purpose : Update application (empty virtual function).*/ -//================================================================ -void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) +/*! + Build whole data model tree +*/ +void LightApp_DataModel::build() { } -//================================================================ -// Function : getModule -/*! Purpose : gets module*/ -//================================================================ +/*! + Updates data model presentation in some widgets (for example, in object browser +*/ +void LightApp_DataModel::updateWidgets() +{ + LightApp_Application* app = dynamic_cast( module()->application() ); + if( app ) + app->objectBrowser()->updateTree( 0, false ); +} + +/*! + Default behaviour of data model update for light modules +*/ +void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* ) +{ + LightApp_ModuleObject* modelRoot = dynamic_cast( root() ); + DataObjectList ch; + if( modelRoot ) + { + ch = modelRoot->children(); + for ( DataObjectListIterator it( ch ); it.current(); ++it ) + it.current()->setParent( 0 ); + } + build(); + updateWidgets(); + for( DataObjectListIterator it( ch ); it.current(); ++it ) + delete it.current(); +} +/*! + \return corresponding module +*/ LightApp_Module* LightApp_DataModel::getModule() const { return dynamic_cast( module() ); } -//================================================================ -// Function : getStudy -/*! Purpose : gets study */ -//================================================================ +/*! + \return corresponding study +*/ LightApp_Study* LightApp_DataModel::getStudy() const { LightApp_RootObject* aRoot = dynamic_cast( root()->root() ); @@ -103,19 +141,17 @@ LightApp_Study* LightApp_DataModel::getStudy() const return aRoot->study(); } -//================================================================ -// Function : isModified -/*! Purpose : default implementation, always returns false so as not to mask study's isModified()*/ -//================================================================ +/*! + default implementation, always returns false so as not to mask study's isModified() +*/ bool LightApp_DataModel::isModified() const { return false; } -//================================================================ -// Function : isSaved -/*! Purpose : default implementation, always returns true so as not to mask study's isSaved()*/ -//================================================================ +/*! + default implementation, always returns true so as not to mask study's isSaved() +*/ bool LightApp_DataModel::isSaved() const { return true; diff --git a/src/LightApp/LightApp_DataModel.h b/src/LightApp/LightApp_DataModel.h index 7b1f92d6c..c2eb2d6e7 100644 --- a/src/LightApp/LightApp_DataModel.h +++ b/src/LightApp/LightApp_DataModel.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_DataModel.h // Created: 10/25/2004 10:32:33 AM // Author: Sergey LITONIN @@ -47,7 +65,8 @@ signals: protected: LightApp_Study* getStudy() const; - + virtual void build(); + virtual void updateWidgets(); }; #endif diff --git a/src/LightApp/LightApp_DataObject.cxx b/src/LightApp/LightApp_DataObject.cxx index 831385908..a4df6dfa8 100644 --- a/src/LightApp/LightApp_DataObject.cxx +++ b/src/LightApp/LightApp_DataObject.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_DataObject.h" @@ -73,10 +73,6 @@ bool LightApp_DataObject::Key::isEqual( const SUIT_DataObjectKey* other ) const return myEntry == that->myEntry; } -/* - Class: LightApp_DataObject - Level: Public -*/ /*!Constructor. Initialize by \a parent*/ LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent ) : CAM_DataObject( parent ), myCompObject( 0 ), myCompDataType( "" ) @@ -142,10 +138,7 @@ QString LightApp_DataObject::componentDataType() const return myCompDataType; } -/* - Class: LightApp_ModuleObject - Level: Public -*/ + /*!Constructor.Initialize by \a parent.*/ LightApp_ModuleObject::LightApp_ModuleObject( SUIT_DataObject* parent ) diff --git a/src/LightApp/LightApp_DataObject.h b/src/LightApp/LightApp_DataObject.h index 1f194ffc2..4d3613dad 100644 --- a/src/LightApp/LightApp_DataObject.h +++ b/src/LightApp/LightApp_DataObject.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_DATAOBJECT_H #define LIGHTAPP_DATAOBJECT_H diff --git a/src/LightApp/LightApp_DataOwner.cxx b/src/LightApp/LightApp_DataOwner.cxx index add34d91f..dea72f88c 100644 --- a/src/LightApp/LightApp_DataOwner.cxx +++ b/src/LightApp/LightApp_DataOwner.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_DataOwner.h" @@ -37,6 +37,7 @@ LightApp_DataOwner { } +#ifndef DISABLE_SALOMEOBJECT /*!Constructor. Initialize by \a SALOME_InteractiveObject.*/ LightApp_DataOwner ::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ): @@ -44,6 +45,7 @@ LightApp_DataOwner myIO(theIO) { } +#endif /*!Destructor. Do nothing.*/ LightApp_DataOwner @@ -61,6 +63,12 @@ LightApp_DataOwner return other && entry() == other->entry(); } +bool LightApp_DataOwner::operator<( const SUIT_DataOwner& obj ) const +{ + const LightApp_DataOwner* other = dynamic_cast( &obj ); + return entry() < other->entry(); +} + /*!Gets entry.*/ QString LightApp_DataOwner @@ -69,6 +77,7 @@ LightApp_DataOwner return myEntry; } +#ifndef DISABLE_SALOMEOBJECT /*!Gets SALOME_InteractiveObject.*/ const Handle(SALOME_InteractiveObject)& LightApp_DataOwner @@ -76,3 +85,4 @@ LightApp_DataOwner { return myIO; } +#endif diff --git a/src/LightApp/LightApp_DataOwner.h b/src/LightApp/LightApp_DataOwner.h index d76e6d411..7fd43eedc 100644 --- a/src/LightApp/LightApp_DataOwner.h +++ b/src/LightApp/LightApp_DataOwner.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_DATAOWNER_H @@ -22,7 +22,10 @@ #include "LightApp.h" #include "SUIT_DataOwner.h" -#include "SALOME_InteractiveObject.hxx" + +#ifndef DISABLE_SALOMEOBJECT + #include "SALOME_InteractiveObject.hxx" +#endif /*! This class provide data owner objects. @@ -30,17 +33,25 @@ class LIGHTAPP_EXPORT LightApp_DataOwner : public SUIT_DataOwner { public: +#ifndef DISABLE_SALOMEOBJECT LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ); +#endif LightApp_DataOwner( const QString& ); virtual ~LightApp_DataOwner(); virtual bool isEqual( const SUIT_DataOwner& ) const; + virtual bool operator<( const SUIT_DataOwner& ) const; + +#ifndef DISABLE_SALOMEOBJECT const Handle(SALOME_InteractiveObject)& IO() const; +#endif QString entry() const; private: QString myEntry; +#ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject) myIO; +#endif }; typedef SMART(LightApp_DataOwner) LightApp_DataOwnerPtr; diff --git a/src/LightApp/LightApp_DataSubOwner.cxx b/src/LightApp/LightApp_DataSubOwner.cxx index c5a6703a4..aaf1d3613 100644 --- a/src/LightApp/LightApp_DataSubOwner.cxx +++ b/src/LightApp/LightApp_DataSubOwner.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_DataSubOwner.h" diff --git a/src/LightApp/LightApp_DataSubOwner.h b/src/LightApp/LightApp_DataSubOwner.h index 507684d5f..0bd219c42 100644 --- a/src/LightApp/LightApp_DataSubOwner.h +++ b/src/LightApp/LightApp_DataSubOwner.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_DATASUBOWNER_H diff --git a/src/LightApp/LightApp_Dialog.cxx b/src/LightApp/LightApp_Dialog.cxx index b77f62f01..27219f5f1 100644 --- a/src/LightApp/LightApp_Dialog.cxx +++ b/src/LightApp/LightApp_Dialog.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: LightApp_Dialog.cxx // Author: Alexander SOLOVYOV @@ -26,15 +26,9 @@ #include #include -/* - Class : LightApp_Dialog - Description : Base class for all dialogs +/*! + Constructor */ - -//======================================================================= -// name : LightApp_Dialog -// Purpose : Constructor -//======================================================================= LightApp_Dialog::LightApp_Dialog( QWidget* parent, const char* name, bool modal, bool allowResize, const int f, WFlags wf ) : QtxDialog( parent, name, modal, allowResize, f, wf ), @@ -44,36 +38,33 @@ LightApp_Dialog::LightApp_Dialog( QWidget* parent, const char* name, bool modal, setObjectPixmap( "LightApp", tr( "ICON_SELECT" ) ); } -//======================================================================= -// name : ~LightApp_Dialog -// Purpose : Destructor -//======================================================================= +/*! + Destructor +*/ LightApp_Dialog::~LightApp_Dialog() { } -//======================================================================= -// name : show -// Purpose : -//======================================================================= +/*! + Show dialog +*/ void LightApp_Dialog::show() { QtxDialog::show(); } -//======================================================================= -// name : isExclusive -// Purpose : -//======================================================================= +/*! + \return isExclusive status of selection buttons +*/ bool LightApp_Dialog::isExclusive() const { return myIsExclusive; } -//======================================================================= -// name : updateButtons -// Purpose : -//======================================================================= +/*! + Updates "on" state of buttons according to special button + \param _id - id of special button (if it is -1, then first selected button will be treated as special) +*/ void LightApp_Dialog::updateButtons( const int _id ) { if( !myIsExclusive ) @@ -97,38 +88,39 @@ void LightApp_Dialog::updateButtons( const int _id ) } } -//======================================================================= -// name : setExclusive -// Purpose : -//======================================================================= +/*! + Sets isExclusive status of selection buttons + \param ex - new value of isExclusive status +*/ void LightApp_Dialog::setExclusive( const bool ex ) { myIsExclusive = ex; updateButtons(); } -//======================================================================= -// name : showObject -// Purpose : -//======================================================================= +/*! + Shows object selection widget + \param id - identificator of object selection widget +*/ void LightApp_Dialog::showObject( const int id ) { setObjectShown( id, true ); } -//======================================================================= -// name : hideObject -// Purpose : -//======================================================================= +/*! + Hides object selection widget + \param id - identificator of object selection widget +*/ void LightApp_Dialog::hideObject( const int id ) { setObjectShown( id, false ); } -//======================================================================= -// name : setObjectShown -// Purpose : -//======================================================================= +/*! + Shows/hides object selection widget + \param id - identificator of object selection widget + \param shown - if it is true, widget will be shown +*/ void LightApp_Dialog::setObjectShown( const int id, const bool shown ) { if( myObjects.contains( id ) && isObjectShown( id )!=shown ) @@ -142,19 +134,20 @@ void LightApp_Dialog::setObjectShown( const int id, const bool shown ) } } -//======================================================================= -// name : isObjectShown -// Purpose : -//======================================================================= +/*! + \return isShown state of object selection widget + \param id - identificator of object selection widget +*/ bool LightApp_Dialog::isObjectShown( const int id ) const { return myObjects.contains( id ) && myObjects[ id ].myEdit->isShown(); } -//======================================================================= -// name : setObjectEnabled -// Purpose : -//======================================================================= +/*! + Change enable state of object selection widget + \param id - identificator of object selection widget + \param en - new value of enable state +*/ void LightApp_Dialog::setObjectEnabled( const int id, const bool en ) { if( myObjects.contains( id ) && isObjectEnabled( id )!=en ) @@ -168,19 +161,22 @@ void LightApp_Dialog::setObjectEnabled( const int id, const bool en ) } } -//======================================================================= -// name : isObjectEnabled -// Purpose : -//======================================================================= +/*! + \return enable state of object selection widget + \param id - identificator of object selection widget +*/ bool LightApp_Dialog::isObjectEnabled( const int id ) const { return myObjects.contains( id ) && myObjects[ id ].myEdit->isEnabled(); } -//======================================================================= -// name : selectObject -// Purpose : -//======================================================================= +/*! + Passes to all active widgets name, type and id of selected object + \param name - name of selected object + \param type - type of selected object + \param id - id of selected object + \param update - is need to update selection description string +*/ void LightApp_Dialog::selectObject( const QString& name, const int type, const QString& id, const bool update ) { QStringList names; names.append( name ); @@ -189,10 +185,13 @@ void LightApp_Dialog::selectObject( const QString& name, const int type, const Q selectObject( names, types, ids, update ); } -//======================================================================= -// name : selectObject -// Purpose : -//======================================================================= +/*! + Passes to all active widgets names, types and ids of selected objects + \param _names - names of selected objects + \param _types - types of selected objects + \param _ids - ids of selected objects + \param update - is need to update selection description string +*/ void LightApp_Dialog::selectObject( const QStringList& _names, const TypesList& _types, const QStringList& _ids, @@ -205,19 +204,19 @@ void LightApp_Dialog::selectObject( const QStringList& _names, selectObject( anIt.key(), _names, _types, _ids, update ); } -//======================================================================= -// name : hasSelection -// Purpose : -//======================================================================= +/*! + \return true if widget has selection + \param id - identificator of object selection widget +*/ bool LightApp_Dialog::hasSelection( const int id ) const { return myObjects.contains( id ) && !myObjects[ id ].myIds.isEmpty(); } -//======================================================================= -// name : clearSelection -// Purpose : -//======================================================================= +/*! + Clears selection of widget + \param id - identificator of object selection widget +*/ void LightApp_Dialog::clearSelection( const int id ) { if( id==-1 ) @@ -239,10 +238,11 @@ void LightApp_Dialog::clearSelection( const int id ) } } -//======================================================================= -// name : objectWg -// Purpose : -//======================================================================= +/*! + \return object selection widget + \param theId - identificator of object selection widget + \param theWgId may be "Label", "Btn" or "Control" +*/ QWidget* LightApp_Dialog::objectWg( const int theId, const int theWgId ) const { QWidget* aResWg = 0; @@ -258,39 +258,41 @@ QWidget* LightApp_Dialog::objectWg( const int theId, const int theWgId ) const return aResWg; } -//======================================================================= -// name : objectText -// Purpose : -//======================================================================= +/*! + \return object selection widget text + \param theId - identificator of object selection widget +*/ QString LightApp_Dialog::objectText( const int theId ) const { return myObjects.contains( theId ) ? myObjects[ theId ].myEdit->text() : ""; } -//======================================================================= -// name : setObjectText -// Purpose : -//======================================================================= +/*! + Sets object selection widget text + \param theId - identificator of object selection widget + \param theText - new text +*/ void LightApp_Dialog::setObjectText( const int theId, const QString& theText ) { if ( myObjects.contains( theId ) ) myObjects[ theId ].myEdit->setText( theText ); } -//======================================================================= -// name : selectedObject -// Purpose : -//======================================================================= +/*! + \return objects selected by widget + \param id - identificator of object selection widget + \param list - list to be filled by selected objects +*/ void LightApp_Dialog::selectedObject( const int id, QStringList& list ) const { if( myObjects.contains( id ) ) list = myObjects[ id ].myIds; } -//======================================================================= -// name : selectedObject -// Purpose : -//======================================================================= +/*! + \return selected object id + \param id - identificator of object selection widget +*/ QString LightApp_Dialog::selectedObject( const int id ) const { if ( myObjects.contains( id ) && myObjects[ id ].myIds.count() > 0 ) @@ -299,10 +301,10 @@ QString LightApp_Dialog::selectedObject( const int id ) const return ""; } -//======================================================================= -// name : objectSelection -// Purpose : -//======================================================================= +/*! + \return all selected objects + \param objs - map: widget id -> string id to be filled with selected objects +*/ void LightApp_Dialog::objectSelection( SelectedObjects& objs ) const { //objs.clear(); @@ -317,10 +319,13 @@ void LightApp_Dialog::objectSelection( SelectedObjects& objs ) const } } -//======================================================================= -// name : createObject -// Purpose : -//======================================================================= +/*! + Creates object selection widget + \return id + \label - label text + \parent - parent object + \id - proposed id for widget (if it is less than 0, the free id will be used) +*/ int LightApp_Dialog::createObject( const QString& label, QWidget* parent, const int id ) { int nid = id; @@ -351,20 +356,22 @@ int LightApp_Dialog::createObject( const QString& label, QWidget* parent, const return nid; } -//======================================================================= -// name : renameObject -// Purpose : -//======================================================================= +/*! + Changes label of object selection widget + \param id - identificator of object selection widget + \param label - new text of label +*/ void LightApp_Dialog::renameObject( const int id, const QString& label ) { if( myObjects.contains( id ) ) myObjects[ id ].myLabel->setText( label ); } -//======================================================================= -// name : setObjectType -// Purpose : -//======================================================================= +/*! + Sets possible types for widget + \param id - identificator of object selection widget + \param type1,... - type +*/ void LightApp_Dialog::setObjectType( const int id, const int type1, ... ) { TypesList types; @@ -379,10 +386,11 @@ void LightApp_Dialog::setObjectType( const int id, const int type1, ... ) setObjectType( id, types ); } -//======================================================================= -// name : setObjectType -// Purpose : -//======================================================================= +/*! + Sets possible types for widget + \param id - identificator of object selection widget + \param list - list of possible types +*/ void LightApp_Dialog::setObjectType( const int id, const TypesList& list ) { if( !myObjects.contains( id ) ) @@ -406,10 +414,11 @@ void LightApp_Dialog::setObjectType( const int id, const TypesList& list ) updateObject( id ); } -//======================================================================= -// name : addObjectType -// Purpose : -//======================================================================= +/*! + Adds new possible types to object selection widget + \param id - identificator of object selection widget + \param type1, ... - new types +*/ void LightApp_Dialog::addObjectType( const int id, const int type1, const int, ... ) { TypesList types; objectTypes( id, types ); @@ -424,20 +433,22 @@ void LightApp_Dialog::addObjectType( const int id, const int type1, const int, . setObjectType( id, types ); } -//======================================================================= -// name : addObjectType -// Purpose : -//======================================================================= +/*! + Adds new possible types to object selection widget + \param id - identificator of object selection widget + \param list - new types +*/ void LightApp_Dialog::addObjectType( const int id, const TypesList& list ) { TypesList types = list; objectTypes( id, types ); setObjectType( id, types ); } -//======================================================================= -// name : addObjectType -// Purpose : -//======================================================================= +/*! + Adds new possible type to object selection widget + \param id - identificator of object selection widget + \param type - new type +*/ void LightApp_Dialog::addObjectType( const int id, const int type ) { TypesList types; objectTypes( id, types ); @@ -445,20 +456,21 @@ void LightApp_Dialog::addObjectType( const int id, const int type ) setObjectType( id, types ); } -//======================================================================= -// name : removeObjectType -// Purpose : -//======================================================================= +/*! + Clears list of possibles types for object selection widget + \param id - identificator of object selection widget +*/ void LightApp_Dialog::removeObjectType( const int id ) { TypesList types; setObjectType( id, types ); } -//======================================================================= -// name : removeObjectType -// Purpose : -//======================================================================= +/*! + Removes types from list of possibles for object selection widget + \param id - identificator of object selection widget + \param list - list of types to be removed +*/ void LightApp_Dialog::removeObjectType( const int id, const TypesList& list ) { if( !myObjects.contains( id ) ) @@ -485,20 +497,22 @@ void LightApp_Dialog::removeObjectType( const int id, const TypesList& list ) updateObject( id ); } -//======================================================================= -// name : removeObjectType -// Purpose : -//======================================================================= +/*! + Removes type from list of possibles for object selection widget + \param id - identificator of object selection widget + \param type - type to be removed +*/ void LightApp_Dialog::removeObjectType( const int id, const int type ) { TypesList list; list.append( type ); removeObjectType( id, list ); } -//======================================================================= -// name : hasObjectType -// Purpose : -//======================================================================= +/*! + \return true if widget has such type + \param id - identificator of object selection widget + \param type - type to be checked +*/ bool LightApp_Dialog::hasObjectType( const int id, const int type ) const { if( myObjects.contains( id ) ) @@ -507,10 +521,11 @@ bool LightApp_Dialog::hasObjectType( const int id, const int type ) const return false; } -//======================================================================= -// name : objectTypes -// Purpose : -//======================================================================= +/*! + Returns list of possible types for widget + \param id - identificator of object selection widget + \param list - list to be filled with possible types +*/ void LightApp_Dialog::objectTypes( const int id, TypesList& list ) const { if( myObjects.contains( id ) ) @@ -522,10 +537,9 @@ void LightApp_Dialog::objectTypes( const int id, TypesList& list ) const } } -//======================================================================= -// name : onToggled -// Purpose : -//======================================================================= +/*! + SLOT: called if selection button is clicked +*/ void LightApp_Dialog::onToggled( bool on ) { QButton* but = ( QButton* )sender(); @@ -550,10 +564,11 @@ void LightApp_Dialog::onToggled( bool on ) emit objectDeactivated( id ); } -//======================================================================= -// name : updateObject -// Purpose : -//======================================================================= +/*! + Updates selection description of widget + \param id - identificator of object selection widget + \param emit_signal - if it is true, the signal "selection changed" is emitted +*/ void LightApp_Dialog::updateObject( const int id, bool emit_signal ) { if( hasSelection( id ) ) @@ -566,10 +581,13 @@ void LightApp_Dialog::updateObject( const int id, bool emit_signal ) } } -//======================================================================= -// name : filterTypes -// Purpose : -//======================================================================= +/*! + Finds in list possible types + \param id - identificator of object selection widget + \param names - list of selected objects names + \param types - list of selected objects types + \param ids - list of selected objects ids +*/ void LightApp_Dialog::filterTypes( const int id, QStringList& names, TypesList& types, QStringList& ids ) const { if( !myObjects.contains( id ) ) @@ -601,19 +619,18 @@ void LightApp_Dialog::filterTypes( const int id, QStringList& names, TypesList& ids = new_ids; } -//======================================================================= -// name : resMgr -// Purpose : -//======================================================================= +/*! + \return global resource manager +*/ SUIT_ResourceMgr* LightApp_Dialog::resMgr() const { return SUIT_Session::session()->resourceMgr(); } -//======================================================================= -// name : setObjectPixmap -// Purpose : -//======================================================================= +/*! + Sets pixmap for all object selection button + \param p - image +*/ void LightApp_Dialog::setObjectPixmap( const QPixmap& p ) { myPixmap = p; @@ -623,10 +640,11 @@ void LightApp_Dialog::setObjectPixmap( const QPixmap& p ) ( ( QToolButton* )anIt.data().myBtn )->setIconSet( p ); } -//======================================================================= -// name : setObjectPixmap -// Purpose : -//======================================================================= +/*! + Sets pixmap all for object selection button + \param section - name of section of resource manager + \param file - name of file +*/ void LightApp_Dialog::setObjectPixmap( const QString& section, const QString& file ) { SUIT_ResourceMgr* mgr = resMgr(); @@ -634,19 +652,19 @@ void LightApp_Dialog::setObjectPixmap( const QString& section, const QString& fi setObjectPixmap( mgr->loadPixmap( section, file ) ); } -//======================================================================= -// name : multipleSelection -// Purpose : -//======================================================================= +/*! + \return true, if it is enable multiple selection + \param id - identificator of object selection widget +*/ bool LightApp_Dialog::multipleSelection( const int id ) const { return nameIndication( id )!=OneName; } -//======================================================================= -// name : nameIndication -// Purpose : -//======================================================================= +/*! + \return type of name indication + \param id - identificator of object selection widget +*/ LightApp_Dialog::NameIndication LightApp_Dialog::nameIndication( const int id ) const { if( myObjects.contains( id ) ) @@ -655,10 +673,11 @@ LightApp_Dialog::NameIndication LightApp_Dialog::nameIndication( const int id ) return OneNameOrCount; } -//======================================================================= -// name : setNameIndication -// Purpose : -//======================================================================= +/*! + Sets type of name indication + \param id - identificator of object selection widget + \param ni - new type of name indication +*/ void LightApp_Dialog::setNameIndication( const int id, const NameIndication ni ) { if( id==-1 ) @@ -682,10 +701,12 @@ void LightApp_Dialog::setNameIndication( const int id, const NameIndication ni ) } } -//======================================================================= -// name : selectionDescription -// Purpose : -//======================================================================= +/*! + \return string representation of selection by selection data + \param names - list of selected objects names + \param types - list of selected objects types + \param ni - type of name indication +*/ QString LightApp_Dialog::selectionDescription( const QStringList& names, const TypesList& types, const NameIndication ni ) const { if( names.count()!=types.count() ) @@ -718,10 +739,10 @@ QString LightApp_Dialog::selectionDescription( const QStringList& names, const T return QString::null; } -//======================================================================= -// name : countOfTypes -// Purpose : -//======================================================================= +/*! + \return string representation of count of types + \param types - list of types +*/ QString LightApp_Dialog::countOfTypes( const TypesList& types ) const { QMap typesCount; @@ -743,39 +764,38 @@ QString LightApp_Dialog::countOfTypes( const TypesList& types ) const return typeCount.join( ", " ); } -//======================================================================= -// name : typeName -// Purpose : -//======================================================================= +/*! + \return reference to type name + \param type - integer id of type +*/ QString& LightApp_Dialog::typeName( const int type ) { return myTypeNames[ type ]; } -//======================================================================= -// name : typeName -// Purpose : -//======================================================================= +/*! + \return const reference to type name + \param type - integer id of type +*/ const QString& LightApp_Dialog::typeName( const int type ) const { return myTypeNames[ type ]; } -//======================================================================= -// name : activateObject -// Purpose : -//======================================================================= +/*! + Activates object selection widget + \param id - identificator of object selection widget +*/ void LightApp_Dialog::activateObject( const int theId ) { if ( myObjects.contains( theId ) && !myObjects[ theId ].myBtn->isOn() ) myObjects[ theId ].myBtn->toggle(); } -//======================================================================= -// name : deactivateAll -// Purpose : -//======================================================================= +/*! + Deactivates all object selection widgets +*/ void LightApp_Dialog::deactivateAll() { ObjectMap::iterator anIt = myObjects.begin(), @@ -787,10 +807,14 @@ void LightApp_Dialog::deactivateAll() } } -//======================================================================= -// name : selectObject -// Purpose : -//======================================================================= +/*! + Passes to widget name, type and id of selected object + \param id - identificator of object selection widget + \param name - name of selected object + \param type - type of selected object + \param selid - id of selected object + \param update - is need to update selection description string +*/ void LightApp_Dialog::selectObject( const int id, const QString& name, const int type, const QString& selid, const bool update ) { QStringList names; names.append( name ); @@ -799,10 +823,14 @@ void LightApp_Dialog::selectObject( const int id, const QString& name, const int selectObject( id, names, types, ids, update ); } -//======================================================================= -// name : selectObject -// Purpose : -//======================================================================= +/*! + Passes to widget names, types and ids of selected objects + \param id - identificator of object selection widget + \param _names - names of selected object + \param _types - types of selected object + \param _ids - ids of selected object + \param update - is need to update selection description string +*/ void LightApp_Dialog::selectObject( const int id, const QStringList& _names, const TypesList& _types, const QStringList& _ids, const bool update ) { @@ -824,20 +852,21 @@ void LightApp_Dialog::selectObject( const int id, const QStringList& _names, con emit selectionChanged( id ); } -//======================================================================= -// name : setReadOnly -// Purpose : -//======================================================================= +/*! + Sets read only state of object selection line edit + \param id - identificator of object selection widget + \param ro - new read only state +*/ void LightApp_Dialog::setReadOnly( const int id, const bool ro ) { if( myObjects.contains( id ) ) myObjects[ id ].myEdit->setReadOnly( nameIndication( id )==ListOfNames || nameIndication( id )==OneName ? ro : true ); } -//======================================================================= -// name : isReadOnly -// Purpose : -//======================================================================= +/*! + \return read only state of object selection line edit + \param id - identificator of object selection widget +*/ bool LightApp_Dialog::isReadOnly( const int id ) const { if( myObjects.contains( id ) ) @@ -845,11 +874,10 @@ bool LightApp_Dialog::isReadOnly( const int id ) const else return true; } - -//======================================================================= -// name : onTextChanged -// Purpose : -//======================================================================= + +/*! + SLOT: called if text of object selection line edit is changed +*/ void LightApp_Dialog::onTextChanged( const QString& text ) { if( myIsBusy ) diff --git a/src/LightApp/LightApp_Dialog.h b/src/LightApp/LightApp_Dialog.h index 12fd50154..a862d6388 100644 --- a/src/LightApp/LightApp_Dialog.h +++ b/src/LightApp/LightApp_Dialog.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: LightApp_Dialog.h // Author: Alexander SOLOVYOV @@ -35,9 +35,13 @@ class QLabel; class SUIT_ResourceMgr; -/* - Class : LightApp_Dialog - Description : Base class for all LightApp dialogs +/*! + \class LightApp_Dialog + Base class for all LightApp dialogs. + Provides standard widget for object selection: line edit, button; + it is necessary to call corresponding methods on selection change. + Standard dialog provides filtering, selection string representation, + possibility to indicate necessary selection by text with list of ids. */ class LIGHTAPP_EXPORT LightApp_Dialog : public QtxDialog { diff --git a/src/LightApp/LightApp_Displayer.cxx b/src/LightApp/LightApp_Displayer.cxx index 65ce0fa3c..0845d5cc9 100644 --- a/src/LightApp/LightApp_Displayer.cxx +++ b/src/LightApp/LightApp_Displayer.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_Displayer.h" @@ -23,8 +23,6 @@ #include -#include - #include #include #include @@ -32,15 +30,30 @@ #include #include +#ifndef DISABLE_SALOMEOBJECT + #include "SALOME_InteractiveObject.hxx" +#endif +/*! + Default constructor +*/ LightApp_Displayer::LightApp_Displayer() { } +/*! + Destructor +*/ LightApp_Displayer::~LightApp_Displayer() { } +/*! + Displays object in view + \param entry - object entry + \param updateViewer - is it necessary to update viewer + \param theViewFrame - view +*/ void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, SALOME_View* theViewFrame ) { SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); @@ -62,6 +75,11 @@ void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, } } +/*! + Redisplays object in view + \param entry - object entry + \param updateViewer - is it necessary to update viewer +*/ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewer ) { // Remove the object permanently ( == true) @@ -92,6 +110,13 @@ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewe } } +/*! + Erases object in view + \param entry - object entry + \param forced - deletes object from viewer (otherwise it will be erased, but cached) + \param updateViewer - is it necessary to update viewer + \param theViewFrame - view +*/ void LightApp_Displayer::Erase( const QString& entry, const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) { @@ -108,6 +133,12 @@ void LightApp_Displayer::Erase( const QString& entry, const bool forced, } } +/*! + Erases all objects in view + \param forced - deletes objects from viewer + \param updateViewer - is it necessary to update viewer + \param theViewFrame - view +*/ void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) const { SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); @@ -119,19 +150,29 @@ void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, S } } +/*! + \return true if object is displayed in viewer + \param entry - object entry + \param theViewFrame - view +*/ bool LightApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theViewFrame ) const { SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); + bool res = false; if( vf ) { +#ifndef DISABLE_SALOMEOBJECT Handle( SALOME_InteractiveObject ) temp = new SALOME_InteractiveObject(); temp->setEntry( entry.latin1() ); - return vf->isVisible( temp ); + res = vf->isVisible( temp ); +#endif } - else - return false; + return res; } +/*! + Updates active view +*/ void LightApp_Displayer::UpdateViewer() const { SALOME_View* vf = GetActiveView(); @@ -139,6 +180,12 @@ void LightApp_Displayer::UpdateViewer() const vf->Repaint(); } +/*! + \return presentation of object, built with help of CreatePrs method + \param entry - object entry + \param theViewFrame - view + \sa CreatePrs() +*/ SALOME_Prs* LightApp_Displayer::buildPresentation( const QString& entry, SALOME_View* theViewFrame ) { SALOME_Prs* prs = 0; @@ -151,6 +198,9 @@ SALOME_Prs* LightApp_Displayer::buildPresentation( const QString& entry, SALOME_ return prs; } +/*! + \return active view +*/ SALOME_View* LightApp_Displayer::GetActiveView() { SUIT_Session* session = SUIT_Session::session(); @@ -165,11 +215,20 @@ SALOME_View* LightApp_Displayer::GetActiveView() return 0; } -bool LightApp_Displayer::canBeDisplayed( const QString&, const QString& ) const +/*! + \return true, if object can be displayed in this type of viewer + \param entry - object entry + \param viewer_type - type of viewer +*/ +bool LightApp_Displayer::canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const { return true; } +/*! + \return true, if object can be displayed in any type of viewer + \param entry - object entry +*/ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const { QString viewerType; @@ -182,6 +241,11 @@ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const return !viewerType.isNull() && canBeDisplayed( entry, viewerType ); } +/*! + \return displayer, corresponding to module + \param mod_name - name of module + \param load - is module has to be forced loaded +*/ LightApp_Displayer* LightApp_Displayer::FindDisplayer( const QString& mod_name, const bool load ) { SUIT_Session* session = SUIT_Session::session(); diff --git a/src/LightApp/LightApp_Displayer.h b/src/LightApp/LightApp_Displayer.h index aef78d214..5b4318965 100644 --- a/src/LightApp/LightApp_Displayer.h +++ b/src/LightApp/LightApp_Displayer.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_DISPLAYER_HEADER @@ -26,6 +26,11 @@ class QString; +/*! + \class LightApp_Displayer + Uniform mechanism of display/erase of objects in different views. + Objects are specified by string entry +*/ class LIGHTAPP_EXPORT LightApp_Displayer : public SALOME_Displayer { public: diff --git a/src/LightApp/LightApp_Driver.cxx b/src/LightApp/LightApp_Driver.cxx index 122890390..e8e161dc5 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_Driver.h" @@ -49,10 +49,9 @@ LightApp_Driver::~LightApp_Driver() using namespace std; -//================================================================ -// Function : SaveDatasInFile -/*! Purpose : save in file 'theFileName' datas from this driver*/ -//================================================================ +/*! + Save in file 'theFileName' datas from this driver +*/ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile ) { int aNbModules = 0; @@ -133,10 +132,9 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile return true; } -//======================================================================= -// name : ReaDatasFromFile -/*! Purpose : filling current driver from file 'theFileName'*/ -//======================================================================= +/*! + Filling current driver from file 'theFileName' +*/ bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFile ) { #ifdef WNT @@ -193,10 +191,9 @@ bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFi return true; } -//================================================================ -// Function : GetTmpDir -/*! Purpose : returns temp directory for path 'theURL'*/ -//================================================================ +/*! + \return temp directory for path 'theURL' +*/ std::string LightApp_Driver::GetTmpDir (const char* theURL, const bool isMultiFile) { std::string anURLDir = GetDirFromPath(theURL); @@ -205,10 +202,9 @@ std::string LightApp_Driver::GetTmpDir (const char* theURL, const bool isMultiF return aTmpDir; } -//================================================================ -// Function : GetListOfFiles -/*! Purpose : returns list of files for module with name 'theModuleName'*/ -//================================================================ +/*! + \return list of files for module with name 'theModuleName' +*/ LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles( const char* theModuleName ) { ListOfFiles aListOfFiles; @@ -220,20 +216,18 @@ LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles( const char* theMod return aListOfFiles; } -//================================================================ -// Function : SetListOfFiles -/*! Purpose : sets list of files for module with name 'theModuleName'*/ -//================================================================ +/*! + Sets list of files for module with name 'theModuleName' +*/ void LightApp_Driver::SetListOfFiles( const char* theModuleName, const ListOfFiles theListOfFiles ) { std::string aName (theModuleName); myMap[aName] = theListOfFiles; } -//============================================================================ -// function : PutFilesToStream -/*! Purpose : converts files which was created from module into a byte sequence unsigned char*/ -//============================================================================ +/*! + Converts files which was created from module into a byte sequence unsigned char +*/ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsigned char*& theBuffer, long& theBufferSize, bool theNamesOnly ) { @@ -342,10 +336,9 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign theBufferSize = aBufferSize; } -//============================================================================ -// function : PutStreamToFile -/*! Purpose : converts a byte sequence to files and return list of them*/ -//============================================================================ +/*! + Converts a byte sequence to files and return list of them +*/ LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned char* theBuffer, const long theBufferSize, bool theNamesOnly ) { @@ -406,13 +399,11 @@ LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned c return aFiles; } -//============================================================================ -// function : RemoveFiles -/*! Purpose : Remove files. First item in is a directory with slash at the end. - Other items are names of files. If is true, - then the directory is also deleted. +/*! + Remove files. First item in is a directory with slash at the end. + Other items are names of files. If is true, + then the directory is also deleted. */ -//============================================================================ void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted) { int i, aLength = theFiles.size() - 1; @@ -449,11 +440,10 @@ void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDir } } -//============================================================================ -// function : RemoveTemporaryFiles -/*! Purpose : removes files which was created from module theModuleName if - is true tmp directory is also deleted if it is empty*/ -//============================================================================ +/*! + Removes files which was created from module theModuleName if + is true tmp directory is also deleted if it is empty +*/ void LightApp_Driver::RemoveTemporaryFiles( const char* theModuleName, const bool IsDirDeleted ) { std::string aModuleName(theModuleName); @@ -464,10 +454,9 @@ void LightApp_Driver::RemoveTemporaryFiles( const char* theModuleName, const boo } -//============================================================================ -// function : ClearDriverContents -/*! Purpose : clear map of list files*/ -//============================================================================ +/*! + Clears map of list files +*/ void LightApp_Driver::ClearDriverContents() { std::map::iterator it; @@ -483,10 +472,9 @@ void LightApp_Driver::ClearDriverContents() SetIsTemporary( false ); } -//============================================================================ -// function : GetTempDir -/*! Purpose : return a temp directory to store created files like "/tmp/sub_dir/" */ -//============================================================================ +/*! + \return a temp directory to store created files like "/tmp/sub_dir/" +*/ std::string LightApp_Driver::GetTmpDir() { if ( myTmpDir.length() != 0 ) @@ -553,10 +541,9 @@ std::string LightApp_Driver::GetTmpDir() return aTmpDir.ToCString(); } -//============================================================================ -// function : GetDirFromPath -/*! Purpose : returns the dir by the path*/ -//============================================================================ +/*! + \return the dir by the path +*/ std::string LightApp_Driver::GetDirFromPath( const std::string& thePath ) { if(thePath == "") return ""; diff --git a/src/LightApp/LightApp_Driver.h b/src/LightApp/LightApp_Driver.h index f995ce27d..e130b86da 100644 --- a/src/LightApp/LightApp_Driver.h +++ b/src/LightApp/LightApp_Driver.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_DRIVER_H #define LIGHTAPP_DRIVER_H diff --git a/src/LightApp/LightApp_GLSelector.cxx b/src/LightApp/LightApp_GLSelector.cxx index 7913b4edf..ceebdeeb4 100644 --- a/src/LightApp/LightApp_GLSelector.cxx +++ b/src/LightApp/LightApp_GLSelector.cxx @@ -14,14 +14,12 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_GLSelector.h" #include "LightApp_DataOwner.h" -#include - #include /*!Constructor. Initialize by GLViewer_Viewer2d and SUIT_SelectionMgr.*/ @@ -66,7 +64,7 @@ void LightApp_GLSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const GLViewer_Object* obj = cont->SelectedObject(); if ( obj ) { - SALOME_GLOwner* owner = dynamic_cast< SALOME_GLOwner* >( obj->owner() ); + LightApp_GLOwner* owner = dynamic_cast< LightApp_GLOwner* >( obj->owner() ); if( owner ) aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( owner->entry() ) ) ); } @@ -90,7 +88,7 @@ void LightApp_GLSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) GLViewer_Object* obj = *it; if ( obj && obj->getVisible() ) { - SALOME_GLOwner* owner = dynamic_cast< SALOME_GLOwner* >( obj->owner() ); + LightApp_GLOwner* owner = dynamic_cast< LightApp_GLOwner* >( obj->owner() ); if ( owner ) aDisplayed.insert( owner->entry(), obj ); } @@ -115,3 +113,38 @@ void LightApp_GLSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) if ( Nb > 0 ) myViewer->updateAll(); } + + +/*! + Constructor + \param entry - entry of object +*/ +LightApp_GLOwner::LightApp_GLOwner( const char* entry ) +: GLViewer_Owner() +{ + setEntry( entry ); +} + +/*! + Destructor +*/ +LightApp_GLOwner::~LightApp_GLOwner() +{ +} + +/*! + \return entry +*/ +const char* LightApp_GLOwner::entry() const +{ + return myEntry.c_str(); +} + +/*! + Sets new entry + \param entry - entry of object +*/ +void LightApp_GLOwner::setEntry( const char* entry ) +{ + myEntry = entry; +} diff --git a/src/LightApp/LightApp_GLSelector.h b/src/LightApp/LightApp_GLSelector.h index 069669a87..13cb191be 100644 --- a/src/LightApp/LightApp_GLSelector.h +++ b/src/LightApp/LightApp_GLSelector.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_GLSELECTOR_H #define LIGHTAPP_GLSELECTOR_H @@ -25,6 +25,13 @@ #include +#include +#include + +/*! + \class LightApp_GLSelector + Custom selector to get/set selection from GL viewer +*/ class LIGHTAPP_EXPORT LightApp_GLSelector : public SUIT_Selector { Q_OBJECT @@ -48,4 +55,21 @@ private: GLViewer_Viewer2d* myViewer; }; + +/*! + This class provide data owner objects for GLViewer. +*/ +class LIGHTAPP_EXPORT LightApp_GLOwner : public GLViewer_Owner +{ +public: + LightApp_GLOwner( const char* ); + ~LightApp_GLOwner(); + + const char* entry() const; + void setEntry( const char* ); + +private: + std::string myEntry; +}; + #endif diff --git a/src/LightApp/LightApp_Module.cxx b/src/LightApp/LightApp_Module.cxx index 6b4de40b6..9c1a71335 100644 --- a/src/LightApp/LightApp_Module.cxx +++ b/src/LightApp/LightApp_Module.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_Module.cxx // Created: 6/20/2005 16:30:56 AM // Author: OCC team @@ -23,16 +41,37 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef DISABLE_VTKVIEWER +#ifndef DISABLE_SALOMEOBJECT + #include + #include +#else + #include +#endif + #include +#endif +#ifndef DISABLE_OCCVIEWER + #include + #include +#ifndef DISABLE_SALOMEOBJECT + #include +#else + #include +#endif +#endif +#ifndef DISABLE_GLVIEWER + #include + #include +#endif +#ifndef DISABLE_PLOT2DVIEWER + #include + #include +#ifndef DISABLE_SALOMEOBJECT + #include +#else + #include +#endif +#endif #include @@ -96,6 +135,9 @@ void LightApp_Module::contextMenuPopup( const QString& client, QPopupMenu* menu, void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel, SUIT_DataObject* theDataObject ) { + bool upd = getApp()->objectBrowser()->isAutoUpdate(); + getApp()->objectBrowser()->setAutoUpdate( false ); + SUIT_DataObject* aDataObject = theDataObject; if( theIsUpdateDataModel ){ if( CAM_DataModel* aDataModel = dataModel() ){ @@ -113,7 +155,8 @@ void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel, } } } - getApp()->objectBrowser()->updateTree( aDataObject ); + getApp()->objectBrowser()->setAutoUpdate( upd ); + getApp()->objectBrowser()->updateTree( 0, false /*aDataObject*/ ); } /*!NOT IMPLEMENTED*/ @@ -129,6 +172,11 @@ bool LightApp_Module::activateModule( SUIT_Study* study ) if ( res && application() && application()->resourceMgr() ) application()->resourceMgr()->raiseTranslators( name() ); + connect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), + this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) ); + connect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ), + this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) ); + if ( mySwitchOp == 0 ) mySwitchOp = new LightApp_SwitchOp( this ); @@ -141,6 +189,11 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study ) delete mySwitchOp; mySwitchOp = 0; + disconnect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), + this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) ); + disconnect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ), + this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) ); + // abort all operations MapOfOperation::const_iterator anIt; for( anIt = myOperations.begin(); anIt != myOperations.end(); anIt++ ) { @@ -196,14 +249,27 @@ void LightApp_Module::update( const int theFlags ) if ( SUIT_ViewManager* viewMgr = getApp()->activeViewManager() ) if ( SUIT_ViewWindow* viewWnd = viewMgr->getActiveView() ) { +#ifndef DISABLE_VTKVIEWER +#ifndef DISABLE_SALOMEOBJECT if ( viewWnd->inherits( "SVTK_ViewWindow" ) ) ( (SVTK_ViewWindow*)viewWnd )->Repaint(); - else if ( viewWnd->inherits( "OCCViewer_ViewWindow" ) ) +#else + if ( viewWnd->inherits( "VTKViewer_ViewWindow" ) ) + ( (VTKViewer_ViewWindow*)viewWnd )->Repaint(); +#endif +#endif +#ifndef DISABLE_OCCVIEWER + if ( viewWnd->inherits( "OCCViewer_ViewWindow" ) ) ( (OCCViewer_ViewWindow*)viewWnd )->getViewPort()->onUpdate(); - else if ( viewWnd->inherits( "Plot2d_ViewWindow" ) ) +#endif +#ifndef DISABLE_PLOT2DVIEWER + if ( viewWnd->inherits( "Plot2d_ViewWindow" ) ) ( (Plot2d_ViewWindow*)viewWnd )->getViewFrame()->Repaint(); - else if ( viewWnd->inherits( "GLViewer_ViewFrame" ) ) +#endif +#ifndef DISABLE_GLVIEWER + if ( viewWnd->inherits( "GLViewer_ViewFrame" ) ) ( (GLViewer_ViewFrame*)viewWnd )->getViewPort()->onUpdate(); +#endif } } } @@ -280,9 +346,40 @@ QtxPopupMgr* LightApp_Module::popupMgr() myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, true ); myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, true ); myPopupMgr->setRule( dispOnly, uniform, true ); - QString viewers = "{ '%1' '%2' '%3' }"; - viewers = viewers.arg( SOCC_Viewer::Type() ).arg( SVTK_Viewer::Type() ).arg( SPlot2d_Viewer::Type() ); - myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( viewers ), true ); + + QStringList viewers; + +#ifndef DISABLE_OCCVIEWER +#ifndef DISABLE_SALOMEOBJECT + viewers.append( SOCC_Viewer::Type() ); +#else + viewers.append( OCCViewer_Viewer::Type() ); +#endif +#endif +#ifndef DISABLE_VTKVIEWER +#ifndef DISABLE_SALOMEOBJECT + viewers.append( SVTK_Viewer::Type() ); +#else + viewers.append( VTKViewer_Viewer::Type() ); +#endif +#endif +#ifndef DISABLE_PLOT2DVIEWER +#ifndef DISABLE_SALOMEOBJECT + viewers.append( SPlot2d_Viewer::Type() ); +#else + viewers.append( Plot2d_Viewer::Type() ); +#endif +#endif + + if( !viewers.isEmpty() ) + { + QString strViewers = "{ ", temp = "'%1' "; + QStringList::const_iterator anIt = viewers.begin(), aLast = viewers.end(); + for( ; anIt!=aLast; anIt++ ) + strViewers+=temp.arg( *anIt ); + strViewers+="}"; + myPopupMgr->setRule( eraseAll, QString( "client in %1" ).arg( strViewers ), true ); + } } return myPopupMgr; } @@ -434,11 +531,18 @@ void LightApp_Module::onOperationDestroyed() } } +/*! + Must be redefined in order to use standard displayer mechanism + \return displayer of module +*/ LightApp_Displayer* LightApp_Module::displayer() { return 0; } +/*! + SLOT: called on activating of standard operations show/hide +*/ void LightApp_Module::onShowHide() { if( !sender()->inherits( "QAction" ) || !popupMgr() ) @@ -449,3 +553,17 @@ void LightApp_Module::onShowHide() if( id!=-1 ) startOperation( id ); } + +/*! + virtual SLOT: called on view manager adding +*/ +void LightApp_Module::onViewManagerAdded( SUIT_ViewManager* ) +{ +} + +/*! + virtual SLOT: called on view manager removing +*/ +void LightApp_Module::onViewManagerRemoved( SUIT_ViewManager* ) +{ +} diff --git a/src/LightApp/LightApp_Module.h b/src/LightApp/LightApp_Module.h index 8c4c3034c..79fd77fe9 100644 --- a/src/LightApp/LightApp_Module.h +++ b/src/LightApp/LightApp_Module.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_Module.h // Created: 6/20/2005 16:25:06 AM // Author: OCC team @@ -22,6 +40,7 @@ class LightApp_Displayer; class SUIT_Study; class SUIT_DataObject; class SUIT_Operation; +class SUIT_ViewManager; class CAM_Application; class QtxPopupMgr; @@ -29,9 +48,9 @@ class QtxPopupMgr; class QString; class QVariant; -/* - Class : LightApp_Module - Description : Base class for all light modules +/*! + \class LightApp_Module + Base class for all light modules */ class LIGHTAPP_EXPORT LightApp_Module : public CAM_Module @@ -82,6 +101,8 @@ protected slots: virtual void onOperationStopped( SUIT_Operation* ); virtual void onOperationDestroyed(); virtual void onShowHide(); + virtual void onViewManagerAdded( SUIT_ViewManager* ); + virtual void onViewManagerRemoved( SUIT_ViewManager* ); protected: virtual QtxPopupMgr* popupMgr(); diff --git a/src/LightApp/LightApp_ModuleDlg.cxx b/src/LightApp/LightApp_ModuleDlg.cxx index b067b0e5d..d7777bdaa 100644 --- a/src/LightApp/LightApp_ModuleDlg.cxx +++ b/src/LightApp/LightApp_ModuleDlg.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : LightApp_ModuleDlg.cxx // Author : Michael Zorin (mzn) diff --git a/src/LightApp/LightApp_ModuleDlg.h b/src/LightApp/LightApp_ModuleDlg.h index 526f16f22..9b818344c 100644 --- a/src/LightApp/LightApp_ModuleDlg.h +++ b/src/LightApp/LightApp_ModuleDlg.h @@ -1,8 +1,22 @@ -// SALOME SALOMEGUI : implementation of desktop and GUI kernel +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// Copyright (C) 2005 CEA/DEN, EDF R&D +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// SALOME SALOMEGUI : implementation of desktop and GUI kernel // // File : LightApp_ModuleDlg.h // Author : Michael ZORIN (mzn) @@ -19,6 +33,11 @@ class QFrame; class QLabel; class QPushButton; +/*! + \class LightApp_ModuleDlg + Dialog allows to choose action on module activation when there is no document. + It is possible to create new document, to open existing or to cancel module activation +*/ class LIGHTAPP_EXPORT LightApp_ModuleDlg : public QDialog { Q_OBJECT diff --git a/src/LightApp/LightApp_NameDlg.cxx b/src/LightApp/LightApp_NameDlg.cxx index 609927305..e1bca58ce 100644 --- a/src/LightApp/LightApp_NameDlg.cxx +++ b/src/LightApp/LightApp_NameDlg.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : LightApp_NameDlg.cxx // Author : Vadim SANDLER @@ -123,6 +123,9 @@ QString LightApp_NameDlg::name() return myLineEdit->text(); } +/*! + Accepts if name isn't empty +*/ void LightApp_NameDlg::accept() { if ( name().stripWhiteSpace().isEmpty() ) diff --git a/src/LightApp/LightApp_NameDlg.h b/src/LightApp/LightApp_NameDlg.h index c0309c0f2..45f64c15b 100644 --- a/src/LightApp/LightApp_NameDlg.h +++ b/src/LightApp/LightApp_NameDlg.h @@ -1,8 +1,22 @@ -// SALOME SalomeApp : implementation of desktop and GUI kernel +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// Copyright (C) 2003 CEA/DEN, EDF R&D +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// SALOME SalomeApp : implementation of desktop and GUI kernel // // File : LightApp_NameDlg.h // Author : Vadim SANDLER @@ -18,10 +32,10 @@ class QLineEdit; class QPushButton; -//================================================================================= -// class : LightApp_NameDlg -/*! purpose : Common dialog box class*/ -//================================================================================= +/*! + \class LightApp_NameDlg + Common dialog box class +*/ class LIGHTAPP_EXPORT LightApp_NameDlg : public QDialog { Q_OBJECT diff --git a/src/LightApp/LightApp_OBFilter.cxx b/src/LightApp/LightApp_OBFilter.cxx index 90a3ce940..b15720271 100644 --- a/src/LightApp/LightApp_OBFilter.cxx +++ b/src/LightApp/LightApp_OBFilter.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_OBFilter.h" diff --git a/src/LightApp/LightApp_OBFilter.h b/src/LightApp/LightApp_OBFilter.h index 4ea292132..79e010c14 100644 --- a/src/LightApp/LightApp_OBFilter.h +++ b/src/LightApp/LightApp_OBFilter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_OBFILTER_H #define LIGHTAPP_OBFILTER_H @@ -24,6 +24,10 @@ class LightApp_SelectionMgr; +/*! + \class LightApp_OBFilter + Custom Object Browser filter, that checks correctness of object by all filters set in selection manager +*/ class LIGHTAPP_EXPORT LightApp_OBFilter: public OB_Filter { public: diff --git a/src/LightApp/LightApp_OBSelector.cxx b/src/LightApp/LightApp_OBSelector.cxx index 76317bf95..0b762d420 100644 --- a/src/LightApp/LightApp_OBSelector.cxx +++ b/src/LightApp/LightApp_OBSelector.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_OBSelector.h" @@ -74,9 +74,13 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const LightApp_DataObject* obj = dynamic_cast( it.current() ); if ( obj ) { +#ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject ( obj->entry(), obj->componentDataType(), obj->name() ); LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj ); +#else + LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() ); +#endif that->mySelectedList.append( SUIT_DataOwnerPtr( owner ) ); } } @@ -103,6 +107,7 @@ void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) } myBrowser->setSelected( objList ); + mySelectedList.clear(); } /*!On selection changed.*/ diff --git a/src/LightApp/LightApp_OBSelector.h b/src/LightApp/LightApp_OBSelector.h index e8fc44371..f6811946c 100644 --- a/src/LightApp/LightApp_OBSelector.h +++ b/src/LightApp/LightApp_OBSelector.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_OBSELECTOR_H #define LIGHTAPP_OBSELECTOR_H @@ -27,6 +27,10 @@ class OB_Browser; class LightApp_DataObject; +/*! + \class LightApp_OBSelector + Custom selector to get/set selection from object browser +*/ class LIGHTAPP_EXPORT LightApp_OBSelector : public SUIT_Selector { Q_OBJECT diff --git a/src/LightApp/LightApp_OCCSelector.cxx b/src/LightApp/LightApp_OCCSelector.cxx index d0b07bb7b..446ae593b 100644 --- a/src/LightApp/LightApp_OCCSelector.cxx +++ b/src/LightApp/LightApp_OCCSelector.cxx @@ -14,14 +14,15 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_DataOwner.h" #include "LightApp_OCCSelector.h" -#include - +#ifndef DISABLE_SALOMEOBJECT + #include +#endif #include #include @@ -68,9 +69,13 @@ void LightApp_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() ) if ( !anIt.Value().IsNull() ) { +#ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast(anIt.Value()->GetOwner()); if( !anObj.IsNull() ) aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( anObj ) ) ); +#else + aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) ); +#endif } } @@ -112,10 +117,13 @@ QString LightApp_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS if ( anAIS.IsNull() || !anAIS->HasOwner() ) return QString::null; - Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast(anAIS->GetOwner()); - QString res; + +#ifndef DISABLE_SALOMEOBJECT + Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast(anAIS->GetOwner()); if ( !anObj.IsNull() ) res = QString( anObj->getEntry() ); +#endif + return res; } diff --git a/src/LightApp/LightApp_OCCSelector.h b/src/LightApp/LightApp_OCCSelector.h index 5a53992e0..c358efe8a 100644 --- a/src/LightApp/LightApp_OCCSelector.h +++ b/src/LightApp/LightApp_OCCSelector.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_OCCSELECTOR_H #define LIGHTAPP_OCCSELECTOR_H @@ -27,6 +27,10 @@ class Handle_AIS_InteractiveObject; +/*! + \class LightApp_OCCSelector + Custom selector to get/set selection from OCC viewer +*/ class LIGHTAPP_EXPORT LightApp_OCCSelector : public SUIT_Selector { Q_OBJECT diff --git a/src/LightApp/LightApp_Operation.cxx b/src/LightApp/LightApp_Operation.cxx index 197eb93ee..86450eb81 100755 --- a/src/LightApp/LightApp_Operation.cxx +++ b/src/LightApp/LightApp_Operation.cxx @@ -1,12 +1,24 @@ -// LIGHT LightApp -// -// Copyright (C) 2005 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : LightApp_Operation.h // Author : Sergey LITONIN -// Module : LIGHT +// Module : LightApp #include #include @@ -121,10 +133,6 @@ void LightApp_Operation::suspendOperation() setDialogActive( false ); } -//======================================================================= -// name : abortOperation -// Purpose : Hide dialog box (if it is exists) -//======================================================================= /*! * \brief Performs actions needed for aborting operation * diff --git a/src/LightApp/LightApp_Operation.h b/src/LightApp/LightApp_Operation.h index 4b07bd7b2..8afcda91a 100755 --- a/src/LightApp/LightApp_Operation.h +++ b/src/LightApp/LightApp_Operation.h @@ -1,8 +1,20 @@ -// LIGHT LightApp -// -// Copyright (C) 2005 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : LightApp_Operation.h // Author : Sergey LITONIN @@ -22,15 +34,10 @@ class LightApp_SelectionMgr; class LightApp_Dialog; class SUIT_Desktop; -/* - Class : LightApp_Operation - Description : Base class for all operations -*/ - /*! - * \brief Base class for all operations - * - * Base class for all operations (see SUIT_Operation for more description) + \class LightApp_Operation + \brief Base class for all operations + Base class for all operations (see SUIT_Operation for more description) */ class LIGHTAPP_EXPORT LightApp_Operation : public SUIT_Operation { diff --git a/src/LightApp/LightApp_Preferences.cxx b/src/LightApp/LightApp_Preferences.cxx index 96d6abcb2..65a7ef490 100644 --- a/src/LightApp/LightApp_Preferences.cxx +++ b/src/LightApp/LightApp_Preferences.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: LightApp_Preferences.cxx // Author: Sergey TELKOV @@ -61,7 +61,7 @@ int LightApp_Preferences::addPreference( const QString& mod, const QString& labe return id; } -/* +/*! Checks: is preferences has module with name \a mod. */ bool LightApp_Preferences::hasModule( const QString& mod ) const diff --git a/src/LightApp/LightApp_Preferences.h b/src/LightApp/LightApp_Preferences.h index 2aa97f143..f3d791986 100644 --- a/src/LightApp/LightApp_Preferences.h +++ b/src/LightApp/LightApp_Preferences.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: LightApp_Preferences.h // Author: Sergey TELKOV @@ -31,6 +31,11 @@ class QtxResourceMgr; +/*! + \class LightApp_Preferences + Custom preference container. Assign each preference category with module. + Emits signal on preference changing +*/ class LIGHTAPP_EXPORT LightApp_Preferences : public QtxListResourceEdit { Q_OBJECT diff --git a/src/LightApp/LightApp_PreferencesDlg.cxx b/src/LightApp/LightApp_PreferencesDlg.cxx index af26451f7..e15c16832 100644 --- a/src/LightApp/LightApp_PreferencesDlg.cxx +++ b/src/LightApp/LightApp_PreferencesDlg.cxx @@ -14,13 +14,12 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: LightApp_PreferencesDlg.cxx // Author: Sergey TELKOV #include "LightApp_PreferencesDlg.h" - #include "LightApp_Preferences.h" #include "QtxResourceMgr.h" @@ -29,12 +28,13 @@ #include #include #include +#include /*! Constructor. */ LightApp_PreferencesDlg::LightApp_PreferencesDlg( LightApp_Preferences* prefs, QWidget* parent ) -: QtxDialog( parent, 0, true, false, OK | Close | Apply ), +: QtxDialog( parent, 0, true, true, OK | Close | Apply ), myPrefs( prefs ), mySaved ( false ) { setCaption( tr( "CAPTION" ) ); @@ -58,6 +58,9 @@ myPrefs( prefs ), mySaved ( false ) QButton* defBtn = userButton( insertButton( tr( "DEFAULT_BTN_TEXT" ) ) ); if ( defBtn ) connect( defBtn, SIGNAL( clicked() ), this, SLOT( onDefault() ) ); + QButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) ); + if( impBtn ) + connect( impBtn, SIGNAL( clicked() ), this, SLOT( onImportPref() ) ); } /*! @@ -132,3 +135,24 @@ void LightApp_PreferencesDlg::onDefault() } } } + +/*! Import preferences from some file */ +void LightApp_PreferencesDlg::onImportPref() +{ + QtxResourceMgr* mgr = myPrefs->resourceMgr(); + if( !mgr ) + return; + + QFileDialog dlg( ".", "*", this, "", tr( "IMPORT_PREFERENCES" ) ); + dlg.setShowHiddenFiles( true ); + dlg.exec(); + QString fname = dlg.selectedFile(); + if( fname.isEmpty() ) + return; + + if( mgr->import( fname ) ) + { + myPrefs->retrieve(); + myPrefs->toBackup(); + } +} diff --git a/src/LightApp/LightApp_PreferencesDlg.h b/src/LightApp/LightApp_PreferencesDlg.h index 771714519..4c7f20f30 100644 --- a/src/LightApp/LightApp_PreferencesDlg.h +++ b/src/LightApp/LightApp_PreferencesDlg.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: LightApp_PreferencesDlg.h // Author: Sergey TELKOV @@ -28,6 +28,10 @@ class LightApp_Preferences; +/*! + \class LightApp_PreferencesDlg + Dialog for preferences edition +*/ class LIGHTAPP_EXPORT LightApp_PreferencesDlg : public QtxDialog { Q_OBJECT @@ -47,6 +51,7 @@ private slots: void onHelp(); void onApply(); void onDefault(); + void onImportPref(); private: LightApp_Preferences* myPrefs; diff --git a/src/LightApp/LightApp_RootObject.h b/src/LightApp/LightApp_RootObject.h index f5daff71c..1c1543a46 100644 --- a/src/LightApp/LightApp_RootObject.h +++ b/src/LightApp/LightApp_RootObject.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_ROOTOBJECT_H #define LIGHTAPP_ROOTOBJECT_H diff --git a/src/LightApp/LightApp_Selection.cxx b/src/LightApp/LightApp_Selection.cxx index bca35cfec..5620c41d3 100644 --- a/src/LightApp/LightApp_Selection.cxx +++ b/src/LightApp/LightApp_Selection.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_Selection.h" @@ -86,13 +86,13 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr LightApp_DataOwner* sowner = dynamic_cast( (*anIt ).get() ); if( sowner ) { - if( entries.contains( sowner->entry() ) ) + entry = myStudy->referencedToEntry( sowner->entry() ); + if( entries.contains( entry ) ) continue; - entry = myStudy->referencedToEntry( sowner->entry() ); entries.insert( entry, 0 ); myEntries.insert( num, entry ); - myIsReferences.insert( num, sowner->entry() == entry ); + myIsReferences.insert( num, sowner->entry() != entry ); processOwner( sowner ); num++; } @@ -153,7 +153,12 @@ QtxValue LightApp_Selection::param( const int ind, const QString& p ) const LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false ); // false in last parameter means that now we doesn't load module, if it isn't loaded - return QtxValue( d ? d->canBeDisplayed( myEntries[ ind ] ) : true, 0 ); + if ( d ) + return d->canBeDisplayed( myEntries[ ind ] ); + else if ( myEntries[ ind ].startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) ) // object is a Save Point object + return false; + + return true; //now if displayer is null, it means, that according module isn't loaded, so that we allow to all display/erase //operations under object } diff --git a/src/LightApp/LightApp_Selection.h b/src/LightApp/LightApp_Selection.h index 79cc0fac6..846699f3b 100644 --- a/src/LightApp/LightApp_Selection.h +++ b/src/LightApp/LightApp_Selection.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -37,7 +37,13 @@ class LightApp_DataOwner; class LightApp_Study; class SUIT_ViewWindow; - +/*! + \class LightApp_Selection + Custom selection class, allowing to build popup with rules on the base + of owners selected in all selectors (popup client has more priority). + It is able to return values of standard object properties + (isVisible,isComponent,canBeDisplayed,isReference, etc) +*/ class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupMgr::Selection { public: diff --git a/src/LightApp/LightApp_SelectionMgr.cxx b/src/LightApp/LightApp_SelectionMgr.cxx index ab7a4f8b1..6d8fb6d44 100644 --- a/src/LightApp/LightApp_SelectionMgr.cxx +++ b/src/LightApp/LightApp_SelectionMgr.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_SelectionMgr.h" @@ -25,13 +25,15 @@ #include -#include -#include +#ifndef DISABLE_SALOMEOBJECT + #include + #include -// Open CASCADE Include -#include -#include -#include + // Open CASCADE Include + #include + #include + #include +#endif /*! Constructor. @@ -57,6 +59,7 @@ LightApp_Application* LightApp_SelectionMgr::application() const return myApp; } +#ifndef DISABLE_SALOMEOBJECT /*! Get all selected objects from selection manager */ @@ -89,12 +92,12 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QStri QString component = study->componentDataType( refEntry ); theList.Append( new SALOME_InteractiveObject( refEntry, component, ""/*refobj->Name().c_str()*/ ) ); } - else + else if( !owner->IO().IsNull() ) theList.Append( owner->IO() ); } } else { - if( !entryMap.contains( entry ) ) + if( !entryMap.contains( entry ) && !owner->IO().IsNull() ) theList.Append( owner->IO() ); } @@ -117,6 +120,37 @@ void LightApp_SelectionMgr::setSelectedObjects( const SALOME_ListIO& lst, const setSelected( owners, append ); } +#else +/*! + Get all selected objects from selection manager +*/ +void LightApp_SelectionMgr::selectedObjects( QStringList& theList, const QString& theType, + const bool convertReferences ) const +{ + theList.clear(); + + SUIT_DataOwnerPtrList aList; + selected( aList, theType ); + + QString entry; + for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) + { + const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); + if( !owner ) + continue; + + LightApp_Study* study = dynamic_cast( application()->activeStudy() ); + if ( !study ) + return; + + entry = owner->entry(); + if( !theList.contains( entry ) ) + theList.append( entry ); + } +} + +#endif + /*! Emit current selection changed. */ @@ -127,6 +161,8 @@ void LightApp_SelectionMgr::selectionChanged( SUIT_Selector* theSel ) emit currentSelectionChanged(); } +#ifndef DISABLE_SALOMEOBJECT + /*! get map of indexes for the given SALOME_InteractiveObject */ @@ -287,3 +323,5 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) } } } + +#endif diff --git a/src/LightApp/LightApp_SelectionMgr.h b/src/LightApp/LightApp_SelectionMgr.h index c063b82be..be758e079 100644 --- a/src/LightApp/LightApp_SelectionMgr.h +++ b/src/LightApp/LightApp_SelectionMgr.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_SELECTIONMGR_H #define LIGHTAPP_SELECTIONMGR_H @@ -22,15 +22,24 @@ #include "LightApp.h" #include -#include -#include +#ifndef DISABLE_SALOMEOBJECT + #include + #include + + class SALOME_ListIO; + class TColStd_IndexedMapOfInteger; + class TColStd_MapOfInteger; +#else +#include +#endif -class SALOME_ListIO; class LightApp_Application; -class TColStd_IndexedMapOfInteger; -class TColStd_MapOfInteger; +/*! + Custom selection manager, allowing to work with object selection + (additionally to data owners) and to access to sub-selection of objects +*/ class LIGHTAPP_EXPORT LightApp_SelectionMgr : public SUIT_SelectionMgr { Q_OBJECT @@ -39,11 +48,12 @@ public: LightApp_SelectionMgr( LightApp_Application*, const bool = true ); virtual ~LightApp_SelectionMgr(); + LightApp_Application* application() const; + +#ifndef DISABLE_SALOMEOBJECT typedef QMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger; typedef QMap< QString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger; - LightApp_Application* application() const; - void selectedObjects( SALOME_ListIO&, const QString& = QString::null, const bool = true ) const; void setSelectedObjects( const SALOME_ListIO&, const bool = false ); @@ -61,6 +71,9 @@ public: void selectObjects( MapIOOfMapOfInteger theMapIO, bool append ); void selectedSubOwners( MapEntryOfMapOfInteger& theMap ); +#else + void selectedObjects( QStringList&, const QString& = QString::null, const bool = true ) const; +#endif signals: void currentSelectionChanged(); diff --git a/src/LightApp/LightApp_ShowHideOp.cxx b/src/LightApp/LightApp_ShowHideOp.cxx index 52f16266f..a329cf889 100644 --- a/src/LightApp/LightApp_ShowHideOp.cxx +++ b/src/LightApp/LightApp_ShowHideOp.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_ShowHideOp.h" @@ -28,19 +28,30 @@ #include "LightApp_SelectionMgr.h" #include "LightApp_Selection.h" -#include -#include +#ifndef DISABLE_SALOMEOBJECT + #include + #include +#endif +/*! + Constructor +*/ LightApp_ShowHideOp::LightApp_ShowHideOp( ActionType type ) : LightApp_Operation(), myActionType( type ) { } +/*! + Destructor +*/ LightApp_ShowHideOp::~LightApp_ShowHideOp() { } +/*! + Makes show/hide operation +*/ void LightApp_ShowHideOp::startOperation() { LightApp_Application* app = dynamic_cast( application() ); @@ -95,21 +106,33 @@ void LightApp_ShowHideOp::startOperation() } } + QStringList entries; + +#ifndef DISABLE_SALOMEOBJECT SALOME_ListIO selObjs; mgr->selectedObjects( selObjs ); - - QStringList entries; SALOME_ListIteratorOfListIO anIt( selObjs ); for( ; anIt.More(); anIt.Next() ) - { - if( anIt.Value().IsNull() ) - continue; + if( !anIt.Value().IsNull() ) +#else + QStringList selObjs; + mgr->selectedObjects( selObjs ); + QStringList::const_iterator anIt = selObjs.begin(), aLast = selObjs.end(); + for( ; ; anIt!=aLast ) +#endif + { + QString entry = +#ifndef DISABLE_SALOMEOBJECT + anIt.Value()->getEntry(); +#else + *anIt; +#endif - if( study->isComponent( anIt.Value()->getEntry() ) ) - study->children( anIt.Value()->getEntry(), entries ); - else - entries.append( anIt.Value()->getEntry() ); - } + if( study->isComponent( entry ) ) + study->children( entry, entries ); + else + entries.append( entry ); + } for( QStringList::const_iterator it = entries.begin(), last = entries.end(); it!=last; it++ ) { diff --git a/src/LightApp/LightApp_ShowHideOp.h b/src/LightApp/LightApp_ShowHideOp.h index cac7b918d..687c16dd2 100644 --- a/src/LightApp/LightApp_ShowHideOp.h +++ b/src/LightApp/LightApp_ShowHideOp.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_SHOW_HIDE_OPERATION_HEADER @@ -23,6 +23,12 @@ #include "LightApp_Operation.h" class LightApp_Displayer; + +/*! + \class LightApp_ShowHideOp + Standard operation allowing to show/hide selected objects + corresponding to any module with help of module displayer +*/ class LIGHTAPP_EXPORT LightApp_ShowHideOp : public LightApp_Operation { Q_OBJECT diff --git a/src/LightApp/LightApp_Study.cxx b/src/LightApp/LightApp_Study.cxx index a2e5e4ba9..a37df3ba7 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_Study.h" @@ -23,8 +23,7 @@ #include "LightApp_DataModel.h" #include "LightApp_DataObject.h" #include "LightApp_RootObject.h" -// HDF persistence not yet completed -//#include "LightApp_HDFDriver.h" +#include "LightApp_HDFDriver.h" #include "SUIT_ResourceMgr.h" #include "SUIT_DataObjectIterator.h" @@ -51,11 +50,11 @@ LightApp_Study::LightApp_Study( SUIT_Application* app ) : CAM_Study( app ) { - // HDF persistence not yet completed - //myDriver = new LightApp_HDFDriver(); - myDriver = new LightApp_Driver(); + // HDF persistence + myDriver = new LightApp_HDFDriver(); + //myDriver = new LightApp_Driver(); } - + /*! Destructor. */ @@ -68,6 +67,8 @@ LightApp_Study::~LightApp_Study() */ void LightApp_Study::createDocument() { + setStudyName( QString( "Study%1" ).arg( LightApp_Application::studyId() ) ); + // create myRoot setRoot( new LightApp_RootObject( this ) ); @@ -76,10 +77,9 @@ void LightApp_Study::createDocument() emit created( this ); } -//======================================================================= -// name : openDocument -/*! Purpose : Open document*/ -//======================================================================= +/*! + Opens document +*/ bool LightApp_Study::openDocument( const QString& theFileName ) { myDriver->ClearDriverContents(); @@ -105,10 +105,9 @@ bool LightApp_Study::openDocument( const QString& theFileName ) return res; } -//======================================================================= -// name : loadDocument -/*! Purpose : Load document */ -//======================================================================= +/*! + Loads document +*/ bool LightApp_Study::loadDocument( const QString& theStudyName ) { myDriver->ClearDriverContents(); @@ -137,10 +136,9 @@ bool LightApp_Study::loadDocument( const QString& theStudyName ) return res; } -//======================================================================= -// name : saveDocumentAs -/*! Purpose : Save document */ -//======================================================================= +/*! + Saves document +*/ bool LightApp_Study::saveDocumentAs( const QString& theFileName ) { SUIT_ResourceMgr* resMgr = application()->resourceMgr(); @@ -200,10 +198,9 @@ bool LightApp_Study::saveDocumentAs( const QString& theFileName ) return res; } -//======================================================================= -// name : saveDocument -/*! Purpose : Save document */ -//======================================================================= +/*! + Saves document +*/ bool LightApp_Study::saveDocument() { ModelList list; dataModels( list ); @@ -226,10 +223,9 @@ bool LightApp_Study::saveDocument() return res; } -//================================================================ -// Function : closeDocument -/*! Purpose : Close document */ -//================================================================ +/*! + Closes document +*/ void LightApp_Study::closeDocument(bool permanently) { // Inform everybody that this study is going to close when it's most safe to, @@ -242,27 +238,25 @@ void LightApp_Study::closeDocument(bool permanently) myDriver->ClearDriverContents(); } -//================================================================ -// Function : referencedToEntry -/*! Purpose : Return current entry*/ -//================================================================ +/*! + \return real entry by entry of reference + \param entry - entry of reference object +*/ QString LightApp_Study::referencedToEntry( const QString& entry ) const { return entry; } -//================================================================ -// Function : children -/*! Purpose : Return entries of children of object*/ -//================================================================ +/*! + \return entries of object children +*/ void LightApp_Study::children( const QString&, QStringList& ) const { } -//================================================================ -// Function : isComponent -/*! Purpose : Return true if entry corresponds to component*/ -//================================================================ +/*! + \return true if entry corresponds to component +*/ bool LightApp_Study::isComponent( const QString& entry ) const { if( !root() ) @@ -280,10 +274,9 @@ bool LightApp_Study::isComponent( const QString& entry ) const return false; } -//================================================================ -// Function : componentDataType -/*! Purpose : Return component data type from entry*/ -//================================================================ +/*! + \return component data type for entry +*/ QString LightApp_Study::componentDataType( const QString& entry ) const { LightApp_DataObject* aCurObj; @@ -296,10 +289,9 @@ QString LightApp_Study::componentDataType( const QString& entry ) const return ""; } -//================================================================ -// Function : isModified -// Purpose : -//================================================================ +/*! + \return true if study is modified +*/ bool LightApp_Study::isModified() const { bool isAnyChanged = CAM_Study::isModified(); @@ -314,27 +306,24 @@ bool LightApp_Study::isModified() const return isAnyChanged; } -//================================================================ -// Function : isSaved -/*! Purpose : Check: data model is saved?*/ -//================================================================ +/*! + \return true if data model is saved +*/ bool LightApp_Study::isSaved() const { return CAM_Study::isSaved(); } -//======================================================================= -// name : addComponent -/*! Purpose : Create SComponent for module, necessary for SalomeApp study */ -//======================================================================= +/*! + Creates SComponent for module, necessary for SalomeApp study +*/ void LightApp_Study::addComponent(const CAM_DataModel* dm) { } -//======================================================================= -// name : saveModuleData -/*! Purpose : save list file for module 'theModuleName' */ -//======================================================================= +/*! + Saves list file for module 'theModuleName' +*/ void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOfFiles) { int aNb = theListOfFiles.count(); @@ -352,10 +341,9 @@ void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOf myDriver->SetListOfFiles(theModuleName, aListOfFiles); } -//======================================================================= -// name : openModuleData -/*! Purpose : gets list of file for module 'theModuleNam' */ -//======================================================================= +/*! + Gets list of file for module 'theModuleNam' +*/ void LightApp_Study::openModuleData(QString theModuleName, QStringList& theListOfFiles) { std::vector aListOfFiles = myDriver->GetListOfFiles(theModuleName); @@ -369,10 +357,9 @@ void LightApp_Study::openModuleData(QString theModuleName, QStringList& theListO theListOfFiles.append(aListOfFiles[i+1].c_str()); } -//======================================================================= -// name : saveStudyData -/*! Purpose : save data from study */ -//======================================================================= +/*! + Saves data from study +*/ bool LightApp_Study::saveStudyData( const QString& theFileName ) { ModelList list; dataModels( list ); @@ -385,10 +372,9 @@ bool LightApp_Study::saveStudyData( const QString& theFileName ) return aRes; } -//======================================================================= -// name : openStudyData -/*! Purpose : open data for study */ -//======================================================================= +/*! + Opens data for study +*/ bool LightApp_Study::openStudyData( const QString& theFileName ) { SUIT_ResourceMgr* resMgr = application()->resourceMgr(); @@ -400,10 +386,9 @@ bool LightApp_Study::openStudyData( const QString& theFileName ) return aRes; } -//================================================================ -// Function : openDataModel -/*! Purpose : Open data model */ -//================================================================ +/*! + Opens data model +*/ bool LightApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm ) { if (!dm) @@ -421,20 +406,19 @@ bool LightApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm return false; } -//================================================================ -// Function : GetTmpDir -/*! Purpose : to be used by modules*/ -//================================================================ +/*! + \return temporary directory for saving files of modules +*/ std::string LightApp_Study::GetTmpDir (const char* theURL, const bool isMultiFile) { return myDriver->GetTmpDir(theURL, isMultiFile); } -//================================================================ -// Function : GetListOfFiles -/*! Purpose : to be used by modules*/ -//================================================================ +/*! + \return list of files necessary for module + \param theModuleName - name of module +*/ std::vector LightApp_Study::GetListOfFiles(const char* theModuleName) const { std::vector aListOfFiles; @@ -442,19 +426,19 @@ std::vector LightApp_Study::GetListOfFiles(const char* theModuleNam return aListOfFiles; } -//================================================================ -// Function : SetListOfFiles -/*! Purpose : to be used by modules*/ -//================================================================ +/*! + Sets list of files necessary for module + \param theModuleName - name of module + \param theListOfFiles - list of files +*/ void LightApp_Study::SetListOfFiles (const char* theModuleName, const std::vector theListOfFiles) { myDriver->SetListOfFiles(theModuleName, theListOfFiles); } -//================================================================ -// Function : RemoveTemporaryFiles -/*! Purpose : to be used by modules*/ -//================================================================ +/*! + Removes temporary files +*/ void LightApp_Study::RemoveTemporaryFiles (const char* theModuleName, const bool isMultiFile) const { if (isMultiFile) @@ -463,10 +447,10 @@ void LightApp_Study::RemoveTemporaryFiles (const char* theModuleName, const bool myDriver->RemoveTemporaryFiles(theModuleName, isDirDeleted); } -//================================================================ -// Function : components -/*! Purpose : to be used by modules*/ -//================================================================ +/*! + Fills list with components names + \param comp - list to be filled +*/ void LightApp_Study::components( QStringList& comp ) const { DataObjectList children = root()->children(); diff --git a/src/LightApp/LightApp_Study.h b/src/LightApp/LightApp_Study.h index 3714f2828..b9de680b8 100644 --- a/src/LightApp/LightApp_Study.h +++ b/src/LightApp/LightApp_Study.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_STUDY_H #define LIGHTAPP_STUDY_H @@ -32,6 +32,11 @@ class SUIT_Application; class CAM_DataModel; +/*! + Custom study, using for open/close of documents HDF format. + Data of each module can be saved to different files, those + after that are combined into one HDF file +*/ class LIGHTAPP_EXPORT LightApp_Study : public CAM_Study { Q_OBJECT @@ -86,6 +91,8 @@ signals: private: LightApp_Driver* myDriver; + + friend class LightApp_Application; }; #endif diff --git a/src/LightApp/LightApp_SwitchOp.cxx b/src/LightApp/LightApp_SwitchOp.cxx index 14feeaa6d..67283f365 100755 --- a/src/LightApp/LightApp_SwitchOp.cxx +++ b/src/LightApp/LightApp_SwitchOp.cxx @@ -14,19 +14,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -/** -* LIGHT LightApp -* -* Copyright (C) 2005 CEA/DEN, EDF R&D -* -* -* -* File : LightApp_SwitchOp.h -* Author : Sergey LITONIN -* Module : LIGHT -*/ #include "LightApp_SwitchOp.h" #include "LightApp_Module.h" diff --git a/src/LightApp/LightApp_SwitchOp.h b/src/LightApp/LightApp_SwitchOp.h index dad93261d..a85d2e3da 100755 --- a/src/LightApp/LightApp_SwitchOp.h +++ b/src/LightApp/LightApp_SwitchOp.h @@ -14,21 +14,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -/** -* LIGHT LightApp -* -* Copyright (C) 2005 CEA/DEN, EDF R&D -* -* -* -* File : LightApp_SwitchOp.h -* Author : Sergey LITONIN -* Module : LIGHT -*/ - - #ifndef LightApp_SwitchOp_H #define LightApp_SwitchOp_H diff --git a/src/LightApp/LightApp_UpdateFlags.h b/src/LightApp/LightApp_UpdateFlags.h index 2fc7fa780..b11103f76 100755 --- a/src/LightApp/LightApp_UpdateFlags.h +++ b/src/LightApp/LightApp_UpdateFlags.h @@ -1,8 +1,20 @@ -// LIGHT LightApp -// -// Copyright (C) 2005 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : LightApp_UpdateFlags.h // Author : Sergey LITONIN @@ -12,11 +24,11 @@ #ifndef LightApp_UpdateFlags_H #define LightApp_UpdateFlags_H -/* - Enum : UpdateFlags - Description : Enumeration for update flags. First byte is reserved for LightApp_Module. - Modules derived from this model must use other 3 bytes to define their - own update flags +/*! + \enum UpdateFlags + Enumeration for update flags. First byte is reserved for LightApp_Module. + Modules derived from this model must use other 3 bytes to define their + own update flags */ typedef enum diff --git a/src/LightApp/LightApp_VTKSelector.cxx b/src/LightApp/LightApp_VTKSelector.cxx index b393b3043..d28da9fae 100644 --- a/src/LightApp/LightApp_VTKSelector.cxx +++ b/src/LightApp/LightApp_VTKSelector.cxx @@ -14,37 +14,40 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_VTKSelector.h" #include "LightApp_DataOwner.h" -#include "SVTK_ViewModelBase.h" -#include "SVTK_Selector.h" -#include "SVTK_ViewWindow.h" -#include "SVTK_Functor.h" +#ifndef DISABLE_VTKVIEWER + #include "SVTK_ViewModelBase.h" + #include "SVTK_ViewManager.h" + #include "SVTK_Selector.h" + #include "SVTK_ViewWindow.h" + #include "SVTK_Functor.h" + #include "VTKViewer_Algorithm.h" + #include +#endif -#include "SALOME_Actor.h" -#include "SALOME_ListIteratorOfListIO.hxx" +#ifndef DISABLE_SALOMEOBJECT + #include "SALOME_Actor.h" + #include "SALOME_ListIteratorOfListIO.hxx" +#endif -#include "VTKViewer_Algorithm.h" -#include +#ifndef DISABLE_VTKVIEWER +#ifndef DISABLE_SALOMEOBJECT /*! Constructor. */ LightApp_SVTKDataOwner ::LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO, - const TColStd_IndexedMapOfInteger& theIds, - Selection_Mode theMode, - SALOME_Actor* theActor): + SUIT_Desktop* theDesktop ): LightApp_DataOwner( theIO ), - mySelectionMode(theMode), - myActor(theActor) -{ - myIds = theIds; // workaround - there is no constructor copy for the container -} + myDesktop( theDesktop ) +{} +#endif /*! Destuctor. @@ -54,6 +57,51 @@ LightApp_SVTKDataOwner { } +/*! + \return active SVTK view window +*/ +SVTK_ViewWindow* +LightApp_SVTKDataOwner +::GetActiveViewWindow() const +{ + if(SUIT_ViewWindow* aViewWindow = myDesktop->activeWindow()) + return dynamic_cast(aViewWindow); + + return NULL; +} + +/*! + Gets dataowners ids list. +*/ +const TColStd_IndexedMapOfInteger& +LightApp_SVTKDataOwner +::GetIds() const +{ + if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){ + if(SVTK_Selector* aSelector = aViewWindow->GetSelector()){ + aSelector->GetIndex(IO(),myIds); + } + } + + return myIds; +} + +/*! + Gets selection mode. +*/ +Selection_Mode +LightApp_SVTKDataOwner +::GetMode() const +{ + if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){ + if(SVTK_Selector* aSelector = aViewWindow->GetSelector()){ + return aSelector->SelectionMode(); + } + } + + return -1; +} + /*! Gets actor pointer. */ @@ -61,9 +109,18 @@ SALOME_Actor* LightApp_SVTKDataOwner ::GetActor() const { - return myActor.GetPointer(); + if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){ + using namespace SVTK; + return Find(aViewWindow->getRenderer()->GetActors(),TIsSameIObject(IO())); + } + + return NULL; } +#endif + + +#ifndef DISABLE_VTKVIEWER /*! Constructor. */ @@ -105,6 +162,7 @@ LightApp_VTKSelector return myViewer->getType(); } +#endif /*! On selection changed. */ @@ -115,6 +173,8 @@ LightApp_VTKSelector selectionChanged(); } +#ifndef DISABLE_VTKVIEWER + /*! Gets list of selected data owners.(output \a aList). */ @@ -123,23 +183,16 @@ LightApp_VTKSelector ::getSelection( SUIT_DataOwnerPtrList& aList ) const { if(myViewer){ - if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){ - if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ - if(SVTK_Selector* aSelector = aView->GetSelector()){ - Selection_Mode aMode = aSelector->SelectionMode(); - const SALOME_ListIO& aListIO = aSelector->StoredIObjects(); - SALOME_ListIteratorOfListIO anIter(aListIO); - for(; anIter.More(); anIter.Next()){ - Handle(SALOME_InteractiveObject) anIO = anIter.Value(); - if(anIO->hasEntry()){ - TColStd_IndexedMapOfInteger anIds; - aSelector->GetIndex(anIO,anIds); - SALOME_Actor* anActor = aSelector->GetActor(anIO); - if( !anActor ){ - using namespace SVTK; - anActor = Find(aView->getRenderer()->GetActors(),TIsSameIObject(anIO)); - } - aList.append(new LightApp_SVTKDataOwner(anIO,anIds,aMode,anActor)); + if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){ + if(SVTK_ViewManager* aViewMgr = dynamic_cast(aViewManager)){ + if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ + if(SVTK_Selector* aSelector = aView->GetSelector()){ + const SALOME_ListIO& aListIO = aSelector->StoredIObjects(); + SALOME_ListIteratorOfListIO anIter(aListIO); + for(; anIter.More(); anIter.Next()){ + Handle(SALOME_InteractiveObject) anIO = anIter.Value(); + if(anIO->hasEntry()) + aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop())); } } } @@ -168,10 +221,7 @@ LightApp_VTKSelector aSelector->SetSelectionMode(anOwner->GetMode()); Handle(SALOME_InteractiveObject) anIO = anOwner->IO(); - if( anOwner->GetActor() ) - aSelector->AddIObject( anOwner->GetActor() ); - else - aSelector->AddIObject(anIO); + aSelector->AddIObject(anIO); anAppendList.Append(anIO); aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false); @@ -204,3 +254,5 @@ LightApp_VTKSelector } } } + +#endif diff --git a/src/LightApp/LightApp_VTKSelector.h b/src/LightApp/LightApp_VTKSelector.h index 14c6523ce..aebf5f54a 100644 --- a/src/LightApp/LightApp_VTKSelector.h +++ b/src/LightApp/LightApp_VTKSelector.h @@ -14,25 +14,28 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_VTKSELECTOR_H #define LIGHTAPP_VTKSELECTOR_H -#include - -#include - #include "SUIT_Selector.h" - #include "LightApp.h" #include "LightApp_DataOwner.h" -#include "SVTK_Selection.h" -#include "SALOME_InteractiveObject.hxx" +class SUIT_Desktop; -class SALOME_Actor; -class SVTK_ViewModelBase; +#ifndef DISABLE_VTKVIEWER + #include + #include + #include "SVTK_Selection.h" +#ifndef DISABLE_SALOMEOBJECT + #include "SALOME_InteractiveObject.hxx" +#endif + class SALOME_Actor; + class SVTK_ViewWindow; + class SVTK_ViewModelBase; +#endif /*! Provide salome vtk data owner list. @@ -40,57 +43,66 @@ class SVTK_ViewModelBase; class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner { public: +#ifndef DISABLE_VTKVIEWER + #ifndef DISABLE_SALOMEOBJECT LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO, - const TColStd_IndexedMapOfInteger& theIds, - Selection_Mode theMode = ActorSelection, - SALOME_Actor* theActor = NULL); + SUIT_Desktop* theDesktop ); + #endif virtual ~LightApp_SVTKDataOwner(); /*!Gets dataowners ids list.*/ - const TColStd_IndexedMapOfInteger& GetIds() const - { - return myIds; - } + const TColStd_IndexedMapOfInteger& GetIds() const; /*!Gets selection mode.*/ - Selection_Mode GetMode() const - { - return mySelectionMode; - } + Selection_Mode GetMode() const; + /*!Finds corresponding actor in the active viewer.*/ SALOME_Actor* GetActor() const; protected: - TColStd_IndexedMapOfInteger myIds; - Selection_Mode mySelectionMode; - vtkSmartPointer myActor; + mutable TColStd_IndexedMapOfInteger myIds; + + SVTK_ViewWindow* GetActiveViewWindow() const; + SUIT_Desktop* myDesktop; + +#else + LightApp_SVTKDataOwner( const QString& ); +#endif }; /*! - Provide vtk selection of data owners. + \class LightApp_VTKSelector + Custom selector to get/set selection from object browser */ class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector { Q_OBJECT; public: +#ifndef DISABLE_VTKVIEWER LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* ); virtual ~LightApp_VTKSelector(); SVTK_ViewModelBase* viewer() const; virtual QString type() const; +#else + LightApp_VTKSelector( SUIT_SelectionMgr* ); +#endif private slots: void onSelectionChanged(); +#ifndef DISABLE_VTKVIEWER protected: virtual void getSelection( SUIT_DataOwnerPtrList& ) const; virtual void setSelection( const SUIT_DataOwnerPtrList& ); private: SVTK_ViewModelBase* myViewer; + +#endif }; #endif diff --git a/src/LightApp/LightApp_WidgetContainer.cxx b/src/LightApp/LightApp_WidgetContainer.cxx index df92c5313..aa6f831d2 100644 --- a/src/LightApp/LightApp_WidgetContainer.cxx +++ b/src/LightApp/LightApp_WidgetContainer.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "LightApp_WidgetContainer.h" diff --git a/src/LightApp/LightApp_WidgetContainer.h b/src/LightApp/LightApp_WidgetContainer.h index df6dbc84d..1679ec0c7 100644 --- a/src/LightApp/LightApp_WidgetContainer.h +++ b/src/LightApp/LightApp_WidgetContainer.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef LIGHTAPP_WIDGETCONTAINER_H #define LIGHTAPP_WIDGETCONTAINER_H diff --git a/src/LightApp/Makefile.in b/src/LightApp/Makefile.in index 3ffef0449..2fd596ee3 100755 --- a/src/LightApp/Makefile.in +++ b/src/LightApp/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : OCC team (OCN) # Module : LightApp @@ -22,13 +40,12 @@ EXPORT_HEADERS= LightApp.h \ LightApp_Dialog.h \ LightApp_Displayer.h \ LightApp_Driver.h \ - LightApp_GLSelector.h \ + LightApp_HDFDriver.h \ LightApp_Module.h \ LightApp_ModuleDlg.h \ LightApp_NameDlg.h \ LightApp_OBFilter.h \ LightApp_OBSelector.h \ - LightApp_OCCSelector.h \ LightApp_Operation.h \ LightApp_Selection.h \ LightApp_SelectionMgr.h \ @@ -39,9 +56,19 @@ EXPORT_HEADERS= LightApp.h \ LightApp_PreferencesDlg.h \ LightApp_RootObject.h \ LightApp_UpdateFlags.h \ - LightApp_VTKSelector.h \ LightApp_WidgetContainer.h -# LightApp_HDFDriver.h \ + +ifneq ($(DISABLE_VTKVIEWER),yes) +ifneq ($(DISABLE_SALOMEOBJECT),yes) + EXPORT_HEADERS+= LightApp_VTKSelector.h +endif +endif +ifneq ($(DISABLE_OCCVIEWER),yes) + EXPORT_HEADERS+= LightApp_OCCSelector.h +endif +ifneq ($(DISABLE_GLVIEWER),yes) + EXPORT_HEADERS+= LightApp_GLSelector.h +endif # .po files to transform in .qm PO_FILES = LightApp_images.po \ @@ -59,13 +86,12 @@ LIB_SRC= LightApp_AboutDlg.cxx \ LightApp_Dialog.cxx \ LightApp_Displayer.cxx \ LightApp_Driver.cxx \ - LightApp_GLSelector.cxx \ + LightApp_HDFDriver.cxx \ LightApp_Module.cxx \ LightApp_ModuleDlg.cxx \ LightApp_NameDlg.cxx \ LightApp_OBFilter.cxx \ LightApp_OBSelector.cxx \ - LightApp_OCCSelector.cxx \ LightApp_Operation.cxx \ LightApp_Selection.cxx \ LightApp_SelectionMgr.cxx \ @@ -74,17 +100,25 @@ LIB_SRC= LightApp_AboutDlg.cxx \ LightApp_SwitchOp.cxx \ LightApp_Preferences.cxx \ LightApp_PreferencesDlg.cxx \ - LightApp_VTKSelector.cxx \ LightApp_WidgetContainer.cxx -# LightApp_HDFDriver.cxx \ + +ifneq ($(DISABLE_VTKVIEWER),yes) +ifneq ($(DISABLE_SALOMEOBJECT),yes) + LIB_SRC+= LightApp_VTKSelector.cxx +endif +endif +ifneq ($(DISABLE_OCCVIEWER),yes) + LIB_SRC+= LightApp_OCCSelector.cxx +endif +ifneq ($(DISABLE_GLVIEWER),yes) + LIB_SRC+= LightApp_GLSelector.cxx +endif LIB_MOC = LightApp_AboutDlg.h \ LightApp_Application.h \ LightApp_DataModel.h \ LightApp_Dialog.h \ - LightApp_GLSelector.h \ LightApp_OBSelector.h \ - LightApp_OCCSelector.h \ LightApp_Operation.h \ LightApp_Module.h \ LightApp_ModuleDlg.h \ @@ -95,9 +129,20 @@ LIB_MOC = LightApp_AboutDlg.h \ LightApp_SwitchOp.h \ LightApp_Preferences.h \ LightApp_PreferencesDlg.h \ - LightApp_VTKSelector.h \ LightApp_WidgetContainer.h +ifneq ($(DISABLE_VTKVIEWER),yes) +ifneq ($(DISABLE_SALOMEOBJECT),yes) + LIB_MOC+= LightApp_VTKSelector.h +endif +endif +ifneq ($(DISABLE_OCCVIEWER),yes) + LIB_MOC+= LightApp_OCCSelector.h +endif +ifneq ($(DISABLE_GLVIEWER),yes) + LIB_MOC+= LightApp_GLSelector.h +endif + RESOURCES_FILES = icon_about.png \ icon_applogo.png \ icon_default.png \ @@ -107,11 +152,74 @@ RESOURCES_FILES = icon_about.png \ LightApp.ini \ LightApp.xml -CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) - #$(HDF5_INCLUDES) +CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(OCC_INCLUDES) \ + $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) + +ifneq ($(DISABLE_VTKVIEWER),yes) + CPPFLAGS+= $(VTK_INCLUDES) +else + CPPFLAGS+= -DDISABLE_VTKVIEWER +endif +ifneq ($(DISABLE_PLOT2DVIEWER),yes) + CPPFLAGS+= $(QWT_INCLUDES) +else + CPPFLAGS+= -DDISABLE_PLOT2DVIEWER +endif +ifeq ($(DISABLE_OCCVIEWER),yes) + CPPFLAGS+= -DDISABLE_OCCVIEWER +endif +ifneq ($(DISABLE_PYCONSOLE),yes) + CPPFLAGS+= $(PYTHON_INCLUDES) +else + CPPFLAGS+= -DDISABLE_PYCONSOLE +endif +ifeq ($(DISABLE_GLVIEWER),yes) + CPPFLAGS+= -DDISABLE_GLVIEWER +endif +ifeq ($(DISABLE_SUPERVGRAPHVIEWER),yes) + CPPFLAGS+= -DDISABLE_SUPERVGRAPHVIEWER +endif +ifeq ($(DISABLE_SALOMEOBJECT),yes) + CPPFLAGS+= -DDISABLE_SALOMEOBJECT +endif + +LDFLAGS+=$(QT_MT_LIBS) +ifneq ($(DISABLE_PYCONSOLE),yes) + LDFLAGS+= $(PYTHON_LIBS) +endif + +LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lLogWindow $(CAS_KERNEL) -lSalomePrs \ + $(HDF5_LIBS) $(KERNEL_LDFLAGS) -lSalomeHDFPersist -LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS) -LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lLogWindow $(CAS_KERNEL) -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSOCC -lSVTK -lSPlot2d -lSUPERVGraph -lPyInterp -lPythonConsole - #$(HDF5_LIBS) -lSalomeHDFPersistCopy +ifneq ($(DISABLE_SALOMEOBJECT),yes) + LIBS+= -lSalomeObject +endif +ifneq ($(DISABLE_VTKVIEWER),yes) + LIBS+= -lVTKViewer +ifneq ($(DISABLE_SALOMEOBJECT),yes) + LIBS+= -lSVTK +endif +endif +ifneq ($(DISABLE_OCCVIEWER),yes) + LIBS+= -lOCCViewer +ifneq ($(DISABLE_SALOMEOBJECT),yes) + LIBS+= -lSOCC +endif +endif +ifneq ($(DISABLE_GLVIEWER),yes) + LIBS+= -lGLViewer +endif +ifneq ($(DISABLE_PLOT2DVIEWER),yes) + LIBS+= -lPlot2d +ifneq ($(DISABLE_SALOMEOBJECT),yes) + LIBS+= -lSPlot2d +endif +endif +ifneq ($(DISABLE_PYCONSOLE),yes) + LIBS+= -lPyInterp -lPythonConsole +endif +ifneq ($(DISABLE_SUPERVGRAPHVIEWER),yes) + LIBS+= -lSUPERVGraph +endif @CONCLUDE@ diff --git a/src/LightApp/resources/LightApp.xml b/src/LightApp/resources/LightApp.xml index 2a4932e04..7cb56db7b 100644 --- a/src/LightApp/resources/LightApp.xml +++ b/src/LightApp/resources/LightApp.xml @@ -1,12 +1,6 @@ -
- - - - - -
+ @@ -15,10 +9,18 @@
+
+
+ + + + +
+ @@ -31,48 +33,60 @@ - + +
+
+ + + + + +
+
- - -
+
+ + + +
+
+ -
- + +
- - - - + + + + +
- - + + +
- - - - - - - + + + + + + + +
- - -
- -
- - + + +
diff --git a/src/LightApp/resources/LightApp_images.po b/src/LightApp/resources/LightApp_images.po index c1ee44b39..9149d196d 100644 --- a/src/LightApp/resources/LightApp_images.po +++ b/src/LightApp/resources/LightApp_images.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: LightApp_images.po // Created: May, 2005 // Author: OCC team diff --git a/src/LightApp/resources/LightApp_msg_en.po b/src/LightApp/resources/LightApp_msg_en.po index c5b364d56..f06c47efc 100644 --- a/src/LightApp/resources/LightApp_msg_en.po +++ b/src/LightApp/resources/LightApp_msg_en.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". @@ -22,7 +40,7 @@ msgid "ABOUT_VERSION" msgstr "Version %1" msgid "ABOUT_COPYRIGHT" -msgstr "Copyright (C) 2003-2005 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS" +msgstr "Copyright (C) 2003-2006 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS" msgid "ABOUT_LICENSE" msgstr "GNU LGPL" @@ -81,10 +99,10 @@ msgid "LightApp_Application::INF_CANCELLED" msgstr "Module activation cancelled" msgid "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" -msgstr "External browser \"%1\" can not show help page \"%2\"" +msgstr "External browser \"%1\" can not show help page \"%2\". Do you want to change it in preferences?" msgid "LightApp_Application::DEFINE_EXTERNAL_BROWSER" -msgstr "Define external browser in preferences" +msgstr "External browser is not found. Do you want to define it in preferences?" msgid "LightApp_Application::DATA_MODELS" msgstr "Data models" @@ -123,9 +141,6 @@ msgstr "Multi file save" msgid "LightApp_Application::PREF_ASCII_FILE" msgstr "ASCII save" -msgid "LightApp_Application::PREF_UNDO_LEVEL" -msgstr "Undo level" - msgid "LightApp_Application::PREF_STORE_POS" msgstr "Store positions of windows" @@ -263,7 +278,13 @@ msgid "LightApp_PreferencesDlg::WARNING" msgstr "Warning" msgid "LightApp_PreferencesDlg::DEFAULT_QUESTION" -msgstr "Do you want to retrieve default preferences?" +msgstr "Do you want to retrieve default preferences?" + +msgid "LightApp_PreferencesDlg::IMPORT_PREFERENCES" +msgstr "Import preferences" + +msgid "LightApp_PreferencesDlg::IMPORT_BTN_TEXT" +msgstr "Import" //======================================================================================= @@ -322,3 +343,10 @@ msgstr "&Cancel" msgid "LightApp_ModuleDlg::ActivateComponent_DESCRIPTION" msgstr "Create, open or load study." + +msgid "LightApp_NameDlg::TLT_RENAME" +msgstr "Rename" + +msgid "LightApp_NameDlg::NAME_LBL" +msgstr "Name: " + diff --git a/src/LightApp/resources/icon_about.png b/src/LightApp/resources/icon_about.png index 287b4f766aa88ed3bcfc8e3137f2be4dba84e35b..6817eb4073d11a0fe69b69d01bc06f5a8895f208 100755 GIT binary patch literal 79549 zcmXte$i(88pcXue70tJd&Deex%H{b5rA2a79 znT#cK<$a$Uqpm84fl7=D004%9ytF0&z|sK#3@$P(bp3eq2_E_ZjJu|sBv3m=atM8a z;v%o_4ghF4|1B`H>p{=ZH@Q7z^gOhjtv$TW-N1m1kBb}F-QCXFi9*iJ+{M<;l0q8n zZfD~JcB4=+ceAvm;NsxmrI6BA&*YVa?u!CYke1N)$vX-3%`=i|d8_E!JX`g@cgR+z z`+P!aE;mTU5FLs(MorZnB20xUiKp?Ko=Nom#&uMvgt~=#E1(|@kNjC2IT@o-?auKo zyCAz@BeQF>a+BP9_VDm9`)4>!IREB!z@C=zz4m&gpr`7*h>j;Jw&Wi?*jt77fAlPr zeh8NyT_=e=R%jLaZ)9$1t!z?xddhHazKOTO9n6)!!_(nbk#ZBnmV6i^ugzeE%>o`g zE^Us_63^r_^B^s4ZH5_OIl2~;=YuxUChMOSt84uBB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B;-#pTJhy|d^X;HLWlFlO>JQfHeu>>f@1U8j=QaJXz@n+so9uw5u zL;pwPj{<&RY2q$Jk5DYx+BQ%2{CWFR-Z%HB-_zs6Z&mlH?(U0hS7c_D=l*;%kbrD0p>%sf}_ zsj^ke!I-?4UCFf+4QXb1nn;O=5GLB$W)SeZXq_qJz>W6Acu&XM9PHjISqrL6Ft`dl zkoihF%VI8v%Ed1{Si~Y`C6o zSYXdJCM)CHD^Jj<{+*Z|D=)s0?j)joW2hqJ>Bts9xz z=+|?F>B~QUGe)j9k@9JtVF^Fi)r65*vajg#atYTD{OfO)7mrzX${RyI#&js5H`Phu zDW~9VBYrIJ`d0wbt+c0YAc*eeD~Y*6fC55PsQ>@J^lMvzL=?4<#7TU6ug>hoCLlgk zs$;F3DA#&t=FOXVE1ajjp^F0>YzJxOpJK6r;#zCKn1EYwLIERC2czn)$u~urxA$M7 z%V~UZ8mB36L%78h;w%^8cs!m0$N9b15QDa*0lcYO(sYP75-=TsjXG@tQWonYDfR~g z9O3j?3|88JN&^A+TS2hd=wbtLqzA}3pb!ZGRKbJM

+*/ template TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) { - // printf( "--- synchronize : %d ---\n", ++gSync ); - if( td.isEqual( r1, r2 ) ) { + // update items themselves + td.updateItem( r2 ); + + // iterate 'siblings' (direct children) QValueList< DiffItem< SrcItem, TrgItem > > d; diffSiblings( r1, r2, d, td ); typename QValueList< DiffItem< SrcItem, TrgItem > >::const_iterator anIt = d.begin(), aLast = d.end(); - bool isFirst = true; TrgItem lastItem = td.nullTrg(); // TrgItem tail = td.nullTrg(); for( ; anIt!=aLast; anIt++ ) @@ -62,7 +128,9 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) if( item.myTrg==td.nullTrg() ) { //to add - lastItem = createSubTree( item.mySrc, r2, lastItem, isFirst, td ); + TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, lastItem==td.nullTrg(), td ); + if( nitem!=td.nullTrg() ) + lastItem = nitem; } else { @@ -71,10 +139,9 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) synchronize( item.mySrc, item.myTrg, td ); lastItem = item.myTrg; } - isFirst = false; } } - + return r2; } else @@ -86,6 +153,14 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) } } +/*! + Finds equal element in list + \return iterator + \param l - list to search + \param first - start iterator + \param it - item to be found + \param td - tree data object (provides auxiliary methods) +*/ template const typename QValueList::const_iterator findEqual( const QValueList& l, const typename QValueList::const_iterator& first, @@ -99,13 +174,20 @@ const typename QValueList::const_iterator findEqual( const QValueList void diffSiblings( const SrcItem& src, const TrgItem& trg, QValueList < DiffItem < SrcItem,TrgItem > >& d, const TreeData& td ) { - if( src==td.nullSrc() || trg==td.nullTrg() ) - return; + //if( src==td.nullSrc() || trg==td.nullTrg() ) + // return; QValueList src_ch; QValueList trg_ch; @@ -153,6 +235,15 @@ void diffSiblings( const SrcItem& src, const TrgItem& trg, } } +/*! + Creates sub-tree + \return root of just created sub-tree + \param src - corresponding SrcItem + \param parent - parent of new TrgItem + \param after - TrgItem, after that new item must be added + \param asFirst - true if TrgItem must be added as first + \param td - tree data object (provides auxiliary methods) +*/ template TrgItem createSubTree( const SrcItem& src, const TrgItem& parent, const TrgItem& after, const bool asFirst, diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 69288994b..619b9c488 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SUIT_ViewManager.h" @@ -254,9 +254,9 @@ void SUIT_ViewManager::onDeleteStudy() myStudy = NULL; } +/*! invoke method of SUIT_PopupClient, which notifies about popup*/ void SUIT_ViewManager::onContextMenuRequested( QContextMenuEvent* e ) { - /*! invoke method of SUIT_PopupClient, which notifies about popup*/ contextMenuRequest( e ); } diff --git a/src/SUIT/SUIT_ViewManager.h b/src/SUIT/SUIT_ViewManager.h index e0ca57fb2..8cacbe253 100755 --- a/src/SUIT/SUIT_ViewManager.h +++ b/src/SUIT/SUIT_ViewManager.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SUIT_VIEWMANAGER_H #define SUIT_VIEWMANAGER_H diff --git a/src/SUIT/SUIT_ViewModel.cxx b/src/SUIT/SUIT_ViewModel.cxx index 38a9aac1e..86c0f0099 100755 --- a/src/SUIT/SUIT_ViewModel.cxx +++ b/src/SUIT/SUIT_ViewModel.cxx @@ -14,11 +14,10 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SUIT_ViewModel.cxx: implementation of the SUIT_ViewModel class. // -////////////////////////////////////////////////////////////////////// #include "SUIT_ViewModel.h" diff --git a/src/SUIT/SUIT_ViewModel.h b/src/SUIT/SUIT_ViewModel.h index b99c4025c..4be9fd777 100755 --- a/src/SUIT/SUIT_ViewModel.h +++ b/src/SUIT/SUIT_ViewModel.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SUIT_VIEWMODEL_H #define SUIT_VIEWMODEL_H diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index bd4c32e69..0df3081c3 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -14,11 +14,10 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SUIT_ViewWindow.cxx: implementation of the SUIT_ViewWindow class. // -////////////////////////////////////////////////////////////////////// #include "SUIT_ViewWindow.h" #include "SUIT_Desktop.h" @@ -54,24 +53,39 @@ SUIT_ViewWindow::~SUIT_ViewWindow() { } +/*! + Sets new view manager for window + \param theManager - new view manager +*/ void SUIT_ViewWindow::setViewManager( SUIT_ViewManager* theManager ) { myManager = theManager; } +/*! + \return view manager of window +*/ SUIT_ViewManager* SUIT_ViewWindow::getViewManager() const { return myManager; } +/*! + \return QImage, containing all scene rendering in window +*/ QImage SUIT_ViewWindow::dumpView() { return QImage(); } -bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& format ) +/*! + Saves image to file according to the format + \param image - image + \param fileName - name of file + \param format - string contains name of format (for example, "BMP"(default) or "JPEG", "JPG") +*/ +bool SUIT_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format ) { - QImage img = dumpView(); if( img.isNull() ) return false; @@ -87,6 +101,16 @@ bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& return res; } +/*! + Saves scene rendering in window to file + \param fileName - name of file + \param format - string contains name of format (for example, "BMP"(default) or "JPEG", "JPG") +*/ +bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& format ) +{ + return dumpViewToFormat( dumpView(), fileName, format ); +} + /*! Close event \a theEvent. */ void SUIT_ViewWindow::closeEvent(QCloseEvent* theEvent) @@ -111,6 +135,9 @@ void SUIT_ViewWindow::onDumpView() qApp->postEvent( this, new QCustomEvent( DUMP_EVENT ) ); } +/*! + \return filters for image files +*/ QString SUIT_ViewWindow::filter() const { return tr( "TLT_IMAGE_FILES" ); @@ -125,13 +152,15 @@ bool SUIT_ViewWindow::event( QEvent* e ) bool bOk = false; if ( myManager && myManager->study() && myManager->study()->application() ) { + QImage im = dumpView(); + // get file name SUIT_Application* app = myManager->study()->application(); QString fileName = app->getFileName( false, QString::null, filter(), tr( "TLT_DUMP_VIEW" ), 0 ); if( !fileName.isEmpty() ) { QString fmt = SUIT_Tools::extension( fileName ).upper(); - bOk = dumpViewToFormat( fileName, fmt ); + bOk = dumpViewToFormat( im, fileName, fmt ); } else { @@ -148,13 +177,30 @@ bool SUIT_ViewWindow::event( QEvent* e ) /*! Called by SUIT_Accel::onActivated() when a key accelerator was activated and this window was active */ -void SUIT_ViewWindow::onAccelAction( int _action ) +bool SUIT_ViewWindow::onAccelAction( int _action ) { - action( _action ); + return action( _action ); } /*! action handle standard action (zoom, pan) or custom action. to be redefined in successors. */ -void SUIT_ViewWindow::action( const int ) +bool SUIT_ViewWindow::action( const int ) +{ + return true; +} + +/*! + \return string containing visual parameters of window +*/ +QString SUIT_ViewWindow::getVisualParameters() +{ + return "empty"; +} + +/*! + Sets visual parameters of window by its string representation + \param parameters - string with visual parameters +*/ +void SUIT_ViewWindow::setVisualParameters( const QString& parameters ) { } diff --git a/src/SUIT/SUIT_ViewWindow.h b/src/SUIT/SUIT_ViewWindow.h index 1ac79a504..2e5eb7804 100755 --- a/src/SUIT/SUIT_ViewWindow.h +++ b/src/SUIT/SUIT_ViewWindow.h @@ -14,11 +14,10 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class. // -////////////////////////////////////////////////////////////////////// #if !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_) #define AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_ @@ -48,9 +47,12 @@ public: bool event(QEvent*); virtual QImage dumpView(); - virtual bool dumpViewToFormat( const QString& fileName, const QString& format ); + bool dumpViewToFormat( const QString& fileName, const QString& format ); - void onAccelAction( int ); + bool onAccelAction( int ); + + virtual QString getVisualParameters(); + virtual void setVisualParameters( const QString& parameters ); public slots: virtual void onDumpView(); @@ -70,7 +72,8 @@ protected: void closeEvent( QCloseEvent* ); virtual void contextMenuEvent( QContextMenuEvent* ); virtual QString filter() const; - virtual void action( const int ); + virtual bool action( const int ); + virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format ); SUIT_Desktop* myDesktop; SUIT_ViewManager* myManager; diff --git a/src/SUIT/resources/SUIT_images.po b/src/SUIT/resources/SUIT_images.po index b22696bbd..88441a5f1 100755 --- a/src/SUIT/resources/SUIT_images.po +++ b/src/SUIT/resources/SUIT_images.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". diff --git a/src/SUIT/resources/SUIT_msg_en.po b/src/SUIT/resources/SUIT_msg_en.po index 95f43c747..480ab305b 100755 --- a/src/SUIT/resources/SUIT_msg_en.po +++ b/src/SUIT/resources/SUIT_msg_en.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # This is a Qt message file in .po format. Each msgid starts with # a scope. This scope should *NOT* be translated - eg. "Foo::Bar" # would be translated to "Pub", not "Foo::Pub". @@ -60,15 +78,6 @@ msgstr "The file \"%1\" does not exist!" msgid "ERR_PERMISSION_DENIED" msgstr "Can't save file \"%1\".\nPermission denied." -msgid "BUT_OK" -msgstr "&OK" - -msgid "BUT_YES" -msgstr "&Yes" - -msgid "BUT_NO" -msgstr "&No" - msgid "INF_DIRECTORIES_FILTER" msgstr "Directories" diff --git a/src/SUIT/utilities.h b/src/SUIT/utilities.h index cfc5ed0e5..a82d31726 100755 --- a/src/SUIT/utilities.h +++ b/src/SUIT/utilities.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -26,7 +26,7 @@ // Module : SALOME // $Header$ -/* --- Definition macros file to print informations if _DEBUG_ is defined --- */ +/*! --- Definition macros file to print informations if _DEBUG_ is defined --- */ #ifndef UTILITIES_H #define UTILITIES_H @@ -38,7 +38,7 @@ #include "LocalTraceBufferPool.hxx" -/** \file utilities.h +/*! \file utilities.h * For each message to put in the trace, a specific ostingstream object is \n * created and destroyed automatically at the end of the message macro. \n * The insert function of LocalTraceBufferPool class gets a buffer in a \n @@ -65,7 +65,7 @@ std::cerr << "ABORT return code= "<< code << std::endl; \ std::exit(code);} -/* --- To print date and time of compilation of current source --- */ +/*! --- To print date and time of compilation of current source --- */ #if defined ( __GNUC__ ) #define COMPILER "g++" @@ -90,7 +90,7 @@ << " at " << __TIME__ << MESS_END } #ifdef _DEBUG_ -/** @name the following MACROS are useful at debug time*/ +/*! @name the following MACROS are useful at debug time*/ //@{ #define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END} #define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var < #include +#include #ifdef SUIT_ENABLE_PYTHON #include @@ -38,6 +39,7 @@ #include #include #include +#include #include @@ -101,7 +103,6 @@ public: SUITApp_Session( bool theIniFormat ) : SUIT_Session(), myIniFormat ( theIniFormat ) {} virtual ~SUITApp_Session() {} -protected: virtual SUIT_ResourceMgr* createResourceMgr( const QString& appName ) const { SUIT_ResourceMgr* resMgr = 0; @@ -139,13 +140,16 @@ int main( int args, char* argv[] ) QStringList argList; bool noExceptHandling = false; - bool iniFormat = false; + bool iniFormat = false; + bool noSplash = false; for ( int i = 1; i < args /*&& !noExceptHandling*/; i++ ) { - if ( !strcmp( argv[i], "/noexcepthandling" ) ) + if ( !strcmp( argv[i], "--noexcepthandling" ) ) noExceptHandling = true; else if ( !strcmp( argv[i], "--format=ini") ) iniFormat = true; + else if ( !strcmp( argv[i], "--nosplash") ) + noSplash = true; else argList.append( QString( argv[i] ) ); } @@ -156,6 +160,55 @@ int main( int args, char* argv[] ) if ( !argList.isEmpty() ) { SUITApp_Session* aSession = new SUITApp_Session( iniFormat ); + QtxSplash* splash = 0; + if ( !noSplash ) { + SUIT_ResourceMgr* resMgr = aSession->createResourceMgr( argList.first() ); + if ( resMgr ) { + resMgr->loadLanguage(); + QString splashIcon, splashInfo, splashTextColors; + resMgr->value( "splash", "image", splashIcon ); + resMgr->value( "splash", "info", splashInfo, false ); + resMgr->value( "splash", "text_colors", splashTextColors ); + QString appName = QObject::tr( "APP_NAME" ).stripWhiteSpace(); + QString appVersion = QObject::tr( "APP_VERSION" ).stripWhiteSpace(); + if ( appVersion == "APP_VERSION" ) { + if ( appName == "APP_NAME" || appName.lower() == "salome" ) + appVersion = salomeVersion(); + else + appVersion = ""; + } + QPixmap px( splashIcon ); + if ( !px.isNull() ) { + splash = QtxSplash::splash( px ); + if ( !splashTextColors.isEmpty() ) { + QStringList colors = QStringList::split( "|", splashTextColors ); + QColor c1, c2; + if ( colors.count() > 0 ) c1 = QColor( colors[0] ); + if ( colors.count() > 1 ) c2 = QColor( colors[1] ); + splash->setTextColors( c1, c2 ); + } + else { + splash->setTextColors( Qt::white, Qt::black ); + } +#ifdef _DEBUG_ + splash->setHideOnClick( true ); +#endif + QFont f = splash->font(); + f.setBold( true ); + splash->setFont( f ); + if ( !splashInfo.isEmpty() ) { + splashInfo.replace( QRegExp( "%A" ), appName ); + splashInfo.replace( QRegExp( "%V" ), QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) ); + splashInfo.replace( QRegExp( "%L" ), QObject::tr( "ABOUT_LICENSE" ) ); + splashInfo.replace( QRegExp( "%C" ), QObject::tr( "ABOUT_COPYRIGHT" ) ); + splashInfo.replace( QRegExp( "\\\\n" ), "\n" ); + splash->message( splashInfo ); + } + splash->show(); + qApp->processEvents(); + } + } + } SUIT_Application* theApp = aSession->startApplication( argList.first() ); if ( theApp ) { @@ -164,8 +217,12 @@ int main( int args, char* argv[] ) // if ( !app.mainWidget() ) // app.setMainWidget( theApp->desktop() ); + if ( splash ) + splash->finish( theApp->desktop() ); result = app.exec(); + if ( splash ) + delete splash; } delete aSession; } diff --git a/src/SUITApp/SUITApp_Application.cxx b/src/SUITApp/SUITApp_Application.cxx index 744d84acc..4639f100d 100644 --- a/src/SUITApp/SUITApp_Application.cxx +++ b/src/SUITApp/SUITApp_Application.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SUITApp_Application.h" @@ -31,6 +31,9 @@ #include #endif +/*! + Constructor +*/ SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* hand ) : QApplication( argc, argv ), myExceptHandler( hand ) @@ -45,6 +48,9 @@ myExceptHandler( hand ) delete strTbl; } +/*! + Constructor +*/ SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand ) : QApplication( argc, argv, type ), myExceptHandler( hand ) @@ -54,17 +60,30 @@ myExceptHandler( hand ) installTranslator( strTbl ); } +/*! + Sends event to receiver + \return the value that is returned from the receiver's event handler + \param e - event + \param receiver - receiver +*/ bool SUITApp_Application::notify( QObject* receiver, QEvent* e ) { return myExceptHandler ? myExceptHandler->handle( receiver, e ) : QApplication::notify( receiver, e ); } +/*! + Changes exception handler + \param hand - new handler +*/ void SUITApp_Application::setHandler( SUIT_ExceptionHandler* hand ) { myExceptHandler = hand; } +/*! + \return exception handler +*/ SUIT_ExceptionHandler* SUITApp_Application::handler() const { return myExceptHandler; diff --git a/src/SUITApp/SUITApp_Application.h b/src/SUITApp/SUITApp_Application.h index 4fe9acebd..479f07a20 100644 --- a/src/SUITApp/SUITApp_Application.h +++ b/src/SUITApp/SUITApp_Application.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SUITAPP_APPLICATION_H #define SUITAPP_APPLICATION_H diff --git a/src/SUITApp/resources/SUITApp_msg_en.po b/src/SUITApp/resources/SUITApp_msg_en.po index fa5399056..3e268b6cf 100644 --- a/src/SUITApp/resources/SUITApp_msg_en.po +++ b/src/SUITApp/resources/SUITApp_msg_en.po @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# msgid "APP_ERROR" msgstr "Error" diff --git a/src/SUPERVGraph/Makefile.in b/src/SUPERVGraph/Makefile.in index 149feb93f..334a2c9fb 100755 --- a/src/SUPERVGraph/Makefile.in +++ b/src/SUPERVGraph/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # source path top_srcdir=@top_srcdir@ top_builddir=../.. @@ -34,8 +52,8 @@ RESOURCES_FILES = view_pan.png \ LIB_CLIENT_IDL = -CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+=$(QT_MT_LIBS) -L$(top_builddir)/lib +CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) +LDFLAGS+=$(QT_MT_LIBS) -lsuit @CONCLUDE@ diff --git a/src/SUPERVGraph/SUPERVGraph.cxx b/src/SUPERVGraph/SUPERVGraph.cxx index 2b8f3d87f..d570c614a 100755 --- a/src/SUPERVGraph/SUPERVGraph.cxx +++ b/src/SUPERVGraph/SUPERVGraph.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,6 +31,9 @@ using namespace std; +/*! + Creates view +*/ SUIT_ViewWindow* SUPERVGraph::createView(SUIT_Desktop* parent) { return new SUPERVGraph_ViewFrame( parent/*, "vtkView"*/ ); @@ -38,6 +41,9 @@ SUIT_ViewWindow* SUPERVGraph::createView(SUIT_Desktop* parent) extern "C" { + /*! + Creates view + */ SUIT_ViewWindow* createView(SUIT_Desktop* parent) { return SUPERVGraph::createView(parent); diff --git a/src/SUPERVGraph/SUPERVGraph.h b/src/SUPERVGraph/SUPERVGraph.h index 599857d00..eef17b998 100755 --- a/src/SUPERVGraph/SUPERVGraph.h +++ b/src/SUPERVGraph/SUPERVGraph.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx index 716cc8fca..e20b59768 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,21 +38,33 @@ using namespace std; +/*! + Constructor +*/ SUPERVGraph_View::SUPERVGraph_View( QWidget* theParent ): QWidget( theParent ) { init(theParent); } +/*! + Constructor +*/ SUPERVGraph_View::SUPERVGraph_View( SUPERVGraph_View* theParent ): QWidget( theParent ) { init(theParent); } +/*! + Builds popup for SUPERVGraph viewer +*/ void SUPERVGraph_View::contextMenuPopup( QPopupMenu* ) { // to be implemented } +/*! + Initialization +*/ void SUPERVGraph_View::init( QWidget* theParent ) { if ( theParent->inherits( "QMainWindow" ) ) { @@ -88,6 +100,9 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop ) createToolBar(); } +/*! + Creates actions of SUPERVGraph view window +*/ void SUPERVGraph_ViewFrame::createActions() { if (!myActionsMap.isEmpty()) return; @@ -109,16 +124,18 @@ void SUPERVGraph_ViewFrame::createActions() myActionsMap[ ResetId ] = aAction; } -//================================================================ -// Function : createToolBar -// Purpose : -//================================================================ +/*! + Creates toolbar of SUPERVGraph view window +*/ void SUPERVGraph_ViewFrame::createToolBar() { myActionsMap[PanId]->addTo(myToolBar); myActionsMap[ResetId]->addTo(myToolBar); } +/*! + Destructor +*/ SUPERVGraph_ViewFrame::~SUPERVGraph_ViewFrame() {} /*! @@ -130,10 +147,13 @@ SUPERVGraph_View* SUPERVGraph_ViewFrame::getViewWidget() } +/*! + Sets new view widget + \param theView - new view widget +*/ void SUPERVGraph_ViewFrame::setViewWidget( SUPERVGraph_View* theView ) { myView = theView; - setFocusProxy( myView ); // mkr : IPAL11388 } @@ -272,40 +292,69 @@ QColor SUPERVGraph_ViewFrame::backgroundColor() const return QMainWindow::backgroundColor(); } +/*! +*/ void SUPERVGraph_ViewFrame::onAdjustTrihedron() { // MESSAGE ( "SUPERVGraph_ViewFrame::onAdjustTrihedron" ) } +/*! + Changes name of object + \param obj - object to be renamed + \param name - new name +*/ void SUPERVGraph_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject, QString newName ) { // MESSAGE ( "SUPERVGraph_ViewFrame::rename" ) } +/*! + Unhilights all object in viewer + \param updateviewer - update current viewer +*/ void SUPERVGraph_ViewFrame::unHighlightAll() { // MESSAGE ( "SUPERVGraph_ViewFrame::unHighlightAll" ) } +/*! + Hilights/unhilights object in viewer + \param obj - object to be updated + \param hilight - if it is true, object will be hilighted, otherwise it will be unhilighted + \param update - update current viewer +*/ void SUPERVGraph_ViewFrame::highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool immediatly ) { // MESSAGE ( "SUPERVGraph_ViewFrame::highlight" ) } +/*! + \return true if object is in viewer or in collector + \param obj - object to be checked + \param onlyInViewer - search object only in viewer (so object must be displayed) +*/ bool SUPERVGraph_ViewFrame::isInViewer( const Handle(SALOME_InteractiveObject)& IObject ) { // MESSAGE ( "SUPERVGraph_ViewFrame::isInViewer" ) return false; } +/*! + \return true if object is displayed in viewer + \param obj - object to be checked +*/ bool SUPERVGraph_ViewFrame::isVisible( const Handle(SALOME_InteractiveObject)& IObject ) { // MESSAGE ( "SUPERVGraph_ViewFrame::isVisible" ) return false; } +/*! + Custom resize event handler +*/ void SUPERVGraph_ViewFrame::resizeEvent( QResizeEvent* theEvent ) { QMainWindow::resizeEvent( theEvent ); diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.h b/src/SUPERVGraph/SUPERVGraph_ViewFrame.h index df3266dd2..f2d336449 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.h +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx b/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx index 9cf508b31..0f890c4b5 100644 --- a/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx @@ -14,12 +14,15 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SUPERVGraph_ViewManager.h" int SUPERVGraph_ViewManager::myMaxId = 0; +/*! + Constructor +*/ SUPERVGraph_ViewManager::SUPERVGraph_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel ) @@ -28,16 +31,27 @@ SUPERVGraph_ViewManager::SUPERVGraph_ViewManager( SUIT_Study* theStudy, myId = ++myMaxId; } +/*! + Destructor +*/ SUPERVGraph_ViewManager::~SUPERVGraph_ViewManager() { } +/*! + Sets view name + \param theView - view to assign name +*/ void SUPERVGraph_ViewManager::setViewName(SUIT_ViewWindow* theView) { int aPos = myViews.find(theView); theView->setCaption( QString( "SUPERVISION scene:%1 - viewer:%2" ).arg( myId ).arg(aPos+1)); } +/*! + Fills popup menu with custom actions + \param popup - popup menu to be filled with +*/ void SUPERVGraph_ViewManager::contextMenuPopup( QPopupMenu* thePopup) { SUIT_ViewManager::contextMenuPopup( thePopup ); diff --git a/src/SUPERVGraph/SUPERVGraph_ViewManager.h b/src/SUPERVGraph/SUPERVGraph_ViewManager.h index f35557960..94c5a850d 100644 --- a/src/SUPERVGraph/SUPERVGraph_ViewManager.h +++ b/src/SUPERVGraph/SUPERVGraph_ViewManager.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SUPERVGRAPH_VIEWMANAGER_H #define SUPERVGRAPH_VIEWMANAGER_H diff --git a/src/SUPERVGraph/SUPERVGraph_ViewModel.cxx b/src/SUPERVGraph/SUPERVGraph_ViewModel.cxx index c6fe5f9ea..a9911da3e 100644 --- a/src/SUPERVGraph/SUPERVGraph_ViewModel.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewModel.cxx @@ -14,22 +14,32 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SUPERVGraph_ViewModel.h" #include "SUPERVGraph_ViewFrame.h" #include "SUIT_Desktop.h" #include "SUIT_ViewWindow.h" +/*! + Constructor +*/ SUPERVGraph_Viewer::SUPERVGraph_Viewer() :SUIT_ViewModel() { } +/*! + Destructor +*/ SUPERVGraph_Viewer::~SUPERVGraph_Viewer() { } +/*! + Creates new view window + \param theDesktop - main window of application +*/ SUIT_ViewWindow* SUPERVGraph_Viewer::createView(SUIT_Desktop* theDesktop) { SUPERVGraph_ViewFrame* aRes = new SUPERVGraph_ViewFrame( theDesktop ); diff --git a/src/SUPERVGraph/SUPERVGraph_ViewModel.h b/src/SUPERVGraph/SUPERVGraph_ViewModel.h index 82c6f6f93..9de2ffa50 100644 --- a/src/SUPERVGraph/SUPERVGraph_ViewModel.h +++ b/src/SUPERVGraph/SUPERVGraph_ViewModel.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SUPERVGRAPH_VIEWMODEL_H #define SUPERVGRAPH_VIEWMODEL_H diff --git a/src/SUPERVGraph/resources/SUPERVGraph_images.po b/src/SUPERVGraph/resources/SUPERVGraph_images.po index 3b41ded0f..97cab3fd6 100644 --- a/src/SUPERVGraph/resources/SUPERVGraph_images.po +++ b/src/SUPERVGraph/resources/SUPERVGraph_images.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SUPERVGraph_images.po // Created: 11/22/2005 10:52:37 PM // Author: Margarita Karpunina diff --git a/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po b/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po index b9ac39b42..1bad63bd6 100644 --- a/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po +++ b/src/SUPERVGraph/resources/SUPERVGraph_msg_en.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SUPERVGraph_msg_en.po // Created: 11/22/2005 10:55:36 PM // Author: Margarita Karpunina diff --git a/src/SUPERVGraph/resources/view_pan.png b/src/SUPERVGraph/resources/view_pan.png index 038fba118736ff3732a97e0e62ea4420022560ff..50db458282a6e86810830ade6ad681c47bb3da5e 100644 GIT binary patch delta 13 UcmZ3;vVeu9Gr-S%BdZJ(031>SkN^Mx delta 14 VcmZ3$vXF(fGr-TCcO#1o696An1DyZ> diff --git a/src/SUPERVGraph/resources/view_reset.png b/src/SUPERVGraph/resources/view_reset.png index 12850643e8c561aae15dc7c2990028d57ac9d1bf..7ba93b98f8d8483609b8655b3306038cade3d9ad 100644 GIT binary patch delta 13 Ucmcc1e21B(Gr-S%BkK)D03%Zb!2kdN delta 14 Vcmcb^e3zNEGr-TCcO%OUMgS(u1kL~e diff --git a/src/SVTK/Makefile.in b/src/SVTK/Makefile.in index 58c7e6fdb..f45b583aa 100755 --- a/src/SVTK/Makefile.in +++ b/src/SVTK/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Alexander Solovyov(OCN) # Module : SVTK @@ -19,6 +37,7 @@ EXPORT_HEADERS= \ SALOME_Actor.h \ SVTK_RectPicker.h \ SVTK_DeviceActor.h \ + SVTK_DialogBase.h \ SVTK_FontWidget.h \ SVTK_CubeAxesActor2D.h \ SVTK_Functor.h \ @@ -38,7 +57,9 @@ EXPORT_HEADERS= \ SVTK_Event.h \ SVTK_ViewModelBase.h -PO_FILES = SVTK_msg_en.po +PO_FILES = \ + SVTK_msg_en.po \ + SVTK_images.po # Libraries targets LIB = libSVTK.la @@ -51,7 +72,9 @@ LIB_SRC= \ SVTK_DeviceActor.cxx \ SVTK_CubeAxesActor2D.cxx \ SVTK_NonIsometricDlg.cxx \ + SVTK_UpdateRateDlg.cxx \ SVTK_CubeAxesDlg.cxx \ + SVTK_DialogBase.cxx \ SVTK_FontWidget.cxx \ SVTK_Trihedron.cxx \ SVTK_MainWindow.cxx \ @@ -70,8 +93,10 @@ LIB_MOC = \ SVTK_GenericRenderWindowInteractor.h \ SVTK_RenderWindowInteractor.h \ SVTK_NonIsometricDlg.h \ + SVTK_UpdateRateDlg.h \ SVTK_CubeAxesDlg.h \ SVTK_FontWidget.h \ + SVTK_DialogBase.h \ SVTK_ViewModelBase.h \ SVTK_ViewManager.h \ SVTK_ViewWindow.h \ @@ -85,11 +110,13 @@ CPPFLAGS+= \ $(QT_INCLUDES) \ $(OCC_INCLUDES) \ $(VTK_INCLUDES) \ + $(QWT_INCLUDES) \ $(BOOST_CPPFLAGS) LDFLAGS+= \ $(QT_MT_LIBS) \ $(OCC_LIBS) \ + $(QWT_LIBS) \ $(VTK_LIBS) LIBS+= -lqtx -lsuit -lstd -lCAM -lSalomeObject -lSalomePrs -lVTKViewer diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 9b1b7937d..8bd1cbd43 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -73,7 +73,6 @@ using namespace std; int SALOME_POINT_SIZE = 5; int SALOME_LINE_WIDTH = 3; -//---------------------------------------------------------------------------- namespace { int @@ -83,12 +82,13 @@ namespace { int anEdgeId = 0; if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) { - float aPickPosition[3]; + vtkFloatingPointType aPickPosition[3]; thePicker->GetPickPosition(aPickPosition); - float aMinDist = 1000000.0, aDist = 0; + vtkFloatingPointType aMinDist = 1000000.0, aDist = 0; for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){ if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){ - int subId; float pcoords[3], closestPoint[3], weights[3]; + int subId; + vtkFloatingPointType pcoords[3], closestPoint[3], weights[3]; aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); if (aDist < aMinDist) { aMinDist = aDist; @@ -122,11 +122,11 @@ namespace } -//---------------------------------------------------------------------------- vtkStandardNewMacro(SALOME_Actor); - -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SALOME_Actor ::SALOME_Actor(): myRenderer(NULL), @@ -164,14 +164,17 @@ SALOME_Actor myOutlineActor->SetVisibility( false ); } - -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SALOME_Actor ::~SALOME_Actor() {} -//---------------------------------------------------------------------------- +/*! + \return true if the SALOME_Actor has a reference to SALOME_InteractiveObject +*/ Standard_Boolean SALOME_Actor ::hasIO() @@ -179,6 +182,9 @@ SALOME_Actor return !myIO.IsNull(); } +/*! + \return correspoinding reference to SALOME_InteractiveObject +*/ const Handle(SALOME_InteractiveObject)& SALOME_Actor ::getIO() @@ -186,6 +192,10 @@ SALOME_Actor return myIO; } +/*! + Sets reference to SALOME_InteractiveObject + \param theIO - new SALOME_InteractiveObject +*/ void SALOME_Actor ::setIO(const Handle(SALOME_InteractiveObject)& theIO) @@ -193,6 +203,10 @@ SALOME_Actor myIO = theIO; } +/*! + Sets name the SALOME_Actor + \param theName - new name +*/ void SALOME_Actor ::setName(const char* theName) @@ -203,7 +217,9 @@ SALOME_Actor } -//---------------------------------------------------------------------------- +/*! + Publishes the actor in all its internal devices +*/ void SALOME_Actor ::AddToRender(vtkRenderer* theRenderer) @@ -217,6 +233,9 @@ SALOME_Actor theRenderer->AddActor( myOutlineActor.GetPointer() ); } +/*! + Removes the actor from all its internal devices +*/ void SALOME_Actor ::RemoveFromRender(vtkRenderer* theRenderer) @@ -228,6 +247,9 @@ SALOME_Actor theRenderer->RemoveActor( myOutlineActor.GetPointer() ); } +/*! + \return reference on renderer where it is published +*/ vtkRenderer* SALOME_Actor ::GetRenderer() @@ -235,8 +257,10 @@ SALOME_Actor return myRenderer; } - -//---------------------------------------------------------------------------- +/*! + Sets interactor in order to use vtkInteractorObserver devices + \param theInteractor - new interactor +*/ void SALOME_Actor ::SetInteractor(vtkRenderWindowInteractor* theInteractor) @@ -244,6 +268,9 @@ SALOME_Actor myInteractor = theInteractor; } +/*! + Put a request to redraw the view +*/ void SALOME_Actor ::Update() @@ -251,8 +278,10 @@ SALOME_Actor myInteractor->CreateTimer(VTKI_TIMER_UPDATE); } - -//---------------------------------------------------------------------------- +/*! + Apply view transformation + \param theTransform - transformation +*/ void SALOME_Actor ::SetTransform(VTKViewer_Transform* theTransform) @@ -264,10 +293,14 @@ SALOME_Actor myOutlineActor->SetTransform(theTransform); } - +/*! + Apply additional position +*/ void SALOME_Actor -::SetPosition(float _arg1, float _arg2, float _arg3) +::SetPosition(vtkFloatingPointType _arg1, + vtkFloatingPointType _arg2, + vtkFloatingPointType _arg3) { Superclass::SetPosition(_arg1,_arg2,_arg3); @@ -276,16 +309,20 @@ SALOME_Actor myOutlineActor->SetPosition(_arg1,_arg2,_arg3); } - +/*! + Apply additional position +*/ void SALOME_Actor -::SetPosition(float _arg[3]) +::SetPosition(vtkFloatingPointType _arg[3]) { SetPosition(_arg[0],_arg[1],_arg[2]); } - -//---------------------------------------------------------------- +/*! + Shows/hides actor + \param theVisibility - new visibility state +*/ void SALOME_Actor ::SetVisibility( int theVisibility ) @@ -304,8 +341,10 @@ SALOME_Actor } } - -//---------------------------------------------------------------- +/*! + Set selector in order to the actor at any time can restore current selection + \param theSelector - new selector +*/ void SALOME_Actor ::SetSelector(SVTK_Selector* theSelector) @@ -313,6 +352,9 @@ SALOME_Actor mySelector = theSelector; } +/*! + To map current selection to VTK representation +*/ void SALOME_Actor ::Highlight(bool theIsHighlight) @@ -349,11 +391,14 @@ SALOME_Actor highlight(theIsHighlight); } +/*! + Updates visibility of the highlight devices +*/ void SALOME_Actor ::highlight(bool theIsHighlight) { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; GetInput()->GetBounds(aBounds); myOutline->SetBounds(aBounds); myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight ); @@ -362,13 +407,18 @@ SALOME_Actor } -//---------------------------------------------------------------- +/*! + To process prehighlight (called from SVTK_InteractorStyle) +*/ bool SALOME_Actor ::PreHighlight(vtkInteractorStyle *theInteractorStyle, SVTK_SelectionEvent* theSelectionEvent, bool theIsHighlight) { + if ( !GetPickable() ) + return false; + vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer(); // myPreHighlightActor->SetVisibility( false ); @@ -377,9 +427,9 @@ SALOME_Actor Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode; bool anIsChanged = (mySelectionMode != aSelectionMode); - float x = theSelectionEvent->myX; - float y = theSelectionEvent->myY; - float z = 0.0; + vtkFloatingPointType x = theSelectionEvent->myX; + vtkFloatingPointType y = theSelectionEvent->myY; + vtkFloatingPointType z = 0.0; if( !theIsHighlight ) { SetPreSelected( false ); @@ -500,14 +550,18 @@ SALOME_Actor return anIsChanged; } - -//---------------------------------------------------------------- +/*! + To process highlight (called from SVTK_InteractorStyle) +*/ bool SALOME_Actor ::Highlight(vtkInteractorStyle *theInteractorStyle, SVTK_SelectionEvent* theSelectionEvent, bool theIsHighlight) { + if ( !GetPickable() ) + return false; + myOutlineActor->SetVisibility( false ); myHighlightActor->SetVisibility( false ); @@ -515,13 +569,16 @@ SALOME_Actor // Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode; bool anIsShift = theSelectionEvent->myIsShift; - if( !anIsShift ) { + if( !anIsShift || !theIsHighlight ) { mySelector->RemoveIObject( this ); } - float x = theSelectionEvent->myX; - float y = theSelectionEvent->myY; - float z = 0.0; + if ( !theIsHighlight ) + return true; + + vtkFloatingPointType x = theSelectionEvent->myX; + vtkFloatingPointType y = theSelectionEvent->myY; + vtkFloatingPointType z = 0.0; if( !theSelectionEvent->myIsRectangle ) { switch(aSelectionMode){ @@ -588,16 +645,16 @@ SALOME_Actor break; } }else{ - float xLast = theSelectionEvent->myLastX; - float yLast = theSelectionEvent->myLastY; - float zLast = 0.0; + vtkFloatingPointType xLast = theSelectionEvent->myLastX; + vtkFloatingPointType yLast = theSelectionEvent->myLastY; + vtkFloatingPointType zLast = 0.0; - float x1 = x < xLast ? x : xLast; - float y1 = y < yLast ? y : yLast; - float z1 = z < zLast ? z : zLast; - float x2 = x > xLast ? x : xLast; - float y2 = y > yLast ? y : yLast; - float z2 = z > zLast ? z : zLast; + vtkFloatingPointType x1 = x < xLast ? x : xLast; + vtkFloatingPointType y1 = y < yLast ? y : yLast; + vtkFloatingPointType z1 = z < zLast ? z : zLast; + vtkFloatingPointType x2 = x > xLast ? x : xLast; + vtkFloatingPointType y2 = y > yLast ? y : yLast; + vtkFloatingPointType z2 = z > zLast ? z : zLast; switch(aSelectionMode){ case NodeSelection: { @@ -611,7 +668,6 @@ SALOME_Actor if(aMapIter != aVectorIdsMap.end()){ const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second; vtkIdType anEnd = aVectorIds.size(); - SVTK_RectPicker::TVectorIds::const_iterator anIdIter = aVectorIds.begin(); for(vtkIdType anId = 0; anId < anEnd; anId++ ) { int aPointId = aVectorIds[anId]; if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) { @@ -633,8 +689,8 @@ SALOME_Actor } case ActorSelection : { - float aPnt[3]; - float* aBounds = GetBounds(); + vtkFloatingPointType aPnt[3]; + vtkFloatingPointType* aBounds = GetBounds(); bool anIsPicked = true; for( int i = 0; i <= 1; i++ ) { @@ -672,7 +728,6 @@ SALOME_Actor if(aMapIter != aVectorIdsMap.end()){ const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second; vtkIdType anEnd = aVectorIds.size(); - SVTK_RectPicker::TVectorIds::const_iterator anIdIter = aVectorIds.begin(); for(vtkIdType anId = 0; anId < anEnd; anId++ ) { int aCellId = aVectorIds[anId]; if ( !mySelector->IsValid( this, aCellId ) ) @@ -698,7 +753,10 @@ SALOME_Actor return true; } -//---------------------------------------------------------------------------- +/*! + To set up a picker for nodal selection (initialized by SVTK_Renderer::AddActor) + \param thePointPicker - new picker +*/ void SALOME_Actor ::SetPointPicker(vtkPointPicker* thePointPicker) @@ -706,6 +764,10 @@ SALOME_Actor myPointPicker = thePointPicker; } +/*! + To set up a picker for cell selection (initialized by SVTK_Renderer::AddActor) + \param theCellPicker - new picker +*/ void SALOME_Actor ::SetCellPicker(vtkCellPicker* theCellPicker) @@ -713,6 +775,10 @@ SALOME_Actor myCellPicker = theCellPicker; } +/*! + To set up a picker for point rectangle selection (initialized by SVTK_Renderer::AddActor) + \param theRectPicker - new picker +*/ void SALOME_Actor ::SetPointRectPicker(SVTK_RectPicker* theRectPicker) @@ -720,6 +786,10 @@ SALOME_Actor myPointRectPicker = theRectPicker; } +/*! + To set up a picker for cell rectangle selection (initialized by SVTK_Renderer::AddActor) + \param theRectPicker - new picker +*/ void SALOME_Actor ::SetCellRectPicker(SVTK_RectPicker* theRectPicker) @@ -727,7 +797,9 @@ SALOME_Actor myCellRectPicker = theRectPicker; } -//---------------------------------------------------------------------------- +/*! + To set up a prehighlight property (initialized by SVTK_Renderer::AddActor) +*/ void SALOME_Actor ::SetPreHighlightProperty(vtkProperty* theProperty) @@ -735,6 +807,9 @@ SALOME_Actor myPreHighlightActor->SetProperty(theProperty); } +/*! + To set up a highlight property (initialized by SVTK_Renderer::AddActor) +*/ void SALOME_Actor ::SetHighlightProperty(vtkProperty* theProperty) diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index d377ff633..03c4ca7a7 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -100,12 +100,14 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor //! Apply additional position virtual void - SetPosition(float _arg1, float _arg2, float _arg3); + SetPosition(vtkFloatingPointType _arg1, + vtkFloatingPointType _arg2, + vtkFloatingPointType _arg3); //! Apply additional position virtual void - SetPosition(float _arg[3]); + SetPosition(vtkFloatingPointType _arg[3]); //---------------------------------------------------------------------------- //! Visibility management diff --git a/src/SVTK/SVTK.cxx b/src/SVTK/SVTK.cxx index 0be0d5cfd..674714f77 100644 --- a/src/SVTK/SVTK.cxx +++ b/src/SVTK/SVTK.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK.h b/src/SVTK/SVTK.h index a5b0ba916..b07763c0b 100755 --- a/src/SVTK/SVTK.h +++ b/src/SVTK/SVTK.h @@ -14,19 +14,26 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#ifndef SVTK_H +#define SVTK_H + +#include "VTKViewer.h" + #ifdef WNT -#ifdef SVTK_EXPORTS -#define SVTK_EXPORT __declspec(dllexport) -#else -#define SVTK_EXPORT __declspec(dllimport) -#endif +# ifdef SVTK_EXPORTS +# define SVTK_EXPORT __declspec(dllexport) +# else +# define SVTK_EXPORT __declspec(dllimport) +# endif #else -#define SVTK_EXPORT +# define SVTK_EXPORT #endif #if defined WNT #pragma warning ( disable: 4251 ) #pragma warning ( disable: 4786 ) #endif + +#endif diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 337075bb1..036926fb8 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "SVTK_Actor.h" #include "SALOME_Actor.h" @@ -46,10 +46,11 @@ CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet) aPoints->Delete(); } -//======================================================================= - vtkStandardNewMacro(SVTK_Actor); +/*! + Constructor +*/ SVTK_Actor ::SVTK_Actor(): myUnstructuredGrid(vtkUnstructuredGrid::New()) @@ -62,7 +63,6 @@ SVTK_Actor myUnstructuredGrid->Allocate(); } -//---------------------------------------------------------------------------- void SVTK_Actor ::Initialize() @@ -70,8 +70,6 @@ SVTK_Actor SetInput(GetSource()); } - -//---------------------------------------------------------------------------- void SVTK_Actor ::SetSource(vtkUnstructuredGrid* theUnstructuredGrid) @@ -91,15 +89,14 @@ SVTK_Actor return myUnstructuredGrid.GetPointer(); } - -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SVTK_Actor ::~SVTK_Actor() { } - -//---------------------------------------------------------------------------- const TColStd_IndexedMapOfInteger& SVTK_Actor ::GetMapIndex() const @@ -107,8 +104,6 @@ SVTK_Actor return myMapIndex; } - -//---------------------------------------------------------------------------- void SVTK_Actor ::MapCells(SALOME_Actor* theMapActor, @@ -136,8 +131,6 @@ SVTK_Actor myMapIndex = theMapIndex; } - -//---------------------------------------------------------------------------- void SVTK_Actor ::MapPoints(SALOME_Actor* theMapActor, @@ -151,7 +144,7 @@ SVTK_Actor aPoints->SetNumberOfPoints(aNbOfParts); for(int i = 0; i < aNbOfParts; i++){ int aPartId = theMapIndex( i+1 ); - if(float* aCoord = theMapActor->GetNodeCoord(aPartId)){ + if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){ aPoints->SetPoint(i,aCoord); myUnstructuredGrid->InsertNextCell(VTK_VERTEX,1,&i); } @@ -165,8 +158,6 @@ SVTK_Actor myMapIndex = theMapIndex; } - -//---------------------------------------------------------------------------- void SVTK_Actor ::MapEdge(SALOME_Actor* theMapActor, @@ -205,5 +196,3 @@ SVTK_Actor myMapIndex = theMapIndex; } - -//---------------------------------------------------------------------------- diff --git a/src/SVTK/SVTK_Actor.h b/src/SVTK/SVTK_Actor.h index 9d1dcb224..bb7542da3 100644 --- a/src/SVTK/SVTK_Actor.h +++ b/src/SVTK/SVTK_Actor.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #ifndef SVTK_ACTOR_H #define SVTK_ACTOR_H diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 3fdcf72f3..823c07224 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -48,7 +48,6 @@ vtkCxxRevisionMacro(SVTK_CubeAxesActor2D, "$Revision$"); vtkStandardNewMacro(SVTK_CubeAxesActor2D); -//---------------------------------------------------------------------------- // Instantiate this object. SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D() { @@ -130,7 +129,6 @@ SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D() } -//---------------------------------------------------------------------------- SVTK_CubeAxesActor2D::~SVTK_CubeAxesActor2D() { this->wireActorXY->Delete(); @@ -146,12 +144,10 @@ SVTK_CubeAxesActor2D::~SVTK_CubeAxesActor2D() this->rgridMapperXZ->Delete(); } -//---------------------------------------------------------------------------- // Static variable describes connections in cube. static int Conn[8][3] = {{1,2,4}, {0,3,5}, {3,0,6}, {2,1,7}, {5,6,0}, {4,7,1}, {7,4,2}, {6,5,3}}; -//---------------------------------------------------------------------------- // Project the bounding box and compute edges on the border of the bounding // cube. Determine which parts of the edges are visible via intersection // with the boundary of the viewport (minus borders). @@ -198,8 +194,13 @@ int SVTK_CubeAxesActor2D::RenderOverlay(vtkViewport *viewport) return renderedSomething; } -static void ChangeValues(float* aArray1,float* aArray2,float *aRange1,float* aRange2,bool theY){ - float tmp=-1000; +static void ChangeValues(vtkFloatingPointType* aArray1, + vtkFloatingPointType* aArray2, + vtkFloatingPointType *aRange1, + vtkFloatingPointType* aRange2, + bool theY) +{ + vtkFloatingPointType tmp=-1000; if (!theY){ for (int i=0; i<4; i++){ tmp = aArray1[i]; aArray1[i] = aArray2[i]; aArray2[i] = tmp; @@ -223,9 +224,15 @@ static void ChangeValues(float* aArray1,float* aArray2,float *aRange1,float* aRa } } -static void ChangeArrays(float* xCoords,float* yCoords,float* zCoords, - float* xRange,float* yRange,float* zRange, - const int xAxes,const int yAxes, const int zAxes) +static void ChangeArrays(vtkFloatingPointType* xCoords, + vtkFloatingPointType* yCoords, + vtkFloatingPointType* zCoords, + vtkFloatingPointType* xRange, + vtkFloatingPointType* yRange, + vtkFloatingPointType* zRange, + const int xAxes, + const int yAxes, + const int zAxes) { if ( xAxes == 0 && yAxes == 2 && zAxes == 1) ChangeValues(yCoords,zCoords,yRange,zRange,true); @@ -243,14 +250,13 @@ static void ChangeArrays(float* xCoords,float* yCoords,float* zCoords, ChangeValues(zCoords,xCoords,zRange,xRange,false); } -//---------------------------------------------------------------------------- // Project the bounding box and compute edges on the border of the bounding // cube. Determine which parts of the edges are visible via intersection // with the boundary of the viewport (minus borders). int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) { - float bounds[6], slope = 0.0, minSlope, num, den; - float pts[8][3], d2, d2Min, min; + vtkFloatingPointType bounds[6], slope = 0.0, minSlope, num, den; + vtkFloatingPointType pts[8][3], d2, d2Min, min; int i, idx = 0; int xIdx, yIdx = 0, zIdx = 0, zIdx2, renderedSomething=0; int xAxes = 0, yAxes, zAxes; @@ -308,7 +314,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) } else { - float e1[2], e2[2], e3[2]; + vtkFloatingPointType e1[2], e2[2], e3[2]; // Find distance to origin d2Min = VTK_LARGE_FLOAT; @@ -401,7 +407,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) } // Setup the axes for plotting - float xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2]; + vtkFloatingPointType xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2]; this->AdjustAxes(pts, bounds, idx, xIdx, yIdx, zIdx, zIdx2, xAxes, yAxes, zAxes, xCoords, yCoords, zCoords, xRange, yRange, zRange); @@ -449,7 +455,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) #else for(i=0;iInsertNextValue(val); } // YCoords coordinates for Y grid @@ -459,7 +465,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) #else for(i=0;iInsertNextValue(val); } // ZCoords coordinates for Z grid @@ -469,7 +475,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) #else for(i=0;iInsertNextValue(val); } @@ -485,8 +491,8 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) rgrid->Delete(); - float aCPosition[3]; - float aCDirection[3]; + vtkFloatingPointType aCPosition[3]; + vtkFloatingPointType aCDirection[3]; this->Camera->GetPosition(aCPosition); this->Camera->GetDirectionOfProjection(aCDirection); @@ -494,12 +500,12 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) bool replaceXY=false; bool replaceYZ=false; bool replaceXZ=false; - float p[6][3]; // centers of planes - float vecs[6][3]; // 6 vectors from camera position to centers + vtkFloatingPointType p[6][3]; // centers of planes + vtkFloatingPointType vecs[6][3]; // 6 vectors from camera position to centers - float aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2; - float aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2; - float aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2; + vtkFloatingPointType aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2; + vtkFloatingPointType aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2; + vtkFloatingPointType aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2; // plane XY p[0][0] = aMiddleX; // plane X=0.5 Y=0.5 Z=0 @@ -555,7 +561,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) YCoords->Delete(); ZCoords->Delete(); - float color[3]; + vtkFloatingPointType color[3]; this->GetProperty()->GetColor(color); this->wireActorXY->GetProperty()->SetColor(color); @@ -644,7 +650,6 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) return renderedSomething; } -//---------------------------------------------------------------------------- // Release any graphics resources that are being consumed by this actor. // The parameter window could be used to determine which graphic // resources to release. diff --git a/src/SVTK/SVTK_CubeAxesActor2D.h b/src/SVTK/SVTK_CubeAxesActor2D.h index 1de1c1ce8..b9583c642 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.h +++ b/src/SVTK/SVTK_CubeAxesActor2D.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -41,7 +41,8 @@ class vtkPolyDataMapper; class vtkRectilinearGridGeometryFilter; class VTKViewer_Transform; -#include +#include "SVTK.h" +#include "VTKViewer.h" #ifndef WNT class VTK_HYBRID_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D diff --git a/src/SVTK/SVTK_CubeAxesDlg.cxx b/src/SVTK/SVTK_CubeAxesDlg.cxx index daed6845e..94e4af88f 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.cxx +++ b/src/SVTK/SVTK_CubeAxesDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -33,6 +33,7 @@ #include "SVTK_CubeAxesActor2D.h" #include "QtxAction.h" +#include "QtxIntSpinBox.h" #include #include @@ -53,10 +54,9 @@ * Description : Tab of dialog */ -//======================================================================= -// name : SVTK_AxisWidget::AxisWg -// Purpose : Constructor -//======================================================================= +/*! + Constructor +*/ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent) : QFrame(theParent) { @@ -88,15 +88,13 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent) aHBox = new QHBox(myLabelsGrp); aHBox->setSpacing(5); aLabel = new QLabel(tr("NUMBER"), aHBox); - myLabelNumber = new QLineEdit(aHBox); - myLabelNumber->setValidator(new QIntValidator(0, 25, this)); - myLabelNumber->installEventFilter(this); + myLabelNumber = new QtxIntSpinBox(0,25,1,aHBox,"SpinBoxLabelNumber"); aLabels.append(aLabel); aHBox = new QHBox(myLabelsGrp); aHBox->setSpacing(5); aLabel = new QLabel(tr("OFFSET"), aHBox); - myLabelOffset = new QLineEdit(aHBox); + myLabelOffset = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxLabellOffset"); aLabels.append(aLabel); aHBox = new QHBox(myLabelsGrp); @@ -113,7 +111,8 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent) aHBox = new QHBox(myTicksGrp); aHBox->setSpacing(5); aLabel = new QLabel(tr("LENGTH"), aHBox); - myTickLength = new QLineEdit(aHBox); + myTickLength = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxTickLength"); + aLabels.append(aLabel); // Layout @@ -143,6 +142,9 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent) connect(myIsTicksVisible, SIGNAL(stateChanged(int)), SLOT(onTicksChecked())); } +/*! + Destructor +*/ SVTK_AxisWidget::~SVTK_AxisWidget() { } @@ -154,20 +156,6 @@ void SVTK_AxisWidget::updateControlState() onTicksChecked(); } -bool SVTK_AxisWidget::eventFilter(QObject* o, QEvent* e) -{ - if (e->type() == QEvent::FocusOut) { - bool isOK = false; - int k = myLabelNumber->text().toInt(&isOK); - if (isOK && k > 25) myLabelNumber->setText("25"); - } - return false; -} - -//======================================================================= -// name : SVTK_AxisWidget::onNameChecked -// Purpose : -//======================================================================= void SVTK_AxisWidget::setEnabled(QGroupBox* theGrp, const bool theState) { QObjectList aChildren(*theGrp->children()); @@ -177,55 +165,31 @@ void SVTK_AxisWidget::setEnabled(QGroupBox* theGrp, const bool theState) ((QHBox*)anObj)->setEnabled(theState); } -//======================================================================= -// Labels : SVTK_AxisWidget::onLabelsChecked -// Purpose : -//======================================================================= void SVTK_AxisWidget::onLabelsChecked() { setEnabled(myLabelsGrp, myIsLabelsVisible->isChecked()); } -//======================================================================= -// Labels : SVTK_AxisWidget::onTicksChecked -// Purpose : -//======================================================================= void SVTK_AxisWidget::onTicksChecked() { setEnabled(myTicksGrp, myIsTicksVisible->isChecked()); } -//======================================================================= -// name : SVTK_AxisWidget::onNameChecked -// Purpose : -//======================================================================= void SVTK_AxisWidget::onNameChecked() { setEnabled(myNameGrp, myIsNameVisible->isChecked()); } -//======================================================================= -// name : SVTK_AxisWidget::UseName -// Purpose : -//======================================================================= void SVTK_AxisWidget::UseName(const bool toUse) { myIsNameVisible->setChecked(toUse); } -//======================================================================= -// name : SVTK_AxisWidget::SetName -// Purpose : -//================================================== ===================== void SVTK_AxisWidget::SetName(const QString& theName) { myAxisName->setText(theName); } -//======================================================================= -// name : SVTK_AxisWidget::SetNameFont -// Purpose : -//======================================================================= void SVTK_AxisWidget::SetNameFont(const QColor& theColor, const int theFont, const bool theIsBold, @@ -235,10 +199,6 @@ void SVTK_AxisWidget::SetNameFont(const QColor& theColor, myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow); } -//======================================================================= -// name : SVTK_AxisWidget::SetNameFont -// Purpose : -//======================================================================= bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) { if (theActor == 0) @@ -258,7 +218,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) vtkTextProperty* aTitleProp = theActor->GetTitleTextProperty(); if (aTitleProp !=0) { - float c[ 3 ]; + vtkFloatingPointType c[ 3 ]; aTitleProp->GetColor(c); aTitleColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); aTitleFontFamily = aTitleProp->GetFontFamily(); @@ -286,7 +246,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) vtkTextProperty* aLabelsProp = theActor->GetLabelTextProperty(); if (aLabelsProp !=0) { - float c[ 3 ]; + vtkFloatingPointType c[ 3 ]; aLabelsProp->GetColor(c); aLabelsColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); aLabelsFontFamily = aLabelsProp->GetFontFamily(); @@ -296,8 +256,8 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) } myIsLabelsVisible->setChecked(useLabels); - myLabelNumber->setText(QString("%1").arg(nbLabels)); - myLabelOffset->setText(QString("%1").arg(anOffset)); + myLabelNumber->setValue(nbLabels); + myLabelOffset->setValue(anOffset); myLabelsFont->SetData(aLabelsColor, aLabelsFontFamily, isLabelsBold, isLabelsItalic, isLabelsShadow); // Tick marks @@ -305,15 +265,11 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) int aTickLength = theActor->GetTickLength(); myIsTicksVisible->setChecked(useTickMarks); - myTickLength->setText(QString("%1").arg(aTickLength)); + myTickLength->setValue(aTickLength); return true; } -//======================================================================= -// name : SVTK_CubeAxesDlg::Apply -// Purpose : -//======================================================================= bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor) { if (theActor == 0) @@ -350,14 +306,11 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor) theActor->SetLabelVisibility(myIsLabelsVisible->isChecked() ? 1 : 0); - bool isOk = false; - int nbLabels = myLabelNumber->text().toInt(&isOk); - if (isOk) - theActor->SetNumberOfLabels(nbLabels); + int nbLabels = myLabelNumber->value(); + theActor->SetNumberOfLabels(nbLabels); - int anOffset = myLabelOffset->text().toInt(&isOk); - if (isOk) - theActor->SetTickOffset(anOffset); + int anOffset = myLabelOffset->value(); + theActor->SetTickOffset(anOffset); QColor aLabelsColor(255, 255, 255); int aLabelsFontFamily = VTK_ARIAL; @@ -385,9 +338,8 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor) // Tick marks theActor->SetTickVisibility(myIsTicksVisible->isChecked()); - int aTickLength = myTickLength->text().toInt(&isOk); - if (isOk) - theActor->SetTickLength(aTickLength); + int aTickLength = myTickLength->value(); + theActor->SetTickLength(aTickLength); return true; } @@ -397,31 +349,30 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor) Description : Dialog for specifynig cube axes properties */ -//======================================================================= -// name : SVTK_CubeAxesDlg::SVTK_CubeAxesDlg -// Purpose : Constructor -//======================================================================= -SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(SVTK_MainWindow* theParent, - const char* theName, - QtxAction* theAction): - QDialog(theParent, - theName, - false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - myMainWindow(theParent), - myAction(theAction) +/*! + Constructor +*/ +SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(QtxAction* theAction, + SVTK_MainWindow* theParent, + const char* theName): + SVTK_DialogBase(theAction, + theParent, + theName), + myMainWindow(theParent) { setCaption(tr("CAPTION")); QVBoxLayout* aLay = new QVBoxLayout(this, 5, 5); aLay->addWidget(createMainFrame(this)); aLay->addWidget(createButtonFrame(this)); + + connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow())); + connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide())); } -//======================================================================= -// name : SVTK_CubeAxesDlg::createMainFrame -// Purpose : Create frame containing dialog's input fields -//======================================================================= +/*! + Create frame containing dialog's input fields +*/ QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent) { QFrame* aFrame = new QFrame(theParent); @@ -447,10 +398,9 @@ QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent) return aFrame; } -//======================================================================= -// name : SVTK_CubeAxesDlg::createButtonFrame -// Purpose : Create frame containing buttons -//======================================================================= +/*! + Create frame containing buttons +*/ QWidget* SVTK_CubeAxesDlg::createButtonFrame(QWidget* theParent) { QFrame* aFrame = new QFrame(theParent); @@ -476,18 +426,16 @@ QWidget* SVTK_CubeAxesDlg::createButtonFrame(QWidget* theParent) return aFrame; } -//======================================================================= -// name : SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg -// Purpose : Destructor -//======================================================================= +/*! + Destructor +*/ SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg() { } -//======================================================================= -// name : SVTK_CubeAxesDlg::Update -// Purpose : Update dialog fields, connect signals and slots, show dialog -//======================================================================= +/*! + Update dialog fields, connect signals and slots, show dialog +*/ void SVTK_CubeAxesDlg::Update() { myActor = myMainWindow->GetCubeAxes(); @@ -499,25 +447,27 @@ void SVTK_CubeAxesDlg::Update() myIsVisible->setChecked(myActor->GetVisibility() ? true : false); } -//======================================================================= -// name : SVTK_CubeAxesDlg::isValid -// Purpose : Verify validity of entry data -//======================================================================= +/*! + Verify validity of entry data +*/ bool SVTK_CubeAxesDlg::isValid() const { return true; } -//======================================================================= -// name : SVTK_CubeAxesDlg::onApply -// Purpose : Verify validity of entry data -//======================================================================= +/*! + Verify validity of entry data +*/ bool SVTK_CubeAxesDlg::onApply() { bool isOk = true; try { + QWidget *aCurrWid = this->focusWidget(); + aCurrWid->clearFocus(); + aCurrWid->setFocus(); + isOk = isOk && myAxes[ 0 ]->Apply(myActor->GetXAxisActor2D()); isOk = isOk && myAxes[ 1 ]->Apply(myActor->GetYAxisActor2D()); isOk = isOk && myAxes[ 2 ]->Apply(myActor->GetZAxisActor2D()); @@ -544,29 +494,19 @@ bool SVTK_CubeAxesDlg::onApply() return isOk; } -//======================================================================= -// name : SVTK_CubeAxesDlg::onOk -// Purpose : SLOT called when "Ok" button pressed. -//======================================================================= +/*! + SLOT called when "Ok" button pressed. +*/ void SVTK_CubeAxesDlg::onOk() { if (onApply()) onClose(); } -//======================================================================= -// name : SVTK_CubeAxesDlg::onClose -// Purpose : SLOT called when "Close" button pressed. Close dialog -//======================================================================= +/*! + SLOT: called when "Close" button pressed. Close dialog +*/ void SVTK_CubeAxesDlg::onClose() { reject(); - - myAction->setOn( false ); -} - -void SVTK_CubeAxesDlg::done( int r ) -{ - myAction->setOn( false ); - QDialog::done( r ); } diff --git a/src/SVTK/SVTK_CubeAxesDlg.h b/src/SVTK/SVTK_CubeAxesDlg.h index bd7e5254c..c4277db69 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.h +++ b/src/SVTK/SVTK_CubeAxesDlg.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,7 +27,8 @@ #ifndef SVTK_CubeAxesDlg_H #define SVTK_CubeAxesDlg_H -#include +#include "SVTK_DialogBase.h" + #include class QWidget; @@ -39,6 +40,7 @@ class QLineEdit; class QGroupBox; class QtxAction; +class QtxIntSpinBox; class vtkAxisActor2D; class SVTK_CubeAxesActor2D; @@ -51,14 +53,14 @@ class SVTK_MainWindow; * Class : SVTK_CubeAxesDlg * Description : Dialog for specifynig cube axes properties */ -class SVTK_CubeAxesDlg : public QDialog +class SVTK_CubeAxesDlg : public SVTK_DialogBase { Q_OBJECT public: - SVTK_CubeAxesDlg(SVTK_MainWindow* theParent, - const char* theName, - QtxAction* theAction); + SVTK_CubeAxesDlg(QtxAction* theAction, + SVTK_MainWindow* theParent, + const char* theName); virtual ~SVTK_CubeAxesDlg(); void Update(); @@ -68,8 +70,6 @@ private slots: bool onApply(); void onClose(); - virtual void done( int ); - private: QWidget* createButtonFrame( QWidget* ); QWidget* createMainFrame ( QWidget* ); @@ -78,7 +78,6 @@ private: private: SVTK_MainWindow *myMainWindow; SVTK_CubeAxesActor2D* myActor; - QtxAction* myAction; QTabWidget* myTabWg; QCheckBox* myIsVisible; @@ -107,9 +106,6 @@ public: bool ReadData( vtkAxisActor2D* ); bool Apply( vtkAxisActor2D* ); -protected: - bool eventFilter(QObject*, QEvent*); - private slots: void onNameChecked(); void onLabelsChecked(); @@ -129,14 +125,14 @@ private: // labels QGroupBox* myLabelsGrp; QCheckBox* myIsLabelsVisible; - QLineEdit* myLabelNumber; - QLineEdit* myLabelOffset; + QtxIntSpinBox* myLabelNumber; + QtxIntSpinBox* myLabelOffset; SVTK_FontWidget* myLabelsFont; // tick marks QGroupBox* myTicksGrp; QCheckBox* myIsTicksVisible; - QLineEdit* myTickLength; + QtxIntSpinBox* myTickLength; friend class SVTK_CubeAxesDlg; }; diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index be959115c..279015efd 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -46,11 +46,11 @@ using namespace std; -//---------------------------------------------------------------------------- vtkStandardNewMacro(SVTK_DeviceActor); - -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_DeviceActor ::SVTK_DeviceActor() { @@ -77,8 +77,9 @@ SVTK_DeviceActor myPassFilter.push_back(VTKViewer_PassThroughFilter::New()); } - -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SVTK_DeviceActor ::~SVTK_DeviceActor() { @@ -96,8 +97,9 @@ SVTK_DeviceActor myPassFilter[i]->Delete(); } - -//---------------------------------------------------------------------------- +/*! + To insert some additional filters and then sets the given vtkMapper +*/ void SVTK_DeviceActor ::SetMapper(vtkMapper* theMapper) @@ -105,6 +107,9 @@ SVTK_DeviceActor InitPipeLine(theMapper); } +/*! + To initialize internal pipeline +*/ void SVTK_DeviceActor ::InitPipeLine(vtkMapper* theMapper) @@ -139,7 +144,9 @@ SVTK_DeviceActor Superclass::SetMapper(theMapper); } -//---------------------------------------------------------------------------- +/*! + Allows to get initial vtkDataSet +*/ vtkDataSet* SVTK_DeviceActor ::GetInput() @@ -147,6 +154,9 @@ SVTK_DeviceActor return myPassFilter.front()->GetOutput(); } +/*! + Allows to set initial vtkDataSet +*/ void SVTK_DeviceActor ::SetInput(vtkDataSet* theDataSet) @@ -155,7 +165,9 @@ SVTK_DeviceActor InitPipeLine(myMapper); } -//---------------------------------------------------------------------------- +/*! + To provide VTK to Object and backward mapping +*/ void SVTK_DeviceActor:: SetStoreMapping(bool theStoreMapping) @@ -164,8 +176,9 @@ SetStoreMapping(bool theStoreMapping) } - -//---------------------------------------------------------------------------- +/*! + \return time of modification +*/ unsigned long int SVTK_DeviceActor ::GetMTime() @@ -185,8 +198,10 @@ SVTK_DeviceActor return mTime; } - -//---------------------------------------------------------------------------- +/*! + Apply a view transformation + \param theTransform - transformation +*/ void SVTK_DeviceActor ::SetTransform(VTKViewer_Transform* theTransform) @@ -194,15 +209,20 @@ SVTK_DeviceActor myTransformFilter->SetTransform(theTransform); } - -//---------------------------------------------------------------------------- +/*! + \return true if actor is shrinkable +*/ bool SVTK_DeviceActor ::IsShrunkable() { return myIsShrinkable; } - + +/*! + Changes shrinkable state of actor + theIsShrinkable - new shrinkable state +*/ void SVTK_DeviceActor ::SetShrinkable(bool theIsShrinkable) @@ -210,6 +230,9 @@ SVTK_DeviceActor myIsShrinkable = theIsShrinkable; } +/*! + \return true if actor is shrunkable +*/ bool SVTK_DeviceActor ::IsShrunk() @@ -217,6 +240,9 @@ SVTK_DeviceActor return myIsShrunk; } +/*! + Insert shrink filter into pipeline +*/ void SVTK_DeviceActor ::SetShrink() @@ -231,6 +257,9 @@ SVTK_DeviceActor } } +/*! + Remove shrink filter from pipeline +*/ void SVTK_DeviceActor ::UnShrink() @@ -243,23 +272,32 @@ SVTK_DeviceActor } } -float +/*! + \return shrink factor +*/ +vtkFloatingPointType SVTK_DeviceActor ::GetShrinkFactor() { return myShrinkFilter->GetShrinkFactor(); } +/*! + Changes shrink factor + \param theValue - new shrink factor +*/ void SVTK_DeviceActor -::SetShrinkFactor(float theValue) +::SetShrinkFactor(vtkFloatingPointType theValue) { myShrinkFilter->SetShrinkFactor(theValue); } - -//---------------------------------------------------------------------------- +/*! + Set representation (VTK_SURFACE, VTK_POINTS, VTK_WIREFRAME and so on) + param theMode - new mode +*/ void SVTK_DeviceActor ::SetRepresentation(SVTK::Representation::Type theMode) @@ -311,6 +349,9 @@ SVTK_DeviceActor myRepresentation = theMode; } +/*! + \return current representation mode +*/ SVTK::Representation::Type SVTK_DeviceActor ::GetRepresentation() @@ -318,21 +359,29 @@ SVTK_DeviceActor return myRepresentation; } -float +/*! + \return default point size +*/ +vtkFloatingPointType SVTK_DeviceActor ::GetDefaultPointSize() { return 5; } -float +/*! + \return default line width +*/ +vtkFloatingPointType SVTK_DeviceActor ::GetDefaultLineWidth() { return 3; } - +/*! + \return true if actor is shaded +*/ bool SVTK_DeviceActor ::IsShaded() @@ -340,6 +389,10 @@ SVTK_DeviceActor return myIsShaded; } +/*! + Sets shaded state of actor + \param theShaded - new shaded state +*/ void SVTK_DeviceActor ::SetShaded(bool theShaded) @@ -347,8 +400,9 @@ SVTK_DeviceActor myIsShaded = theShaded; } - -//---------------------------------------------------------------------------- +/*! + Maps VTK index of a node to corresponding object index +*/ int SVTK_DeviceActor ::GetNodeObjId(int theVtkID) @@ -356,7 +410,10 @@ SVTK_DeviceActor return theVtkID; } -float* +/*! + Get coordinates of a node for given object index +*/ +vtkFloatingPointType* SVTK_DeviceActor ::GetNodeCoord(int theObjID) { @@ -364,6 +421,9 @@ SVTK_DeviceActor } +/*! + Get corresponding #vtkCell for given object index +*/ vtkCell* SVTK_DeviceActor ::GetElemCell(int theObjID) @@ -371,6 +431,9 @@ SVTK_DeviceActor return GetInput()->GetCell(theObjID); } +/*! + Maps VTK index of a cell to corresponding object index +*/ int SVTK_DeviceActor ::GetElemObjId(int theVtkID) @@ -378,15 +441,16 @@ SVTK_DeviceActor return theVtkID; } - -//---------------------------------------------------------------------------- +/*! + Renders actor +*/ void SVTK_DeviceActor ::Render(vtkRenderer *ren, vtkMapper* m) { if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - float aFactor, aUnit; + vtkFloatingPointType aFactor, aUnit; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -401,18 +465,27 @@ SVTK_DeviceActor } } - +/*! + Set polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ void SVTK_DeviceActor -::SetPolygonOffsetParameters(float factor, float units) +::SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; } +/*! + Get polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ void SVTK_DeviceActor -::GetPolygonOffsetParameters(float& factor, float& units) +::GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index 38378d295..c68829de9 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -29,6 +29,9 @@ #ifndef SVTK_DEVICE_ACTOR_H #define SVTK_DEVICE_ACTOR_H +#include "SVTK.h" +#include "VTKViewer.h" + #include #include @@ -44,9 +47,6 @@ class vtkDataSet; class vtkShrinkFilter; class vtkDataSetMapper; -#include "SVTK.h" - -//---------------------------------------------------------------------------- namespace SVTK { namespace Representation @@ -60,7 +60,6 @@ namespace SVTK } -//---------------------------------------------------------------------------- class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor { public: @@ -97,7 +96,7 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor GetNodeObjId(int theVtkID); virtual - float* + vtkFloatingPointType* GetNodeCoord(int theObjID); virtual @@ -120,12 +119,12 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor /** @name For shrink mamnagement purpose */ //@{ - float + vtkFloatingPointType GetShrinkFactor(); virtual void - SetShrinkFactor(float value); + SetShrinkFactor(vtkFloatingPointType value); virtual void @@ -155,11 +154,11 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor GetRepresentation(); virtual - float + vtkFloatingPointType GetDefaultPointSize(); virtual - float + vtkFloatingPointType GetDefaultLineWidth(); bool @@ -192,11 +191,13 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor bool myIsShrunk; bool myIsResolveCoincidentTopology; - float myPolygonOffsetFactor; - float myPolygonOffsetUnits; + vtkFloatingPointType myPolygonOffsetFactor; + vtkFloatingPointType myPolygonOffsetUnits; - void SetPolygonOffsetParameters(float factor, float units); - void GetPolygonOffsetParameters(float& factor, float& units); + void SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units); + void GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units); SVTK_DeviceActor(); ~SVTK_DeviceActor(); diff --git a/src/SVTK/SVTK_Event.h b/src/SVTK/SVTK_Event.h index f4c1c42ec..fa415ab83 100644 --- a/src/SVTK/SVTK_Event.h +++ b/src/SVTK/SVTK_Event.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_FontWidget.cxx b/src/SVTK/SVTK_FontWidget.cxx index edaa9a6c0..4269b5b6b 100644 --- a/src/SVTK/SVTK_FontWidget.cxx +++ b/src/SVTK/SVTK_FontWidget.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,10 +39,9 @@ * Description : Dialog for specifynig font */ -//======================================================================= -// name : SVTK_FontWidget -// Purpose : Constructor -//======================================================================= +/*! + Constructor +*/ SVTK_FontWidget::SVTK_FontWidget( QWidget* theParent ) : QHBox( theParent ) { @@ -62,36 +61,23 @@ SVTK_FontWidget::SVTK_FontWidget( QWidget* theParent ) connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) ); } -//======================================================================= -// name : ~SVTK_FontWidget -// Purpose : Destructor -//======================================================================= +/*! + Destructor +*/ SVTK_FontWidget::~SVTK_FontWidget() { } -//======================================================================= -// name : SetColor -// Purpose : -//======================================================================= void SVTK_FontWidget::SetColor( const QColor& theColor ) { myColorBtn->setPaletteBackgroundColor( theColor ); } -//======================================================================= -// name : GetColor -// Purpose : -//======================================================================= QColor SVTK_FontWidget::GetColor() const { return myColorBtn->paletteBackgroundColor(); } -//======================================================================= -// name : onColor -// Purpose : -//======================================================================= void SVTK_FontWidget::onColor() { QColor aColor = QColorDialog::getColor( GetColor(), this ); @@ -99,10 +85,6 @@ void SVTK_FontWidget::onColor() SetColor( aColor ); } -//======================================================================= -// name : SetData -// Purpose : -//======================================================================= void SVTK_FontWidget::SetData( const QColor& theColor, const int theFamily, const bool theBold, @@ -123,10 +105,6 @@ void SVTK_FontWidget::SetData( const QColor& theColor, myShadow->setChecked( theShadow ); } -//======================================================================= -// name : GetData -// Purpose : -//======================================================================= void SVTK_FontWidget::GetData( QColor& theColor, int& theFamily, bool& theBold, diff --git a/src/SVTK/SVTK_FontWidget.h b/src/SVTK/SVTK_FontWidget.h index c2b62ee8d..953072a94 100644 --- a/src/SVTK/SVTK_FontWidget.h +++ b/src/SVTK/SVTK_FontWidget.h @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_Functor.h b/src/SVTK/SVTK_Functor.h index b47d26e6c..d76a93548 100644 --- a/src/SVTK/SVTK_Functor.h +++ b/src/SVTK/SVTK_Functor.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SVTK_Functor_H #define SVTK_Functor_H diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx b/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx index e3cb3c8e2..ecb406b1b 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,9 +36,11 @@ using namespace std; -//---------------------------------------------------------------------------- vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor); +/*! + Constructor +*/ QVTK_GenericRenderWindowInteractor ::QVTK_GenericRenderWindowInteractor() { @@ -46,14 +48,18 @@ QVTK_GenericRenderWindowInteractor connect(myTimer, SIGNAL(timeout()), this, SLOT(OnTimeOut())) ; } +/*! + Destructor +*/ QVTK_GenericRenderWindowInteractor ::~QVTK_GenericRenderWindowInteractor() { delete myTimer; } - -//---------------------------------------------------------------------------- +/*! + The slot connects to QTimer::timeout signal to invoke vtkCommand::TimerEvent +*/ void QVTK_GenericRenderWindowInteractor ::OnTimeOut() @@ -63,6 +69,9 @@ QVTK_GenericRenderWindowInteractor } } +/*! + Starts the QTimer instance on defined microseconds +*/ int QVTK_GenericRenderWindowInteractor ::CreateTimer(int vtkNotUsed(timertype)) @@ -75,6 +84,9 @@ QVTK_GenericRenderWindowInteractor return 1; } +/*! + Stops the QTimer instance +*/ int QVTK_GenericRenderWindowInteractor ::DestroyTimer(void) @@ -95,20 +107,28 @@ QVTK_GenericRenderWindowInteractor } -//---------------------------------------------------------------------------- vtkStandardNewMacro(SVTK_GenericRenderWindowInteractor); +/*! + Constructor +*/ SVTK_GenericRenderWindowInteractor ::SVTK_GenericRenderWindowInteractor(): myRenderWidget(NULL) { } +/*! + Destructor +*/ SVTK_GenericRenderWindowInteractor ::~SVTK_GenericRenderWindowInteractor() { } +/*! + To get access to SVTK_Selector +*/ SVTK_Selector* SVTK_GenericRenderWindowInteractor ::GetSelector() @@ -116,6 +136,10 @@ SVTK_GenericRenderWindowInteractor return mySelector.GetPointer(); } +/*! + To initialize mySelector field + \param theSelector - new selector +*/ void SVTK_GenericRenderWindowInteractor ::SetSelector(SVTK_Selector* theSelector) @@ -123,6 +147,9 @@ SVTK_GenericRenderWindowInteractor mySelector = theSelector; } +/*! + To get access to QWidget, where vtkRenderWindow maps to. +*/ QWidget* SVTK_GenericRenderWindowInteractor ::GetRenderWidget() @@ -130,6 +157,9 @@ SVTK_GenericRenderWindowInteractor return myRenderWidget; } +/*! + To initialize myRenderWidget field. +*/ void SVTK_GenericRenderWindowInteractor ::SetRenderWidget(QWidget* theRenderWidget) diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.h b/src/SVTK/SVTK_GenericRenderWindowInteractor.h index d15fdc557..b47705d50 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.h +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -42,9 +42,9 @@ class SVTK_Selector; class SVTK_Renderer; -//============================================================================ -//! Introduction of the class is intended to implement Qt based #CreateTimer and #DestroyTimer functionality. /*! + \class QVTK_GenericRenderWindowInteractor + Introduction of the class is intended to implement Qt based #CreateTimer and #DestroyTimer functionality. The class intendes to implement platform indepenedant subclass of vtkRenderWindowInteractor. This is done by usage of Qt library. \note @@ -86,9 +86,9 @@ class SVTK_EXPORT QVTK_GenericRenderWindowInteractor: }; -//============================================================================ -//! This class introduce SALOME specific to the base one /*! + \class SVTK_GenericRenderWindowInteractor + This class introduce SALOME specific to the base one In this class new members is added (#mySelector and #myRenderWidget). They are used for initialization of #SVTK_InteractorStyle by redefinition of #SVTK_InteractorStyle::SetInteractor method diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index 963aa1894..4f8dfaa60 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -98,9 +98,11 @@ namespace } -//---------------------------------------------------------------------------- vtkStandardNewMacro(SVTK_InteractorStyle); -//---------------------------------------------------------------------------- + +/*! + Constructor +*/ SVTK_InteractorStyle ::SVTK_InteractorStyle(): mySelectionEvent(new SVTK_SelectionEvent()), @@ -131,13 +133,17 @@ SVTK_InteractorStyle myControllerOnKeyDown->Delete(); } -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SVTK_InteractorStyle ::~SVTK_InteractorStyle() { } -//---------------------------------------------------------------------------- +/*! + \return widget for rendering +*/ QWidget* SVTK_InteractorStyle ::GetRenderWidget() @@ -145,6 +151,9 @@ SVTK_InteractorStyle return myInteractor->GetRenderWidget(); } +/*! + \return selector +*/ SVTK_Selector* SVTK_InteractorStyle ::GetSelector() @@ -152,7 +161,9 @@ SVTK_InteractorStyle return myInteractor->GetSelector(); } -//---------------------------------------------------------------------------- +/*! + Generate special SVTK_SelectionEvent +*/ SVTK_SelectionEvent* SVTK_InteractorStyle ::GetSelectionEvent() @@ -170,7 +181,9 @@ SVTK_InteractorStyle return mySelectionEvent.get(); } -//---------------------------------------------------------------------------- +/*! + Generate special SVTK_SelectionEvent with flipped Y coordinate +*/ SVTK_SelectionEvent* SVTK_InteractorStyle ::GetSelectionEventFlipY() @@ -188,7 +201,6 @@ SVTK_InteractorStyle return mySelectionEvent.get(); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::RotateXY(int dx, int dy) @@ -213,7 +225,6 @@ SVTK_InteractorStyle this->Render(); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::PanXY(int x, int y, int oldX, int oldY) @@ -223,7 +234,6 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::DollyXY(int dx, int dy) @@ -247,7 +257,6 @@ SVTK_InteractorStyle this->Render(); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::SpinXY(int x, int y, int oldX, int oldY) @@ -273,7 +282,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- +/*! + To reset reset view +*/ void SVTK_InteractorStyle ::OnConfigure() @@ -282,8 +293,9 @@ SVTK_InteractorStyle this->GetCurrentRenderer()->InvokeEvent(vtkCommand::ConfigureEvent,NULL); } - -//---------------------------------------------------------------------------- +/*! + To handle mouse move event +*/ void SVTK_InteractorStyle ::OnMouseMove() @@ -295,8 +307,9 @@ SVTK_InteractorStyle x, y ); } - -//---------------------------------------------------------------------------- +/*! + To handle left mouse button down event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnLeftButtonDown() @@ -308,8 +321,9 @@ SVTK_InteractorStyle x, y ); } - -//---------------------------------------------------------------------------- +/*! + To handle left mouse button up event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnLeftButtonUp() @@ -321,8 +335,9 @@ SVTK_InteractorStyle x, y ); } - -//---------------------------------------------------------------------------- +/*! + To handle middle mouse button down event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnMiddleButtonDown() @@ -334,8 +349,9 @@ SVTK_InteractorStyle x, y ); } - -//---------------------------------------------------------------------------- +/*! + To handle middle mouse button up event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnMiddleButtonUp() @@ -347,8 +363,9 @@ SVTK_InteractorStyle x, y ); } - -//---------------------------------------------------------------------------- +/*! + To handle right mouse button down event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnRightButtonDown() @@ -360,7 +377,9 @@ SVTK_InteractorStyle x, y ); } -//---------------------------------------------------------------------------- +/*! + To handle right mouse button up event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnRightButtonUp() @@ -372,8 +391,9 @@ SVTK_InteractorStyle x, y ); } - -//---------------------------------------------------------------------------- +/*! + To handle mouse move event +*/ void SVTK_InteractorStyle ::OnMouseMove(int vtkNotUsed(ctrl), @@ -387,8 +407,9 @@ SVTK_InteractorStyle onCursorMove(QPoint(x, y)); } - -//---------------------------------------------------------------------------- +/*! + To handle left mouse button down event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnLeftButtonDown(int ctrl, int shift, @@ -416,8 +437,9 @@ SVTK_InteractorStyle return; } - -//---------------------------------------------------------------------------- +/*! + To handle left mouse button up event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnLeftButtonUp(int vtkNotUsed(ctrl), @@ -433,8 +455,9 @@ SVTK_InteractorStyle } } - -//---------------------------------------------------------------------------- +/*! + To handle middle mouse button down event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnMiddleButtonDown(int ctrl, @@ -462,7 +485,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- +/*! + To handle middle mouse button up event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnMiddleButtonUp(int vtkNotUsed(ctrl), @@ -479,7 +504,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- +/*! + To handle right mouse button down event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnRightButtonDown(int ctrl, @@ -506,7 +533,9 @@ SVTK_InteractorStyle } } -//---------------------------------------------------------------------------- +/*! + To handle right mouse button up event (reimplemented from vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::OnRightButtonUp(int vtkNotUsed(ctrl), @@ -522,7 +551,6 @@ SVTK_InteractorStyle } } -//---------------------------------------------------------------------------- /* XPM */ const char* imageZoomCursor[] = { "32 32 3 1", @@ -601,8 +629,9 @@ const char* imageRotateCursor[] = { "................................"}; -//---------------------------------------------------------------------------- -// loads cursors for viewer operations - zoom, pan, etc... +/*! + loads cursors for viewer operations - zoom, pan, etc... +*/ void SVTK_InteractorStyle ::loadCursors() @@ -618,8 +647,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// starts Zoom operation (e.g. through menu command) +/*! + Starts Zoom operation (e.g. through menu command) +*/ void SVTK_InteractorStyle ::startZoom() @@ -634,8 +664,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// starts Pan operation (e.g. through menu command) +/*! + Starts Pan operation (e.g. through menu command) +*/ void SVTK_InteractorStyle ::startPan() @@ -649,8 +680,9 @@ SVTK_InteractorStyle ForcedState = VTK_INTERACTOR_STYLE_CAMERA_PAN; } -//---------------------------------------------------------------------------- -// starts Rotate operation (e.g. through menu command) +/*! + Starts Rotate operation (e.g. through menu command) +*/ void SVTK_InteractorStyle ::startRotate() @@ -665,8 +697,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// starts Spin operation (e.g. through menu command) +/*! + Starts Spin operation (e.g. through menu command) +*/ void SVTK_InteractorStyle ::startSpin() @@ -682,8 +715,9 @@ SVTK_InteractorStyle -//---------------------------------------------------------------------------- -// starts Fit Area operation (e.g. through menu command) +/*! + Starts Fit Area operation (e.g. through menu command) +*/ void SVTK_InteractorStyle ::startFitArea() @@ -698,8 +732,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// starts Global Panning operation (e.g. through menu command) +/*! + Starts Global Panning operation (e.g. through menu command) +*/ void SVTK_InteractorStyle ::startGlobalPan() @@ -721,8 +756,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// fits viewer contents to rect +/*! + Fits viewer contents to rect +*/ void SVTK_InteractorStyle ::fitRect(const int left, @@ -758,8 +794,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// starts viewer operation (!internal usage!) +/*! + Starts viewer operation (!internal usage!) +*/ void SVTK_InteractorStyle ::startOperation(int operation) @@ -789,8 +826,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// sets proper cursor for window when viewer operation is activated +/*! + Sets proper cursor for window when viewer operation is activated +*/ void SVTK_InteractorStyle ::setCursor(const int operation) @@ -832,15 +870,20 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// called when viewer operation started (!put necessary initialization here!) +/*! + Called when viewer operation started (!put necessary initialization here!) +*/ void SVTK_InteractorStyle ::onStartOperation() { - if (!GetRenderWidget()) return; - // VSV: LOD actor activisation - // this->Interactor->GetRenderWindow()->SetDesiredUpdateRate(this->Interactor->GetDesiredUpdateRate()); + if (!GetRenderWidget()) + return; + + vtkRenderWindowInteractor *aRWI = this->Interactor; + vtkRenderWindow *aRenWin = aRWI->GetRenderWindow(); + aRenWin->SetDesiredUpdateRate(aRWI->GetDesiredUpdateRate()); + switch (State) { case VTK_INTERACTOR_STYLE_CAMERA_SELECT: case VTK_INTERACTOR_STYLE_CAMERA_FIT: @@ -861,8 +904,9 @@ SVTK_InteractorStyle } -//---------------------------------------------------------------------------- -// called when viewer operation finished (!put necessary post-processing here!) +/*! + Called when viewer operation finished (!put necessary post-processing here!) +*/ void SVTK_InteractorStyle ::onFinishOperation() @@ -870,8 +914,9 @@ SVTK_InteractorStyle if (!GetRenderWidget()) return; - // VSV: LOD actor activisation - // rwi->GetRenderWindow()->SetDesiredUpdateRate(rwi->GetStillUpdateRate()); + vtkRenderWindowInteractor *aRWI = this->Interactor; + vtkRenderWindow *aRenWin = aRWI->GetRenderWindow(); + aRenWin->SetDesiredUpdateRate(aRWI->GetStillUpdateRate()); SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY(); @@ -909,13 +954,15 @@ SVTK_InteractorStyle // SALOME_Actor* anActor = GetFirstSALOMEActor(myPicker.GetPointer()); aSelectionEvent->myIsRectangle = false; + + if(!myShiftState) + GetSelector()->ClearIObjects(); + if(anActor){ anActor->Highlight( this, aSelectionEvent, true ); }else{ if(myLastHighlitedActor.GetPointer() && myLastHighlitedActor.GetPointer() != anActor) myLastHighlitedActor->Highlight( this, aSelectionEvent, false ); - if(!myShiftState) - GetSelector()->ClearIObjects(); } myLastHighlitedActor = anActor; } @@ -965,8 +1012,9 @@ SVTK_InteractorStyle } -// called during viewer operation when user moves mouse (!put necessary processing here!) -//---------------------------------------------------------------------------- +/*! + Called during viewer operation when user moves mouse (!put necessary processing here!) +*/ void SVTK_InteractorStyle ::onOperation(QPoint mousePos) @@ -1021,9 +1069,10 @@ SVTK_InteractorStyle } } -// called when user moves mouse inside viewer window and there is no active viewer operation -// (!put necessary processing here!) -//---------------------------------------------------------------------------- +/*! + Called when user moves mouse inside viewer window and there is no active viewer operation + (!put necessary processing here!) +*/ void SVTK_InteractorStyle ::onCursorMove(QPoint mousePos) @@ -1053,8 +1102,9 @@ SVTK_InteractorStyle this->Render(); } -// called on finsh GlobalPan operation -//---------------------------------------------------------------------------- +/*! + Called on finsh GlobalPan operation +*/ void SVTK_InteractorStyle ::Place(const int theX, const int theY) @@ -1079,15 +1129,16 @@ SVTK_InteractorStyle -// Translates view from Point to Point -//---------------------------------------------------------------------------- +/*! + Translates view from Point to Point +*/ void SVTK_InteractorStyle ::TranslateView(int toX, int toY, int fromX, int fromY) { vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera(); double viewFocus[4], focalDepth, viewPoint[3]; - float newPickPoint[4], oldPickPoint[4], motionVector[3]; + vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3]; cam->GetFocalPoint(viewFocus); this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1], @@ -1114,7 +1165,6 @@ SVTK_InteractorStyle motionVector[2] + viewPoint[2]); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::IncrementalPan( const int incrX, const int incrY ) @@ -1122,7 +1172,6 @@ SVTK_InteractorStyle this->PanXY( incrX, incrY, 0, 0 ); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::IncrementalZoom( const int incr ) @@ -1130,7 +1179,6 @@ SVTK_InteractorStyle this->DollyXY( incr, incr ); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::IncrementalRotate( const int incrX, const int incrY ) @@ -1138,7 +1186,9 @@ SVTK_InteractorStyle this->RotateXY( incrX, -incrY ); } -//---------------------------------------------------------------------------- +/*! + Redefined in order to add an observer (callback) for custorm event (space mouse event) +*/ void SVTK_InteractorStyle ::SetInteractor( vtkRenderWindowInteractor* theInteractor ) @@ -1178,8 +1228,9 @@ SVTK_InteractorStyle } } - -//---------------------------------------------------------------------------- +/*! + To implement cached rendering +*/ void SVTK_InteractorStyle ::OnTimer() @@ -1188,7 +1239,9 @@ SVTK_InteractorStyle this->Interactor->Render(); } -//---------------------------------------------------------------------------- +/*! + To invoke #vtkRenderWindowInteractor::CreateTimer +*/ void SVTK_InteractorStyle ::Render() @@ -1196,7 +1249,6 @@ SVTK_InteractorStyle this->Interactor->CreateTimer(VTKI_TIMER_FIRST); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::onSpaceMouseMove( double* data ) @@ -1212,7 +1264,6 @@ SVTK_InteractorStyle IncrementalRotate( (int)data[3], 0 ); // 5. tilt the control forward/backward = rotate around X axis (Z axis of local coordinate system of space mouse) } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::onSpaceMouseButton( int button ) @@ -1227,7 +1278,6 @@ SVTK_InteractorStyle DominantCombinedSwitch(); } -//---------------------------------------------------------------------------- void SVTK_InteractorStyle ::DominantCombinedSwitch() @@ -1235,7 +1285,9 @@ SVTK_InteractorStyle printf( "\n--DominantCombinedSwitch() NOT IMPLEMENTED--\n" ); } -//---------------------------------------------------------------------------- +/*! + Main process event method (reimplemented from #vtkInteractorStyle) +*/ void SVTK_InteractorStyle ::ProcessEvents( vtkObject* object, @@ -1326,11 +1378,17 @@ SVTK_InteractorStyle Superclass::ProcessEvents( object, event, clientData, callData ); } -//---------------------------------------------------------------------------- + +/*! + To handle keyboard event (reimplemented from #vtkInteractorStyle) +*/ void SVTK_InteractorStyle::OnChar() { } -//---------------------------------------------------------------------------- + +/*! + Redefined vtkInteractorStyle::OnKeyDown +*/ void SVTK_InteractorStyle::OnKeyDown() { bool bInvokeSuperclass=myControllerOnKeyDown->OnKeyDown(this); @@ -1338,7 +1396,10 @@ void SVTK_InteractorStyle::OnKeyDown() Superclass::OnKeyDown(); } } -//---------------------------------------------------------------------------- + +/*! + Provide instructions for Picking +*/ void SVTK_InteractorStyle::ActionPicking() { int x, y; @@ -1351,54 +1412,60 @@ void SVTK_InteractorStyle::ActionPicking() onFinishOperation(); startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE); } -//---------------------------------------------------------------------------- + +/*! + To set current increment controller +*/ void SVTK_InteractorStyle::SetControllerOnKeyDown(SVTK_ControllerOnKeyDown* theController) { myControllerOnKeyDown=theController; } -//---------------------------------------------------------------------------- + +/*! + To get current OnKeyDown controller +*/ SVTK_ControllerOnKeyDown* SVTK_InteractorStyle::ControllerOnKeyDown() { return myControllerOnKeyDown.GetPointer(); } -//---------------------------------------------------------------------------- + +/*! + To get current increment controller +*/ void SVTK_InteractorStyle::SetControllerIncrement(SVTK_ControllerIncrement* theController) { myControllerIncrement=theController; } -//---------------------------------------------------------------------------- + +/*! + To get current increment controller +*/ SVTK_ControllerIncrement* SVTK_InteractorStyle::ControllerIncrement() { return myControllerIncrement.GetPointer(); } vtkStandardNewMacro(SVTK_ControllerIncrement); -//---------------------------------------------------------------------------- SVTK_ControllerIncrement::SVTK_ControllerIncrement() { myIncrement=10; } -//---------------------------------------------------------------------------- SVTK_ControllerIncrement::~SVTK_ControllerIncrement() { } -//---------------------------------------------------------------------------- void SVTK_ControllerIncrement::SetStartValue(const int theValue) { myIncrement=theValue; } -//---------------------------------------------------------------------------- int SVTK_ControllerIncrement::Current()const { return myIncrement; } -//---------------------------------------------------------------------------- int SVTK_ControllerIncrement::Increase() { ++myIncrement; return myIncrement; } -//---------------------------------------------------------------------------- int SVTK_ControllerIncrement::Decrease() { if (myIncrement>1){ @@ -1408,15 +1475,21 @@ int SVTK_ControllerIncrement::Decrease() } vtkStandardNewMacro(SVTK_ControllerOnKeyDown); -//---------------------------------------------------------------------------- + +/*! + Constructor +*/ SVTK_ControllerOnKeyDown::SVTK_ControllerOnKeyDown() { } -//---------------------------------------------------------------------------- + +/*! + Destructor +*/ SVTK_ControllerOnKeyDown::~SVTK_ControllerOnKeyDown() { } -//---------------------------------------------------------------------------- + bool SVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* theIS) { return true; diff --git a/src/SVTK/SVTK_InteractorStyle.h b/src/SVTK/SVTK_InteractorStyle.h index 97a9ecdb7..93a1b2b6e 100644 --- a/src/SVTK/SVTK_InteractorStyle.h +++ b/src/SVTK/SVTK_InteractorStyle.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -45,7 +45,6 @@ #include // -//------------------------------------------- //! Control the value of increment in SALOME way. /*! This class controls of value of increment, @@ -77,7 +76,6 @@ class SVTK_EXPORT SVTK_ControllerIncrement : public vtkObject{ void operator=(const SVTK_ControllerIncrement&); //Not implemented }; // -//------------------------------------------- //! Control the behaviour of KeyDown event in SALOME way. /*! This class controls the behaviour of KeyDown event @@ -99,7 +97,6 @@ class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{ SVTK_ControllerOnKeyDown(const SVTK_ControllerOnKeyDown&);//Not implemented void operator=(const SVTK_ControllerOnKeyDown&); //Not implemented }; -//------------------------------------------- class vtkCell; class vtkPicker; @@ -143,7 +140,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle SVTK_SelectionEvent* GetSelectionEventFlipY(); - //! Redefined in order to add an observer (callback) for custorm event (space mouse event) + //! Redefined in order to add an observer (callback) for custom event (space mouse event) virtual void SetInteractor( vtkRenderWindowInteractor* ); diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx index ad01609bc..2cb5d4379 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,6 +40,7 @@ #include "SUIT_Tools.h" #include "SUIT_ResourceMgr.h" #include "SVTK_NonIsometricDlg.h" +#include "SVTK_UpdateRateDlg.h" #include "SVTK_CubeAxesDlg.h" #include "SVTK_MainWindow.h" @@ -51,8 +52,9 @@ #include - -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_MainWindow ::SVTK_MainWindow(QWidget* theParent, const char* theName, @@ -69,6 +71,9 @@ SVTK_MainWindow createToolBar(); } +/*! + To initialize the class +*/ void SVTK_MainWindow ::Initialize(SVTK_RenderWindowInteractor* theInteractor) @@ -82,17 +87,23 @@ SVTK_MainWindow myInteractor->setFocusPolicy(StrongFocus); myInteractor->setFocus(); setFocusProxy(myInteractor); -} + myUpdateRateDlg = new SVTK_UpdateRateDlg(myActionsMap[UpdateRate],this,"SVTK_UpdateRateDlg"); + myNonIsometricDlg = new SVTK_NonIsometricDlg(myActionsMap[NonIsometric],this,"SVTK_NonIsometricDlg"); + myCubeAxesDlg = new SVTK_CubeAxesDlg(myActionsMap[GraduatedAxes],this,"SVTK_CubeAxesDlg"); +} -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SVTK_MainWindow ::~SVTK_MainWindow() { } - -//---------------------------------------------------------------------------- +/*! + \return used SVTK_RenderWindowInteractor +*/ SVTK_RenderWindowInteractor* SVTK_MainWindow ::GetInteractor() @@ -100,6 +111,9 @@ SVTK_MainWindow return myInteractor; } +/*! + \return used #vtkRenderWindowInteractor (obsolete) +*/ vtkRenderWindowInteractor* SVTK_MainWindow ::getInteractor() @@ -107,6 +121,9 @@ SVTK_MainWindow return GetInteractor()->GetDevice(); } +/*! + \return used vtkRenderWindow (obsolete) +*/ vtkRenderWindow* SVTK_MainWindow ::getRenderWindow() @@ -114,7 +131,10 @@ SVTK_MainWindow return GetInteractor()->getRenderWindow(); } -//---------------------------------------------------------------------------- +/*! + To repaint the view + \param theUpdateTrihedron - adjust trihedron +*/ void SVTK_MainWindow ::Repaint(bool theUpdateTrihedron) @@ -125,7 +145,9 @@ SVTK_MainWindow GetInteractor()->update(); } -//---------------------------------------------------------------------------- +/*! + To invoke a VTK event on SVTK_RenderWindowInteractor instance +*/ void SVTK_MainWindow ::InvokeEvent(unsigned long theEvent, void* theCallData) @@ -133,7 +155,9 @@ SVTK_MainWindow GetInteractor()->InvokeEvent(theEvent,theCallData); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_RenderWindowInteractor::GetInteractorStyle +*/ vtkInteractorStyle* SVTK_MainWindow ::GetInteractorStyle() @@ -141,6 +165,9 @@ SVTK_MainWindow return GetInteractor()->GetInteractorStyle(); } +/*! + Redirect the request to SVTK_RenderWindowInteractor::PushInteractorStyle +*/ void SVTK_MainWindow ::PushInteractorStyle(vtkInteractorStyle* theStyle) @@ -148,6 +175,9 @@ SVTK_MainWindow GetInteractor()->PushInteractorStyle(theStyle); } +/*! + Redirect the request to SVTK_RenderWindowInteractor::PopInteractorStyle +*/ void SVTK_MainWindow ::PopInteractorStyle() @@ -155,7 +185,9 @@ SVTK_MainWindow GetInteractor()->PopInteractorStyle(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_RenderWindowInteractor::GetSelector +*/ SVTK_Selector* SVTK_MainWindow ::GetSelector() @@ -163,6 +195,9 @@ SVTK_MainWindow return GetInteractor()->GetSelector(); } +/*! + Redirect the request to SVTK_RenderWindowInteractor::SelectionMode +*/ Selection_Mode SVTK_MainWindow ::SelectionMode() @@ -170,6 +205,9 @@ SVTK_MainWindow return GetSelector()->SelectionMode(); } +/*! + Redirect the request to SVTK_RenderWindowInteractor::SetSelectionMode +*/ void SVTK_MainWindow ::SetSelectionMode(Selection_Mode theMode) @@ -177,8 +215,9 @@ SVTK_MainWindow GetSelector()->SetSelectionMode(theMode); } - -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_RenderWindowInteractor::GetRenderer +*/ SVTK_Renderer* SVTK_MainWindow ::GetRenderer() @@ -186,6 +225,9 @@ SVTK_MainWindow return GetInteractor()->GetRenderer(); } +/*! + Redirect the request to SVTK_RenderWindowInteractor::getRenderer +*/ vtkRenderer* SVTK_MainWindow ::getRenderer() @@ -193,7 +235,10 @@ SVTK_MainWindow return GetInteractor()->getRenderer(); } -//---------------------------------------------------------------------------- +/*! + Sets background color of the view + \param theColor - new background color +*/ void SVTK_MainWindow ::SetBackgroundColor(const QColor& theColor) @@ -203,18 +248,23 @@ SVTK_MainWindow theColor.blue()/255.0); } +/*! + \return background color of the view +*/ QColor SVTK_MainWindow ::BackgroundColor() { - float aBackgroundColor[3]; + vtkFloatingPointType aBackgroundColor[3]; getRenderer()->GetBackground(aBackgroundColor); return QColor(int(aBackgroundColor[0]*255), int(aBackgroundColor[1]*255), int(aBackgroundColor[2]*255)); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::GetScale +*/ void SVTK_MainWindow ::GetScale( double theScale[3] ) @@ -222,6 +272,9 @@ SVTK_MainWindow GetRenderer()->GetScale( theScale ); } +/*! + Redirect the request to SVTK_Renderer::SetScale +*/ void SVTK_MainWindow ::SetScale( double theScale[3] ) @@ -230,8 +283,9 @@ SVTK_MainWindow Repaint(); } - -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::AddActor +*/ void SVTK_MainWindow ::AddActor(VTKViewer_Actor* theActor, @@ -242,7 +296,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::RemoveActor +*/ void SVTK_MainWindow ::RemoveActor(VTKViewer_Actor* theActor, @@ -253,8 +309,9 @@ SVTK_MainWindow Repaint(); } - -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::GetTrihedronSize +*/ int SVTK_MainWindow ::GetTrihedronSize() @@ -262,17 +319,18 @@ SVTK_MainWindow return GetRenderer()->GetTrihedronSize(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::SetTrihedronSize +*/ void SVTK_MainWindow -::SetTrihedronSize( const int theSize ) +::SetTrihedronSize( const int theSize, const bool theRelative ) { - GetRenderer()->SetTrihedronSize(theSize); + GetRenderer()->SetTrihedronSize(theSize, theRelative); Repaint(); } -//---------------------------------------------------------------------------- /*! If parameter theIsForcedUpdate is true, recalculate parameters for * trihedron and cube axes, even if trihedron and cube axes is invisible. */ @@ -284,7 +342,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::IsTrihedronDisplayed +*/ bool SVTK_MainWindow ::IsTrihedronDisplayed() @@ -292,7 +352,9 @@ SVTK_MainWindow return GetRenderer()->IsTrihedronDisplayed(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::IsCubeAxesDisplayed +*/ bool SVTK_MainWindow ::IsCubeAxesDisplayed() @@ -300,7 +362,9 @@ SVTK_MainWindow return GetRenderer()->IsCubeAxesDisplayed(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::GetTrihedron +*/ VTKViewer_Trihedron* SVTK_MainWindow ::GetTrihedron() @@ -308,7 +372,9 @@ SVTK_MainWindow return GetRenderer()->GetTrihedron(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to SVTK_Renderer::GetCubeAxes +*/ SVTK_CubeAxesActor2D* SVTK_MainWindow ::GetCubeAxes() @@ -316,8 +382,9 @@ SVTK_MainWindow return GetRenderer()->GetCubeAxes(); } - -//---------------------------------------------------------------------------- +/*! + \return toolbar of svtk main window +*/ QToolBar* SVTK_MainWindow ::getToolBar() @@ -325,7 +392,6 @@ SVTK_MainWindow return myToolBar; } -//---------------------------------------------------------------------------- void SVTK_MainWindow ::SetEventDispatcher(vtkObject* theDispatcher) @@ -333,11 +399,13 @@ SVTK_MainWindow myEventDispatcher = theDispatcher; } -//---------------------------------------------------------------------------- #if defined(WIN32) && !defined(_DEBUG) #pragma optimize( "", off ) #endif +/*! + Creates all actions of svtk main window +*/ void SVTK_MainWindow ::createActions(SUIT_ResourceMgr* theResourceMgr) @@ -471,8 +539,6 @@ SVTK_MainWindow connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool))); myActionsMap[ NonIsometric ] = anAction; - myNonIsometricDlg = new SVTK_NonIsometricDlg(this,"SVTK_NonIsometricDlg",anAction); - // onGraduatedAxes: Manage graduated axes params anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"), theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_GRADUATED_AXES" ) ), @@ -482,14 +548,23 @@ SVTK_MainWindow connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool))); myActionsMap[ GraduatedAxes ] = anAction; - myCubeAxesDlg = new SVTK_CubeAxesDlg(this,"SVTK_CubeAxesDlg",anAction); + // onGraduatedAxes: Manage graduated axes params + anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"), + theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_UPDATE_RATE" ) ), + tr( "MNU_SVTK_UPDATE_RATE" ), 0, this); + anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE")); + anAction->setToggleAction(true); + connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool))); + myActionsMap[ UpdateRate ] = anAction; } #if defined(WIN32) && !defined(_DEBUG) #pragma optimize( "", on ) #endif -//---------------------------------------------------------------------------- +/*! + Creates toolbar of svtk main window +*/ void SVTK_MainWindow ::createToolBar() @@ -518,11 +593,34 @@ SVTK_MainWindow myActionsMap[ResetId]->addTo(myToolBar); + myActionsMap[UpdateRate]->addTo(myToolBar); myActionsMap[NonIsometric]->addTo(myToolBar); myActionsMap[GraduatedAxes]->addTo(myToolBar); } -//---------------------------------------------------------------------------- +/*! + Custom show event handler +*/ +void +SVTK_MainWindow +::showEvent( QShowEvent * theEvent ) +{ + emit Show( theEvent ); +} + +/*! + Custom hide event handler +*/ +void +SVTK_MainWindow +::hideEvent( QHideEvent * theEvent ) +{ + emit Hide( theEvent ); +} + +/*! + Starts zoom transformation +*/ void SVTK_MainWindow ::activateZoom() @@ -530,7 +628,9 @@ SVTK_MainWindow myEventDispatcher->InvokeEvent(SVTK::StartZoom,0); } -//---------------------------------------------------------------------------- +/*! + Starts panning transformation +*/ void SVTK_MainWindow ::activatePanning() @@ -538,7 +638,9 @@ SVTK_MainWindow myEventDispatcher->InvokeEvent(SVTK::StartPan,0); } -//---------------------------------------------------------------------------- +/*! + Starts rotation transformation +*/ void SVTK_MainWindow ::activateRotation() @@ -546,7 +648,9 @@ SVTK_MainWindow myEventDispatcher->InvokeEvent(SVTK::StartRotate,0); } -//---------------------------------------------------------------------------- +/*! + Starts global panning transformation +*/ void SVTK_MainWindow ::activateGlobalPanning() @@ -554,7 +658,9 @@ SVTK_MainWindow myEventDispatcher->InvokeEvent(SVTK::StartGlobalPan,0); } -//---------------------------------------------------------------------------- +/*! + Starts window fit transformation +*/ void SVTK_MainWindow ::activateWindowFit() @@ -562,7 +668,9 @@ SVTK_MainWindow myEventDispatcher->InvokeEvent(SVTK::StartFitArea,0); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "front view" +*/ void SVTK_MainWindow ::onFrontView() @@ -571,7 +679,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "back view" +*/ void SVTK_MainWindow ::onBackView() @@ -580,7 +690,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "top view" +*/ void SVTK_MainWindow ::onTopView() @@ -589,7 +701,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "bottom view" +*/ void SVTK_MainWindow ::onBottomView() @@ -598,7 +712,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "left view" +*/ void SVTK_MainWindow ::onLeftView() @@ -607,7 +723,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "right view" +*/ void SVTK_MainWindow ::onRightView() @@ -616,7 +734,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "reset view": sets default orientation of viewport camera +*/ void SVTK_MainWindow ::onResetView() @@ -625,7 +745,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "fit all" +*/ void SVTK_MainWindow ::onFitAll() @@ -634,7 +756,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Shows trihedron +*/ void SVTK_MainWindow ::onViewTrihedron() @@ -643,7 +767,9 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +/*! + Shows cube axes +*/ void SVTK_MainWindow ::onViewCubeAxes() @@ -652,7 +778,17 @@ SVTK_MainWindow Repaint(); } -//---------------------------------------------------------------------------- +void +SVTK_MainWindow +::onUpdateRate(bool theIsActivate) +{ + if(theIsActivate){ + myUpdateRateDlg->Update(); + myUpdateRateDlg->show(); + }else + myUpdateRateDlg->hide(); +} + void SVTK_MainWindow ::onNonIsometric(bool theIsActivate) @@ -675,7 +811,6 @@ SVTK_MainWindow myCubeAxesDlg->hide(); } -//---------------------------------------------------------------------------- void SVTK_MainWindow ::onAdjustTrihedron() @@ -683,7 +818,6 @@ SVTK_MainWindow GetRenderer()->OnAdjustTrihedron(); } -//---------------------------------------------------------------------------- void SVTK_MainWindow ::onAdjustCubeAxes() @@ -691,7 +825,9 @@ SVTK_MainWindow GetRenderer()->OnAdjustCubeAxes(); } -//---------------------------------------------------------------------------- +/*! + \return QImage, containing all scene rendering in window +*/ QImage SVTK_MainWindow ::dumpView() diff --git a/src/SVTK/SVTK_MainWindow.h b/src/SVTK/SVTK_MainWindow.h index 758093797..3d9637a40 100644 --- a/src/SVTK/SVTK_MainWindow.h +++ b/src/SVTK/SVTK_MainWindow.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef SVTK_MAINWINDOW_H #define SVTK_MAINWINDOW_H @@ -25,6 +43,7 @@ class SUIT_ViewWindow; class SVTK_RenderWindowInteractor; class SVTK_NonIsometricDlg; +class SVTK_UpdateRateDlg; class SVTK_CubeAxesActor2D; class SVTK_CubeAxesDlg; @@ -36,7 +55,6 @@ class SVTK_Renderer; class SVTK_Selector; -//---------------------------------------------------------------------------- //! The class is a container for #SVTK_RenderWindowInteractor. /*! The class contains #SVTK_RenderWindowInteractor instance and @@ -150,7 +168,7 @@ public: //! Redirect the request to #SVTK_Renderer::SetTrihedronSize void - SetTrihedronSize(const int theSize); + SetTrihedronSize(const int theSize, const bool theRelative = true); //! Redirect the request to #SVTK_Renderer::AdjustActors void @@ -175,7 +193,14 @@ public: //---------------------------------------------------------------------------- QToolBar* getToolBar(); + signals: + void Show( QShowEvent * ); + void Hide( QHideEvent * ); + public slots: + virtual void showEvent( QShowEvent * ); + virtual void hideEvent( QHideEvent * ); + void activateZoom(); void activateWindowFit(); void activateRotation(); @@ -195,6 +220,7 @@ public: void onViewTrihedron(); void onViewCubeAxes(); + void onUpdateRate(bool theIsActivate); void onNonIsometric(bool theIsActivate); void onGraduatedAxes(bool theIsActivate); @@ -216,12 +242,13 @@ public: enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, - ViewTrihedronId, NonIsometric, GraduatedAxes}; + ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate}; typedef QMap TActionsMap; SUIT_ViewWindow* myViewWindow; SVTK_NonIsometricDlg* myNonIsometricDlg; + SVTK_UpdateRateDlg* myUpdateRateDlg; SVTK_CubeAxesDlg* myCubeAxesDlg; vtkSmartPointer myEventDispatcher; diff --git a/src/SVTK/SVTK_NonIsometricDlg.cxx b/src/SVTK/SVTK_NonIsometricDlg.cxx index a01bcbdcb..7b99f2c9c 100644 --- a/src/SVTK/SVTK_NonIsometricDlg.cxx +++ b/src/SVTK/SVTK_NonIsometricDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -44,15 +44,13 @@ using namespace std; Constructor */ SVTK_NonIsometricDlg -::SVTK_NonIsometricDlg(SVTK_MainWindow* theParent, - const char* theName, - QtxAction* theAction): - QDialog(theParent, - theName, - false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), - m_MainWindow(theParent), - m_Action(theAction) +::SVTK_NonIsometricDlg(QtxAction* theAction, + SVTK_MainWindow* theParent, + const char* theName): + SVTK_DialogBase(theAction, + theParent, + theName), + m_MainWindow(theParent) { setCaption(tr("DLG_TITLE")); setSizeGripEnabled(TRUE); @@ -63,66 +61,70 @@ SVTK_NonIsometricDlg layoutDlg->setMargin(11); // Create croup box with grid layout - QGroupBox* GroupBox = new QGroupBox(this, "GroupBox"); - QGridLayout* glGroupBox = new QGridLayout(GroupBox); - glGroupBox->setMargin(11); - glGroupBox->setSpacing(6); + QGroupBox* aGroupBox = new QGroupBox(this, "GroupBox"); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(aGroupBox); + aHBoxLayout->setMargin(11); + aHBoxLayout->setSpacing(6); // "X" scaling - QLabel* TextLabelX = new QLabel (tr("LBL_X"), GroupBox, "TextLabelX"); - m_sbXcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, GroupBox); + QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox, "TextLabelX"); + TextLabelX->setFixedWidth(15); + m_sbXcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox); m_sbXcoeff->setMinimumWidth(80); m_sbXcoeff->setValue(1.0); // "Y" scaling - QLabel* TextLabelY = new QLabel (tr("LBL_Y"), GroupBox, "TextLabelY"); - m_sbYcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, GroupBox); + QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox, "TextLabelY"); + TextLabelY->setFixedWidth(15); + m_sbYcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox); m_sbYcoeff->setMinimumWidth(80); m_sbYcoeff->setValue(1.0); // "Z" scaling - QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), GroupBox, "TextLabelZ"); - m_sbZcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, GroupBox); + QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox, "TextLabelZ"); + TextLabelZ->setFixedWidth(15); + m_sbZcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox); m_sbZcoeff->setMinimumWidth(80); m_sbZcoeff->setValue(1.0); // Create button - m_bReset = new QPushButton(tr("&Reset"), GroupBox, "m_bReset"); + m_bReset = new QPushButton(tr("&Reset"), aGroupBox, "m_bReset"); // Layout widgets in the group box - glGroupBox->addWidget(TextLabelX, 0, 0); - glGroupBox->addWidget(m_sbXcoeff, 0, 1); - glGroupBox->addWidget(TextLabelY, 0, 2); - glGroupBox->addWidget(m_sbYcoeff, 0, 3); - glGroupBox->addWidget(TextLabelZ, 0, 4); - glGroupBox->addWidget(m_sbZcoeff, 0, 5); - glGroupBox->addWidget(m_bReset, 0, 6); + aHBoxLayout->addWidget(TextLabelX); + aHBoxLayout->addWidget(m_sbXcoeff); + aHBoxLayout->addWidget(TextLabelY); + aHBoxLayout->addWidget(m_sbYcoeff); + aHBoxLayout->addWidget(TextLabelZ); + aHBoxLayout->addWidget(m_sbZcoeff); + //aHBoxLayout->addStretch(); + aHBoxLayout->addWidget(m_bReset); // OK, CANCEL, Apply button - QGroupBox* aWgt = new QGroupBox(this); - QHBoxLayout* aHBoxLayout = new QHBoxLayout(aWgt); - aHBoxLayout->setMargin(11); - aHBoxLayout->setSpacing(6); + QGroupBox* aGroupBox2 = new QGroupBox(this); + QHBoxLayout* aHBoxLayout2 = new QHBoxLayout(aGroupBox2); + aHBoxLayout2->setMargin(11); + aHBoxLayout2->setSpacing(6); // Create button - QPushButton* m_bOk = new QPushButton(tr("O&K"), aWgt, "m_bOk"); + QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2, "m_bOk"); m_bOk->setDefault(TRUE); m_bOk->setAutoDefault(TRUE); // Create button - QPushButton* m_bApply = new QPushButton(tr("&Apply"), aWgt, "m_bApply"); + QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2, "m_bApply"); m_bApply->setAutoDefault(TRUE); // Create button - QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aWgt, "m_bCancel"); + QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2, "m_bCancel"); m_bCancel->setAutoDefault(TRUE); // Layout buttons - aHBoxLayout->addWidget(m_bOk); - aHBoxLayout->addWidget(m_bApply); - aHBoxLayout->addStretch(); - aHBoxLayout->addWidget(m_bCancel); + aHBoxLayout2->addWidget(m_bOk); + aHBoxLayout2->addWidget(m_bApply); + aHBoxLayout2->addStretch(); + aHBoxLayout2->addWidget(m_bCancel); // Layout top level widgets - layoutDlg->addWidget(GroupBox,0,0); - layoutDlg->addWidget(aWgt,1,0); + layoutDlg->addWidget(aGroupBox,0,0); + layoutDlg->addWidget(aGroupBox2,1,0); // signals and slots connections connect(m_bCancel, SIGNAL(clicked()), this, SLOT(onClickClose())); @@ -187,14 +189,4 @@ SVTK_NonIsometricDlg ::onClickClose() { reject(); - - m_Action->setOn( false ); -} - -void -SVTK_NonIsometricDlg -::done( int r ) -{ - m_Action->setOn( false ); - QDialog::done( r ); } diff --git a/src/SVTK/SVTK_NonIsometricDlg.h b/src/SVTK/SVTK_NonIsometricDlg.h index 6a11a14f6..66be82a39 100644 --- a/src/SVTK/SVTK_NonIsometricDlg.h +++ b/src/SVTK/SVTK_NonIsometricDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -29,7 +29,7 @@ #ifndef SVTK_NONISOMETRICDLG_H #define SVTK_NONISOMETRICDLG_H -#include +#include "SVTK_DialogBase.h" class SVTK_MainWindow; @@ -39,14 +39,14 @@ class QtxAction; class QPushButton; -class SVTK_NonIsometricDlg : public QDialog +class SVTK_NonIsometricDlg : public SVTK_DialogBase { Q_OBJECT; public: - SVTK_NonIsometricDlg(SVTK_MainWindow* theParent, - const char* theName, - QtxAction* theAction); + SVTK_NonIsometricDlg(QtxAction* theAction, + SVTK_MainWindow* theParent, + const char* theName); ~SVTK_NonIsometricDlg(); @@ -54,7 +54,6 @@ public: protected: SVTK_MainWindow *m_MainWindow; - QtxAction* m_Action; QtxDblSpinBox* m_sbXcoeff; QtxDblSpinBox* m_sbYcoeff; @@ -66,8 +65,6 @@ protected slots: void onClickReset(); void onClickOk(); void onClickClose(); - - virtual void done( int ); }; #endif // SVTK_NONISOMETRICDLG_H diff --git a/src/SVTK/SVTK_Prs.cxx b/src/SVTK/SVTK_Prs.cxx index 9db710484..11e4b20f5 100644 --- a/src/SVTK/SVTK_Prs.cxx +++ b/src/SVTK/SVTK_Prs.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -29,55 +29,40 @@ #include "SVTK_Prs.h" using namespace std; -//========================================================== /*! - * SVTK_Prs::SVTK_Prs - * Default constructor - */ -//========================================================== + Default constructor +*/ SVTK_Prs::SVTK_Prs() : myObjects( 0 ) { } -//========================================================== /*! - * SVTK_Prs::SVTK_Prs - * tandard constructora - */ -//========================================================== + Standard constructor +*/ SVTK_Prs::SVTK_Prs( const vtkActor* obj ) { AddObject( obj ); } -//========================================================== /*! - * SVTK_Prs::~SVTK_Prs - * Destructor - */ -//========================================================== + Destructor +*/ SVTK_Prs:: ~SVTK_Prs() { if ( myObjects ) myObjects->Delete(); } -//========================================================== /*! - * SVTK_Prs::GetObjects - * Get actors list - */ -//========================================================== + \return actors list +*/ vtkActorCollection* SVTK_Prs::GetObjects() const { return myObjects; } -//========================================================== /*! - * SVTK_Prs::AddObject - * Add actor - */ -//========================================================== + Add actor +*/ void SVTK_Prs::AddObject( const vtkActor* obj ) { if ( !myObjects) @@ -85,13 +70,9 @@ void SVTK_Prs::AddObject( const vtkActor* obj ) myObjects->AddItem( (vtkActor*)obj ); } -//========================================================== /*! - * SVTK_Prs::IsNull - * Return 0 if list of the actors is empty - * [ Reimplemented from SALOME_Prs ] - */ -//========================================================== + \return 0 if list of the actors is empty [ Reimplemented from SALOME_Prs ] +*/ bool SVTK_Prs::IsNull() const { return !myObjects || myObjects->GetNumberOfItems() <= 0; diff --git a/src/SVTK/SVTK_Prs.h b/src/SVTK/SVTK_Prs.h index 3446e9afe..218a9f101 100644 --- a/src/SVTK/SVTK_Prs.h +++ b/src/SVTK/SVTK_Prs.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_RectPicker.cxx b/src/SVTK/SVTK_RectPicker.cxx index 775782e80..9aaad409e 100644 --- a/src/SVTK/SVTK_RectPicker.cxx +++ b/src/SVTK/SVTK_RectPicker.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -47,12 +47,11 @@ #include #include -//---------------------------------------------------------------------------- namespace { //---------------------------------------------------------------------------- inline - float + vtkFloatingPointType GetZ(float* theZPtr, int theSelection[4], int theDX, @@ -67,13 +66,13 @@ namespace int Check(float* theZPtr, int theSelection[4], - float theTolerance, - float theDZ, + vtkFloatingPointType theTolerance, + vtkFloatingPointType theDZ, int theDX, int theDY) { int aRet = 0; - float aZ = -1.0; + vtkFloatingPointType aZ = -1.0; if(theDX >= theSelection[0] && theDX <= theSelection[2] && theDY >= theSelection[1] && theDY <= theSelection[3]) { @@ -98,7 +97,7 @@ namespace vtkDataSet *theInput, SVTK_RectPicker::TVectorIds& theVisibleIds, SVTK_RectPicker::TVectorIds& theInVisibleIds, - float theTolerance) + vtkFloatingPointType theTolerance) { theVisibleIds.clear(); theInVisibleIds.clear(); @@ -134,10 +133,10 @@ namespace */ for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){ // perform conversion - float aX[4] = {1.0, 1.0, 1.0, 1.0}; + vtkFloatingPointType aX[4] = {1.0, 1.0, 1.0, 1.0}; theInput->GetPoint(aPntId,aX); - float aView[4]; + vtkFloatingPointType aView[4]; aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) continue; @@ -146,7 +145,7 @@ namespace aView[2]/aView[3]); theRenderer->ViewToDisplay(); - float aDX[3]; + vtkFloatingPointType aDX[3]; theRenderer->GetDisplayPoint(aDX); // check whether visible and in selection window @@ -212,8 +211,8 @@ namespace //---------------------------------------------------------------------------- inline void - GetCenter(const float theBounds[6], - float theCenter[3]) + GetCenter(const vtkFloatingPointType theBounds[6], + vtkFloatingPointType theCenter[3]) { theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0; theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0; @@ -225,7 +224,7 @@ namespace vtkRenderer *theRenderer, vtkDataSet *theInput, SVTK_RectPicker::TVectorIds& theVectorIds, - float theTolerance) + vtkFloatingPointType theTolerance) { theVectorIds.clear(); @@ -260,14 +259,14 @@ namespace for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){ vtkCell* aCell = theInput->GetCell(aCellId); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; aCell->GetBounds(aBounds); - float aCenter[3]; + vtkFloatingPointType aCenter[3]; GetCenter(aBounds,aCenter); - float aView[4]; - float aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0}; + vtkFloatingPointType aView[4]; + vtkFloatingPointType aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0}; aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) @@ -278,7 +277,7 @@ namespace aView[2]/aView[3]); theRenderer->ViewToDisplay(); - float aDX[3]; + vtkFloatingPointType aDX[3]; theRenderer->GetDisplayPoint(aDX); // check whether visible and in selection window @@ -306,16 +305,16 @@ namespace //---------------------------------------------------------------------------- void CalculatePickPosition(vtkRenderer *theRenderer, - float theSelectionX, - float theSelectionY, - float theSelectionZ, - float thePickPosition[3]) + vtkFloatingPointType theSelectionX, + vtkFloatingPointType theSelectionY, + vtkFloatingPointType theSelectionZ, + vtkFloatingPointType thePickPosition[3]) { // Convert the selection point into world coordinates. // theRenderer->SetDisplayPoint(theSelectionX, theSelectionY, theSelectionZ); theRenderer->DisplayToWorld(); - float* aWorldCoords = theRenderer->GetWorldPoint(); + vtkFloatingPointType* aWorldCoords = theRenderer->GetWorldPoint(); if ( aWorldCoords[3] != 0.0 ) { for (int i=0; i < 3; i++) { thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3]; @@ -324,10 +323,8 @@ namespace } } -//---------------------------------------------------------------------------- vtkStandardNewMacro(SVTK_RectPicker); -//---------------------------------------------------------------------------- SVTK_RectPicker ::SVTK_RectPicker() { @@ -341,26 +338,33 @@ SVTK_RectPicker int SVTK_RectPicker -::Pick(float, float, float, vtkRenderer*) +::Pick(vtkFloatingPointType, + vtkFloatingPointType, + vtkFloatingPointType, + vtkRenderer*) { return 0; } -//---------------------------------------------------------------------------- int SVTK_RectPicker -::Pick(float theSelection[3], float theSelection2[3], vtkRenderer *theRenderer) +::Pick(vtkFloatingPointType theSelection[3], + vtkFloatingPointType theSelection2[3], + vtkRenderer *theRenderer) { return Pick(theSelection[0], theSelection[1], theSelection[2], theSelection2[0], theSelection2[1], theSelection2[2], theRenderer); } -//---------------------------------------------------------------------------- int SVTK_RectPicker -::Pick(float theSelectionX, float theSelectionY, float theSelectionZ, - float theSelectionX2, float theSelectionY2, float theSelectionZ2, +::Pick(vtkFloatingPointType theSelectionX, + vtkFloatingPointType theSelectionY, + vtkFloatingPointType theSelectionZ, + vtkFloatingPointType theSelectionX2, + vtkFloatingPointType theSelectionY2, + vtkFloatingPointType theSelectionZ2, vtkRenderer *theRenderer) { // Initialize picking process @@ -374,14 +378,14 @@ SVTK_RectPicker // vtkCamera* aCamera = theRenderer->GetActiveCamera(); - float aCameraFP[4]; + vtkFloatingPointType aCameraFP[4]; aCamera->GetFocalPoint(aCameraFP); aCameraFP[3] = 1.0; theRenderer->SetWorldPoint(aCameraFP); theRenderer->WorldToDisplay(); - float* aDisplayCoords = theRenderer->GetDisplayPoint(); - float aSelectionZ = aDisplayCoords[2]; + vtkFloatingPointType* aDisplayCoords = theRenderer->GetDisplayPoint(); + vtkFloatingPointType aSelectionZ = aDisplayCoords[2]; this->SelectionPoint[0] = theSelectionX; this->SelectionPoint[1] = theSelectionY; @@ -472,7 +476,6 @@ SVTK_RectPicker } -//---------------------------------------------------------------------------- const SVTK_RectPicker::TVectorIdsMap& SVTK_RectPicker ::GetPointIdsMap() const diff --git a/src/SVTK/SVTK_RectPicker.h b/src/SVTK/SVTK_RectPicker.h index a9837c2d9..d70ed0a1a 100644 --- a/src/SVTK/SVTK_RectPicker.h +++ b/src/SVTK/SVTK_RectPicker.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -29,6 +29,7 @@ #define __SVTK_RectPicker_h #include "SVTK.h" +#include "VTKViewer.h" #include #include @@ -40,7 +41,7 @@ class vtkRenderer; /*! \class vtkAbstractPropPicker * \brief For more information see VTK documentation */ -/*! \class VTKViewer_RectPicker +/*! \class SVTK_RectPicker * \brief Rectangular picker class. */ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker @@ -56,8 +57,8 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker as fraction of rendering window size. (Rendering window size is measured across diagonal.) */ - vtkSetMacro(Tolerance,float); - vtkGetMacro(Tolerance,float); + vtkSetMacro(Tolerance,vtkFloatingPointType); + vtkGetMacro(Tolerance,vtkFloatingPointType); //! Use these methods to pick points or points and cells vtkSetMacro(PickPoints,int); @@ -66,12 +67,18 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker virtual int - Pick(float theSelectionX, float theSelectionY, float theSelectionZ, - float theSelectionX2, float theSelectionY2, float theSelectionZ2, + Pick(vtkFloatingPointType theSelectionX, + vtkFloatingPointType theSelectionY, + vtkFloatingPointType theSelectionZ, + vtkFloatingPointType theSelectionX2, + vtkFloatingPointType theSelectionY2, + vtkFloatingPointType theSelectionZ2, vtkRenderer *theRenderer); int - Pick(float theSelection[3], float theSelection2[3], vtkRenderer *theRenderer); + Pick(vtkFloatingPointType theSelection[3], + vtkFloatingPointType theSelection2[3], + vtkRenderer *theRenderer); typedef std::vector TVectorIds; typedef std::map TVectorIdsMap; @@ -87,16 +94,16 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker ~SVTK_RectPicker(); //! tolerance for computation (% of window) - float Tolerance; + vtkFloatingPointType Tolerance; //! use the following to control picking mode int PickPoints; //! second rectangle selection point in window (pixel) coordinates - float SelectionPoint2[3]; + vtkFloatingPointType SelectionPoint2[3]; //! second rectangle selection point in world coordinates - float PickPosition2[3]; + vtkFloatingPointType PickPosition2[3]; TVectorIdsMap myPointIdsMap; TVectorIdsMap myCellIdsMap; @@ -104,7 +111,10 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker private: virtual int - Pick(float, float, float, vtkRenderer*); + Pick(vtkFloatingPointType, + vtkFloatingPointType, + vtkFloatingPointType, + vtkRenderer*); }; #endif diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index bc4de96c6..69d19aa6e 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -61,7 +61,9 @@ static bool GENERATE_SUIT_EVENTS = false; static bool FOCUS_UNDER_MOUSE = false; -//---------------------------------------------------------------------------- +/*! + Constructor +*/ QVTK_RenderWindowInteractor ::QVTK_RenderWindowInteractor(QWidget* theParent, const char* theName): @@ -79,8 +81,12 @@ QVTK_RenderWindowInteractor myRenderWindow->SetWindowId((void*)winId()); } - -void QVTK_RenderWindowInteractor::Initialize( vtkGenericRenderWindowInteractor* theDevice ) +/*! + To initialize by vtkGenericRenderWindowInteractor instance +*/ +void +QVTK_RenderWindowInteractor +::Initialize(vtkGenericRenderWindowInteractor* theDevice) { if ( GetDevice() ) myDevice->SetRenderWindow( NULL ); @@ -91,8 +97,11 @@ void QVTK_RenderWindowInteractor::Initialize( vtkGenericRenderWindowInteractor* theDevice->SetRenderWindow( getRenderWindow() ); } -//---------------------------------------------------------------------------- -QVTK_RenderWindowInteractor::~QVTK_RenderWindowInteractor() +/*! + Destructor +*/ +QVTK_RenderWindowInteractor +::~QVTK_RenderWindowInteractor() { #ifndef WIN32 SVTK_SpaceMouse* aSpaceMouse = SVTK_SpaceMouse::getInstance(); @@ -101,13 +110,20 @@ QVTK_RenderWindowInteractor::~QVTK_RenderWindowInteractor() #endif } -//---------------------------------------------------------------------------- -vtkGenericRenderWindowInteractor* QVTK_RenderWindowInteractor::GetDevice() + +/*! + \return corresponding render window interactor +*/ +vtkGenericRenderWindowInteractor* +QVTK_RenderWindowInteractor +::GetDevice() { return myDevice.GetPointer(); } -//---------------------------------------------------------------------------- +/*! + \return corresponding render window +*/ vtkRenderWindow* QVTK_RenderWindowInteractor ::getRenderWindow() @@ -115,7 +131,9 @@ QVTK_RenderWindowInteractor return myRenderWindow.GetPointer(); } -//---------------------------------------------------------------------------- +/*! + Just to simplify usage of its device (vtkGenericRenderWindowInteractor) +*/ void QVTK_RenderWindowInteractor ::InvokeEvent(unsigned long theEvent, void* theCallData) @@ -123,7 +141,9 @@ QVTK_RenderWindowInteractor GetDevice()->InvokeEvent(theEvent,theCallData); } -//---------------------------------------------------------------------------- +/*! + Need for initial contents display on Win32 +*/ void QVTK_RenderWindowInteractor ::show() @@ -132,7 +152,9 @@ QVTK_RenderWindowInteractor update(); // needed for initial contents display on Win32 } -//---------------------------------------------------------------------------- +/*! + To implement final initialization, just before the widget is displayed +*/ void QVTK_RenderWindowInteractor ::polish() @@ -145,7 +167,9 @@ QVTK_RenderWindowInteractor } } -//---------------------------------------------------------------------------- +/*! + To adjust widget and vtkRenderWindow size +*/ void QVTK_RenderWindowInteractor ::resize(int w, int h) @@ -153,16 +177,20 @@ QVTK_RenderWindowInteractor GetDevice()->UpdateSize(w,h); } -//---------------------------------------------------------------------------- +/*! + Custom paint event handler +*/ void QVTK_RenderWindowInteractor ::paintEvent( QPaintEvent* theEvent ) { - GetDevice()->Render(); + GetDevice()->CreateTimer(VTKI_TIMER_FIRST); } -//---------------------------------------------------------------------------- +/*! + Custom resize event handler +*/ void QVTK_RenderWindowInteractor ::resizeEvent( QResizeEvent* theEvent ) @@ -194,14 +222,18 @@ QVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- + +/*! + Custom context menu event handler +*/ void QVTK_RenderWindowInteractor ::contextMenuEvent( QContextMenuEvent* event ) {} - -//---------------------------------------------------------------------------- +/*! + Custom mouse move event handler +*/ void QVTK_RenderWindowInteractor ::mouseMoveEvent( QMouseEvent* event ) @@ -214,7 +246,9 @@ QVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse press event handler +*/ void QVTK_RenderWindowInteractor ::mousePressEvent( QMouseEvent* event ) @@ -232,7 +266,9 @@ QVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse release event handler +*/ void QVTK_RenderWindowInteractor ::mouseReleaseEvent( QMouseEvent *event ) @@ -251,14 +287,18 @@ QVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse double click event handler +*/ void QVTK_RenderWindowInteractor ::mouseDoubleClickEvent( QMouseEvent* event ) {} -//---------------------------------------------------------------------------- +/*! + Custom mouse wheel event handler +*/ void QVTK_RenderWindowInteractor ::wheelEvent( QWheelEvent* event ) @@ -268,7 +308,9 @@ QVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom key press event handler +*/ void QVTK_RenderWindowInteractor ::keyPressEvent( QKeyEvent* event ) @@ -280,7 +322,9 @@ QVTK_RenderWindowInteractor GetDevice()->CharEvent(); } -//---------------------------------------------------------------------------- +/*! + Custom key release event handler +*/ void QVTK_RenderWindowInteractor ::keyReleaseEvent( QKeyEvent * event ) @@ -292,7 +336,9 @@ QVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom enter event handler +*/ void QVTK_RenderWindowInteractor ::enterEvent( QEvent* event ) @@ -304,7 +350,9 @@ QVTK_RenderWindowInteractor GetDevice()->EnterEvent(); } -//---------------------------------------------------------------------------- +/*! + Custom leave event handler +*/ void QVTK_RenderWindowInteractor ::leaveEvent( QEvent * ) @@ -312,9 +360,13 @@ QVTK_RenderWindowInteractor GetDevice()->LeaveEvent(); } - -//---------------------------------------------------------------------------- -void QVTK_RenderWindowInteractor::focusInEvent( QFocusEvent* event ) +/*! + Reimplemented from QWidget in order to set window - receiver + of space mouse events. +*/ +void +QVTK_RenderWindowInteractor +::focusInEvent( QFocusEvent* event ) { QWidget::focusInEvent( event ); @@ -333,8 +385,13 @@ void QVTK_RenderWindowInteractor::focusInEvent( QFocusEvent* event ) #endif } -//---------------------------------------------------------------------------- -void QVTK_RenderWindowInteractor::focusOutEvent( QFocusEvent* event ) +/*! + Reimplemented from QWidget in order to set window - receiver + of space mouse events. +*/ +void +QVTK_RenderWindowInteractor +::focusOutEvent ( QFocusEvent* event ) { QWidget::focusOutEvent( event ); @@ -347,9 +404,11 @@ void QVTK_RenderWindowInteractor::focusOutEvent( QFocusEvent* event ) } -//---------------------------------------------------------------------------- #ifdef WIN32 +/*! + To handle native Win32 events (from such devices as SpaceMouse) +*/ bool QVTK_RenderWindowInteractor::winEvent( MSG* msg ) { // TODO: Implement event handling for SpaceMouse @@ -358,7 +417,12 @@ bool QVTK_RenderWindowInteractor::winEvent( MSG* msg ) #else -bool QVTK_RenderWindowInteractor::x11Event( XEvent *xEvent ) +/*! + To handle native X11 events (from such devices as SpaceMouse) +*/ +bool +QVTK_RenderWindowInteractor +::x11Event( XEvent *xEvent ) { // handle 3d space mouse events if ( SVTK_SpaceMouse* aSpaceMouse = SVTK_SpaceMouse::getInstance() ) @@ -387,7 +451,9 @@ bool QVTK_RenderWindowInteractor::x11Event( XEvent *xEvent ) #endif -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_RenderWindowInteractor ::SVTK_RenderWindowInteractor(QWidget* theParent, const char* theName): @@ -402,6 +468,9 @@ SVTK_RenderWindowInteractor myEventCallbackCommand->SetCallback(SVTK_RenderWindowInteractor::ProcessEvents); } +/*! + To initialize properly the class +*/ void SVTK_RenderWindowInteractor ::Initialize(vtkGenericRenderWindowInteractor* theDevice, @@ -413,7 +482,9 @@ SVTK_RenderWindowInteractor SetSelector(theSelector); } -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SVTK_RenderWindowInteractor ::~SVTK_RenderWindowInteractor() { @@ -431,7 +502,9 @@ SVTK_RenderWindowInteractor GetDevice()->SetRenderWindow(NULL); } -//---------------------------------------------------------------------------- +/*! + To get corresponding SVTK_Renderer instance +*/ SVTK_Renderer* SVTK_RenderWindowInteractor ::GetRenderer() @@ -439,6 +512,9 @@ SVTK_RenderWindowInteractor return myRenderer.GetPointer(); } +/*! + To get corresponding SVTK_Renderer device (just to simplify collobaration with SVTK_Renderer) +*/ vtkRenderer* SVTK_RenderWindowInteractor ::getRenderer() @@ -446,6 +522,10 @@ SVTK_RenderWindowInteractor return GetRenderer()->GetDevice(); } +/*! + Changes renderer + \param theRenderer - new renderer +*/ void SVTK_RenderWindowInteractor ::SetRenderer(SVTK_Renderer* theRenderer) @@ -463,7 +543,10 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Changes interactor style + \param theStyle - new interactor style +*/ void SVTK_RenderWindowInteractor ::InitInteractorStyle(vtkInteractorStyle* theStyle) @@ -471,8 +554,9 @@ SVTK_RenderWindowInteractor GetDevice()->SetInteractorStyle(theStyle); } - -//---------------------------------------------------------------------------- +/*! + To change current interactor style by pushing the new one into the container +*/ void SVTK_RenderWindowInteractor ::PushInteractorStyle(vtkInteractorStyle* theStyle) @@ -481,8 +565,9 @@ SVTK_RenderWindowInteractor InitInteractorStyle(theStyle); } - -//---------------------------------------------------------------------------- +/*! + To restore previous interactor style +*/ void SVTK_RenderWindowInteractor ::PopInteractorStyle() @@ -494,8 +579,9 @@ SVTK_RenderWindowInteractor InitInteractorStyle(GetInteractorStyle()); } - -//---------------------------------------------------------------------------- +/*! + To get current interactor style +*/ vtkInteractorStyle* SVTK_RenderWindowInteractor ::GetInteractorStyle() @@ -504,7 +590,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + To get current selector +*/ SVTK_Selector* SVTK_RenderWindowInteractor ::GetSelector() @@ -513,6 +601,10 @@ SVTK_RenderWindowInteractor } +/*! + Changes selector + \param theSelector - new selector +*/ void SVTK_RenderWindowInteractor ::SetSelector(SVTK_Selector* theSelector) @@ -528,8 +620,9 @@ SVTK_RenderWindowInteractor myPriority); } - -//---------------------------------------------------------------------------- +/*! + Main process VTK event method +*/ void SVTK_RenderWindowInteractor ::ProcessEvents(vtkObject* vtkNotUsed(theObject), @@ -546,8 +639,9 @@ SVTK_RenderWindowInteractor } } - -//---------------------------------------------------------------- +/*! + To change selection mode (just to simplify collobaration with SVTK_Selector) +*/ void SVTK_RenderWindowInteractor ::SetSelectionMode(Selection_Mode theMode) @@ -555,8 +649,9 @@ SVTK_RenderWindowInteractor mySelector->SetSelectionMode(theMode); } - -//---------------------------------------------------------------- +/*! + To get current selection mode (just to simplify collobaration with SVTK_Selector) +*/ Selection_Mode SVTK_RenderWindowInteractor ::SelectionMode() const @@ -565,7 +660,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------- +/*! + Emits signal selectionChanged() +*/ void SVTK_RenderWindowInteractor ::onEmitSelectionChanged() @@ -574,7 +671,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse move event handler +*/ void SVTK_RenderWindowInteractor ::mouseMoveEvent( QMouseEvent* event ) @@ -586,7 +685,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse press event handler +*/ void SVTK_RenderWindowInteractor ::mousePressEvent( QMouseEvent* event ) @@ -598,7 +699,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse release event handler +*/ void SVTK_RenderWindowInteractor ::mouseReleaseEvent( QMouseEvent *event ) @@ -610,7 +713,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse double click event handler +*/ void SVTK_RenderWindowInteractor ::mouseDoubleClickEvent( QMouseEvent* event ) @@ -622,7 +727,9 @@ SVTK_RenderWindowInteractor } -//---------------------------------------------------------------------------- +/*! + Custom mouse wheel event handler +*/ void SVTK_RenderWindowInteractor ::wheelEvent( QWheelEvent* event ) @@ -638,8 +745,9 @@ SVTK_RenderWindowInteractor emit WheelMoved( event ); } - -//---------------------------------------------------------------------------- +/*! + Custom key press event handler +*/ void SVTK_RenderWindowInteractor ::keyPressEvent( QKeyEvent* event ) @@ -650,7 +758,9 @@ SVTK_RenderWindowInteractor emit KeyPressed( event ); } -//---------------------------------------------------------------------------- +/*! + Custom key release event handler +*/ void SVTK_RenderWindowInteractor ::keyReleaseEvent( QKeyEvent * event ) @@ -661,7 +771,9 @@ SVTK_RenderWindowInteractor emit KeyReleased( event ); } -//---------------------------------------------------------------------------- +/*! + Custom context menu event handler +*/ void SVTK_RenderWindowInteractor ::contextMenuEvent( QContextMenuEvent* event ) diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index 42011c4e2..ce1f76a88 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -52,9 +52,9 @@ class vtkObject; class SVTK_Selector; class SVTK_Renderer; -//============================================================================ -//! Implemements Qt based vtkRenderWindowInteractor. /*! + \class QVTK_RenderWindowInteractor + Implements Qt based vtkRenderWindowInteractor. The class inherits #QWidget class in order to be possible process Qt events. It invokes corresponding VTK events through usage of its device - a #vtkGenericRenderWindowInteractor. Also, it creates, initialize and holds vtkRenderWindow instance. @@ -128,9 +128,9 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget }; -//============================================================================ //! Extends QVTK_RenderWindowInteractor functionality. /*! + \class SVTK_RenderWindowInteractor Implements such features as support of selection, run-time interactor style management, diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index cad43a139..2ca7c7aef 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -55,10 +55,11 @@ #undef max -//---------------------------------------------------------------------------- vtkStandardNewMacro(SVTK_Renderer); -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_Renderer ::SVTK_Renderer(): myDevice(vtkRenderer::New()), @@ -74,7 +75,8 @@ SVTK_Renderer myTransform(VTKViewer_Transform::New()), myCubeAxes(SVTK_CubeAxesActor2D::New()), myTrihedron(SVTK_Trihedron::New()), - myTrihedronSize(105) + myTrihedronSize(105), + myIsTrihedronRelative(true) { myDevice->Delete(); myTransform->Delete(); @@ -151,6 +153,9 @@ SVTK_Renderer myPriority); } +/*! + Destructor +*/ SVTK_Renderer ::~SVTK_Renderer() { @@ -175,6 +180,9 @@ SVTK_Renderer } +/*! + Main process event method +*/ void SVTK_Renderer ::ProcessEvents(vtkObject* vtkNotUsed(theObject), @@ -197,7 +205,9 @@ SVTK_Renderer } } -//---------------------------------------------------------------------------- +/*! + \return renderer's device +*/ vtkRenderer* SVTK_Renderer ::GetDevice() @@ -205,6 +215,9 @@ SVTK_Renderer return myDevice.GetPointer(); } +/*! + Initialize renderer +*/ void SVTK_Renderer ::Initialize(vtkRenderWindowInteractor* theInteractor, @@ -214,7 +227,9 @@ SVTK_Renderer mySelector = theSelector; } -//---------------------------------------------------------------------------- +/*! + Publishes pointed actor into the renderer +*/ void SVTK_Renderer ::AddActor(VTKViewer_Actor* theActor) @@ -238,6 +253,9 @@ SVTK_Renderer } } +/*! + Removes pointed actor from the renderer +*/ void SVTK_Renderer ::RemoveActor(VTKViewer_Actor* theActor) @@ -263,6 +281,9 @@ SVTK_Renderer } } +/*! + Get special container that keeps scaling of the scene +*/ VTKViewer_Transform* SVTK_Renderer ::GetTransform() @@ -270,6 +291,9 @@ SVTK_Renderer return myTransform.GetPointer(); } +/*! + Allows to get a scale that is applied on the whole scene +*/ void SVTK_Renderer ::GetScale( double theScale[3] ) @@ -277,6 +301,9 @@ SVTK_Renderer myTransform->GetMatrixScale( theScale ); } +/*! + Allows to apply a scale on the whole scene +*/ void SVTK_Renderer ::SetScale( double theScale[3] ) @@ -285,8 +312,9 @@ SVTK_Renderer AdjustActors(); } - -//---------------------------------------------------------------------------- +/*! + Applies color and size (PointSize and LineWidth) of primitives in selection mode +*/ void SVTK_Renderer ::SetSelectionProp(const double& theRed, @@ -299,7 +327,9 @@ SVTK_Renderer myHighlightProperty->SetPointSize( theWidth ); } -//---------------------------------------------------------------------------- +/*! + Applies color and size (PointSize and LineWidth) of primitives in preselection mode +*/ void SVTK_Renderer ::SetPreselectionProp(const double& theRed, @@ -312,7 +342,9 @@ SVTK_Renderer myPreHighlightProperty->SetPointSize( theWidth ); } -//---------------------------------------------------------------------------- +/*! + Setup requested tolerance for the picking +*/ void SVTK_Renderer ::SetSelectionTolerance(const double& theTolNodes, @@ -326,14 +358,13 @@ SVTK_Renderer } -//---------------------------------------------------------------------------- /*! If parameter theIsForcedUpdate is true, recalculate parameters for * trihedron and cube axes, even if trihedron and cube axes is invisible. */ inline bool -CheckBndBox(const float theBounds[6]) +CheckBndBox(const vtkFloatingPointType theBounds[6]) { if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT && theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT && @@ -342,6 +373,9 @@ CheckBndBox(const float theBounds[6]) return false; } +/*! + Adjusts size of actors +*/ bool SVTK_Renderer ::OnAdjustActors() @@ -349,7 +383,7 @@ SVTK_Renderer bool aTDisplayed = IsTrihedronDisplayed(); bool aCDisplayed = IsCubeAxesDisplayed(); - float aNewBndBox[6]; + vtkFloatingPointType aNewBndBox[6]; aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; @@ -362,9 +396,14 @@ SVTK_Renderer myCubeAxes->VisibilityOff(); // if the new trihedron size have sufficient difference, then apply the value - double aSize = myTrihedron->GetSize(); - ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize); - myTrihedron->SetSize(aSize); + vtkFloatingPointType aSize = myTrihedron->GetSize(); + if ( IsTrihedronRelative() ) + { + ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize); + myTrihedron->SetSize(aSize); + } + else + myTrihedron->SetSize( myTrihedronSize ); // iterate through displayed objects and set size if necessary vtkActorCollection* anActors = GetDevice()->GetActors(); @@ -374,7 +413,7 @@ SVTK_Renderer if(anActor->IsResizable()) anActor->SetSize(0.5*aSize); if(anActor->GetVisibility() && !anActor->IsInfinitive()){ - float *aBounds = anActor->GetBounds(); + vtkFloatingPointType *aBounds = anActor->GetBounds(); if(CheckBndBox(aBounds)) for(int i = 0; i < 5; i = i + 2){ if(aBounds[i] < aNewBndBox[i]) @@ -408,6 +447,9 @@ SVTK_Renderer return false; } +/*! + Adjusts size of actors +*/ void SVTK_Renderer ::AdjustActors() @@ -416,16 +458,26 @@ SVTK_Renderer ::ResetCameraClippingRange(GetDevice()); } +/*! + Set size of the trihedron + \param theSize - new size + \param theRelative - if it is true, then size is mesured in percents from bounding box of the scene, + otherwise - in viewer units +*/ void SVTK_Renderer -::SetTrihedronSize(int theSize) +::SetTrihedronSize(int theSize, const bool theRelative) { - if(myTrihedronSize != theSize){ + if(myTrihedronSize != theSize || myIsTrihedronRelative != theRelative){ myTrihedronSize = theSize; + myIsTrihedronRelative = theRelative; AdjustActors(); } } +/*! + \return size of the trihedron in percents from bounding box of the scene +*/ int SVTK_Renderer ::GetTrihedronSize() const @@ -433,8 +485,19 @@ SVTK_Renderer return myTrihedronSize; } +/*! + \return true if the size of the trihedron is relative +*/ +bool +SVTK_Renderer +::IsTrihedronRelative() const +{ + return myIsTrihedronRelative; +} -//---------------------------------------------------------------------------- +/*! + \return trihedron control +*/ VTKViewer_Trihedron* SVTK_Renderer ::GetTrihedron() @@ -442,6 +505,9 @@ SVTK_Renderer return myTrihedron.GetPointer(); } +/*! + \return true if trihedron is displayed +*/ bool SVTK_Renderer ::IsTrihedronDisplayed() @@ -449,6 +515,9 @@ SVTK_Renderer return myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn; } +/*! + Toggle trihedron visibility +*/ void SVTK_Renderer ::OnViewTrihedron() @@ -459,6 +528,9 @@ SVTK_Renderer myTrihedron->VisibilityOn(); } +/*! + Adjust size of the trihedron to the bounding box of the scene +*/ void SVTK_Renderer ::OnAdjustTrihedron() @@ -466,8 +538,9 @@ SVTK_Renderer AdjustActors(); } - -//---------------------------------------------------------------------------- +/*! + \return graduated rules control +*/ SVTK_CubeAxesActor2D* SVTK_Renderer ::GetCubeAxes() @@ -475,6 +548,9 @@ SVTK_Renderer return myCubeAxes.GetPointer(); } +/*! + \return true if graduated rules displayed +*/ bool SVTK_Renderer ::IsCubeAxesDisplayed() @@ -482,6 +558,9 @@ SVTK_Renderer return myCubeAxes->GetVisibility() == 1; } +/*! + Toggle graduated rules visibility +*/ void SVTK_Renderer ::OnViewCubeAxes() @@ -492,6 +571,9 @@ SVTK_Renderer myCubeAxes->VisibilityOn(); } +/*! + Adjust size of the graduated rules to the bounding box of the scene +*/ void SVTK_Renderer ::OnAdjustCubeAxes() @@ -499,8 +581,9 @@ SVTK_Renderer AdjustActors(); } - -//---------------------------------------------------------------------------- +/*! + Sets camera into predefined state +*/ void SVTK_Renderer ::OnResetView() @@ -527,12 +610,13 @@ SVTK_Renderer else myCubeAxes->VisibilityOff(); - static float aCoeff = 3.0; + static vtkFloatingPointType aCoeff = 3.0; aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); } - -//---------------------------------------------------------------------------- +/*! + Fit all presentation in the scene into the window +*/ void SVTK_Renderer ::OnFitAll() @@ -571,8 +655,9 @@ SVTK_Renderer ::ResetCameraClippingRange(GetDevice()); } - -//---------------------------------------------------------------------------- +/*! + Reset camera clipping range to adjust the range to the bounding box of the scene +*/ void SVTK_Renderer ::OnResetClippingRange() @@ -581,8 +666,9 @@ SVTK_Renderer ::ResetCameraClippingRange(GetDevice()); } - -//---------------------------------------------------------------------------- +/*! + To reset direction of the camera to front view +*/ void SVTK_Renderer ::OnFrontView() @@ -594,7 +680,9 @@ SVTK_Renderer this->OnFitAll(); } -//---------------------------------------------------------------------------- +/*! + To reset direction of the camera to back view +*/ void SVTK_Renderer ::OnBackView() @@ -606,7 +694,9 @@ SVTK_Renderer this->OnFitAll(); } -//---------------------------------------------------------------------------- +/*! + To reset direction of the camera to top view +*/ void SVTK_Renderer ::OnTopView() @@ -618,7 +708,9 @@ SVTK_Renderer this->OnFitAll(); } -//---------------------------------------------------------------------------- +/*! + To reset direction of the camera to bottom view +*/ void SVTK_Renderer ::OnBottomView() @@ -630,7 +722,9 @@ SVTK_Renderer this->OnFitAll(); } -//---------------------------------------------------------------------------- +/*! + To reset direction of the camera to left view +*/ void SVTK_Renderer ::OnLeftView() @@ -642,7 +736,9 @@ SVTK_Renderer this->OnFitAll(); } -//---------------------------------------------------------------------------- +/*! + To reset direction of the camera to right view +*/ void SVTK_Renderer ::OnRightView() diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index 5f486543c..c9908539d 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -30,6 +30,7 @@ #define SVTK_Renderer_h #include "SVTK.h" +#include "VTKViewer.h" #include #include @@ -52,13 +53,13 @@ class VTKViewer_Actor; class SVTK_Selector; -//! The class is a container for #vtkRenderer instance. -/*! +/*! + \class SVTK_Renderer + The class is a container for #vtkRenderer instance. Main goal of the class is to apply common behaviour to all #SALOME_Actor, like selection and preselection colors. Also, the class is responsible for management of internal actors like trihedron an so on. */ -//============================================================================ class SVTK_EXPORT SVTK_Renderer : public vtkObject { public: @@ -77,12 +78,12 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject SVTK_Selector* theSelector); //---------------------------------------------------------------------------- - //! This method publishes pointed actor into the renderer + //! Publishes pointed actor into the renderer virtual void AddActor(VTKViewer_Actor* theActor); - //! This method removes pointed actor from the renderer + //! Removes pointed actor from the renderer virtual void RemoveActor(VTKViewer_Actor* theActor); @@ -91,12 +92,12 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject VTKViewer_Transform* GetTransform(); - //! This method allow to apply a scale on the whole scene + //! Allows to apply a scale on the whole scene virtual void SetScale( double theScale[3] ); - //! This method allow to get a scale that is applied on the whole scene + //! Allows to get a scale that is applied on the whole scene void GetScale( double theScale[3] ); @@ -115,7 +116,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject const double& theBlue = 1, const int& theWidth = 5); - //! Setup requested tollerance for the picking + //! Setup requested tolerance for the picking void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001); @@ -127,12 +128,16 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //! Set size of the trihedron in percents from bounding box of the scene void - SetTrihedronSize(int theSize); + SetTrihedronSize(int theSize, const bool theRelative = true); //! Get size of the trihedron in percents from bounding box of the scene int GetTrihedronSize() const; + //! Shows if the size of the trihedron is relative + bool + IsTrihedronRelative() const; + //---------------------------------------------------------------------------- //! Get trihedron control VTKViewer_Trihedron* @@ -205,7 +210,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //---------------------------------------------------------------------------- // Priority at which events are processed - float myPriority; + vtkFloatingPointType myPriority; // Used to process events vtkSmartPointer myEventCallbackCommand; @@ -238,8 +243,9 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //---------------------------------------------------------------------------- vtkSmartPointer myCubeAxes; vtkSmartPointer myTrihedron; - int myTrihedronSize; - float myBndBox[6]; + int myTrihedronSize; + bool myIsTrihedronRelative; + vtkFloatingPointType myBndBox[6]; }; #endif diff --git a/src/SVTK/SVTK_Selection.h b/src/SVTK/SVTK_Selection.h index 3307565c2..4b0b4f55d 100644 --- a/src/SVTK/SVTK_Selection.h +++ b/src/SVTK/SVTK_Selection.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_SelectionEvent.h b/src/SVTK/SVTK_SelectionEvent.h index cfa753f97..75d01316f 100644 --- a/src/SVTK/SVTK_SelectionEvent.h +++ b/src/SVTK/SVTK_SelectionEvent.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_Selector.cxx b/src/SVTK/SVTK_Selector.cxx index b05a168a2..d93bd4b44 100644 --- a/src/SVTK/SVTK_Selector.cxx +++ b/src/SVTK/SVTK_Selector.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,6 +36,9 @@ #include +/*! + \return new SVTK_Selector +*/ SVTK_Selector* SVTK_Selector ::New() @@ -43,19 +46,26 @@ SVTK_Selector return new SVTK_SelectorDef(); } -//---------------------------------------------------------------------------- +/*! + Default constructor +*/ SVTK_SelectorDef ::SVTK_SelectorDef() { mySelectionMode = ActorSelection; } +/*! + Destructor +*/ SVTK_SelectorDef ::~SVTK_SelectorDef() { } -//---------------------------------------------------------------------------- +/*! + To invoke selectionChanged signals +*/ void SVTK_SelectorDef ::StartPickCallback() @@ -63,7 +73,9 @@ SVTK_SelectorDef this->InvokeEvent(vtkCommand::StartPickEvent,NULL); } -//---------------------------------------------------------------------------- +/*! + To invoke selectionChanged signals +*/ void SVTK_SelectorDef ::EndPickCallback() @@ -71,7 +83,9 @@ SVTK_SelectorDef this->InvokeEvent(vtkCommand::EndPickEvent,NULL); } -//---------------------------------------------------------------------------- +/*! + To change current Selection_Mode (as outside effect, it invokes selectionChange signal) +*/ void SVTK_SelectorDef ::SetSelectionMode(Selection_Mode theMode) @@ -83,6 +97,9 @@ SVTK_SelectorDef } } +/*! + Clear selection +*/ void SVTK_SelectorDef ::ClearIObjects() @@ -92,7 +109,9 @@ SVTK_SelectorDef myMapIOSubIndex.clear(); } -//---------------------------------------------------------------------------- +/*! + \return true if the SALOME_InteractiveObject presents into selection +*/ bool SVTK_SelectorDef ::IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const @@ -100,6 +119,9 @@ SVTK_SelectorDef return !theIO.IsNull() && (myIObjects.find(theIO) != myIObjects.end()); } +/*! + \return true if the SALOME_Actor presents into selection +*/ bool SVTK_SelectorDef ::IsSelected(SALOME_Actor* theActor) const @@ -108,6 +130,10 @@ SVTK_SelectorDef return IsSelected(anIO) && myIO2Actors.find(anIO) != myIO2Actors.end(); } +/*! + \return corresponding SALOME_Actor for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject +*/ SALOME_Actor* SVTK_SelectorDef ::GetActor(const Handle(SALOME_InteractiveObject)& theIO) const @@ -118,7 +144,10 @@ SVTK_SelectorDef return NULL; } -//---------------------------------------------------------------------------- +/*! + Adds SALOME_InteractiveObject into selection + \param theIO - SALOME_InteractiveObject +*/ bool SVTK_SelectorDef ::AddIObject(const Handle(SALOME_InteractiveObject)& theIO) @@ -130,6 +159,10 @@ SVTK_SelectorDef return false; } +/*! + Adds SALOME_Actor into selection + \param theActor - SALOME_Actor +*/ bool SVTK_SelectorDef ::AddIObject(SALOME_Actor* theActor) @@ -147,7 +180,10 @@ SVTK_SelectorDef return !anIsIOBound || !anIsActorBound; } -//---------------------------------------------------------------------------- +/*! + Removes SALOME_InteractiveObject from selection + \param theIO - SALOME_InteractiveObject +*/ bool SVTK_SelectorDef ::RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO) @@ -161,6 +197,10 @@ SVTK_SelectorDef return anIsIOBound; } +/*! + Removes SALOME_Actor from selection + \param theActor - SALOME_Actor +*/ bool SVTK_SelectorDef ::RemoveIObject(SALOME_Actor* theActor) @@ -174,7 +214,9 @@ SVTK_SelectorDef return RemoveIObject(anIO) || anIsActorBound; } -//---------------------------------------------------------------------------- +/*! + \return list of all SALOME_InteractiveObject presenting in selection +*/ const SALOME_ListIO& SVTK_SelectorDef ::StoredIObjects() const @@ -188,6 +230,9 @@ SVTK_SelectorDef return myIObjectList; } +/*! + \return number of selected objects +*/ int SVTK_SelectorDef ::IObjectCount() const @@ -195,6 +240,10 @@ SVTK_SelectorDef return myIObjects.size(); } +/*! + \return true if the SALOME_InteractiveObject has a subselection + \param theIO - SALOME_InteractiveObject +*/ bool SVTK_SelectorDef ::HasIndex( const Handle(SALOME_InteractiveObject)& theIO) const @@ -202,6 +251,10 @@ SVTK_SelectorDef return myMapIOSubIndex.find(theIO) != myMapIOSubIndex.end(); } +/*! + Gets indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject +*/ void SVTK_SelectorDef ::GetIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -214,8 +267,15 @@ SVTK_SelectorDef theIndex.Clear(); } -bool SVTK_SelectorDef::IsIndexSelected( const Handle(SALOME_InteractiveObject)& theIO, - int theIndex) const +/*! + \return true if the index presents in subselection + \param theIO - SALOME_InteractiveObject + \param theIndex - index +*/ +bool +SVTK_SelectorDef +::IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, + int theIndex) const { TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO); if(anIter != myMapIOSubIndex.end()){ @@ -248,6 +308,12 @@ static bool removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, const int theI return anId != 0; } +/*! + Changes indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndices - indices + \param theIsModeShift - if it is false, then map will be cleared before indices are added +*/ bool SVTK_SelectorDef ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -277,6 +343,12 @@ SVTK_SelectorDef } +/*! + Changes indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndices - indices + \param theIsModeShift - if it is false, then map will be cleared before indices are added +*/ bool SVTK_SelectorDef ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -307,6 +379,12 @@ SVTK_SelectorDef } +/*! + Changes indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndex - index + \param theIsModeShift - if it is false, then map will be cleared before indices are added +*/ bool SVTK_SelectorDef ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -337,6 +415,12 @@ SVTK_SelectorDef return false; } + +/*! + Removes index of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndex - index +*/ void SVTK_SelectorDef ::RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -349,6 +433,9 @@ SVTK_SelectorDef } } +/*! + Clears all indices of subselection +*/ void SVTK_SelectorDef ::ClearIndex() @@ -356,7 +443,10 @@ SVTK_SelectorDef myMapIOSubIndex.clear(); } -//---------------------------------------------------------------------------- +/*! + To apply a filter on the selection + \param theFilter - new filter +*/ void SVTK_SelectorDef ::SetFilter(const Handle(VTKViewer_Filter)& theFilter) @@ -364,7 +454,10 @@ SVTK_SelectorDef myFilters.insert(TFilters::value_type(theFilter->GetId(),theFilter)); } -//---------------------------------------------------------------------------- +/*! + \return true if filter with given number is applyed + \param theId - filter id +*/ bool SVTK_SelectorDef ::IsFilterPresent(const TFilterID theId) const @@ -372,7 +465,10 @@ SVTK_SelectorDef return myFilters.find(theId) != myFilters.end(); } -//---------------------------------------------------------------------------- +/*! + To remove a filter from the selection + \param theId - filter id +*/ void SVTK_SelectorDef ::RemoveFilter(const TFilterID theId) @@ -381,7 +477,12 @@ SVTK_SelectorDef myFilters.erase(theId); } -//---------------------------------------------------------------------------- +/*! + \return true if the index satisfy installed filters + \param theActor - actor + \param theId - filter id + \param theIsNode - whether it is node +*/ bool SVTK_SelectorDef ::IsValid(SALOME_Actor* theActor, @@ -398,7 +499,10 @@ SVTK_SelectorDef return true; } -//---------------------------------------------------------------------------- +/*! + \return filter by it's id + \param theId - filter id +*/ Handle(VTKViewer_Filter) SVTK_SelectorDef ::GetFilter(const TFilterID theId) const diff --git a/src/SVTK/SVTK_Selector.h b/src/SVTK/SVTK_Selector.h index 8d8fec33c..380e28b31 100644 --- a/src/SVTK/SVTK_Selector.h +++ b/src/SVTK/SVTK_Selector.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -128,7 +128,7 @@ public: GetIndex( const Handle(SALOME_InteractiveObject)& theIO, TColStd_IndexedMapOfInteger& theIndex ) = 0; - //! Change indexes of subslection for given #SALOME_InteractiveObject + //! Change indices of subselection for given #SALOME_InteractiveObject virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -155,7 +155,7 @@ public: RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, int theIndex) = 0; - //! Check, if the given index is present in subslection + //! Check, if the given index is present in subselection virtual bool IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, diff --git a/src/SVTK/SVTK_SelectorDef.h b/src/SVTK/SVTK_SelectorDef.h index 050a6838a..e20d764ec 100644 --- a/src/SVTK/SVTK_SelectorDef.h +++ b/src/SVTK/SVTK_SelectorDef.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_SpaceMouse.cxx b/src/SVTK/SVTK_SpaceMouse.cxx index 8ee2e21d7..7d858a780 100644 --- a/src/SVTK/SVTK_SpaceMouse.cxx +++ b/src/SVTK/SVTK_SpaceMouse.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,10 +40,11 @@ #include "SVTK_SpaceMouse.h" -//--------------------------------------------- SVTK_SpaceMouse* SVTK_SpaceMouse::myInstance = 0; -//--------------------------------------------- +/*! + \return shared instance of object (creates if there is no one) +*/ SVTK_SpaceMouse* SVTK_SpaceMouse::getInstance() { if ( !myInstance ) @@ -51,7 +52,9 @@ SVTK_SpaceMouse* SVTK_SpaceMouse::getInstance() return myInstance; } -//--------------------------------------------- +/*! + Constructor +*/ SVTK_SpaceMouse::SVTK_SpaceMouse() { #ifndef WIN32 @@ -60,9 +63,11 @@ SVTK_SpaceMouse::SVTK_SpaceMouse() spaceMouseOn = 0; } -//--------------------------------------------- #ifndef WIN32 +/*! + Initialization +*/ int SVTK_SpaceMouse::initialize( Display *display, Window window ) { XMotionEvent = XInternAtom( display, "MotionEvent", 1 ); @@ -84,7 +89,6 @@ int SVTK_SpaceMouse::initialize( Display *display, Window window ) return spaceMouseOn; } -//--------------------------------------------- static int errorCallback( Display *display, XErrorEvent *Error ) { char msg[ 128 ]; @@ -95,7 +99,9 @@ static int errorCallback( Display *display, XErrorEvent *Error ) return 0; } -//--------------------------------------------- +/*! + Initialize by window +*/ int SVTK_SpaceMouse::setWindow( Display *display, Window window ) { XTextProperty winName; @@ -152,7 +158,9 @@ int SVTK_SpaceMouse::setWindow( Display *display, Window window ) return result; } -//--------------------------------------------- +/*! + Close +*/ int SVTK_SpaceMouse::close(Display *display) { initialize( display, (Window)InputFocus ); @@ -161,7 +169,9 @@ int SVTK_SpaceMouse::close(Display *display) return 1; } -//--------------------------------------------- +/*! + Custom event handler +*/ int SVTK_SpaceMouse::translateEvent( Display* display, XEvent* xEvent, MoveEvent* spaceMouseEvent, double scale, double rScale ) { diff --git a/src/SVTK/SVTK_SpaceMouse.h b/src/SVTK/SVTK_SpaceMouse.h index a282dae6f..f920bf44a 100644 --- a/src/SVTK/SVTK_SpaceMouse.h +++ b/src/SVTK/SVTK_SpaceMouse.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SVTK/SVTK_Trihedron.cxx b/src/SVTK/SVTK_Trihedron.cxx index ea8783a07..ac0bbd4d8 100644 --- a/src/SVTK/SVTK_Trihedron.cxx +++ b/src/SVTK/SVTK_Trihedron.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SVTK_Trihedron.h" #include "SALOME_Actor.h" @@ -23,16 +23,20 @@ #include #include -//**************************************************************** vtkStandardNewMacro(SVTK_Trihedron); -//**************************************************************** +/*! + Constructor +*/ SVTK_Trihedron ::SVTK_Trihedron() { } -//**************************************************************** +/*! + \return count of visible actors + \param theRenderer - renderer to be checked +*/ int SVTK_Trihedron ::GetVisibleActorCount(vtkRenderer* theRenderer) diff --git a/src/SVTK/SVTK_Trihedron.h b/src/SVTK/SVTK_Trihedron.h index 69a80303e..3f410cde1 100644 --- a/src/SVTK/SVTK_Trihedron.h +++ b/src/SVTK/SVTK_Trihedron.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SVTK_TRIHEDRON_H #define SVTK_TRIHEDRON_H diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 966ff2340..882728b3a 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -40,8 +40,9 @@ #include #include - -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_SignalHandler ::SVTK_SignalHandler(SVTK_MainWindow* theMainWindow): QObject(theMainWindow), @@ -67,11 +68,17 @@ SVTK_SignalHandler this,SIGNAL(selectionChanged())); } +/*! + Destructor +*/ SVTK_SignalHandler ::~SVTK_SignalHandler() { } +/*! + \return corresponding svtk main window +*/ SVTK_MainWindow* SVTK_SignalHandler ::GetMainWindow() @@ -80,7 +87,9 @@ SVTK_SignalHandler } -//---------------------------------------------------------------- +/*! + Redirect the request to #SVTK_MainWindow::Repaint (just for flexibility) +*/ void SVTK_SignalHandler ::Repaint(bool theUpdateTrihedron) @@ -88,7 +97,9 @@ SVTK_SignalHandler myMainWindow->Repaint(theUpdateTrihedron); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_MainWindow::GetRenderer (just for flexibility) +*/ SVTK_Renderer* SVTK_SignalHandler ::GetRenderer() @@ -96,6 +107,9 @@ SVTK_SignalHandler return myMainWindow->GetRenderer(); } +/*! + Redirect the request to #SVTK_MainWindow::getRenderer (just for flexibility) +*/ vtkRenderer* SVTK_SignalHandler ::getRenderer() @@ -103,7 +117,6 @@ SVTK_SignalHandler return myMainWindow->getRenderer(); } -//---------------------------------------------------------------- namespace SVTK { struct THighlightAction @@ -123,6 +136,9 @@ namespace SVTK }; } +/*! + SLOT: called on selection change +*/ void SVTK_SignalHandler ::onSelectionChanged() @@ -144,21 +160,26 @@ SVTK_SignalHandler myMainWindow->Repaint(false); } - -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_View ::SVTK_View(SVTK_MainWindow* theMainWindow) : SVTK_SignalHandler(theMainWindow) { } -//---------------------------------------------------------------------------- +/*! + Destructor +*/ SVTK_View ::~SVTK_View() { } -//---------------------------------------------------------------- +/*! + Unhilights all objects in viewer +*/ void SVTK_View ::unHighlightAll() @@ -169,7 +190,12 @@ SVTK_View Repaint(); } -//---------------------------------------------------------------- +/*! + Hilights/unhilights object in viewer + \param theIO - object to be updated + \param theIsHighlight - if it is true, object will be hilighted, otherwise it will be unhilighted + \param theIsUpdate - update current viewer +*/ void SVTK_View ::highlight( const Handle(SALOME_InteractiveObject)& theIO, @@ -183,7 +209,27 @@ SVTK_View Repaint(); } -//---------------------------------------------------------------------------- +/*! + Display object + \param theEntry - entry that corresponds to intractive objects +*/ +Handle(SALOME_InteractiveObject) +SVTK_View +::FindIObject(const char* theEntry) +{ + using namespace SVTK; + SALOME_Actor* anActor = + Find(getRenderer()->GetActors(), + TIsSameEntry(theEntry)); + if(anActor != NULL) + return anActor->getIO(); + + return NULL; +} + +/*! + Redirect the request to #SVTK_Renderer::SetPreselectionProp +*/ void SVTK_View ::SetSelectionProp(const double& theRed, @@ -194,7 +240,9 @@ SVTK_View GetRenderer()->SetSelectionProp(theRed,theGreen,theBlue,theWidth); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::SetPreselectionProp +*/ void SVTK_View ::SetPreselectionProp(const double& theRed, @@ -205,7 +253,9 @@ SVTK_View GetRenderer()->SetPreselectionProp(theRed,theGreen,theBlue,theWidth); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::SetPreselectionProp +*/ void SVTK_View ::SetSelectionTolerance(const double& theTolNodes, @@ -214,7 +264,10 @@ SVTK_View GetRenderer()->SetSelectionTolerance(theTolNodes,theTolCell); } -//---------------------------------------------------------------------------- +/*! + \return true if object is in viewer or in collector + \param theIO - object to be checked +*/ bool SVTK_View ::isInViewer(const Handle(SALOME_InteractiveObject)& theIObject) @@ -226,7 +279,10 @@ SVTK_View return anActor != NULL; } -//---------------------------------------------------------------------------- +/*! + \return true if object is displayed in viewer + \param theIO - object to be checked +*/ bool SVTK_View ::isVisible(const Handle(SALOME_InteractiveObject)& theIObject) @@ -238,7 +294,11 @@ SVTK_View return anActor != NULL && anActor->GetVisibility(); } -//---------------------------------------------------------------------------- +/*! + Changes name of object + \param theIObject - object to be renamed + \param theName - new name +*/ void SVTK_View ::rename(const Handle(SALOME_InteractiveObject)& theIObject, @@ -251,7 +311,9 @@ SVTK_View (&SALOME_Actor::setName,theName.latin1())); } -//---------------------------------------------------------------------------- +/*! + \return current display mode (obsolete) +*/ int SVTK_View ::GetDisplayMode() @@ -259,6 +321,10 @@ SVTK_View return myDisplayMode; } +/*! + Set current display mode + \param theMode - new display mode +*/ void SVTK_View ::SetDisplayMode(int theMode) @@ -270,6 +336,11 @@ SVTK_View myDisplayMode = theMode; } +/*! + Set current display mode + \param theIObject - object + \param theMode - new display mode +*/ void SVTK_View ::SetDisplayMode(const Handle(SALOME_InteractiveObject)& theIObject, @@ -282,7 +353,9 @@ SVTK_View (&SALOME_Actor::setDisplayMode,theMode)); } -//---------------------------------------------------------------------------- +/*! + Change all actors to wireframe +*/ void SVTK_View ::ChangeRepresentationToWireframe() @@ -290,6 +363,9 @@ SVTK_View ChangeRepresentationToWireframe(getRenderer()->GetActors()); } +/*! + Change all actors to shading +*/ void SVTK_View ::ChangeRepresentationToSurface() @@ -297,7 +373,10 @@ SVTK_View ChangeRepresentationToSurface(getRenderer()->GetActors()); } - +/*! + Change to wireframe a list of vtkactor + theCollection - list of vtkactor +*/ void SVTK_View ::ChangeRepresentationToWireframe(vtkActorCollection* theCollection) @@ -309,6 +388,10 @@ SVTK_View Repaint(); } +/*! + Change to shading a list of vtkactor + theCollection - list of vtkactor +*/ void SVTK_View ::ChangeRepresentationToSurface(vtkActorCollection* theCollection) @@ -320,7 +403,6 @@ SVTK_View Repaint(); } -//---------------------------------------------------------------------------- namespace SVTK { struct TErase @@ -342,6 +424,9 @@ namespace SVTK }; } +/*! + To erase all existing VTK presentations +*/ void SVTK_View ::EraseAll() @@ -352,6 +437,9 @@ SVTK_View Repaint(); } +/*! + To display all existing VTK presentations +*/ void SVTK_View ::DisplayAll() @@ -362,7 +450,11 @@ SVTK_View Repaint(); } - +/*! + To erase VTK presentation + \param theActor - actor + \param theIsUpdate - updates current viewer +*/ void SVTK_View ::Erase(SALOME_Actor* theActor, @@ -375,6 +467,11 @@ SVTK_View } +/*! + To erase VTK presentation + \param theIObject - object + \param theIsUpdate - updates current viewer +*/ void SVTK_View ::Erase(const Handle(SALOME_InteractiveObject)& theIObject, @@ -388,7 +485,9 @@ SVTK_View Repaint(); } -//---------------------------------------------------------------------------- +/*! + To display the VTK presentation +*/ void SVTK_View ::Display(SALOME_Actor* theActor, @@ -401,6 +500,9 @@ SVTK_View Repaint(); } +/*! + To display the VTK presentation +*/ void SVTK_View ::Display(const Handle(SALOME_InteractiveObject)& theIObject, @@ -415,6 +517,9 @@ SVTK_View Repaint(); } +/*! + To display VTK presentation with defined #SALOME_InteractiveObject and erase all others +*/ void SVTK_View ::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject) @@ -424,7 +529,6 @@ SVTK_View } -//---------------------------------------------------------------------------- namespace SVTK { struct TRemoveAction @@ -441,6 +545,9 @@ namespace SVTK }; } +/*! + To remove the VTK presentation +*/ void SVTK_View ::Remove(const Handle(SALOME_InteractiveObject)& theIObject, @@ -454,6 +561,9 @@ SVTK_View Repaint(); } +/*! + To remove the VTK presentation +*/ void SVTK_View ::Remove(SALOME_Actor* theActor, @@ -464,6 +574,9 @@ SVTK_View Repaint(); } +/*! + To remove all VTK presentations +*/ void SVTK_View ::RemoveAll(bool theIsUpdate) @@ -483,7 +596,10 @@ SVTK_View } } -//---------------------------------------------------------------------------- +/*! + \return current transparency + \param theIObject - object +*/ float SVTK_View ::GetTransparency(const Handle(SALOME_InteractiveObject)& theIObject) @@ -498,35 +614,48 @@ SVTK_View } +/*! + Sets current transparency + \param theIObject - object + \param theTrans - new transparency +*/ void SVTK_View ::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, float theTrans) { - float anOpacity = 1.0 - theTrans; + vtkFloatingPointType anOpacity = 1.0 - theTrans; using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), - TSetFunction + TSetFunction (&SALOME_Actor::SetOpacity,anOpacity)); } -//---------------------------------------------------------------------------- +/*! + Change color + \param theIObject - object + \param theColor - new color +*/ void SVTK_View ::SetColor(const Handle(SALOME_InteractiveObject)& theIObject, const QColor& theColor) { - float aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; + vtkFloatingPointType aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), - TSetFunction + TSetFunction (&SALOME_Actor::SetColor,aColor)); } +/*! + \return object color + \param theIObject - object +*/ QColor SVTK_View ::GetColor(const Handle(SALOME_InteractiveObject)& theIObject) @@ -536,7 +665,7 @@ SVTK_View Find(getRenderer()->GetActors(), TIsSameIObject(theIObject)); if(anActor){ - float r,g,b; + vtkFloatingPointType r,g,b; anActor->GetColor(r,g,b); return QColor(int(r*255),int(g*255),int(b*255)); } diff --git a/src/SVTK/SVTK_View.h b/src/SVTK/SVTK_View.h index 2512c3497..4c25de9bc 100644 --- a/src/SVTK/SVTK_View.h +++ b/src/SVTK/SVTK_View.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef SVTK_VIEW_H #define SVTK_VIEW_H @@ -18,7 +36,6 @@ class SVTK_Renderer; class SALOME_Actor; -//---------------------------------------------------------------------------- //! Main purpose of the class is to provide a way to customize #SVTK_MainWindow. /*! This class is initialized by #SVTK_MainWindow and just pass Qt signals from @@ -78,7 +95,6 @@ public: }; -//---------------------------------------------------------------------------- //! This class is introduced just for compatibility with old code. /*! This class contains frequantly used functionality in old code. @@ -106,7 +122,7 @@ public: void unHighlightAll(); - /* Selection Management */ + //! Try to find a SALOME_InteractiveObject in the view that corresponds to the entry Handle(SALOME_InteractiveObject) FindIObject(const char* Entry); diff --git a/src/SVTK/SVTK_ViewManager.cxx b/src/SVTK/SVTK_ViewManager.cxx index 4822bf639..3465d1535 100644 --- a/src/SVTK/SVTK_ViewManager.cxx +++ b/src/SVTK/SVTK_ViewManager.cxx @@ -14,14 +14,16 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SVTK_ViewManager.h" #include "SVTK_ViewModel.h" int SVTK_ViewManager::_SVTKViewMgr_Id = 0; -//*************************************************************** +/*! + Constructor +*/ SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) : SUIT_ViewManager( study, theDesktop ) @@ -30,12 +32,24 @@ SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, setViewModel( new SVTK_Viewer() ); } -//*************************************************************** +/*! + Destructor +*/ SVTK_ViewManager::~SVTK_ViewManager() { } -//*************************************************************** +/*! + \return corresponding main window +*/ +SUIT_Desktop* SVTK_ViewManager::getDesktop() +{ + return myDesktop; +} + +/*! + Sets default name of view +*/ void SVTK_ViewManager::setViewName(SUIT_ViewWindow* theView) { int aPos = myViews.find(theView); diff --git a/src/SVTK/SVTK_ViewManager.h b/src/SVTK/SVTK_ViewManager.h index b200ccc5b..eda062600 100644 --- a/src/SVTK/SVTK_ViewManager.h +++ b/src/SVTK/SVTK_ViewManager.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SVTK_VIEWMANAGER_H #define SVTK_VIEWMANAGER_H @@ -36,6 +36,8 @@ public: //! Destroy the view manager virtual ~SVTK_ViewManager(); + SUIT_Desktop* getDesktop(); + protected: void setViewName( SUIT_ViewWindow* theView ); diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 08c2169d5..61cde9d5b 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include #include @@ -59,17 +59,25 @@ // return aMgr->GetStudyByID( id ); //} -//========================================================== +/*! + Constructor +*/ SVTK_Viewer::SVTK_Viewer() { myTrihedronSize = 105; + myTrihedronRelative = true; } -//========================================================== +/*! + Destructor +*/ SVTK_Viewer::~SVTK_Viewer() { } +/*! + \return background color +*/ QColor SVTK_Viewer ::backgroundColor() const @@ -77,6 +85,10 @@ SVTK_Viewer return myBgColor; } +/*! + Changes background color + \param theColor - new background color +*/ void SVTK_Viewer ::setBackgroundColor( const QColor& theColor ) @@ -88,7 +100,7 @@ SVTK_Viewer for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){ if(TViewWindow* aView = dynamic_cast(aViewWindow)){ - aView->getMainWindow()->SetBackgroundColor(theColor); + aView->setBackgroundColor(theColor); } } } @@ -96,46 +108,62 @@ SVTK_Viewer myBgColor = theColor; } -//========================================================== -SUIT_ViewWindow* +/*!Create new instance of view window on desktop \a theDesktop. + *\retval SUIT_ViewWindow* - created view window pointer. + */ +SUIT_ViewWindow* SVTK_Viewer:: createView( SUIT_Desktop* theDesktop ) { - SVTK_ViewWindow* aViewWindow = new SVTK_ViewWindow(theDesktop); + TViewWindow* aViewWindow = new TViewWindow(theDesktop); aViewWindow->Initialize(this); - + aViewWindow->setBackgroundColor( backgroundColor() ); - aViewWindow->SetTrihedronSize( trihedronSize() ); + aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() ); return aViewWindow; } +/*! + \return trihedron size +*/ int SVTK_Viewer::trihedronSize() const { return myTrihedronSize; } -void SVTK_Viewer::setTrihedronSize( const int sz ) +/*! + \return true if thihedron changes size in accordance with bounding box +*/ +bool SVTK_Viewer::trihedronRelative() const { - myTrihedronSize = sz; - - SUIT_ViewManager* vm = getViewManager(); - if ( !vm ) - return; - - QPtrVector vec = vm->getViews(); - for ( int i = 0; i < vec.count(); i++ ) - { - SUIT_ViewWindow* win = vec.at( i ); - if ( !win || !win->inherits( "SVTK_ViewWindow" ) ) - continue; + return myTrihedronRelative; +} - SVTK_ViewWindow* vw = (SVTK_ViewWindow*)win; - vw->SetTrihedronSize( sz ); +/*! + Sets trihedron size and relativeness( whether thihedron changes size in accordance with bounding box) + \param theSize - new size + \param theRelative - new relativeness +*/ +void SVTK_Viewer::setTrihedronSize( const int theSize, const bool theRelative ) +{ + myTrihedronSize = theSize; + myTrihedronRelative = theRelative; + + if (SUIT_ViewManager* aViewManager = getViewManager()) { + QPtrVector aViews = aViewManager->getViews(); + for (int i = 0; i < aViews.count(); i++) { + if (TViewWindow* aView = dynamic_cast(aViews.at(i))) { + aView->SetTrihedronSize(theSize, theRelative); + } + } } } -//========================================================== +/*! + Sets new view manager + \param theViewManager - new view manager +*/ void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager) { SUIT_ViewModel::setViewManager(theViewManager); @@ -153,7 +181,9 @@ void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager) this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*))); } -//========================================================== +/*! + Builds popup for vtk viewer +*/ void SVTK_Viewer ::contextMenuPopup( QPopupMenu* thePopup ) @@ -164,31 +194,40 @@ SVTK_Viewer thePopup->insertSeparator(); if(TViewWindow* aView = dynamic_cast(myViewManager->getActiveView())){ - if ( !aView->getView()->GetMainWindow()->getToolBar()->isVisible() ){ + if ( !aView->getMainWindow()->getToolBar()->isVisible() ){ thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) ); } } } -//========================================================== +/*! + SLOT: called on mouse button press, empty implementation +*/ void SVTK_Viewer ::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event) {} -//========================================================== +/*! + SLOT: called on mouse move, empty implementation +*/ void SVTK_Viewer ::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event) {} -//========================================================== +/*! + SLOT: called on mouse button release, empty implementation +*/ void SVTK_Viewer ::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event) {} -//========================================================== +/*! + Enables/disables selection + \param isEnabled - new state +*/ void SVTK_Viewer ::enableSelection(bool isEnabled) @@ -197,7 +236,10 @@ SVTK_Viewer //!! To be done for view windows } -//========================================================== +/*! + Enables/disables selection of many object + \param isEnabled - new state +*/ void SVTK_Viewer ::enableMultiselection(bool isEnable) @@ -206,6 +248,9 @@ SVTK_Viewer //!! To be done for view windows } +/*! + SLOT: called on dump view operation is activated, stores scene to raster file +*/ void SVTK_Viewer ::onDumpView() @@ -214,7 +259,9 @@ SVTK_Viewer aView->onDumpView(); } -//========================================================== +/*! + SLOT: called if background color is to be changed changed, passes new color to view port +*/ void SVTK_Viewer ::onChangeBgColor() @@ -225,7 +272,9 @@ SVTK_Viewer } } -//========================================================== +/*! + SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window +*/ void SVTK_Viewer ::onShowToolbar() @@ -233,12 +282,15 @@ SVTK_Viewer QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(TViewWindow* aView = dynamic_cast(aViews.at(i))){ - aView->getView()->GetMainWindow()->getToolBar()->show(); + aView->getMainWindow()->getToolBar()->show(); } } } -//========================================================== +/*! + Display presentation + \param prs - presentation +*/ void SVTK_Viewer ::Display( const SALOME_VTKPrs* prs ) @@ -283,7 +335,11 @@ SVTK_Viewer } } -//========================================================== +/*! + Erase presentation + \param prs - presentation + \param forced - removes object from view +*/ void SVTK_Viewer ::Erase( const SALOME_VTKPrs* prs, const bool forced ) @@ -323,8 +379,11 @@ SVTK_Viewer } } } - -//========================================================== + +/*! + Erase all presentations + \param forced - removes all objects from view +*/ void SVTK_Viewer ::EraseAll( const bool forced ) @@ -369,7 +428,10 @@ SVTK_Viewer Repaint(); } -//========================================================== +/*! + Create presentation corresponding to the entry + \param entry - entry +*/ SALOME_Prs* SVTK_Viewer ::CreatePrs( const char* entry ) @@ -393,7 +455,9 @@ SVTK_Viewer return prs; } -//========================================================== +/*! + Auxiliary method called before displaying of objects +*/ void SVTK_Viewer ::BeforeDisplay( SALOME_Displayer* d ) @@ -401,29 +465,37 @@ SVTK_Viewer d->BeforeDisplay( this, SALOME_VTKViewType() ); } -//========================================================== +/*! + Auxiliary method called after displaying of objects +*/ void SVTK_Viewer::AfterDisplay( SALOME_Displayer* d ) { d->AfterDisplay( this, SALOME_VTKViewType() ); } -//========================================================== +/*! + \return true if object is displayed in viewer + \param obj - object to be checked +*/ bool SVTK_Viewer ::isVisible( const Handle(SALOME_InteractiveObject)& io ) { QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) - if(SVTK_View* aView = aViewWindow->getView()) - if(!aView->isVisible( io )) - return false; + if(SUIT_ViewWindow* aViewWindow = aViews.at(i)) + if(TViewWindow* aViewWnd = dynamic_cast(aViewWindow)) + if(SVTK_View* aView = aViewWnd->getView()) + if(!aView->isVisible( io )) + return false; return true; } -//========================================================== +/*! + Updates current viewer +*/ void SVTK_Viewer ::Repaint() @@ -431,7 +503,7 @@ SVTK_Viewer // if (theUpdateTrihedron) onAdjustTrihedron(); QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) + if(TViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) if(SVTK_View* aView = aViewWindow->getView()) aView->Repaint(); } diff --git a/src/SVTK/SVTK_ViewModel.h b/src/SVTK/SVTK_ViewModel.h index 5875d465e..3c55105c1 100644 --- a/src/SVTK/SVTK_ViewModel.h +++ b/src/SVTK/SVTK_ViewModel.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SVTK_VIEWMODEL_H #define SVTK_VIEWMODEL_H @@ -65,8 +65,11 @@ public: //! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize) int trihedronSize() const; + //! Shows if the size of trihedron relative (see #SVTK_Renderer::SetTrihedronSize) + bool trihedronRelative() const; + //! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize) - void setTrihedronSize( const int ); + void setTrihedronSize( const int, const bool = true ); public: void enableSelection(bool isEnabled); @@ -115,6 +118,7 @@ protected slots: private: QColor myBgColor; int myTrihedronSize; + bool myTrihedronRelative; bool mySelectionEnabled; bool myMultiSelectionEnabled; }; diff --git a/src/SVTK/SVTK_ViewModelBase.h b/src/SVTK/SVTK_ViewModelBase.h index d58827229..49f335e66 100644 --- a/src/SVTK/SVTK_ViewModelBase.h +++ b/src/SVTK/SVTK_ViewModelBase.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef SVTK_SELECTIONCHANGED_H #define SVTK_SELECTIONCHANGED_H diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index b95a23d20..3fee43d8e 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SALOME_Actor.h" @@ -28,6 +28,7 @@ #include #include #include +#include #include "QtxAction.h" @@ -53,13 +54,16 @@ #include "SVTK_InteractorStyle.h" #include "SVTK_RenderWindowInteractor.h" #include "SVTK_GenericRenderWindowInteractor.h" +#include "SVTK_CubeAxesActor2D.h" #include "SALOME_ListIteratorOfListIO.hxx" #include "VTKViewer_Algorithm.h" #include "SVTK_Functor.h" -//---------------------------------------------------------------------------- +/*! + Constructor +*/ SVTK_ViewWindow ::SVTK_ViewWindow(SUIT_Desktop* theDesktop): SUIT_ViewWindow(theDesktop), @@ -67,6 +71,9 @@ SVTK_ViewWindow myView(NULL) {} +/*! + To initialize #SVTK_ViewWindow instance +*/ void SVTK_ViewWindow ::Initialize(SVTK_ViewModelBase* theModel) @@ -106,6 +113,9 @@ SVTK_ViewWindow } } +/*! + To initialize #SVTK_ViewWindow instance +*/ void SVTK_ViewWindow ::Initialize(SVTK_View* theView, @@ -129,12 +139,17 @@ SVTK_ViewWindow theModel,SLOT(onSelectionChanged())); } +/*! + Destructor +*/ SVTK_ViewWindow ::~SVTK_ViewWindow() {} -//---------------------------------------------------------------------------- +/*! + \return corresponding view +*/ SVTK_View* SVTK_ViewWindow ::getView() @@ -142,6 +157,9 @@ SVTK_ViewWindow return myView; } +/*! + \return corresponding vtk main window +*/ SVTK_MainWindow* SVTK_ViewWindow ::getMainWindow() @@ -149,6 +167,9 @@ SVTK_ViewWindow return myMainWindow; } +/*! + \return corresponding vtk render window +*/ vtkRenderWindow* SVTK_ViewWindow ::getRenderWindow() @@ -156,6 +177,9 @@ SVTK_ViewWindow return getMainWindow()->getRenderWindow(); } +/*! + \return corresponding vtk render window interactor +*/ vtkRenderWindowInteractor* SVTK_ViewWindow ::getInteractor() @@ -163,6 +187,9 @@ SVTK_ViewWindow return getMainWindow()->getInteractor(); } +/*! + \return corresponding vtk renderer +*/ vtkRenderer* SVTK_ViewWindow ::getRenderer() @@ -170,6 +197,9 @@ SVTK_ViewWindow return myMainWindow->getRenderer(); } +/*! + \return corresponding vtk selector +*/ SVTK_Selector* SVTK_ViewWindow ::GetSelector() @@ -177,8 +207,9 @@ SVTK_ViewWindow return myMainWindow->GetSelector(); } - -//---------------------------------------------------------------------------- +/*! + Processes transformation "front view" +*/ void SVTK_ViewWindow ::onFrontView() @@ -186,7 +217,9 @@ SVTK_ViewWindow myMainWindow->onFrontView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "back view" +*/ void SVTK_ViewWindow ::onBackView() @@ -194,7 +227,9 @@ SVTK_ViewWindow myMainWindow->onBackView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "top view" +*/ void SVTK_ViewWindow ::onTopView() @@ -202,7 +237,9 @@ SVTK_ViewWindow myMainWindow->onTopView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "bottom view" +*/ void SVTK_ViewWindow ::onBottomView() @@ -210,7 +247,9 @@ SVTK_ViewWindow myMainWindow->onBottomView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "left view" +*/ void SVTK_ViewWindow ::onLeftView() @@ -218,7 +257,9 @@ SVTK_ViewWindow myMainWindow->onLeftView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "right view" +*/ void SVTK_ViewWindow ::onRightView() @@ -226,7 +267,9 @@ SVTK_ViewWindow myMainWindow->onRightView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "reset view": sets default orientation of viewport camera +*/ void SVTK_ViewWindow ::onResetView() @@ -234,7 +277,9 @@ SVTK_ViewWindow myMainWindow->onResetView(); } -//---------------------------------------------------------------------------- +/*! + Processes transformation "fit all" +*/ void SVTK_ViewWindow ::onFitAll() @@ -242,7 +287,9 @@ SVTK_ViewWindow myMainWindow->onFitAll(); } -//---------------------------------------------------------------- +/*! + SLOT: called if selection is changed +*/ void SVTK_ViewWindow ::onSelectionChanged() @@ -250,7 +297,10 @@ SVTK_ViewWindow myView->onSelectionChanged(); } -//---------------------------------------------------------------- +/*! + Change selection mode + \param theMode - new selection mode +*/ void SVTK_ViewWindow ::SetSelectionMode(Selection_Mode theMode) @@ -258,7 +308,9 @@ SVTK_ViewWindow myMainWindow->SetSelectionMode( theMode ); } -//---------------------------------------------------------------- +/*! + \return selection mode +*/ Selection_Mode SVTK_ViewWindow ::SelectionMode() const @@ -266,7 +318,9 @@ SVTK_ViewWindow return myMainWindow->SelectionMode(); } -//---------------------------------------------------------------- +/*! + Unhilights all objects in viewer +*/ void SVTK_ViewWindow ::unHighlightAll() @@ -274,7 +328,12 @@ SVTK_ViewWindow myView->unHighlightAll(); } -//---------------------------------------------------------------- +/*! + Hilights/unhilights object in viewer + \param theIO - object to be updated + \param theIsHighlight - if it is true, object will be hilighted, otherwise it will be unhilighted + \param theIsUpdate - update current viewer +*/ void SVTK_ViewWindow ::highlight(const Handle(SALOME_InteractiveObject)& theIO, @@ -284,7 +343,10 @@ SVTK_ViewWindow myView->highlight( theIO, theIsHighlight, theIsUpdate ); } -//---------------------------------------------------------------- +/*! + \return true if object is in viewer or in collector + \param theIO - object to be checked +*/ bool SVTK_ViewWindow ::isInViewer( const Handle(SALOME_InteractiveObject)& theIO ) @@ -292,7 +354,10 @@ SVTK_ViewWindow return myView->isInViewer( theIO ); } -//---------------------------------------------------------------- +/*! + \return true if object is displayed in viewer + \param theIO - object to be checked +*/ bool SVTK_ViewWindow ::isVisible( const Handle(SALOME_InteractiveObject)& theIO ) @@ -300,7 +365,22 @@ SVTK_ViewWindow return myView->isVisible( theIO ); } -//---------------------------------------------------------------- +/*! + Display object + \param theEntry - entry that corresponds to intractive objects +*/ +Handle(SALOME_InteractiveObject) +SVTK_ViewWindow +::FindIObject(const char* theEntry) +{ + return myView->FindIObject(theEntry); +} + +/*! + Display object + \param theIO - object + \param theImmediatly - update viewer +*/ void SVTK_ViewWindow ::Display(const Handle(SALOME_InteractiveObject)& theIO, @@ -309,6 +389,11 @@ SVTK_ViewWindow myView->Display(theIO,theImmediatly); } +/*! + Erase object + \param theIO - object + \param theImmediatly - update viewer +*/ void SVTK_ViewWindow ::Erase(const Handle(SALOME_InteractiveObject)& theIO, @@ -317,6 +402,10 @@ SVTK_ViewWindow myView->Erase(theIO,theImmediatly); } +/*! + Display only passed object + \param theIO - object +*/ void SVTK_ViewWindow ::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO) @@ -324,6 +413,9 @@ SVTK_ViewWindow myView->DisplayOnly(theIO); } +/*! + Display all objects in view +*/ void SVTK_ViewWindow ::DisplayAll() @@ -331,6 +423,9 @@ SVTK_ViewWindow myView->DisplayAll(); } +/*! + Erase all objects in view +*/ void SVTK_ViewWindow ::EraseAll() @@ -338,7 +433,10 @@ SVTK_ViewWindow myView->EraseAll(); } -//---------------------------------------------------------------------------- +/*! + Sets background color + \param color - new background color +*/ void SVTK_ViewWindow ::setBackgroundColor( const QColor& color ) @@ -346,7 +444,9 @@ SVTK_ViewWindow myMainWindow->SetBackgroundColor( color ); } -//---------------------------------------------------------------------------- +/*! + \return background color of viewer +*/ QColor SVTK_ViewWindow ::backgroundColor() const @@ -354,7 +454,9 @@ SVTK_ViewWindow return myMainWindow->BackgroundColor(); } -//---------------------------------------------------------------------------- +/*! + Updates current viewer +*/ void SVTK_ViewWindow ::Repaint(bool theUpdateTrihedron) @@ -362,7 +464,9 @@ SVTK_ViewWindow myMainWindow->Repaint( theUpdateTrihedron ); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::GetScale +*/ void SVTK_ViewWindow ::GetScale( double theScale[3] ) @@ -370,7 +474,9 @@ SVTK_ViewWindow myMainWindow->GetScale( theScale ); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::SetScale +*/ void SVTK_ViewWindow ::SetScale( double theScale[3] ) @@ -378,7 +484,9 @@ SVTK_ViewWindow myMainWindow->SetScale( theScale ); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed +*/ bool SVTK_ViewWindow ::isTrihedronDisplayed() @@ -386,6 +494,9 @@ SVTK_ViewWindow return myMainWindow->IsTrihedronDisplayed(); } +/*! + Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed +*/ bool SVTK_ViewWindow ::isCubeAxesDisplayed() @@ -393,7 +504,9 @@ SVTK_ViewWindow return myMainWindow->IsCubeAxesDisplayed(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::OnViewTrihedron +*/ void SVTK_ViewWindow ::onViewTrihedron() @@ -401,6 +514,9 @@ SVTK_ViewWindow myMainWindow->onViewTrihedron(); } +/*! + Redirect the request to #SVTK_Renderer::OnViewCubeAxes +*/ void SVTK_ViewWindow ::onViewCubeAxes() @@ -408,7 +524,9 @@ SVTK_ViewWindow myMainWindow->onViewCubeAxes(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::GetTrihedron +*/ VTKViewer_Trihedron* SVTK_ViewWindow:: GetTrihedron() @@ -416,6 +534,9 @@ GetTrihedron() return myMainWindow->GetTrihedron(); } +/*! + Redirect the request to #SVTK_Renderer::GetCubeAxes +*/ SVTK_CubeAxesActor2D* SVTK_ViewWindow ::GetCubeAxes() @@ -423,6 +544,9 @@ SVTK_ViewWindow return myMainWindow->GetCubeAxes(); } +/*! + \return trihedron size +*/ int SVTK_ViewWindow ::GetTrihedronSize() const @@ -430,11 +554,16 @@ SVTK_ViewWindow return myMainWindow->GetTrihedronSize(); } +/*! + Sets trihedron size + \param theSize - new trihedron size + \param theRelative - trihedron relativeness +*/ void SVTK_ViewWindow -::SetTrihedronSize(const int theSize) +::SetTrihedronSize(const int theSize, const bool theRelative) { - myMainWindow->SetTrihedronSize(theSize); + myMainWindow->SetTrihedronSize(theSize, theRelative); } /*! If parameter theIsForcedUpdate is true, recalculate parameters for @@ -447,7 +576,9 @@ SVTK_ViewWindow myMainWindow->AdjustActors(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::OnAdjustTrihedron +*/ void SVTK_ViewWindow ::onAdjustTrihedron() @@ -455,6 +586,9 @@ SVTK_ViewWindow myMainWindow->onAdjustTrihedron(); } +/*! + Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes +*/ void SVTK_ViewWindow ::onAdjustCubeAxes() @@ -462,7 +596,9 @@ SVTK_ViewWindow myMainWindow->onAdjustCubeAxes(); } -//======================================================================= +/*! + Emits key pressed +*/ void SVTK_ViewWindow ::onKeyPressed(QKeyEvent* event) @@ -470,7 +606,9 @@ SVTK_ViewWindow emit keyPressed( this, event ); } -//======================================================================= +/*! + Emits key released +*/ void SVTK_ViewWindow ::onKeyReleased(QKeyEvent* event) @@ -478,7 +616,9 @@ SVTK_ViewWindow emit keyReleased( this, event ); } -//======================================================================= +/*! + Emits mouse pressed +*/ void SVTK_ViewWindow ::onMousePressed(QMouseEvent* event) @@ -486,7 +626,9 @@ SVTK_ViewWindow emit mousePressed(this, event); } -//======================================================================= +/*! + Emits mouse released +*/ void SVTK_ViewWindow ::onMouseReleased(QMouseEvent* event) @@ -494,7 +636,9 @@ SVTK_ViewWindow emit mouseReleased( this, event ); } -//======================================================================= +/*! + Emits mouse moving +*/ void SVTK_ViewWindow ::onMouseMoving(QMouseEvent* event) @@ -502,7 +646,9 @@ SVTK_ViewWindow emit mouseMoving( this, event ); } -//======================================================================= +/*! + Emits mouse double clicked +*/ void SVTK_ViewWindow ::onMouseDoubleClicked( QMouseEvent* event ) @@ -510,7 +656,9 @@ SVTK_ViewWindow emit mouseDoubleClicked( this, event ); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::AddActor +*/ void SVTK_ViewWindow ::AddActor( VTKViewer_Actor* theActor, @@ -519,7 +667,9 @@ SVTK_ViewWindow myMainWindow->AddActor( theActor, theUpdate ); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::RemoveActor +*/ void SVTK_ViewWindow ::RemoveActor( VTKViewer_Actor* theActor, @@ -528,7 +678,9 @@ SVTK_ViewWindow myMainWindow->RemoveActor( theActor, theUpdate ); } -//---------------------------------------------------------------------------- +/*! + \return QImage, containing all scene rendering in window +*/ QImage SVTK_ViewWindow ::dumpView() @@ -536,7 +688,9 @@ SVTK_ViewWindow return myMainWindow->dumpView(); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::SetSelectionProp +*/ void SVTK_ViewWindow ::SetSelectionProp(const double& theRed, @@ -547,7 +701,9 @@ SVTK_ViewWindow myView->SetSelectionProp(theRed,theGreen,theBlue,theWidth); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::SetSelectionProp +*/ void SVTK_ViewWindow ::SetPreselectionProp(const double& theRed, @@ -558,7 +714,9 @@ SVTK_ViewWindow myView->SetPreselectionProp(theRed,theGreen,theBlue,theWidth); } -//---------------------------------------------------------------------------- +/*! + Redirect the request to #SVTK_Renderer::SetSelectionTolerance +*/ void SVTK_ViewWindow ::SetSelectionTolerance(const double& theTolNodes, @@ -567,7 +725,6 @@ SVTK_ViewWindow myView->SetSelectionTolerance(theTolNodes,theTolItems); } -//---------------------------------------------------------------------------- int convertAction( const int accelAction ) { switch ( accelAction ) { @@ -585,15 +742,273 @@ int convertAction( const int accelAction ) return accelAction; } -//---------------------------------------------------------------------------- -void +/*! + Performs action + \param accelAction - action +*/ +bool SVTK_ViewWindow ::action( const int accelAction ) { + if ( !myMainWindow->hasFocus() ) + return false; if ( accelAction == SUIT_Accel::ZoomFit ) onFitAll(); else { int anEvent = convertAction( accelAction ); myMainWindow->InvokeEvent( anEvent, 0 ); } + return true; +} + +// old visual parameters had 13 values. New format added additional +// 76 values for graduated axes, so both numbers are processed. +const int nNormalParams = 13; // number of view windows parameters excluding graduated axes params +const int nGradAxisParams = 25; // number of parameters of ONE graduated axis (X, Y, or Z) +const int nAllParams = nNormalParams + 3*nGradAxisParams + 1; // number of all visual parameters + +/*! The method returns visual parameters of a graduated axis actor (x,y,z axis of graduated axes) + */ +QString getGradAxisVisualParams( vtkAxisActor2D* actor ) +{ + QString params; + if ( !actor ) + return params; + + // Name + bool isVisible = actor->GetTitleVisibility(); + QString title ( actor->GetTitle() ); + vtkFloatingPointType color[ 3 ]; + int font = VTK_ARIAL; + int bold = 0; + int italic = 0; + int shadow = 0; + + vtkTextProperty* txtProp = actor->GetTitleTextProperty(); + if ( txtProp ) + { + txtProp->GetColor( color ); + font = txtProp->GetFontFamily(); + bold = txtProp->GetBold(); + italic = txtProp->GetItalic(); + shadow = txtProp->GetShadow(); + } + params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, + title.latin1(), color[0], color[1], color[2], font, bold, italic, shadow ); + + // Labels + isVisible = actor->GetLabelVisibility(); + int labels = actor->GetNumberOfLabels(); + int offset = actor->GetTickOffset(); + font = VTK_ARIAL; + bold = false; + italic = false; + shadow = false; + + txtProp = actor->GetLabelTextProperty(); + if ( txtProp ) + { + txtProp->GetColor( color ); + font = txtProp->GetFontFamily(); + bold = txtProp->GetBold(); + italic = txtProp->GetItalic(); + shadow = txtProp->GetShadow(); + } + params += QString().sprintf( "* Labels *%u*%u*%u*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, labels, offset, + color[0], color[1], color[2], font, bold, italic, shadow ); + + // Tick marks + isVisible = actor->GetTickVisibility(); + int length = actor->GetTickLength(); + + params += QString().sprintf( "* Tick marks *%u*%u", isVisible, length ); + + return params; +} + +/*! The method restores visual parameters of a graduated axis actor (x,y,z axis) + */ +void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params ) +{ + if ( !actor ) + return; + + QStringList paramsLst = QStringList::split( '*', params, true ); + + if ( paramsLst.size() == nGradAxisParams ) { // altogether name, lable, ticks parameters make up 25 values + + // retrieve and set name parameters + bool isVisible = paramsLst[2].toUShort(); + QString title = paramsLst[3]; + vtkFloatingPointType color[3]; + color[0] = paramsLst[4].toDouble(); + color[1] = paramsLst[5].toDouble(); + color[2] = paramsLst[6].toDouble(); + int font = paramsLst[7].toInt(); + int bold = paramsLst[8].toInt(); + int italic = paramsLst[9].toInt(); + int shadow = paramsLst[10].toInt(); + + actor->SetTitleVisibility( isVisible ); + actor->SetTitle( title.latin1() ); + vtkTextProperty* txtProp = actor->GetTitleTextProperty(); + if ( txtProp ) { + txtProp->SetColor( color ); + txtProp->SetFontFamily( font ); + txtProp->SetBold( bold ); + txtProp->SetItalic( italic ); + txtProp->SetShadow( shadow ); + } + + // retrieve and set lable parameters + isVisible = paramsLst[12].toUShort(); + int labels = paramsLst[13].toInt(); + int offset = paramsLst[14].toInt(); + color[0] = paramsLst[15].toDouble(); + color[1] = paramsLst[16].toDouble(); + color[2] = paramsLst[17].toDouble(); + font = paramsLst[18].toInt(); + bold = paramsLst[19].toInt(); + italic = paramsLst[20].toInt(); + shadow = paramsLst[21].toInt(); + + actor->SetLabelVisibility( isVisible ); + actor->SetNumberOfLabels( labels ); + actor->SetTickOffset( offset ); + txtProp = actor->GetLabelTextProperty(); + if ( txtProp ) { + txtProp->SetColor( color ); + txtProp->SetFontFamily( font ); + txtProp->SetBold( bold ); + txtProp->SetItalic( italic ); + txtProp->SetShadow( shadow ); + } + + // retrieve and set tick marks properties + isVisible = paramsLst[23].toUShort(); + int length = paramsLst[24].toInt(); + + actor->SetTickVisibility( isVisible ); + actor->SetTickLength( length ); + } +} + +/*! The method returns the visual parameters of this view as a formated string + */ +QString +SVTK_ViewWindow +::getVisualParameters() +{ + double pos[3], focalPnt[3], viewUp[3], parScale, scale[3]; + + // save position, focal point, viewUp, scale + vtkCamera* camera = getRenderer()->GetActiveCamera(); + camera->GetPosition( pos ); + camera->GetFocalPoint( focalPnt ); + camera->GetViewUp( viewUp ); + parScale = camera->GetParallelScale(); + GetScale( scale ); + + // Parameters are given in the following format:view position (3 digits), focal point position (3 digits) + // view up values (3 digits), parallel scale (1 digit), scale (3 digits, + // Graduated axes parameters (X, Y, Z axes parameters) + QString retStr; + retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", + pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], + viewUp[0], viewUp[1], viewUp[2], parScale, scale[0], scale[1], scale[2] ); + + // save graduated axes parameters + if ( SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes() ) { + retStr += QString( "*%1" ).arg( getMainWindow()->IsCubeAxesDisplayed() ); + retStr += ::getGradAxisVisualParams( gradAxesActor->GetXAxisActor2D() ); + retStr += ::getGradAxisVisualParams( gradAxesActor->GetYAxisActor2D() ); + retStr += ::getGradAxisVisualParams( gradAxesActor->GetZAxisActor2D() ); + } + + return retStr; +} + +/*! + The method restores visual parameters of this view or postpones it untill the view is shown +*/ +void +SVTK_ViewWindow +::setVisualParameters( const QString& parameters ) +{ + SVTK_RenderWindowInteractor* anInteractor = getMainWindow()->GetInteractor(); + if ( anInteractor->isVisible() ) { + doSetVisualParameters( parameters ); + } + else { + myVisualParams = parameters; + anInteractor->installEventFilter(this); + } +} + +/*! + The method restores visual parameters of this view from a formated string +*/ +void +SVTK_ViewWindow +::doSetVisualParameters( const QString& parameters ) +{ + QStringList paramsLst = QStringList::split( '*', parameters, true ); + if ( paramsLst.size() >= nNormalParams ) { + // 'reading' list of parameters + double pos[3], focalPnt[3], viewUp[3], parScale, scale[3]; + pos[0] = paramsLst[0].toDouble(); + pos[1] = paramsLst[1].toDouble(); + pos[2] = paramsLst[2].toDouble(); + focalPnt[0] = paramsLst[3].toDouble(); + focalPnt[1] = paramsLst[4].toDouble(); + focalPnt[2] = paramsLst[5].toDouble(); + viewUp[0] = paramsLst[6].toDouble(); + viewUp[1] = paramsLst[7].toDouble(); + viewUp[2] = paramsLst[8].toDouble(); + parScale = paramsLst[9].toDouble(); + scale[0] = paramsLst[10].toDouble(); + scale[1] = paramsLst[11].toDouble(); + scale[2] = paramsLst[12].toDouble(); + + // applying parameters + vtkCamera* camera = getRenderer()->GetActiveCamera(); + camera->SetPosition( pos ); + camera->SetFocalPoint( focalPnt ); + camera->SetViewUp( viewUp ); + camera->SetParallelScale( parScale ); + SetScale( scale ); + + // apply graduated axes parameters + SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes(); + if ( gradAxesActor && paramsLst.size() == nAllParams ) { + + int i = nNormalParams+1, j = i + nGradAxisParams - 1; + ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) ); + i = j + 1; j += nGradAxisParams; + ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) ); + i = j + 1; j += nGradAxisParams; + ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) ); + + if ( paramsLst[13].toUShort() ) + gradAxesActor->VisibilityOn(); + else + gradAxesActor->VisibilityOff(); + } + } +} + + +/*! + Delayed setVisualParameters +*/ +bool SVTK_ViewWindow::eventFilter( QObject* theWatched, QEvent* theEvent ) +{ + if ( theEvent->type() == QEvent::Show && theWatched->inherits( "SVTK_RenderWindowInteractor" ) ) { + SVTK_RenderWindowInteractor* anInteractor = (SVTK_RenderWindowInteractor*)theWatched; + if ( anInteractor->isVisible() ) { + doSetVisualParameters( myVisualParams ); + anInteractor->removeEventFilter( this ); // theWatched = RenderWindowInteractor + } + } + return SUIT_ViewWindow::eventFilter( theWatched, theEvent ); } diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index 0c1479a39..7a0808be5 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SVTK_VIEWWINDOW_H #define SVTK_VIEWWINDOW_H @@ -136,7 +136,7 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow bool isVisible(const Handle(SALOME_InteractiveObject)& theIObject); - /* selection */ + //! Redirect the request to #SVTK_View::FindIObject (to support old code) //---------------------------------------------------------------------------- Handle(SALOME_InteractiveObject) FindIObject(const char* theEntry); @@ -219,7 +219,7 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow //! Redirect the request to #SVTK_Renderer::SetTrihedronSize virtual void - SetTrihedronSize( const int ); + SetTrihedronSize( const int, const bool = true ); //! Redirect the request to #SVTK_Renderer::SetSelectionProp virtual @@ -242,6 +242,19 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001); + + //! Methods to save/restore visual parameters of a view (pan, zoom, etc.) + virtual + QString + getVisualParameters(); + + virtual + void + setVisualParameters( const QString& parameters ); + + virtual + bool + eventFilter( QObject*, QEvent* ); public slots: virtual @@ -326,12 +339,17 @@ protected: Initialize(SVTK_View* theView, SVTK_ViewModelBase* theModel); + void + doSetVisualParameters( const QString& ); + QImage dumpView(); - virtual void action( const int ); + virtual bool action( const int ); SVTK_View* myView; SVTK_MainWindow* myMainWindow; SVTK_ViewModelBase* myModel; + + QString myVisualParams; // used for delayed setting of view parameters }; extern "C" diff --git a/src/SVTK/resources/SVTK_msg_en.po b/src/SVTK/resources/SVTK_msg_en.po index eb7db7c20..1e28bfdbd 100755 --- a/src/SVTK/resources/SVTK_msg_en.po +++ b/src/SVTK/resources/SVTK_msg_en.po @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -131,9 +131,6 @@ msgstr "Cannot save file" msgid "ERROR" msgstr "Error" -msgid "BUT_OK" -msgstr "Ok" - msgid "SVTK_Viewer::MEN_DUMP_VIEW" msgstr "Dump view..." @@ -151,3 +148,130 @@ msgstr "Show/Hide trihedron" msgid "DSC_SHOW_TRIHEDRON" msgstr "Show/Hide trihedron in the current view" + +msgid "SVTK_NonIsometricDlg::MEN_SCALING" +msgstr "Scaling" + +msgid "SVTK_NonIsometricDlg::O&K" +msgstr "" + +msgid "SVTK_NonIsometricDlg::&Apply" +msgstr "" + +msgid "SVTK_NonIsometricDlg::&Cancel" +msgstr "" + +msgid "SVTK_NonIsometricDlg::&Reset" +msgstr "" + +msgid "SVTK_NonIsometricDlg::DLG_TITLE" +msgstr "Scaling" + +msgid "SVTK_NonIsometricDlg::LBL_X" +msgstr "X :" + +msgid "SVTK_NonIsometricDlg::LBL_Y" +msgstr "Y :" + +msgid "SVTK_NonIsometricDlg::LBL_Z" +msgstr "Z :" + +msgid "SVTK_MainWindow::MNU_SVTK_SCALING" +msgstr "Scaling" + +msgid "SVTK_MainWindow::DSC_SVTK_SCALING" +msgstr "Scaling" + +msgid "SVTK_FontWidget::ARIAL" +msgstr "Arial" + +msgid "SVTK_FontWidget::COURIER" +msgstr "Courier" + +msgid "SVTK_FontWidget::TIMES" +msgstr "Times" + +msgid "SVTK_FontWidget::BOLD" +msgstr "Bold" + +msgid "SVTK_FontWidget::ITALIC" +msgstr "Italic" + +msgid "SVTK_FontWidget::SHADOW" +msgstr "Shadow" + +msgid "SVTK_CubeAxesDlg::CAPTION" +msgstr "Graduated axes" + +msgid "SVTK_CubeAxesDlg::X_AXIS" +msgstr "X axis" + +msgid "SVTK_CubeAxesDlg::Y_AXIS" +msgstr "Y axis" + +msgid "SVTK_CubeAxesDlg::Z_AXIS" +msgstr "Z axis" + +msgid "SVTK_CubeAxesDlg::IS_VISIBLE" +msgstr "Is visible" + +msgid "SVTK_AxisWidget::AXIS_NAME" +msgstr "Axis name" + +msgid "SVTK_AxisWidget::IS_VISIBLE" +msgstr "Is visible" + +msgid "SVTK_AxisWidget::NAME" +msgstr "Name" + +msgid "SVTK_AxisWidget::FONT" +msgstr "Font" + +msgid "SVTK_AxisWidget::LABELS" +msgstr "Labels" + +msgid "SVTK_AxisWidget::NUMBER" +msgstr "Number" + +msgid "SVTK_AxisWidget::OFFSET" +msgstr "Offset" + +msgid "SVTK_AxisWidget::TICK_MARKS" +msgstr "Tick marks" + +msgid "SVTK_AxisWidget::LENGTH" +msgstr "Length" + +msgid "SVTK_MainWindow::MNU_SVTK_GRADUATED_AXES" +msgstr "Graduated axes" + +msgid "SVTK_MainWindow::DSC_SVTK_GRADUATED_AXES" +msgstr "Graduated axes" + +msgid "SVTK_MainWindow::MNU_SVTK_UPDATE_RATE" +msgstr "Update rate" + +msgid "SVTK_MainWindow::DSC_SVTK_UPDATE_RATE" +msgstr "Update rate" + +msgid "SVTK_UpdateRateDlg::DLG_TITLE" +msgstr "Update Rate" + +msgid "SVTK_UpdateRateDlg::INPUT_FRAME_TITLE" +msgstr "Enable" + +msgid "SVTK_UpdateRateDlg::DESIRED" +msgstr "Desired Update Rate, FPS" + +msgid "SVTK_UpdateRateDlg::STILL" +msgstr "Still Update Rate, FPS" + +msgid "SVTK_UpdateRateDlg::INFORMATION_FRAME_TITLE" +msgstr "Rendering Metrics" + +msgid "SVTK_UpdateRateDlg::CURRENT_FPS" +msgstr "Current Update Rate, FPS" + +msgid "SVTK_UpdateRateDlg::NUMBER_CELLS" +msgstr "Number of Cells, -" + diff --git a/src/SalomeApp/Makefile.in b/src/SalomeApp/Makefile.in index 308e5126b..ed377dfaf 100755 --- a/src/SalomeApp/Makefile.in +++ b/src/SalomeApp/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Vladimir Klyachin (OCN) # Module : SalomeApp @@ -25,7 +43,8 @@ EXPORT_HEADERS= SalomeApp.h \ SalomeApp_Filter.h \ SalomeApp_TypeFilter.h \ SalomeApp_StudyPropertiesDlg.h \ - SalomeApp_CheckFileDlg.h + SalomeApp_CheckFileDlg.h \ + SalomeApp_VisualState.h # .po files to transform in .qm PO_FILES = SalomeApp_images.po \ @@ -48,7 +67,8 @@ LIB_SRC= SalomeApp_Module.cxx \ SalomeApp_TypeFilter.cxx \ SalomeApp_StudyPropertiesDlg.cxx \ SalomeApp_ListView.cxx \ - SalomeApp_CheckFileDlg.cxx + SalomeApp_CheckFileDlg.cxx \ + SalomeApp_VisualState.cxx LIB_MOC = SalomeApp_Application.h \ SalomeApp_DataModel.h \ @@ -65,10 +85,10 @@ LIB_CLIENT_IDL = SALOMEDS.idl \ RESOURCES_FILES = SalomeApp.ini \ SalomeApp.xml -CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS) -LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lSalomePrs -L$(KERNEL_ROOT_DIR)/lib/salome -lOpUtil -lSALOMELocalTrace $(CAS_KERNEL) -lSPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPythonConsole -lLogWindow -lLightApp -lSalomeContainer -lToolsGUI +LIBS+= -lsuit -lstd -lCAM -lObjBrowser -lSalomePrs $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeDSClient $(CAS_KERNEL) -lSPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPythonConsole -lLogWindow -lLightApp -lSalomeContainer -lToolsGUI @CONCLUDE@ diff --git a/src/SalomeApp/SalomeApp.h b/src/SalomeApp/SalomeApp.h index d590d27a7..130299b08 100644 --- a/src/SalomeApp/SalomeApp.h +++ b/src/SalomeApp/SalomeApp.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp.h // Created: November, 2004 // Author: OCC team diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 5139ce4f2..5e73de8a6 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_Application.cxx // Created: 10/22/2004 3:23:45 PM // Author: Sergey LITONIN @@ -11,15 +29,15 @@ #include "SalomeApp_DataModel.h" #include "SalomeApp_DataObject.h" #include "SalomeApp_EventFilter.h" +#include "SalomeApp_VisualState.h" #include "SalomeApp_StudyPropertiesDlg.h" -#include "SalomeApp_CheckFileDlg.h" - #include "LightApp_Application.h" #include "LightApp_Preferences.h" #include "LightApp_WidgetContainer.h" #include "LightApp_SelectionMgr.h" +#include "LightApp_NameDlg.h" #include "STD_LoadStudiesDlg.h" @@ -48,9 +66,12 @@ #include #include #include +#include +#include +#include -#include "SALOMEDS_StudyManager.hxx" -#include "SALOMEDS_SObject.hxx" +#include "SALOMEDSClient_ClientFactory.hxx" +#include "SALOMEDSClient_IParameters.hxx" #include "SALOME_ListIteratorOfListIO.hxx" #include "SALOME_ListIO.hxx" @@ -58,17 +79,14 @@ #include "ToolsGUI_CatalogGeneratorDlg.h" #include "ToolsGUI_RegWidget.h" +#include + /*!Create new instance of SalomeApp_Application.*/ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication() { return new SalomeApp_Application(); } -/* - Class : SalomeApp_Application - Description : Application containing SalomeApp module or LightApp module -*/ - /*!Constructor.*/ SalomeApp_Application::SalomeApp_Application() : LightApp_Application() @@ -99,6 +117,12 @@ void SalomeApp_Application::createActions() SUIT_Desktop* desk = desktop(); + //! Save GUI state + // "Save GUI State" command is moved to VISU module + // createAction( SaveGUIStateId, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIconSet(), + // tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ), + // 0, desk, false, this, SLOT( onSaveGUIState() ) ); + //! Dump study createAction( DumpStudyId, tr( "TOT_DESK_FILE_DUMP_STUDY" ), QIconSet(), tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ), @@ -126,6 +150,10 @@ void SalomeApp_Application::createActions() int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); + // "Save GUI State" command is renamed to "Save VISU State" and + // creation of menu item is moved to VISU + // createMenu( SaveGUIStateId, fileMenu, 10, -1 ); + createMenu( DumpStudyId, fileMenu, 10, -1 ); createMenu( separator(), fileMenu, -1, 15, -1 ); createMenu( LoadScriptId, fileMenu, 10, -1 ); @@ -133,7 +161,7 @@ void SalomeApp_Application::createActions() createMenu( PropertiesId, fileMenu, 10, -1 ); createMenu( separator(), fileMenu, -1, 15, -1 ); - int toolsMenu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 50 ); + int toolsMenu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, MenuToolsId, 50 ); createMenu( CatalogGenId, toolsMenu, 10, -1 ); createMenu( RegDisplayId, toolsMenu, 10, -1 ); createMenu( separator(), toolsMenu, -1, 15, -1 ); @@ -327,6 +355,14 @@ void SalomeApp_Application::onPaste() _PTR(Study) stdDS = study->studyDS(); if(!stdDS) return; + if ( stdDS->GetProperties()->IsLocked() ) { + SUIT_MessageBox::warn1 ( desktop(), + QObject::tr("WRN_WARNING"), + QObject::tr("WRN_STUDY_LOCKED"), + QObject::tr("BUT_OK") ); + return; + } + SALOME_ListIteratorOfListIO it( list ); if(it.More()) { @@ -362,12 +398,8 @@ void SalomeApp_Application::onSelectionChanged() _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry()); if ( so ) { - SALOMEDS_SObject* aSO = dynamic_cast(so.get()); - - if ( aSO ) { canCopy = studyMgr()->CanCopy(so); canPaste = studyMgr()->CanPaste(so); - } } } } @@ -424,10 +456,9 @@ void SalomeApp_Application::onOpenWith() QApplication::restoreOverrideCursor(); } -//======================================================================= -// name : createNewStudy -/*! Purpose : Create new study*/ -//======================================================================= +/*! + Creates new study +*/ SUIT_Study* SalomeApp_Application::createNewStudy() { SalomeApp_Study* aStudy = new SalomeApp_Study( this ); @@ -441,10 +472,9 @@ SUIT_Study* SalomeApp_Application::createNewStudy() return aStudy; } -//======================================================================= -// name : updateCommandsStatus -/*! Purpose : Enable/Disable menu items and toolbar buttons. Rebuild menu*/ -//======================================================================= +/*! + Enable/Disable menu items and toolbar buttons. Rebuild menu +*/ void SalomeApp_Application::updateCommandsStatus() { LightApp_Application::updateCommandsStatus(); @@ -459,14 +489,41 @@ void SalomeApp_Application::updateCommandsStatus() if ( a ) a->setEnabled( activeStudy() ); + // Properties menu a = action( PropertiesId ); if( a ) a->setEnabled( activeStudy() ); + // Save GUI state menu + a = action( SaveGUIStateId ); + if( a ) + a->setEnabled( activeStudy() ); + // update state of Copy/Paste menu items onSelectionChanged(); } +/*! + \class DumpStudyFileDlg + Private class used in Dump Study operation. Consists 2 check boxes: + "Publish in study" and "Save GUI parameters" +*/ +class DumpStudyFileDlg : public SUIT_FileDlg +{ +public: + DumpStudyFileDlg( QWidget* parent ) : SUIT_FileDlg( parent, false, true, true ) + { + QHBox* hB = new QHBox( this ); + myPublishChk = new QCheckBox( tr("PUBLISH_IN_STUDY"), hB ); + mySaveGUIChk = new QCheckBox( tr("SAVE_GUI_STATE"), hB ); + QPushButton* pb = new QPushButton(this); + addWidgets( new QLabel("", this), hB, pb ); + pb->hide(); + } + QCheckBox* myPublishChk; + QCheckBox* mySaveGUIChk; +}; + /*!Private SLOT. On dump study.*/ void SalomeApp_Application::onDumpStudy( ) { @@ -477,23 +534,35 @@ void SalomeApp_Application::onDumpStudy( ) QStringList aFilters; aFilters.append( tr( "PYTHON_FILES_FILTER" ) ); - SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( desktop(), false, tr("PUBLISH_IN_STUDY"), true, true); + DumpStudyFileDlg* fd = new DumpStudyFileDlg( desktop() ); fd->setCaption( tr( "TOT_DESK_FILE_DUMP_STUDY" ) ); fd->setFilters( aFilters ); - fd->SetChecked(true); + fd->myPublishChk->setChecked( true ); + fd->mySaveGUIChk->setChecked( true ); fd->exec(); QString aFileName = fd->selectedFile(); - bool toPublish = fd->IsChecked(); + bool toPublish = fd->myPublishChk->isChecked(); + bool toSaveGUI = fd->mySaveGUIChk->isChecked(); delete fd; - if(!aFileName.isEmpty()) { + if ( !aFileName.isEmpty() ) { QFileInfo aFileInfo(aFileName); - bool res = aStudy->DumpStudy( aFileInfo.dirPath( true ).latin1(), aFileInfo.baseName().latin1(), toPublish ); + int savePoint; + _PTR(AttributeParameter) ap; + _PTR(IParameters) ip = ClientFactory::getIParameters(ap); + if(ip->isDumpPython(appStudy->studyDS())) ip->setDumpPython(appStudy->studyDS()); //Unset DumpPython flag. + if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method + ip->setDumpPython(appStudy->studyDS()); + savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point + } + bool res = aStudy->DumpStudy( aFileInfo.dirPath( true ).latin1(), aFileInfo.baseName().latin1(), toPublish); + if ( toSaveGUI ) + appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point. if ( !res ) - SUIT_MessageBox::warn1 ( desktop(), - QObject::tr("WRN_WARNING"), - tr("WRN_DUMP_STUDY_FAILED"), - QObject::tr("BUT_OK") ); + SUIT_MessageBox::warn1 ( desktop(), + QObject::tr("WRN_WARNING"), + tr("WRN_DUMP_STUDY_FAILED"), + QObject::tr("BUT_OK") ); } } @@ -529,6 +598,18 @@ void SalomeApp_Application::onLoadScript( ) } } +/*!Private SLOT. On save GUI state.*/ +void SalomeApp_Application::onSaveGUIState() +{ + SalomeApp_Study* study = dynamic_cast( activeStudy() ); + if ( study ) { + SalomeApp_VisualState( this ).storeState(); + updateSavePointDataObjects( study ); + objectBrowser()->updateTree( study->root() ); + } + updateActions(); +} + /*!Gets file filter. *\retval QString "(*.hdf)" */ @@ -589,6 +670,11 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref ) LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_%d", i ) ); } pref->setItemProperty( defCols, "columns", 1 ); + + // adding preference to LightApp_Application handled preferences.. a bit of hacking with resources.. + int genTab = pref->addPreference( LightApp_Application::tr( "PREF_TAB_GENERAL" ), salomeCat ); + int studyGroup = pref->addPreference( LightApp_Application::tr( "PREF_GROUP_STUDY" ), genTab ); + pref->addPreference( tr( "PREF_STORE_VISUAL_STATE" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_visual_state" ); } /*!Update desktop title.*/ @@ -630,8 +716,9 @@ CORBA::ORB_var SalomeApp_Application::orb() /*!Create and return SALOMEDS_StudyManager.*/ SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr() { - static SALOMEDSClient_StudyManager* _sm = new SALOMEDS_StudyManager(); - return _sm; + static _PTR(StudyManager) _sm; + if(!_sm) _sm = ClientFactory::StudyManager(); + return _sm.get(); } /*!Create and return SALOME_NamingService.*/ @@ -695,6 +782,15 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t LightApp_SelectionMgr* mgr = selectionMgr(); mgr->selectedObjects( aList, QString::null, false ); + // add GUI state commands: restore, rename + if ( aList.Extent() == 1 && aList.First()->hasEntry() && + QString( aList.First()->getEntry() ).startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) ) { + thePopup->insertSeparator(); + thePopup->insertItem( tr( "MEN_RESTORE_VS" ), this, SLOT( onRestoreGUIState() ) ); + thePopup->insertItem( tr( "MEN_RENAME_VS" ), this, SLOT( onRenameGUIState() ) ); + thePopup->insertItem( tr( "MEN_DELETE_VS" ), this, SLOT( onDeleteGUIState() ) ); + } + // "Delete reference" item should appear only for invalid references // isInvalidRefs will be true, if at least one of selected objects is invalid reference @@ -729,6 +825,10 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t if (aList.Extent() != 1) return; Handle(SALOME_InteractiveObject) aIObj = aList.First(); + // check if item is a "GUI state" item (also a first level object) + QString entry( aIObj->getEntry() ); + if ( entry.startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) ) + return; QString aModuleName(aIObj->getComponentDataType()); QString aModuleTitle = moduleTitle(aModuleName); CAM_Module* currentModule = activeModule(); @@ -740,7 +840,7 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t /*!Update obect browser: 1.if 'updateModels' true, update existing data models; 2. update "non-existing" (not loaded yet) data models; - 3. update object browser if it existing */ + 3. update object browser if it exists */ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) { // update "non-existing" (not loaded yet) data models @@ -767,14 +867,11 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) } } + // create data objects that correspond to GUI state save points + if ( study ) updateSavePointDataObjects( study ); + // update existing data models (already loaded SComponents) LightApp_Application::updateObjectBrowser( updateModels ); - -/* if ( objectBrowser() ) - { - objectBrowser()->updateGeometry(); - objectBrowser()->updateTree(); - }*/ } /*!Display Catalog Genenerator dialog */ @@ -836,3 +933,173 @@ void SalomeApp_Application::onDblClick( QListViewItem* it ) } } } + +/*! + Creates new view manager + \param type - type of view manager +*/ +SUIT_ViewManager* SalomeApp_Application::newViewManager(const QString& type) +{ + return createViewManager(type); +} + + +/*!Global utility funciton, returns selected GUI Save point object's ID */ +int getSelectedSavePoint( const LightApp_SelectionMgr* selMgr ) +{ + SALOME_ListIO aList; + selMgr->selectedObjects( aList ); + Handle(SALOME_InteractiveObject) aIObj = aList.First(); + QString entry( aIObj->getEntry() ); + QString startStr = QObject::tr( "SAVE_POINT_DEF_NAME" ); + if ( !entry.startsWith( startStr ) ) // it's a "GUI state" object + return -1; + bool ok; // conversion to integer is ok? + int savePoint = entry.right( entry.length() - startStr.length() ).toInt( &ok ); + return ok ? savePoint : -1; +} + +/*!Called on Restore GUI State popup command*/ +void SalomeApp_Application::onRestoreGUIState() +{ + int savePoint = ::getSelectedSavePoint( selectionMgr() ); + if ( savePoint == -1 ) + return; + SalomeApp_VisualState( this ).restoreState( savePoint ); +} + +/*!Called on Rename GUI State popup command*/ +void SalomeApp_Application::onRenameGUIState() +{ + int savePoint = ::getSelectedSavePoint( selectionMgr() ); + if ( savePoint == -1 ) + return; + SalomeApp_Study* study = dynamic_cast( activeStudy() ); + if ( !study ) + return; + + QString newName = LightApp_NameDlg::getName( desktop(), study->getNameOfSavePoint( savePoint ) ); + if ( !newName.isNull() && !newName.isEmpty() ) { + study->setNameOfSavePoint( savePoint, newName ); + updateSavePointDataObjects( study ); + objectBrowser()->updateTree( study->root() ); + } +} + + +/*!Called on Delete GUI State popup command*/ +void SalomeApp_Application::onDeleteGUIState() +{ + int savePoint = ::getSelectedSavePoint( selectionMgr() ); + if ( savePoint == -1 ) + return; + SalomeApp_Study* study = dynamic_cast( activeStudy() ); + if ( !study ) + return; + + study->removeSavePoint( savePoint ); + updateSavePointDataObjects( study ); +} + +/*!Called on Save study operation*/ +void SalomeApp_Application::onStudySaved( SUIT_Study* study ) +{ + LightApp_Application::onStudySaved( study ); + + if ( objectBrowser() ) { + updateSavePointDataObjects( dynamic_cast( study ) ); + objectBrowser()->updateTree( study->root() ); + } +} + +/*!Called on Open study operation*/ +void SalomeApp_Application::onStudyOpened( SUIT_Study* study ) +{ + LightApp_Application::onStudyOpened( study ); + + if ( objectBrowser() ) { + updateSavePointDataObjects( dynamic_cast( study ) ); + objectBrowser()->updateTree( study->root() ); + } +} + +/*! utility function. returns true if list view item that correspond to given SUIT_DataObject is open. + only first level items are traversed */ +bool isListViewItemOpen( QListView* lv, const SUIT_DataObject* dobj ) +{ + if ( !lv || !dobj ) + return false; + + QListViewItem* item = lv->firstChild(); + while ( item ) { + OB_ListItem* ob_item = dynamic_cast( item ); + if ( ob_item && ob_item->dataObject() == dobj ) + return ob_item->isOpen(); + item = item->nextSibling(); + } + return false; +} + +/*! updateSavePointDataObjects: syncronize data objects that correspond to save points (gui states)*/ +void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study ) +{ + OB_Browser* ob = objectBrowser(); + + if ( !study || !ob ) + return; + + // find GUI states root object + SUIT_DataObject* guiRootObj = 0; + DataObjectList ch; + study->root()->children( ch ); + DataObjectList::const_iterator it = ch.begin(), last = ch.end(); + for ( ; it != last ; ++it ) { + if ( dynamic_cast( *it ) ) { + guiRootObj = *it; + break; + } + } + std::vector savePoints = study->getSavePoints(); + // case 1: no more save points but they existed in study's tree + if ( savePoints.empty() && guiRootObj ) { + delete guiRootObj; + return; + } + // case 2: no more save points but root does not exist either + if ( savePoints.empty() && !guiRootObj ) + return; + // case 3: save points but no root for them - create it + if ( !savePoints.empty() && !guiRootObj ) + guiRootObj = new SalomeApp_SavePointRootObject( study->root() ); + // case 4: everything already exists.. here may be a problem: we want "GUI states" root object + // to be always the last one in the tree. Here we check - if it is not the last one - remove and + // re-create it. + if ( guiRootObj->nextBrother() ) { + study->root()->removeChild(guiRootObj); + study->root()->appendChild(guiRootObj); + //study->root()->dump(); + } + + // store data objects in a map id-to-DataObject + QMap mapDO; + ch.clear(); + guiRootObj->children( ch ); + for( it = ch.begin(), last = ch.end(); it != last ; ++it ) { + SalomeApp_SavePointObject* dobj = dynamic_cast( *it ); + if ( dobj ) + mapDO[dobj->getId()] = dobj; + } + + // iterate new save points. if DataObject with such ID not found in map - create DataObject + // if in the map - remove it from map. + for ( int i = 0; i < savePoints.size(); i++ ) + if ( !mapDO.contains( savePoints[i] ) ) + new SalomeApp_SavePointObject( guiRootObj, savePoints[i], study ); + else + mapDO.remove( savePoints[i] ); + + // delete DataObjects that are still in the map -- their IDs were not found in data model + for ( QMap::Iterator it = mapDO.begin(); it != mapDO.end(); ++it ) + delete it.data(); +} + diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 0a60577e6..9adf31b66 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_Application.h // Created: 10/22/2004 3:37:25 PM // Author: Sergey LITONIN @@ -27,6 +45,7 @@ class QDockWindow; class LightApp_Preferences; class SalomeApp_Module; +class SalomeApp_Study; class SALOME_LifeCycleCORBA; @@ -37,7 +56,8 @@ class QListViewItem; #endif /*! - Description : Application containing SalomeApp module or LightApp module + \class SalomeApp_Application + \brief Application containing SalomeApp module or LightApp module */ class SALOMEAPP_EXPORT SalomeApp_Application : public LightApp_Application @@ -45,8 +65,9 @@ class SALOMEAPP_EXPORT SalomeApp_Application : public LightApp_Application Q_OBJECT public: + enum { MenuToolsId = 5 }; enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId, - CatalogGenId, RegDisplayId, UserID }; + CatalogGenId, RegDisplayId, SaveGUIStateId, UserID }; public: SalomeApp_Application(); @@ -66,12 +87,20 @@ public: static SALOME_LifeCycleCORBA* lcc(); static QString defaultEngineIOR(); + SUIT_ViewManager* newViewManager(const QString&); + void updateSavePointDataObjects( SalomeApp_Study* ); + public slots: virtual bool onOpenDoc( const QString& ); virtual void onLoadDoc(); virtual bool onLoadDoc( const QString& ); virtual void onCopy(); virtual void onPaste(); + void onSaveGUIState();// called from VISU + +protected slots: + void onStudySaved( SUIT_Study* ); + void onStudyOpened( SUIT_Study* ); protected: virtual void createActions(); @@ -91,6 +120,10 @@ private slots: void onDumpStudy(); void onLoadScript(); + void onDeleteGUIState(); + void onRestoreGUIState(); + void onRenameGUIState(); + void onCatalogGen(); void onRegDisplay(); void onOpenWith(); diff --git a/src/SalomeApp/SalomeApp_CheckFileDlg.cxx b/src/SalomeApp/SalomeApp_CheckFileDlg.cxx index 370526ff8..a62a33d47 100644 --- a/src/SalomeApp/SalomeApp_CheckFileDlg.cxx +++ b/src/SalomeApp/SalomeApp_CheckFileDlg.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_CheckFileDlg.h" diff --git a/src/SalomeApp/SalomeApp_CheckFileDlg.h b/src/SalomeApp/SalomeApp_CheckFileDlg.h index 98989a70d..53e56683c 100644 --- a/src/SalomeApp/SalomeApp_CheckFileDlg.h +++ b/src/SalomeApp/SalomeApp_CheckFileDlg.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_CHECKFILEDIALOG_H #define SALOMEAPP_CHECKFILEDIALOG_H diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 3b11eb669..6c7129543 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_DataModel.cxx // Created: 10/25/2004 10:36:06 AM // Author: Sergey LITONIN @@ -23,16 +41,13 @@ #include #include CORBA_SERVER_HEADER(SALOME_Exception) -#include "SALOMEDS_Tool.hxx" - -//======================================================================= -// name : SalomeApp_DataModelSync -/*!Purpose : Auxiliary class for synchronizing tree of kernel objects and SUIT_DataObjects */ -//======================================================================= - typedef _PTR(SObject) kerPtr; typedef SUIT_DataObject* suitPtr; +/*! + \class SalomeApp_DataModelSync + Auxiliary class for synchronizing tree of kernel objects and SUIT_DataObjects +*/ class SalomeApp_DataModelSync { public: @@ -54,25 +69,37 @@ private: SUIT_DataObject* myRoot; }; - +/*! + Constructor +*/ SalomeApp_DataModelSync::SalomeApp_DataModelSync( _PTR( Study ) aStudy, SUIT_DataObject* aRoot ) : myStudy( aStudy ), myRoot( aRoot ) { } +/*! + \return true if kernel object is correct (has non empty name or is reference) +*/ bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const { kerPtr refObj; - QString name( so->GetName().c_str() ); + QString name = so->GetName().c_str(); bool res = so && ( so->GetName().size() || so->ReferencedObject( refObj ) ); return res; } +/*! + Creates SUIT object by KERNEL object + \param so - corresponding KERNEL object + \param parent - parent for SUIT object + \param after - previous sibling for SUIT object + \param prepend - SUIT object must be added to start of children list +*/ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so, const suitPtr& parent, const suitPtr& after, - const bool asFirst ) const + const bool prepend ) const { if( !isCorrect( so ) ) return 0; @@ -91,15 +118,19 @@ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so, else parent->appendChild( nitem ); } - else if( asFirst ) + else if( prepend ) parent->insertChild( nitem, 0 ); - else + else // append parent->appendChild( nitem ); else if( myRoot ) myRoot->appendChild( nitem ); return nitem; } +/*! + Deletes object with all children + \param p - SUIT object +*/ void SalomeApp_DataModelSync::deleteItemWithChildren( const suitPtr& p ) const { if( !p ) @@ -113,22 +144,43 @@ void SalomeApp_DataModelSync::deleteItemWithChildren( const suitPtr& p ) const delete p; } +/*! + \return true if objects correspond each other at all + \param p - kernel object + \param q - suit object +*/ bool SalomeApp_DataModelSync::isEqual( const kerPtr& p, const suitPtr& q ) const { - LightApp_DataObject* obj = dynamic_cast( q ); - return ( !p && !q ) || ( obj && isCorrect( p ) && QString( p->GetID().c_str() ) == obj->entry() ); + LightApp_ModuleObject* lobj = dynamic_cast( q ); + SalomeApp_DataObject* sobj = dynamic_cast( q ); + _PTR( SComponent ) aComp( p ); + bool res = ( !p && !q ) || + ( lobj && !sobj && aComp ) || + ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() ); + return res; } +/*! + \return null kernel object +*/ kerPtr SalomeApp_DataModelSync::nullSrc() const { return kerPtr(); } +/*! + \return null suit object +*/ suitPtr SalomeApp_DataModelSync::nullTrg() const { return suitPtr( 0 ); } +/*! + Fills list with children of kernel object + \param obj - kernel object + \param ch - list to be filled +*/ void SalomeApp_DataModelSync::children( const kerPtr& obj, QValueList& ch ) const { ch.clear(); @@ -137,6 +189,11 @@ void SalomeApp_DataModelSync::children( const kerPtr& obj, QValueList& c ch.append( it->Value() ); } +/*! + Fills list with children of SUIT object + \param p - SUIT object + \param ch - list to be filled +*/ void SalomeApp_DataModelSync::children( const suitPtr& p, QValueList& ch ) const { DataObjectList l; @@ -149,15 +206,26 @@ void SalomeApp_DataModelSync::children( const suitPtr& p, QValueList& c } } +/*! + \return parent of SUIT object + \param p - SUIT object +*/ suitPtr SalomeApp_DataModelSync::parent( const suitPtr& p ) const { return p ? p->parent(): 0; } +/*! + Updates SUIT object + \param p - SUIT object +*/ void SalomeApp_DataModelSync::updateItem( const suitPtr& ) const { } +/*! + Auxiliary function, shows SUIT tree +*/ void showTree( SUIT_DataObject* root ) { qDebug( root ? "" : "" ); @@ -173,27 +241,24 @@ void showTree( SUIT_DataObject* root ) } } -//======================================================================= -// name : SalomeApp_DataModel::SalomeApp_DataModel -/*!Purpose : Constructor*/ -//======================================================================= +/*! + Constructor +*/ SalomeApp_DataModel::SalomeApp_DataModel( CAM_Module* theModule ) : LightApp_DataModel( theModule ) { } -//======================================================================= -// name : SalomeApp_DataModel::~SalomeApp_DataModel -/*! Purpose : Destructor*/ -//======================================================================= +/*! + Destructor +*/ SalomeApp_DataModel::~SalomeApp_DataModel() { } -//================================================================ -// Function : open -/*! Purpose : Open data model*/ -//================================================================ +/*! + Opens data model +*/ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringList ) { SalomeApp_Study* aDoc = dynamic_cast( study ); @@ -214,20 +279,18 @@ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringLi return true; } -//================================================================ -// Function : create -/*! Purpose : Create data model*/ -//================================================================ +/*! + Creates data model +*/ bool SalomeApp_DataModel::create( CAM_Study* theStudy ) { update(NULL, (LightApp_Study*)theStudy); return true; } -//================================================================ -// Function : update -/*! Purpose : Update application.*/ -//================================================================ +/*! + Updates application. +*/ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) { SalomeApp_Study* aSStudy = dynamic_cast(study); @@ -261,10 +324,9 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) updateTree( sobj, aSStudy ); } -//================================================================ -// Function : synchronize -/*! Purpose : synchronizes kernel tree and suit data tree starting from component 'sobj' */ -//================================================================ +/*! + Synchronizes kernel tree and suit data tree starting from component 'sobj' +*/ SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SComponent )& sobj, SalomeApp_Study* study ) { if( !study || !study->root() || !sobj ) @@ -272,11 +334,11 @@ SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SComponent )& sob DataObjectList ch; study->root()->children( ch ); DataObjectList::const_iterator anIt = ch.begin(), aLast = ch.end(); - SalomeApp_DataObject* suitObj = 0; + SUIT_DataObject* suitObj = 0; for( ; anIt!=aLast; anIt++ ) { - SalomeApp_DataObject* dobj = dynamic_cast( *anIt ); - if( dobj && dobj->name()==sobj->GetName().c_str() ) + LightApp_DataObject* dobj = dynamic_cast( *anIt ); + if( dobj && dobj->name() == sobj->GetName().c_str() ) { suitObj = dobj; break; @@ -285,37 +347,15 @@ SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SComponent )& sob SalomeApp_DataModelSync sync( study->studyDS(), study->root() ); - // QString srcName = sobj ? sobj->GetName().c_str() : ""; - // QString trgName = ( suitObj && !suitObj->name().isNull() ) ? suitObj->name() : ""; - // printf( "--- SalomeApp_DataModel::syncronize() calls synchronize()_1: src = %s, trg = %s ---\n", srcName.latin1(), trgName.latin1() ); - - SUIT_DataObject* o = ::synchronize( sobj, suitObj, sync ); -// showTree( o ); - return o; -} - -//================================================================ -// Function : synchronize -/*! Purpose : synchronizes kernel tree and suit data tree starting from 'sobj' and 'obj' correspondly */ -//================================================================ -SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SObject )& sobj, SUIT_DataObject* obj, - SalomeApp_Study* study ) -{ - if( !study ) + if( !suitObj || dynamic_cast( suitObj ) ) + return ::synchronize( sobj, suitObj, sync ); + else return 0; - SalomeApp_DataModelSync sync( study->studyDS(), study->root() ); - - // QString srcName = sobj ? sobj->GetName().c_str() : ""; - // QString trgName = ( obj && !obj->name().isNull() ) ? obj->name() : ""; - // printf( "--- SalomeApp_DataModel::syncronize() calls synchronize()_2: src = s, trg = %s ---\n", srcName.latin1(), trgName.latin1() ); - - return ::synchronize( sobj, obj, sync ); } -//================================================================ -// Function : updateTree -/*! Purpose : updates tree.*/ -//================================================================ +/*! + Updates tree. +*/ void SalomeApp_DataModel::updateTree( const _PTR( SComponent )& comp, SalomeApp_Study* study ) { SalomeApp_ModuleObject* aNewRoot = dynamic_cast( synchronize( comp, study ) ); @@ -326,20 +366,17 @@ void SalomeApp_DataModel::updateTree( const _PTR( SComponent )& comp, SalomeApp_ } } -//================================================================ -// Function : getModule -/*! Purpose : gets module*/ -//================================================================ - +/*! + \return module +*/ SalomeApp_Module* SalomeApp_DataModel::getModule() const { return dynamic_cast( module() ); } -//================================================================ -// Function : getStudy -/*! Purpose : gets study */ -//================================================================ +/*! + \return study +*/ SalomeApp_Study* SalomeApp_DataModel::getStudy() const { if(!root()) return 0; @@ -352,10 +389,9 @@ SalomeApp_Study* SalomeApp_DataModel::getStudy() const return aStudy; } -//================================================================ -// Function : getRootEntry -/*! Purpose : returns study entry corresponding to this data model*/ -//================================================================ +/*! + \return study entry corresponding to this data model +*/ QString SalomeApp_DataModel::getRootEntry( SalomeApp_Study* study ) const { QString anEntry; diff --git a/src/SalomeApp/SalomeApp_DataModel.h b/src/SalomeApp/SalomeApp_DataModel.h index 62e649bc3..9c2bff16a 100644 --- a/src/SalomeApp/SalomeApp_DataModel.h +++ b/src/SalomeApp/SalomeApp_DataModel.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_DataModel.h // Created: 10/25/2004 10:32:33 AM // Author: Sergey LITONIN @@ -27,10 +45,9 @@ class SALOMEAPP_EXPORT SalomeApp_DataModel : public LightApp_DataModel public: static SUIT_DataObject* synchronize( const _PTR( SComponent )&, SalomeApp_Study* ); - static SUIT_DataObject* synchronize( const _PTR( SObject )&, SUIT_DataObject*, SalomeApp_Study* ); - SalomeApp_DataModel ( CAM_Module* theModule ); - virtual ~SalomeApp_DataModel(); + SalomeApp_DataModel ( CAM_Module* theModule ); + virtual ~SalomeApp_DataModel(); virtual bool open( const QString&, CAM_Study*, QStringList ); virtual bool create( CAM_Study* ); diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index ef7b8df7b..d3a4b5c9d 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -14,13 +14,15 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_DataObject.h" #include "SalomeApp_Study.h" #include "LightApp_RootObject.h" +#include + #include #include #include @@ -33,10 +35,6 @@ #include #include -/* - Class: SalomeApp_DataObject - Level: Public -*/ /*!Constructor. Initialize by \a parent*/ SalomeApp_DataObject::SalomeApp_DataObject( SUIT_DataObject* parent ) : LightApp_DataObject( parent ), @@ -331,10 +329,9 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const return val; } -/* - Class: SalomeApp_ModuleObject - Level: Public -*/ + + + /*!Constructor.Initialize by \a parent.*/ SalomeApp_ModuleObject::SalomeApp_ModuleObject( SUIT_DataObject* parent ) @@ -371,3 +368,50 @@ QString SalomeApp_ModuleObject::name() const return SalomeApp_DataObject::name(); } + + + +/*!Constructor.Initialize by \a parent.*/ +SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* _parent, const int id, SalomeApp_Study* study ) + : LightApp_DataObject( _parent ), CAM_DataObject( _parent ), // IMPORTANT TO CALL ALL VIRTUAL CONSTRUCTORS! + myId( id ), + myStudy( study ) +{ +} + +/*!Destructor. Do nothing.*/ +SalomeApp_SavePointObject::~SalomeApp_SavePointObject() +{ +} + +/*!Returns save points ID */ +int SalomeApp_SavePointObject::getId() const +{ + return myId; +} + +/*!Returns "invalid" entry, which does not correspond to any object in data structure + but indicates that it is a save point object */ +QString SalomeApp_SavePointObject::entry() const +{ + return QObject::tr( "SAVE_POINT_DEF_NAME" ) + QString::number( myId ); +} + +/*!Returns displayed name of object */ +QString SalomeApp_SavePointObject::name() const +{ + return myStudy->getNameOfSavePoint( myId ); +} + +/*!Gets icon picture of object.*/ +QPixmap SalomeApp_SavePointObject::icon() const +{ + return QPixmap(); +} + +/*!Gets tooltip.*/ +QString SalomeApp_SavePointObject::toolTip() const +{ + return QObject::tr( "SAVE_POINT_OBJECT_TOOLTIP" ).arg( name() ); +} + diff --git a/src/SalomeApp/SalomeApp_DataObject.h b/src/SalomeApp/SalomeApp_DataObject.h index 15a1d96bf..7f3ae993d 100644 --- a/src/SalomeApp/SalomeApp_DataObject.h +++ b/src/SalomeApp/SalomeApp_DataObject.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_DATAOBJECT_H #define SALOMEAPP_DATAOBJECT_H @@ -82,7 +82,45 @@ public: SalomeApp_ModuleObject( CAM_DataModel*, const _PTR(SObject)&, SUIT_DataObject* = 0 ); virtual ~SalomeApp_ModuleObject(); - virtual QString name() const; + virtual QString name() const; +}; + +/*! + * SalomeApp_SavePointObject - class that represents persistent visual_state object + * these objects are stored in data model, but NOT in SObjects structure, so we + * must handle them separately using this special class for them + */ + +class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject +{ +public: + SalomeApp_SavePointObject( SUIT_DataObject* parent, const int, SalomeApp_Study* study ); + virtual ~SalomeApp_SavePointObject(); + + virtual QString entry() const; + + virtual QString name() const; + virtual QPixmap icon() const; + virtual QString toolTip() const; + + int getId() const; + +private: + int myId; + SalomeApp_Study* myStudy; +}; + +/*! + * SalomeApp_SavePointRootObject - class that represents parent object for visual_state objects + */ + +class SALOMEAPP_EXPORT SalomeApp_SavePointRootObject : public SUIT_DataObject +{ +public: + SalomeApp_SavePointRootObject( SUIT_DataObject* parent ) : SUIT_DataObject( parent ) {} + + virtual QString name() const { return QObject::tr( "SAVE_POINT_ROOT_NAME" ); } + virtual QString toolTip() const{ return QObject::tr( "SAVE_POINT_ROOT_TOOLTIP" ); } }; #endif diff --git a/src/SalomeApp/SalomeApp_Displayer.cxx b/src/SalomeApp/SalomeApp_Displayer.cxx index 6e2caeda2..55ac92ba5 100644 --- a/src/SalomeApp/SalomeApp_Displayer.cxx +++ b/src/SalomeApp/SalomeApp_Displayer.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_Displayer.h" @@ -30,14 +30,26 @@ #include +/*! + Default constructor +*/ SalomeApp_Displayer::SalomeApp_Displayer() { } +/*! + Destructor +*/ SalomeApp_Displayer::~SalomeApp_Displayer() { } +/*! + Displays object in view + \param entry - object entry + \param updateViewer - is it necessary to update viewer + \param theViewFrame - view +*/ void SalomeApp_Displayer::Display( const QString& entry, const bool updateViewer, SALOME_View* theViewFrame ) { SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); @@ -59,6 +71,11 @@ void SalomeApp_Displayer::Display( const QString& entry, const bool updateViewer } } +/*! + Redisplays object in view + \param entry - object entry + \param updateViewer - is it necessary to update viewer +*/ void SalomeApp_Displayer::Redisplay( const QString& entry, const bool updateViewer ) { // Remove the object permanently ( == true) @@ -89,6 +106,13 @@ void SalomeApp_Displayer::Redisplay( const QString& entry, const bool updateView } } +/*! + Erases object in view + \param entry - object entry + \param forced - deletes object from viewer (otherwise it will be erased, but cached) + \param updateViewer - is it necessary to update viewer + \param theViewFrame - view +*/ void SalomeApp_Displayer::Erase( const QString& entry, const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) { @@ -105,6 +129,12 @@ void SalomeApp_Displayer::Erase( const QString& entry, const bool forced, } } +/*! + Erases all objects in view + \param forced - deletes objects from viewer + \param updateViewer - is it necessary to update viewer + \param theViewFrame - view +*/ void SalomeApp_Displayer::EraseAll( const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) const { SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); @@ -116,6 +146,11 @@ void SalomeApp_Displayer::EraseAll( const bool forced, const bool updateViewer, } } +/*! + \return true if object is displayed in viewer + \param entry - object entry + \param theViewFrame - view +*/ bool SalomeApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theViewFrame ) const { SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); @@ -129,6 +164,9 @@ bool SalomeApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theVie return false; } +/*! + Updates active view +*/ void SalomeApp_Displayer::UpdateViewer() const { SALOME_View* vf = GetActiveView(); @@ -136,6 +174,12 @@ void SalomeApp_Displayer::UpdateViewer() const vf->Repaint(); } +/*! + \return presentation of object, built with help of CreatePrs method + \param entry - object entry + \param theViewFrame - view + \sa CreatePrs() +*/ SALOME_Prs* SalomeApp_Displayer::buildPresentation( const QString& entry, SALOME_View* theViewFrame ) { SALOME_Prs* prs = 0; @@ -148,6 +192,9 @@ SALOME_Prs* SalomeApp_Displayer::buildPresentation( const QString& entry, SALOME return prs; } +/*! + \return active view +*/ SALOME_View* SalomeApp_Displayer::GetActiveView() { SUIT_Session* session = SUIT_Session::session(); diff --git a/src/SalomeApp/SalomeApp_Displayer.h b/src/SalomeApp/SalomeApp_Displayer.h index 25ba911e2..db5319392 100644 --- a/src/SalomeApp/SalomeApp_Displayer.h +++ b/src/SalomeApp/SalomeApp_Displayer.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_DISPLAYER_HEADER diff --git a/src/SalomeApp/SalomeApp_EventFilter.cxx b/src/SalomeApp/SalomeApp_EventFilter.cxx index 0db6f5fe3..493d690c8 100755 --- a/src/SalomeApp/SalomeApp_EventFilter.cxx +++ b/src/SalomeApp/SalomeApp_EventFilter.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_EventFilter.h" @@ -38,6 +38,9 @@ SalomeApp_EventFilter::~SalomeApp_EventFilter() qApp->removeEventFilter( this ); } +/*! + Custom event filter +*/ bool SalomeApp_EventFilter::eventFilter( QObject* o, QEvent* e ) { if ( e->type() == SALOME_EVENT ) diff --git a/src/SalomeApp/SalomeApp_EventFilter.h b/src/SalomeApp/SalomeApp_EventFilter.h index 1411a3f5e..e8849e231 100755 --- a/src/SalomeApp/SalomeApp_EventFilter.h +++ b/src/SalomeApp/SalomeApp_EventFilter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_EVENTFILTER_H #define SALOMEAPP_EVENTFILTER_H diff --git a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx index 3791d4d98..b22ab38d8 100644 --- a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx +++ b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx @@ -14,25 +14,18 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_ExceptionHandler.h" +#include "CASCatch.hxx" #include -#include -#include - #include #include #include -#include -#include -#include - - /*!Constructor. Initialize by \a floatSignal.*/ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal ) : SUIT_ExceptionHandler() @@ -43,32 +36,17 @@ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal ) /*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/ bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e ) { - - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - - CASCatch_TRY { SUIT_ExceptionHandler::internalHandle( o, e ); } - CASCatch_CATCH(CASCatch_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); - throw std::runtime_error( aFail->GetError() ); + CASCatch_CATCH(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + throw Standard_Failure( aFail->GetMessageString() ); } - aCatchSignals.Deactivate(); return true; } -#ifdef try -#undef try -#endif - -#ifdef catch -#undef catch -#endif - /*!Try to call handleSignals( o, e ), catch and show error message.*/ bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e ) { @@ -99,5 +77,17 @@ bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e ) /*!Create new SUIT_ExceptionHandler*/ extern "C" SALOMEAPP_EXPORT SUIT_ExceptionHandler* getExceptionHandler() { - return new SalomeApp_ExceptionHandler( true ); + // MSV 2006-04-26: work around PAL12004 "VTK window => SIGFPE Arithmetic Exception Detected" + // We disable FPE signal as it was in earlier versions of SALOME. It is enabled + // only in debug mode if the environment variable DISABLE_FPE is not set to 1. + bool raiseFPE; +#ifdef _DEBUG_ + raiseFPE = true; + char* envDisableFPE = getenv("DISABLE_FPE"); + if (envDisableFPE && atoi(envDisableFPE)) + raiseFPE = false; +#else + raiseFPE = false; +#endif + return new SalomeApp_ExceptionHandler( raiseFPE ); } diff --git a/src/SalomeApp/SalomeApp_ExceptionHandler.h b/src/SalomeApp/SalomeApp_ExceptionHandler.h index 823c3e530..4a4c0bdab 100644 --- a/src/SalomeApp/SalomeApp_ExceptionHandler.h +++ b/src/SalomeApp/SalomeApp_ExceptionHandler.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_EXCEPTIONHANDLER_H #define SALOMEAPP_EXCEPTIONHANDLER_H diff --git a/src/SalomeApp/SalomeApp_Filter.cxx b/src/SalomeApp/SalomeApp_Filter.cxx index 98f9a1a74..b3214ba00 100644 --- a/src/SalomeApp/SalomeApp_Filter.cxx +++ b/src/SalomeApp/SalomeApp_Filter.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_Filter.h" diff --git a/src/SalomeApp/SalomeApp_Filter.h b/src/SalomeApp/SalomeApp_Filter.h index e8afc8014..8de24ccdd 100644 --- a/src/SalomeApp/SalomeApp_Filter.h +++ b/src/SalomeApp/SalomeApp_Filter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_FILTER_H #define SALOMEAPP_FILTER_H diff --git a/src/SalomeApp/SalomeApp_ImportOperation.cxx b/src/SalomeApp/SalomeApp_ImportOperation.cxx index 5543f903f..5d19bf6f0 100644 --- a/src/SalomeApp/SalomeApp_ImportOperation.cxx +++ b/src/SalomeApp/SalomeApp_ImportOperation.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SalomeApp/SalomeApp_ImportOperation.h b/src/SalomeApp/SalomeApp_ImportOperation.h index 0cf83bb16..56b895584 100644 --- a/src/SalomeApp/SalomeApp_ImportOperation.h +++ b/src/SalomeApp/SalomeApp_ImportOperation.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SalomeApp/SalomeApp_ListView.cxx b/src/SalomeApp/SalomeApp_ListView.cxx index 6f3bd20e1..e2c354eaa 100644 --- a/src/SalomeApp/SalomeApp_ListView.cxx +++ b/src/SalomeApp/SalomeApp_ListView.cxx @@ -1,8 +1,22 @@ -// SALOME SalomeApp +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// Copyright (C) 2005 CEA/DEN, EDF R&D +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// SALOME SalomeApp // // File : SalomeApp_ListView.cxx // Author : Vadim SANDLER @@ -27,14 +41,9 @@ using namespace std; -////////////////////////////////////////////////////////////////////// -// SalomeApp_ListView class implementation -////////////////////////////////////////////////////////////////////// - -//================================================================ -// Function : computeEditGeometry -/*! Purpose : static function - used for resizing editing widget*/ -//================================================================ +/*! + Used for resizing editing widget +*/ void computeEditGeometry(SalomeApp_ListViewItem* theItem, SalomeApp_EntityEdit* theWidget) { @@ -61,10 +70,9 @@ void computeEditGeometry(SalomeApp_ListViewItem* theItem, theWidget->setGeometry(aX, aY, aW, aH); } -//================================================================ -// Function : SalomeApp_ListView::SalomeApp_ListView -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListView::SalomeApp_ListView( QWidget* parent ) : QtxListView( parent ) { @@ -88,10 +96,9 @@ SalomeApp_ListView::SalomeApp_ListView( QWidget* parent ) this, SLOT(onHeaderSizeChange(int, int, int))); } -//================================================================ -// Function : SalomeApp_ListView::~SalomeApp_ListView -/*! Purpose : destructor*/ -//================================================================ +/*! + Destructor +*/ SalomeApp_ListView::~SalomeApp_ListView() { if (myEdit) { @@ -101,10 +108,9 @@ SalomeApp_ListView::~SalomeApp_ListView() myEditedItem = 0; } -//================================================================ -// Function : SalomeApp_ListView::updateViewer -/*! Purpose : updates all data viewer*/ -//================================================================ +/*! + Updates all data viewer +*/ void SalomeApp_ListView::updateViewer() { // temporary disconnecting selection changed SIGNAL @@ -118,10 +124,9 @@ void SalomeApp_ListView::updateViewer() emit selectionChanged(); } -//================================================================ -// Function : SalomeApp_ListView::updateSelected -/*! Purpose : updates currently selected item(s)*/ -//================================================================ +/*! + Updates currently selected item(s) +*/ void SalomeApp_ListView::updateSelected() { // temporary disconnecting selection changed SIGNAL @@ -135,19 +140,17 @@ void SalomeApp_ListView::updateSelected() emit selectionChanged(); } -//================================================================ -// Function : SalomeApp_ListView::popupClientType -/*! Purpose : returns popup client type*/ -//================================================================ +/*! + Returns popup client type +*/ QString SalomeApp_ListView::popupClientType() const { return "SalomeApp_ListView"; } -//================================================================ -// Function : SalomeApp_ListView::contextMenuPopup -/*! Purpose : fills popup menu with items*/ -//================================================================ +/*! + Fills popup menu with items +*/ void SalomeApp_ListView::contextMenuPopup( QPopupMenu* aPopup ) { if (aPopup) { @@ -155,10 +158,9 @@ void SalomeApp_ListView::contextMenuPopup( QPopupMenu* aPopup ) } } -//================================================================ -// Function : SalomeApp_ListView::clear -/*! Purpose : clears view*/ -//================================================================ +/*! + Clears view +*/ void SalomeApp_ListView::clear() { if (myEdit) { @@ -169,28 +171,25 @@ void SalomeApp_ListView::clear() QListView::clear(); } -//================================================================ -// Function : SalomeApp_ListView::isMouseEnabled -/*! Purpose : returms true if mouse events are enabled*/ -//================================================================ +/*! + \return true if mouse events are enabled +*/ bool SalomeApp_ListView::isMouseEnabled() { return myMouseEnabled; } -//================================================================ -// Function : SalomeApp_ListView::enableMouse -// Purpose : enabled/disables mouse events (excluding MouseMove) -//================================================================ +/*! + Enables/disables mouse events (excluding MouseMove) +*/ void SalomeApp_ListView::enableMouse(bool enable) { myMouseEnabled = enable; } -//================================================================ -// Function : SalomeApp_ListView::eventFilter -/*! Purpose : event filter*/ -//================================================================ +/*! + Event filter +*/ bool SalomeApp_ListView::eventFilter(QObject* object, QEvent* event) { if (object == viewport() && @@ -203,10 +202,9 @@ bool SalomeApp_ListView::eventFilter(QObject* object, QEvent* event) return QListView::eventFilter(object, event); } -//================================================================ -// Function : SalomeApp_ListView::enableEditing -/*! Purpose : setting editing of items availbale/not available*/ -//================================================================ +/*! + Setting editing of items availbale/not available +*/ void SalomeApp_ListView::enableEditing(bool theFlag) { myEditingEnabled = theFlag; @@ -219,28 +217,25 @@ void SalomeApp_ListView::enableEditing(bool theFlag) } } -//================================================================ -// Function : SalomeApp_ListView::isEnableEditing -/*! Purpose : says if editing is enabled*/ -//================================================================ +/*! + Says if editing is enabled +*/ bool SalomeApp_ListView::isEnableEditing() { return myEditingEnabled; } -//================================================================ -// Function : SalomeApp_ListView::accept -/*! Purpose : calls finishEditing(true)...*/ -//================================================================ +/*! + Calls finishEditing(true)... +*/ void SalomeApp_ListView::accept() { finishEditing(true); } -//================================================================ -// Function : QAD_ListView::onSelectionChanged -/*! Purpose : slot, called when selection changed in List Viewer*/ -//================================================================ +/*! + Slot, called when selection changed in List Viewer +*/ void SalomeApp_ListView::onSelectionChanged() { if (myEdit) { @@ -271,10 +266,9 @@ void SalomeApp_ListView::onSelectionChanged() } } -//================================================================ -// Function : SalomeApp_ListView::resizeEvent -/*! Purpose : called when Data Viewer is resized*/ -//================================================================ +/*! + Called when Data Viewer is resized +*/ void SalomeApp_ListView::resizeEvent( QResizeEvent * e) { QListView::resizeEvent(e); @@ -285,10 +279,9 @@ void SalomeApp_ListView::resizeEvent( QResizeEvent * e) updateContents(); } -//================================================================ -// Function : SalomeApp_ListView::onHeaderSizeChange -/*! Purpose : slot, called when columns sizes are changed*/ -//================================================================ +/*! + Slot, called when columns sizes are changed +*/ void SalomeApp_ListView::onHeaderSizeChange(int, int, int) { int aW = columnWidth(columns()-1); @@ -297,10 +290,9 @@ void SalomeApp_ListView::onHeaderSizeChange(int, int, int) setColumnWidth(columns()-1, width() - frameWidth() * 2 - aX - 1); } -//================================================================ -// Function : SalomeApp_ListView::viewportPaintEvent -/*! Purpose : handler for paint event*/ -//================================================================ +/*! + Handler for paint event +*/ void SalomeApp_ListView::viewportPaintEvent(QPaintEvent* e) { QListView::viewportPaintEvent(e); @@ -309,28 +301,25 @@ void SalomeApp_ListView::viewportPaintEvent(QPaintEvent* e) } } -//================================================================ -// Function : SalomeApp_ListView::onEditOk -/*! Purpose : called when user finishes in editing of item*/ -//================================================================ +/*! + Called when user finishes in editing of item +*/ void SalomeApp_ListView::onEditOk() { finishEditing(true); } -//================================================================ -// Function : SalomeApp_ListView::onEditCancel -/*! Purpose : called when user cancels item editing*/ -//================================================================ +/*! + Called when user cancels item editing +*/ void SalomeApp_ListView::onEditCancel() { finishEditing(false); } -//================================================================ -// Function : SalomeApp_ListView::finishEditing -/*! Purpose : finishes editing of entity*/ -//================================================================ +/*! + Finishes editing of entity +*/ UpdateType SalomeApp_ListView::finishEditing(bool ok) { UpdateType aNeedsUpdate = utCancel; @@ -392,12 +381,10 @@ UpdateType SalomeApp_ListView::finishEditing(bool ok) return aNeedsUpdate; } -//================================================================ -// Function : SalomeApp_ListView::tip -/*! Purpose : gets current tooltip for list view - * \retval valid rect in success - */ -//================================================================ +/*! + \return current tooltip for list view + \retval valid rect in success +*/ QRect SalomeApp_ListView::tip(QPoint aPos, QString& aText, QRect& dspRect, @@ -429,24 +416,18 @@ QRect SalomeApp_ListView::tip(QPoint aPos, return result; } -////////////////////////////////////////////////////////////////////// -// SalomeApp_ListViewItem Class Implementation -////////////////////////////////////////////////////////////////////// - -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent) : QListViewItem( parent ) { init(); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, SalomeApp_ListViewItem* after) : QListViewItem( parent, after ) @@ -454,10 +435,9 @@ QListViewItem( parent, after ) init(); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, const QString& theName, const bool theEditable) : @@ -467,10 +447,9 @@ QListViewItem(parent, theName) setEditable(theEditable); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, const QString& theName, const QString& theValue, @@ -481,10 +460,9 @@ QListViewItem(parent, theName, theValue) setEditable(theEditable); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, const QString& theName, const bool theEditable) : @@ -494,10 +472,9 @@ QListViewItem(parent, theName) setEditable(theEditable); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, SalomeApp_ListViewItem* after, const QString& theName, @@ -508,10 +485,9 @@ QListViewItem(parent, after, theName) setEditable(theEditable); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, SalomeApp_ListViewItem* after, const QString& theName, @@ -523,10 +499,9 @@ QListViewItem(parent, after, theName) } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, const QString& theName, const QString& theValue, @@ -538,10 +513,9 @@ QListViewItem(parent, theName, theValue) } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, SalomeApp_ListViewItem* after, const QString& theName, @@ -553,10 +527,9 @@ QListViewItem(parent, after, theName, theValue) setEditable(theEditable); } -//================================================================ -// Function : SalomeApp_ListViewItem::SalomeApp_ListViewItem -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, SalomeApp_ListViewItem* after, const QString& theName, @@ -568,18 +541,16 @@ QListViewItem(parent, after, theName, theValue) setEditable(theEditable); } -//================================================================ -// Function : SalomeApp_ListViewItem::~SalomeApp_ListViewItem -/*! Purpose : destructor*/ -//================================================================ +/*! + Destructor +*/ SalomeApp_ListViewItem::~SalomeApp_ListViewItem() { } -//================================================================ -// Function : SalomeApp_ListViewItem::init -/*! Purpose : initialization*/ -//================================================================ +/*! + Initialization +*/ void SalomeApp_ListViewItem::init() { myEditable = false; @@ -590,19 +561,17 @@ void SalomeApp_ListViewItem::init() myUserType = -1; } -//================================================================ -// Function : SalomeApp_ListViewItem::getName -/*! Purpose : as default returns text in the first column*/ -//================================================================ +/*! + \return text in the first column +*/ QString SalomeApp_ListViewItem::getName() const { return ( listView()->columns() > 0 ) ? text(0) : QString(""); } -//================================================================ -// Function : SalomeApp_ListViewItem::setName -/*! Purpose : as default sets text in the first column*/ -//================================================================ +/*! + Sets text in the first column +*/ UpdateType SalomeApp_ListViewItem::setName(const QString& theName) { UpdateType aNeedsUpdate = utCancel; @@ -613,19 +582,17 @@ UpdateType SalomeApp_ListViewItem::setName(const QString& theName) return aNeedsUpdate; } -//================================================================ -// Function : SalomeApp_ListViewItem::getValue -/*! Purpose : as default returns text in the second column*/ -//================================================================ +/*! + \return text in the second column +*/ QString SalomeApp_ListViewItem::getValue() const { return ( listView()->columns() > 1 ) ? text(1) : QString(""); } -//================================================================ -// Function : SalomeApp_ListViewItem::setValue -/*! Purpose : as default sets text in the second column*/ -//================================================================ +/*! + Sets text in the second column +*/ UpdateType SalomeApp_ListViewItem::setValue(const QString& theValue) { UpdateType aNeedsUpdate = utCancel; @@ -636,10 +603,9 @@ UpdateType SalomeApp_ListViewItem::setValue(const QString& theValue) return aNeedsUpdate; } -//================================================================ -// Function : SalomeApp_ListViewItem::fullName -/*! Purpose : returns full path to the entity from the root*/ -//================================================================ +/*! + \return full path to the entity from the root +*/ QString SalomeApp_ListViewItem::fullName() { QString aFullName = getName(); @@ -651,10 +617,9 @@ QString SalomeApp_ListViewItem::fullName() return aFullName; } -//================================================================ -// Function : SalomeApp_ListViewItem::openAllLevels -/*! Purpose : expands all entities beginning from this level*/ -//================================================================ +/*! + expands all entities beginning from this level +*/ void SalomeApp_ListViewItem::openAllLevels() { setOpen(true); @@ -665,10 +630,9 @@ void SalomeApp_ListViewItem::openAllLevels() } } -//================================================================ -// Function : SalomeApp_ListViewItem::updateAllLevels -/*! Purpose : update all entites beginning from this level*/ -//================================================================ +/*! + update all entites beginning from this level +*/ void SalomeApp_ListViewItem::updateAllLevels() { SalomeApp_ListViewItem* aChild = (SalomeApp_ListViewItem*)firstChild(); @@ -678,145 +642,121 @@ void SalomeApp_ListViewItem::updateAllLevels() } } -//================================================================ -// Function : SalomeApp_EditBox::isEditable -/*! Purpose : return true if entity is editable*/ -//================================================================ +/*! + \return true if entity is editable +*/ bool SalomeApp_ListViewItem::isEditable() const { return myEditable; } -//================================================================ -// Function : SalomeApp_ListViewItem::setEditable -/*! Purpose : sets editable flag fo the entity*/ -//================================================================ +/*! + Sets editable flag fo the entity +*/ void SalomeApp_ListViewItem::setEditable(bool theEditable) { myEditable = theEditable; } -//================================================================ -// Function : SalomeApp_ListViewItem::isAccepted -/*! Purpose : returns true if entitiy is accepted after editing*/ -//================================================================ +/*! + \return true if entitiy is accepted after editing +*/ bool SalomeApp_ListViewItem::isAccepted() const { return myAccepted; } -//================================================================ -// Function : SalomeApp_ListViewItem::setAccepted -/*! Purpose : set entitiy accepted or not after editing*/ -//================================================================ +/*! + Sets entitiy accepted or not after editing +*/ void SalomeApp_ListViewItem::setAccepted(bool theAccepted) { myAccepted = theAccepted; } -//================================================================ -// Function : SalomeApp_ListViewItem::getEditingType -/*! Purpose : - * \retval type of edit control (default is edit box) - * \li 0 - edit box - * \li 1 - combo box - * \li 2 - editable combo box - */ -//================================================================ +/*! + \retval type of edit control (default is edit box) + \li 0 - edit box + \li 1 - combo box + \li 2 - editable combo box +*/ int SalomeApp_ListViewItem::getEditingType() { return myEditingType; } -//================================================================ -// Function : SalomeApp_ListViewItem::setEditingType -/*! Purpose : - * \retval type of edit control (negative value means none) - * \li 0 - edit box - * \li 1 - combo box - * \li 2 - editable combo box - */ -//================================================================ +/*! + \retval type of edit control (negative value means none) + \li 0 - edit box + \li 1 - combo box + \li 2 - editable combo box +*/ void SalomeApp_ListViewItem::setEditingType(const int type) { myEditingType = type; } -//================================================================ -// Function : SalomeApp_ListViewItem::getEditedColumn -// Purpose : /*! \retval edited column, default is last column - * negative value means there are no editable columns - */ -//================================================================ + negative value means there are no editable columns +*/ int SalomeApp_ListViewItem::getEditedColumn() { return listView()->columns()-1; } -//================================================================ -// Function : SalomeApp_ListViewItem::getValueType -// Purpose : -/*!\retval type of edited value (string, int, double) - * default is string - */ -//================================================================ +/*! + \retval type of edited value (string, int, double) + default is string +*/ int SalomeApp_ListViewItem::getValueType() { return myValueType; } -//================================================================ -// Function : SalomeApp_ListViewItem::setValueType -/*! Purpose : sets type of edited value*/ -//================================================================ +/*! + Sets type of edited value +*/ void SalomeApp_ListViewItem::setValueType(const int valueType) { myValueType = valueType; } -//================================================================ -// Function : SalomeApp_ListViewItem::getUserType -/*! Purpose : sets type of edited value*/ -//================================================================ +/*! + Sets type of edited value +*/ int SalomeApp_ListViewItem::getUserType() { return myUserType; } -//================================================================ -// Function : SalomeApp_ListViewItem::setUserType -/*! Purpose : sets type of edited value*/ -//================================================================ +/*! + Sets type of edited value +*/ void SalomeApp_ListViewItem::setUserType(const int userType) { myUserType = userType; } -//================================================================ -// Function : SalomeApp_ListViewItem::getButtons -/*! Purpose : returns buttons for editing widget (Apply (V), Cancel (X)) - * default is both buttons - */ -//================================================================ +/*! + \return buttons for editing widget (Apply (V), Cancel (X)) + default is both buttons +*/ int SalomeApp_ListViewItem::getButtons() { return myButtons; } -//================================================================ -// Function : SalomeApp_ListViewItem::getButtons -/*! Purpose : sets buttons for editing widget (Apply (V), Cancel (X))*/ -//================================================================ +/*! + Sets buttons for editing widget (Apply (V), Cancel (X)) +*/ void SalomeApp_ListViewItem::setButtons(const int buttons) { myButtons = buttons; } -//================================================================ -// Function : SalomeApp_ListViewItem::startEditing -/*! Purpose : creates control for editing and fills it with values*/ -//================================================================ +/*! + Creates control for editing and fills it with values +*/ SalomeApp_EntityEdit* SalomeApp_ListViewItem::startEditing() { SalomeApp_EntityEdit* aWidget = 0; @@ -842,10 +782,9 @@ SalomeApp_EntityEdit* SalomeApp_ListViewItem::startEditing() return aWidget; } -//================================================================ -// Function : SalomeApp_ListViewItem::fillWidgetWithValues -/*! Purpose : fills widget with initial values (list or single value)*/ -//================================================================ +/*! + Fills widget with initial values (list or single value) +*/ void SalomeApp_ListViewItem::fillWidgetWithValues(SalomeApp_EntityEdit* theWidget) { int anEditColumn = getEditedColumn(); @@ -853,10 +792,9 @@ void SalomeApp_ListViewItem::fillWidgetWithValues(SalomeApp_EntityEdit* theWidge theWidget->insertItem(text(anEditColumn), true); } -//================================================================ -// Function : SalomeApp_ListViewItem::finishEditing -/*! Purpose : finishes editing of entity*/ -//================================================================ +/*! + Finishes editing of entity +*/ UpdateType SalomeApp_ListViewItem::finishEditing(SalomeApp_EntityEdit* theWidget) { UpdateType aNeedsUpdate = utCancel; @@ -881,10 +819,9 @@ UpdateType SalomeApp_ListViewItem::finishEditing(SalomeApp_EntityEdit* theWidget return aNeedsUpdate; } -//================================================================ -// Function : SalomeApp_ListViewItem::tipRect -/*! Purpose : calculates rectangle which should contain item's tip*/ -//================================================================ +/*! + Calculates rectangle which should contain item's tip +*/ QRect SalomeApp_ListViewItem::tipRect() { QRect aRect = QRect(-1, -1, -1, -1); @@ -906,10 +843,9 @@ QRect SalomeApp_ListViewItem::tipRect() return aRect; } -//================================================================ -// Function : SalomeApp_ListViewItem::tipText -/*! Purpose : returns text for tooltip*/ -//================================================================ +/*! + \return text for tooltip +*/ QString SalomeApp_ListViewItem::tipText() { QString aText = getName(); @@ -918,10 +854,9 @@ QString SalomeApp_ListViewItem::tipText() return aText; } -//================================================================ -// Function : SalomeApp_ListViewItem::textRect -/*! Purpose : calculates rect of item text in viewport coordinates*/ -//================================================================ +/*! + Calculates rect of item text in viewport coordinates +*/ QRect SalomeApp_ListViewItem::textRect(const int column) const { QRect aItemRect = listView()->itemRect( this ); @@ -956,10 +891,9 @@ QRect SalomeApp_ListViewItem::textRect(const int column) const return theResult; } -//================================================================ -// Function : SalomeApp_ListViewItem::itemRect -/*! Purpose : calculates rect of item data in viewport coordinates*/ -//================================================================ +/*! + Calculates rect of item data in viewport coordinates +*/ QRect SalomeApp_ListViewItem::itemRect(const int column) const { QRect aItemRect = listView()->itemRect( this ); @@ -991,23 +925,17 @@ QRect SalomeApp_ListViewItem::itemRect(const int column) const return theResult; } -////////////////////////////////////////////////////////////////////// -// SalomeApp_EditBox class implementation -////////////////////////////////////////////////////////////////////// - -//================================================================ -// Function : SalomeApp_EditBox::SalomeApp_EditBox -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_EditBox::SalomeApp_EditBox(QWidget* parent) : QLineEdit(parent) { } -//================================================================ -// Function : SalomeApp_EditBox::keyPressEvent -/*! Purpose : event filter for key pressing*/ -//================================================================ +/*! + Event filter for key pressing +*/ void SalomeApp_EditBox::keyPressEvent( QKeyEvent *e ) { if ( e->key() == Key_Escape ) @@ -1017,23 +945,18 @@ void SalomeApp_EditBox::keyPressEvent( QKeyEvent *e ) e->accept(); } -////////////////////////////////////////////////////////////////////// -// SalomeApp_ComboBox class implementation -////////////////////////////////////////////////////////////////////// -//================================================================ -// Function : SalomeApp_ComboBox::SalomeApp_ComboBox -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_ComboBox::SalomeApp_ComboBox(bool rw, QWidget* parent, const char* name) : QComboBox(rw, parent, name) { } -//================================================================ -// Function : SalomeApp_ComboBox::findItem -/*! Purpose : searches item in list and returns its index*/ -//================================================================ +/*! + Searches item in list and returns its index +*/ int SalomeApp_ComboBox::findItem(const QString& theText) { for (int i = 0; i < count(); i++) @@ -1042,10 +965,9 @@ int SalomeApp_ComboBox::findItem(const QString& theText) return -1; } -//================================================================ -// Function : SalomeApp_ComboBox::insertItem -/*! Purpose : adds item in combo box*/ -//================================================================ +/*! + Adds item in combo box +*/ void SalomeApp_ComboBox::insertItem(const QString& theValue, int theIndex) { @@ -1053,20 +975,18 @@ void SalomeApp_ComboBox::insertItem(const QString& theValue, QComboBox::insertItem(theValue, theIndex); } -//================================================================ -// Function : SalomeApp_ComboBox::insertList -/*! Purpose : adds list of items in combo box*/ -//================================================================ +/*! + Adds list of items in combo box +*/ void SalomeApp_ComboBox::insertList(const QStringList& theList) { for (unsigned i = 0; i < theList.count(); i++) insertItem(theList[i]); } -//================================================================ -// Function : SalomeApp_ComboBox::insertItem -/*! Purpose : adds item in combo box*/ -//================================================================ +/*! + Adds item in combo box +*/ void SalomeApp_ComboBox::insertItem(const int theValue) { int aNum; @@ -1083,20 +1003,18 @@ void SalomeApp_ComboBox::insertItem(const int theValue) insertItem(QString::number(theValue)); } -//================================================================ -// Function : SalomeApp_ComboBox::insertList -/*! Purpose : adds list of items in combo box*/ -//================================================================ +/*! + Adds list of items in combo box +*/ void SalomeApp_ComboBox::insertList(const TColStd_ListOfInteger& theList) { for (TColStd_ListIteratorOfListOfInteger aIter(theList); aIter.More(); aIter.Next()) insertItem(aIter.Value()); } -//================================================================ -// Function : SalomeApp_ComboBox::insertItem -/*! Purpose : adds item in combo box*/ -//================================================================ +/*! + Adds item in combo box +*/ void SalomeApp_ComboBox::insertItem(const double theValue) { double aNum; @@ -1113,29 +1031,23 @@ void SalomeApp_ComboBox::insertItem(const double theValue) insertItem(QString::number(theValue)); } -//================================================================ -// Function : SalomeApp_ComboBox::insertList -/*! Purpose : adds list of items in combo box*/ -//================================================================ +/*! + Adds list of items in combo box +*/ void SalomeApp_ComboBox::insertList(const TColStd_ListOfReal& theList) { for (TColStd_ListIteratorOfListOfReal aIter(theList); aIter.More(); aIter.Next()) insertItem(aIter.Value()); } -////////////////////////////////////////////////////////////////////// -// SalomeApp_EntityEdit class implementation -////////////////////////////////////////////////////////////////////// - #include #define MIN_COMBO_WIDTH 1 #define MIN_EDIT_WIDTH 1 -//================================================================ -// Function : SalomeApp_EntityEdit::SalomeApp_EntityEdit -/*! Purpose : constructor*/ -//================================================================ +/*! + Constructor +*/ SalomeApp_EntityEdit::SalomeApp_EntityEdit(QWidget* parent, int controlType, int valueType, @@ -1224,18 +1136,16 @@ myCancelBtn(0) } } -//================================================================ -// Function : SalomeApp_EntityEdit::~SalomeApp_EntityEdit -/*! Purpose : destructor*/ -//================================================================ +/*! + Destructor +*/ SalomeApp_EntityEdit::~SalomeApp_EntityEdit() { } -//================================================================ -// Function : SalomeApp_EntityEdit::clear -/*! Purpose : clears edit/combo box*/ -//================================================================ +/*! + Clears edit/combo box +*/ void SalomeApp_EntityEdit::clear() { if (myEdit) @@ -1244,10 +1154,9 @@ void SalomeApp_EntityEdit::clear() myCombo->clear(); } -//================================================================ -// Function : SalomeApp_EntityEdit::getText -/*! Purpose : returns current text in edit box or combo box*/ -//================================================================ +/*! + \return current text in edit box or combo box +*/ QString SalomeApp_EntityEdit::getText() { if (myEdit) @@ -1258,10 +1167,9 @@ QString SalomeApp_EntityEdit::getText() return ""; } -//================================================================ -// Function : SalomeApp_EntityEdit::setText -/*! Purpose : sets text*/ -//================================================================ +/*! + Sets text +*/ void SalomeApp_EntityEdit::setText(const QString& theText) { myString = theText; @@ -1276,12 +1184,9 @@ void SalomeApp_EntityEdit::setText(const QString& theText) } } -//================================================================ -// Function : SalomeApp_EntityEdit::insertItem -/*! Purpose : adds item in combo box, - * sets it current if theSetCurrent is true - */ -//================================================================ +/*! + Adds item in combo box, sets it current if theSetCurrent is true +*/ void SalomeApp_EntityEdit::insertItem(const QString& theValue, bool theSetCurrent, int theOrder) @@ -1302,12 +1207,9 @@ void SalomeApp_EntityEdit::insertItem(const QString& theValue, setText(theValue); } -//================================================================ -// Function : SalomeApp_EntityEdit::insertList -/*! Purpose : adds items in combo box, - * sets item theCurrent as current - */ -//================================================================ +/*! + Adds items in combo box, sets item theCurrent as current +*/ void SalomeApp_EntityEdit::insertList(const QStringList& theList, const int theCurrent) { @@ -1317,12 +1219,9 @@ void SalomeApp_EntityEdit::insertList(const QStringList& theList, setText(theList[theCurrent]); } -//================================================================ -// Function : SalomeApp_EntityEdit::insertItem -/*! Purpose : adds item in combo box, - * sets it current if theSetCurrent is true - */ -//================================================================ +/*! + Adds item in combo box, sets it current if theSetCurrent is true +*/ void SalomeApp_EntityEdit::insertItem(const int theValue, bool theSetCurrent) { @@ -1333,12 +1232,9 @@ void SalomeApp_EntityEdit::insertItem(const int theValue, setText(QString::number(theValue)); } -//================================================================ -// Function : SalomeApp_EntityEdit::insertList -/*! Purpose : adds items in combo box, - * sets item theCurrent as current - */ -//================================================================ +/*! + Adds items in combo box, sets item theCurrent as current +*/ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList, const int theCurrent) { @@ -1354,11 +1250,9 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList, } } -//================================================================ -// Function : SalomeApp_EntityEdit::insertItem -// Purpose : adds item in combo box, -// sets it current if theSetCurrent is true -//================================================================ +/*! + Adds item in combo box, sets it current if theSetCurrent is true +*/ void SalomeApp_EntityEdit::insertItem(const double theValue, bool theSetCurrent) { @@ -1369,12 +1263,9 @@ void SalomeApp_EntityEdit::insertItem(const double theValue, setText(QString::number(theValue)); } -//================================================================ -// Function : SalomeApp_EntityEdit::insertList -/*! Purpose : adds items in combo box, - * sets item theCurrent as current - */ -//================================================================ +/*! + Adds items in combo box, sets item theCurrent as current +*/ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList, const int theCurrent) { @@ -1390,10 +1281,9 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList, } } -//================================================================ -// Function : SalomeApp_EntityEdit::getControl -/*! Purpose : gets actual widget*/ -//================================================================ +/*! + \return actual widget +*/ QWidget* SalomeApp_EntityEdit::getControl() { if (myEdit) @@ -1404,10 +1294,9 @@ QWidget* SalomeApp_EntityEdit::getControl() return 0; } -//================================================================ -// Function : SalomeApp_EntityEdit::setFocus -/*! Purpose : redirect focus to corresponding widget*/ -//================================================================ +/*! + redirect focus to corresponding widget +*/ void SalomeApp_EntityEdit::setFocus() { if (myEdit) { @@ -1420,10 +1309,9 @@ void SalomeApp_EntityEdit::setFocus() } } -//================================================================ -// Function : SalomeApp_EntityEdit::setValidator -/*! Purpose : sets validator for the control*/ -//================================================================ +/*! + Sets validator for the control +*/ void SalomeApp_EntityEdit::setValidator(const QValidator* theValidator) { if (myEdit) @@ -1432,10 +1320,9 @@ void SalomeApp_EntityEdit::setValidator(const QValidator* theValidator) myCombo->setValidator(theValidator); } -//================================================================ -// Function : SalomeApp_EntityEdit::keyPressEvent -/*! Purpose : event filter for KeyPress event*/ -//================================================================ +/*! + Event filter for KeyPress event +*/ void SalomeApp_EntityEdit::keyPressEvent( QKeyEvent * e) { if ( (e->key() == Key_Enter || @@ -1445,19 +1332,17 @@ void SalomeApp_EntityEdit::keyPressEvent( QKeyEvent * e) onCancel(); } -//================================================================ -// Function : SalomeApp_EntityEdit::onComboActivated -/*! Purpose : called when item activated in combo box*/ -//================================================================ +/*! + Called when item activated in combo box +*/ void SalomeApp_EntityEdit::onComboActivated(const QString& theText) { onTextChanged(theText); } -//================================================================ -// Function : SalomeApp_EntityEdit::onTextChanged -/*! Purpose : slot, called when text changed in line edit*/ -//================================================================ +/*! + Slot, called when text changed in line edit +*/ void SalomeApp_EntityEdit::onTextChanged(const QString& theText) { if (myApplyBtn) @@ -1466,10 +1351,9 @@ void SalomeApp_EntityEdit::onTextChanged(const QString& theText) myCancelBtn->setEnabled(!(theText == myString)); } -//================================================================ -// Function : SalomeApp_EntityEdit::onCancel -/*! Purpose : slot, called when user presses Cancel button*/ -//================================================================ +/*! + Slot, called when user presses Cancel button +*/ void SalomeApp_EntityEdit::onCancel() { setText(myString); @@ -1480,10 +1364,9 @@ void SalomeApp_EntityEdit::onCancel() emit escapePressed(); } -//================================================================ -// Function : SalomeApp_EntityEdit::onApply -/*! Purpose : slot, called when user presses Apply button*/ -//================================================================ +/*! + Slot, called when user presses Apply button +*/ void SalomeApp_EntityEdit::onApply() { myString = getText(); @@ -1494,10 +1377,9 @@ void SalomeApp_EntityEdit::onApply() emit returnPressed(); } -//================================================================ -// Function : SalomeApp_EntityEdit::showButtons -/*! Purpose : shows/hides buttons*/ -//================================================================ +/*! + Shows/hides buttons +*/ void SalomeApp_EntityEdit::showButtons(bool show) { if (myApplyBtn) @@ -1506,10 +1388,9 @@ void SalomeApp_EntityEdit::showButtons(bool show) show ? myCancelBtn->show() : myCancelBtn->hide(); } -//================================================================ -// Function : SalomeApp_EntityEdit::setDuplicatesEnabled -/*! Purpose : enables/disables data duplication (for combo box)*/ -//================================================================ +/*! + Enables/disables data duplication (for combo box) +*/ void SalomeApp_EntityEdit::setDuplicatesEnabled(bool enabled) { if (myCombo) diff --git a/src/SalomeApp/SalomeApp_ListView.h b/src/SalomeApp/SalomeApp_ListView.h index e7b7552cf..3fa857bb0 100644 --- a/src/SalomeApp/SalomeApp_ListView.h +++ b/src/SalomeApp/SalomeApp_ListView.h @@ -1,13 +1,26 @@ -// SALOME SalomeApp +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// Copyright (C) 2005 CEA/DEN, EDF R&D +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// SALOME SalomeApp // // File : SalomeApp_ListView.h // Author : Vadim SANDLER // Module : SALOME -// $Header$ #ifndef SALOMEAPP_LISTVIEW_H #define SALOMEAPP_LISTVIEW_H @@ -44,10 +57,10 @@ enum UpdateType { class SalomeApp_ListViewItem; class SalomeApp_EntityEdit; -//================================================================ -// Class : SalomeApp_ListView -// Description : parent class for Data Viewer and Properties Viewer -//================================================================ +/*! + \class SalomeApp_ListView + parent class for Data Viewer and Properties Viewer +*/ class SalomeApp_ListView : public QtxListView , public SUIT_PopupClient { Q_OBJECT diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 9284a5792..332441a65 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_Module.cxx // Created: 10/25/2004 11:39:56 AM // Author: Sergey LITONIN @@ -11,6 +29,7 @@ #include "LightApp_Selection.h" #include "LightApp_Operation.h" #include "LightApp_Preferences.h" +//#include "LightApp_Displayer.h" #include "CAM_DataModel.h" @@ -19,12 +38,22 @@ #include #include #include +//#include #include +#include + +#include +//#include +//#include +//#include #include #include +//#include +//#include + /*!Constructor.*/ SalomeApp_Module::SalomeApp_Module( const QString& name ) : LightApp_Module( name ) @@ -54,6 +83,12 @@ LightApp_Selection* SalomeApp_Module::createSelection() const return LightApp_Module::createSelection(); } +/*! + Converts objects-containers to list of objects, those are contained + Other objects must be added without conversion + \param source - source list of objects + \param dest - list of converted objects +*/ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_ListIO& dest ) const { SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); @@ -97,3 +132,24 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li dest.Append( obj ); } } + +/*! + * \brief Virtual public + * + * This method is called just before the study document is saved, so the module has a possibility + * to store visual parameters in AttributeParameter attribue(s) + */ +void SalomeApp_Module::storeVisualParameters(int savePoint) +{ +} + +/*! + * \brief Virtual public + * + * This method is called after the study document is opened, so the module has a possibility to restore + * visual parameters + */ +void SalomeApp_Module::restoreVisualParameters(int savePoint) +{ +} + diff --git a/src/SalomeApp/SalomeApp_Module.h b/src/SalomeApp/SalomeApp_Module.h index 433d918fd..07f4c0620 100644 --- a/src/SalomeApp/SalomeApp_Module.h +++ b/src/SalomeApp/SalomeApp_Module.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_Module.h // Created: 10/25/2004 11:33:06 AM // Author: Sergey LITONIN @@ -10,8 +28,6 @@ #include -#include - class CAM_DataModel; class SalomeApp_Application; class LightApp_Operation; @@ -41,6 +57,9 @@ public: SalomeApp_Application* getApp() const; + virtual void storeVisualParameters(int savePoint); + virtual void restoreVisualParameters(int savePoint); + protected: virtual CAM_DataModel* createDataModel(); virtual LightApp_Selection* createSelection() const; diff --git a/src/SalomeApp/SalomeApp_PyInterp.cxx b/src/SalomeApp/SalomeApp_PyInterp.cxx index 19bc57559..67606feae 100755 --- a/src/SalomeApp/SalomeApp_PyInterp.cxx +++ b/src/SalomeApp/SalomeApp_PyInterp.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -108,12 +108,12 @@ bool SalomeApp_PyInterp::initContext() return true; } +/*! + Do nothing + The initialization has been done in main + */ void SalomeApp_PyInterp::init_python() { - /* - * Do nothing - * The initialization has been done in main - */ MESSAGE("PyInterp_base::init_python"); ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main SCRUTE(KERNEL_PYTHON::_gtstate); diff --git a/src/SalomeApp/SalomeApp_PyInterp.h b/src/SalomeApp/SalomeApp_PyInterp.h index a15b3767f..a0db6377f 100755 --- a/src/SalomeApp/SalomeApp_PyInterp.h +++ b/src/SalomeApp/SalomeApp_PyInterp.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 6b72dd880..e227a58e8 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_Study.h" @@ -23,6 +23,7 @@ #include "SalomeApp_DataObject.h" #include "SalomeApp_Application.h" #include "SalomeApp_Engine_i.hxx" +#include "SalomeApp_VisualState.h" #include "LightApp_RootObject.h" @@ -31,16 +32,29 @@ #include #include +#include +#include #include "utilities.h" +#include #include #include +#include + +#include +#include + +#include "SALOMEDS_Tool.hxx" + +#include "SALOMEDSClient_ClientFactory.hxx" +#include "SALOMEDSClient_IParameters.hxx" + #include #include CORBA_SERVER_HEADER(SALOME_Exception) -#include "SALOMEDS_Tool.hxx" +using namespace std; /*! Constructor. @@ -99,10 +113,10 @@ void SalomeApp_Study::createDocument() emit created( this ); } -//======================================================================= -// name : openDocument -/*! Purpose : Open document*/ -//======================================================================= +/*! + Opens document + \param theFileName - name of file +*/ bool SalomeApp_Study::openDocument( const QString& theFileName ) { MESSAGE( "openDocument" ); @@ -131,13 +145,21 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) emit opened( this ); study->IsSaved(true); + + bool restore = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true ); + if ( restore ) { + std::vector savePoints = getSavePoints(); + if ( savePoints.size() > 0 ) + SalomeApp_VisualState( (SalomeApp_Application*)application() ).restoreState( savePoints[savePoints.size()-1] ); + } + return res; } -//======================================================================= -// name : loadDocument -/*! Purpose : Connects GUI study to SALOMEDS one already loaded into StudyManager*/ -//======================================================================= +/*! + Connects GUI study to SALOMEDS one already loaded into StudyManager + \param theStudyName - name of study +*/ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) { MESSAGE( "loadDocument" ); @@ -168,17 +190,28 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) bool res = CAM_Study::openDocument( theStudyName ); emit opened( this ); + bool restore = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true ); + if ( restore ) { + std::vector savePoints = getSavePoints(); + if ( savePoints.size() > 0 ) + SalomeApp_VisualState( (SalomeApp_Application*)application() ).restoreState( savePoints[savePoints.size()-1] ); + } + //SRN: BugID IPAL9021: End return res; } -//======================================================================= -// name : saveDocumentAs -/*! Purpose : Save document*/ -//======================================================================= +/*! + Saves document + \param theFileName - name of file +*/ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) { + bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true ); + if ( store ) + SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState(); + ModelList list; dataModels( list ); SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)list.first(); @@ -195,13 +228,14 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) if( !resMgr ) return false; - bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ), - isAscii = resMgr->booleanValue( "Study", "ascii_file", false ), - res = isAscii ? - SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.latin1(), studyDS(), isMultiFile ) : - SalomeApp_Application::studyMgr()->SaveAs ( theFileName.latin1(), studyDS(), isMultiFile ) && - CAM_Study::saveDocumentAs( theFileName ) && //SRN: BugID IPAL9377, removed usage of uninitialized variable - saveStudyData(theFileName); + bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ); + bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false ); + bool res = (isAscii ? + SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.latin1(), studyDS(), isMultiFile ) : + SalomeApp_Application::studyMgr()->SaveAs ( theFileName.latin1(), studyDS(), isMultiFile )) + && CAM_Study::saveDocumentAs( theFileName ); + + res = res && saveStudyData(theFileName); if ( res ) emit saved( this ); @@ -209,12 +243,15 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) return res; } -//======================================================================= -// name : saveDocument -/*! Purpose : Save document*/ -//======================================================================= +/*! + Saves previously opened document +*/ bool SalomeApp_Study::saveDocument() { + bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true ); + if ( store ) + SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState(); + ModelList list; dataModels( list ); SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)list.first(); @@ -222,7 +259,7 @@ bool SalomeApp_Study::saveDocument() for ( ; aModel; aModel = (SalomeApp_DataModel*)list.next() ) { listOfFiles.clear(); aModel->save(listOfFiles); - if ( !listOfFiles.isEmpty() ) + if ( !listOfFiles.isEmpty() ) saveModuleData(aModel->module()->name(), listOfFiles); } @@ -231,11 +268,11 @@ bool SalomeApp_Study::saveDocument() if( !resMgr ) return false; - bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ), - isAscii = resMgr->booleanValue( "Study", "ascii_file", false ), - res = isAscii ? - SalomeApp_Application::studyMgr()->SaveASCII( studyDS(), isMultiFile ) : - SalomeApp_Application::studyMgr()->Save ( studyDS(), isMultiFile ) && CAM_Study::saveDocument(); + bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false ); + bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false ); + bool res = (isAscii ? + SalomeApp_Application::studyMgr()->SaveASCII( studyDS(), isMultiFile ) : + SalomeApp_Application::studyMgr()->Save ( studyDS(), isMultiFile )) && CAM_Study::saveDocument(); res = res && saveStudyData(studyName()); if ( res ) @@ -244,10 +281,9 @@ bool SalomeApp_Study::saveDocument() return res; } -//================================================================ -// Function : closeDocument -/*! Purpose : Close document*/ -//================================================================ +/*! + Closes document +*/ void SalomeApp_Study::closeDocument(bool permanently) { LightApp_Study::closeDocument(permanently); @@ -262,10 +298,9 @@ void SalomeApp_Study::closeDocument(bool permanently) } } -//================================================================ -// Function : isModified -// Purpose : -//================================================================ +/*! + \return true, if study is modified in comparison with last open/save +*/ bool SalomeApp_Study::isModified() const { bool isAnyChanged = studyDS() && studyDS()->IsModified(); @@ -275,23 +310,23 @@ bool SalomeApp_Study::isModified() const return isAnyChanged; } -//================================================================ -// Function : isSaved -/*! Purpose : Check: data model is saved?*/ -//================================================================ +/*! + \return if data model is saved +*/ bool SalomeApp_Study::isSaved() const { bool isAllSaved = studyDS() && studyDS()->GetPersistentReference().size(); if (!isAllSaved) - isAllSaved = LightApp_Study::isModified(); + isAllSaved = LightApp_Study::isSaved(); return isAllSaved; } -//======================================================================= -// name : saveModuleData -/*! Purpose : save list file for module 'theModuleName' */ -//======================================================================= +/*! + Saves data of module + \param theModuleName - name of module + \param theListOfFiles - list of files to be saved +*/ void SalomeApp_Study::saveModuleData( QString theModuleName, QStringList theListOfFiles ) { int aNb = theListOfFiles.count(); @@ -309,10 +344,11 @@ void SalomeApp_Study::saveModuleData( QString theModuleName, QStringList theList SetListOfFiles(theModuleName, aListOfFiles); } -//======================================================================= -// name : openModuleData -/*! Purpose : gets list of file for module 'theModuleNam' */ -//======================================================================= +/*! + Loads data of module + \param theModuleName - name of module + \param theListOfFiles - list of files to be loaded +*/ void SalomeApp_Study::openModuleData( QString theModuleName, QStringList& theListOfFiles ) { std::vector aListOfFiles = GetListOfFiles( theModuleName ); @@ -328,10 +364,9 @@ void SalomeApp_Study::openModuleData( QString theModuleName, QStringList& theLis theListOfFiles.append(aListOfFiles[i+1].c_str()); } -//======================================================================= -// name : saveStudyData -/*! Purpose : save data from study */ -//======================================================================= +/*! + Saves data from study +*/ bool SalomeApp_Study::saveStudyData( const QString& theFileName ) { ModelList list; dataModels( list ); @@ -342,10 +377,9 @@ bool SalomeApp_Study::saveStudyData( const QString& theFileName ) return true; } -//======================================================================= -// name : openStudyData -/*! Purpose : open data for study */ -//======================================================================= +/*! + Loads data for study +*/ bool SalomeApp_Study::openStudyData( const QString& theFileName ) { return true; @@ -372,7 +406,7 @@ void SalomeApp_Study::dataModelInserted (const CAM_DataModel* dm) } /*! - Create SComponent for module, using default engine (CORBAless) + Create SComponent for module, using default engine (CORBAless) */ void SalomeApp_Study::addComponent(const CAM_DataModel* dm) { @@ -490,10 +524,10 @@ QString SalomeApp_Study::newStudyName() const return newName; } -//================================================================ -// Function : GetListOfFiles -/*! Purpose : to be used by CORBAless modules*/ -//================================================================ +/*! + \return list of files used by module: to be used by CORBAless modules + \param theModuleName - name of module +*/ std::vector SalomeApp_Study::GetListOfFiles( const char* theModuleName ) const { SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance(); @@ -504,10 +538,11 @@ std::vector SalomeApp_Study::GetListOfFiles( const char* theModuleN return aListOfFiles; } -//================================================================ -// Function : SetListOfFiles -/*! Purpose : to be used by CORBAless modules*/ -//================================================================ +/*! + Sets list of files used by module: to be used by CORBAless modules + \param theModuleName - name of module + \param theListOfFiles - list of files +*/ void SalomeApp_Study::SetListOfFiles ( const char* theModuleName, const std::vector theListOfFiles ) { @@ -516,10 +551,9 @@ void SalomeApp_Study::SetListOfFiles ( const char* theModuleName, aDefaultEngine->SetListOfFiles(theListOfFiles, id(), theModuleName); } -//================================================================ -// Function : GetTmpDir -/*! Purpose : to be used by CORBAless modules*/ -//================================================================ +/*! + \return temporary directory for saving files of modules +*/ std::string SalomeApp_Study::GetTmpDir ( const char* theURL, const bool isMultiFile ) { std::string anURLDir = SALOMEDS_Tool::GetDirFromPath(theURL); @@ -527,10 +561,9 @@ std::string SalomeApp_Study::GetTmpDir ( const char* theURL, const bool isMulti return aTmpDir; } -//================================================================ -// Function : RemoveTemporaryFiles -/*! Purpose : to be used by CORBAless modules*/ -//================================================================ +/*! + Removes temporary files +*/ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile ) const { if (isMultiFile) @@ -550,8 +583,10 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, const bo } } -// END: methods to be used by CORBAless modules - +/*! + Deletes all references to object + \param obj - object +*/ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) { _PTR(StudyBuilder) sb = studyDS()->NewBuilder(); @@ -567,10 +602,10 @@ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) } } -//================================================================ -// Function : referencedToEntry -/*! Purpose : Return referenced entry from entry*/ -//================================================================ +/*! + \return real entry by entry of reference + \param entry - entry of reference object +*/ QString SalomeApp_Study::referencedToEntry( const QString& entry ) const { _PTR(SObject) obj = studyDS()->FindObjectID( entry.latin1() ); @@ -581,10 +616,9 @@ QString SalomeApp_Study::referencedToEntry( const QString& entry ) const return LightApp_Study::referencedToEntry( entry ); } -//================================================================ -// Function : componentDataType -/*! Purpose : Return component data type from entry*/ -//================================================================ +/*! + \return component data type for entry +*/ QString SalomeApp_Study::componentDataType( const QString& entry ) const { _PTR(SObject) obj( studyDS()->FindObjectID( entry.latin1() ) ); @@ -593,20 +627,18 @@ QString SalomeApp_Study::componentDataType( const QString& entry ) const return obj->GetFatherComponent()->ComponentDataType().c_str(); } -//================================================================ -// Function : componentDataType -/*! Purpose : Return component data type from entry*/ -//================================================================ +/*! + \return true if entry corresponds to component +*/ bool SalomeApp_Study::isComponent( const QString& entry ) const { _PTR(SObject) obj( studyDS()->FindObjectID( entry.latin1() ) ); return obj && QString( obj->GetID().c_str() ) == obj->GetFatherComponent()->GetID().c_str(); } -//================================================================ -// Function : children -/*! Purpose : Return entries of children of object*/ -//================================================================ +/*! + \return entries of object children +*/ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries ) const { _PTR(SObject) SO = studyDS()->FindObjectID( entry.latin1() ); @@ -620,6 +652,10 @@ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries } } +/*! + Fills list with components names + \param comp - list to be filled +*/ void SalomeApp_Study::components( QStringList& comps ) const { for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() ) @@ -630,3 +666,77 @@ void SalomeApp_Study::components( QStringList& comps ) const comps.append( aComponent->ComponentDataType().c_str() ); } } + +/*! + \return a list of saved points' IDs +*/ +std::vector SalomeApp_Study::getSavePoints() +{ + std::vector v; + + _PTR(SObject) so = studyDS()->FindComponent("Interface Applicative"); + if(!so) return v; + + _PTR(StudyBuilder) builder = studyDS()->NewBuilder(); + _PTR(ChildIterator) anIter ( studyDS()->NewChildIterator( so ) ); + for(; anIter->More(); anIter->Next()) + { + _PTR(SObject) val( anIter->Value() ); + _PTR(GenericAttribute) genAttr; + if(builder->FindAttribute(val, genAttr, "AttributeParameter")) v.push_back(val->Tag()); + } + + return v; +} + +/*! + Removes a given save point +*/ +void SalomeApp_Study::removeSavePoint(int savePoint) +{ + if(savePoint <= 0) return; + _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint); + _PTR(SObject) so = AP->GetSObject(); + _PTR(StudyBuilder) builder = studyDS()->NewBuilder(); + builder->RemoveObjectWithChildren(so); +} + +/*! + \return a name of save point +*/ +QString SalomeApp_Study::getNameOfSavePoint(int savePoint) +{ + _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint); + _PTR(IParameters) ip = ClientFactory::getIParameters(AP); + return ip->getProperty("AP_SAVEPOINT_NAME").c_str(); +} + +/*! + Sets a name of save point +*/ +void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint) +{ + _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint); + _PTR(IParameters) ip = ClientFactory::getIParameters(AP); + ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.latin1()); +} + +/*! + \return a name of the component where visual parameters are stored +*/ +std::string SalomeApp_Study::getVisualComponentName() +{ + return "Interface Applicative"; +} + +/*! + Slot: called on change of a root of a data model. Redefined from CAM_Study +*/ +void SalomeApp_Study::updateModelRoot( const CAM_DataModel* dm ) +{ + LightApp_Study::updateModelRoot( dm ); + + // calling updateSavePointDataObjects in order to set correct order of "Gui states" object + // it must always be the last one. + ((SalomeApp_Application*)application())->updateSavePointDataObjects( this ); +} diff --git a/src/SalomeApp/SalomeApp_Study.h b/src/SalomeApp/SalomeApp_Study.h index c07d20528..ef5c127fd 100644 --- a/src/SalomeApp/SalomeApp_Study.h +++ b/src/SalomeApp/SalomeApp_Study.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_STUDY_H #define SALOMEAPP_STUDY_H @@ -22,6 +22,7 @@ #include "SalomeApp.h" #include +#include #ifdef WIN32 #pragma warning( disable:4251 ) @@ -66,6 +67,12 @@ public: virtual void children( const QString&, QStringList& ) const; virtual void components( QStringList& ) const; + std::vector getSavePoints(); + void removeSavePoint(int savePoint); + QString getNameOfSavePoint(int savePoint); + void setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint); + virtual std::string getVisualComponentName(); + protected: virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles ); virtual void openModuleData ( QString theModuleName, QStringList& theListOfFiles ); @@ -82,6 +89,9 @@ protected: virtual bool openDataModel( const QString&, CAM_DataModel* ); void setStudyDS(const _PTR(Study)& s ); +protected slots: + virtual void updateModelRoot( const CAM_DataModel* ); + private: QString newStudyName() const; diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index 2a7040d54..830536676 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -1,8 +1,22 @@ -// SALOME SalomeApp +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// Copyright (C) 2005 CEA/DEN, EDF R&D +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// SALOME SalomeApp // // File : SalomeApp_StudyPropertiesDlg.cxx // Author : Sergey ANIKIN diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h index 556a3d318..4abedf932 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.h @@ -1,13 +1,24 @@ -// SALOME SalomeApp -// -// Copyright (C) 2005 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SalomeApp_StudyPropertiesDlg.h // Author : Sergey ANIKIN // Module : SALOME -// $Header$ #ifndef SALOMEAPP_STUDY_PROPERTIES_DLG_H #define SALOMEAPP_STUDY_PROPERTIES_DLG_H diff --git a/src/SalomeApp/SalomeApp_Tools.cxx b/src/SalomeApp/SalomeApp_Tools.cxx index f6b93b4ca..a20fbf0c8 100644 --- a/src/SalomeApp/SalomeApp_Tools.cxx +++ b/src/SalomeApp/SalomeApp_Tools.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_Tools.h" diff --git a/src/SalomeApp/SalomeApp_Tools.h b/src/SalomeApp/SalomeApp_Tools.h index 074367b32..a6f1e06dc 100644 --- a/src/SalomeApp/SalomeApp_Tools.h +++ b/src/SalomeApp/SalomeApp_Tools.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_TOOLS_H #define SALOMEAPP_TOOLS_H diff --git a/src/SalomeApp/SalomeApp_TypeFilter.cxx b/src/SalomeApp/SalomeApp_TypeFilter.cxx index 58ab6bb57..c82912207 100644 --- a/src/SalomeApp/SalomeApp_TypeFilter.cxx +++ b/src/SalomeApp/SalomeApp_TypeFilter.cxx @@ -14,15 +14,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeApp_TypeFilter.h" #include "LightApp_DataOwner.h" #include "SalomeApp_Study.h" -#include - /*! Constructor. */ diff --git a/src/SalomeApp/SalomeApp_TypeFilter.h b/src/SalomeApp/SalomeApp_TypeFilter.h index 9c95d25ee..533ea7269 100644 --- a/src/SalomeApp/SalomeApp_TypeFilter.h +++ b/src/SalomeApp/SalomeApp_TypeFilter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMEAPP_TYPEFILTER_H #define SALOMEAPP_TYPEFILTER_H diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index 4c290584a..f6cfb540c 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -1,12 +1,6 @@ -
- - - - - -
+ @@ -23,10 +17,19 @@
+
+
+ + + + + +
+ @@ -40,239 +43,76 @@ - - - - - - - - - - - + - -
-
- -
-
- -
-
- - -
-
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - + +
- - -
- - +
+ + + + + +
- - - - - - + + + + + + + +
+
+ + +
- - - - + + + + +
- - - + + + +
-
- -
- - - - - - - + + + + + + + +
- - - -
-
- - - + + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + +
- -
- - +
+ +
diff --git a/src/SalomeApp/resources/SalomeApp_images.po b/src/SalomeApp/resources/SalomeApp_images.po index 29ec0e6e6..25df26cd8 100644 --- a/src/SalomeApp/resources/SalomeApp_images.po +++ b/src/SalomeApp/resources/SalomeApp_images.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: SalomeApp_images.po // Created: November, 2004 // Author: OCC team diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po index a739779d2..ae12d309a 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.po +++ b/src/SalomeApp/resources/SalomeApp_msg_en.po @@ -1,3 +1,21 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: CATHAREGUI_msg_en.po // Created: 10/25/2004 12:46:36 PM // Author: Sergey LITONIN @@ -13,9 +31,6 @@ msgstr "" //======================================================================================= -msgid "BUT_OK" -msgstr "&OK" - msgid "BUT_NEW" msgstr "&New" @@ -25,9 +40,6 @@ msgstr "&Open" msgid "BUT_LOAD" msgstr "&Load" -msgid "BUT_CANCEL" -msgstr "&Cancel" - //======================================================================================= msgid "SalomeApp_Application::PYTHON_CONSOLE" @@ -42,6 +54,15 @@ msgstr "&Dump study..." msgid "SalomeApp_Application::PRP_DESK_FILE_DUMP_STUDY" msgstr "Dumps study to the python script" +msgid "SalomeApp_Application::TOT_DESK_FILE_SAVE_GUI_STATE" +msgstr "Save GUI state" + +msgid "SalomeApp_Application::MEN_DESK_FILE_SAVE_GUI_STATE" +msgstr "Save GUI state" + +msgid "SalomeApp_Application::PRP_DESK_FILE_SAVE_GUI_STATE" +msgstr "Saves current state of viewers, displayed objects, etc." + msgid "SalomeApp_Application::TOT_DESK_FILE_LOAD_SCRIPT" msgstr "Load python script" @@ -102,6 +123,17 @@ msgstr "Activate Module" msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE" msgstr "Delete Invalid Reference" +msgid "SalomeApp_Application::PREF_STORE_VISUAL_STATE" +msgstr "Store/restore last GUI state" + +//======================================================================================= + +msgid "PUBLISH_IN_STUDY" +msgstr "Publish in study" + +msgid "SAVE_GUI_STATE" +msgstr "Save GUI state" + //======================================================================================= msgid "SalomeApp_Application::MEN_WINDOWS_NEW" @@ -190,3 +222,25 @@ msgstr "Publish in study" msgid "SalomeApp_Application::WRN_DUMP_STUDY_FAILED" msgstr "Dump study failed" +msgid "SAVE_POINT_OBJECT_TOOLTIP" +msgstr "Saved GUI state: %1" + +msgid "SAVE_POINT_DEF_NAME" +msgstr "GUI state: " + +msgid "SAVE_POINT_ROOT_TOOLTIP" +msgstr "Persistent GUI states" + +msgid "SAVE_POINT_ROOT_NAME" +msgstr "GUI states" + +//======================================================================================= + +msgid "SalomeApp_Application::MEN_RESTORE_VS" +msgstr "Restore" + +msgid "SalomeApp_Application::MEN_RENAME_VS" +msgstr "Rename" + +msgid "SalomeApp_Application::MEN_DELETE_VS" +msgstr "Delete" diff --git a/src/Session/InquireServersQThread.cxx b/src/Session/InquireServersQThread.cxx index 3a4b9ddd6..61fdc3eff 100755 --- a/src/Session/InquireServersQThread.cxx +++ b/src/Session/InquireServersQThread.cxx @@ -1,6 +1,20 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : InquireServersQThread.cxx // Author : Vasily RUSYAEV @@ -49,6 +63,9 @@ using namespace std; #define MARGIN_SIZE 5 #define SPACING_SIZE 3 +/*! + Constructor +*/ InquireServersGUI::InquireServersGUI() : QVBox(0, "SFA splash", Qt::WDestructiveClose | Qt::WStyle_Customize | Qt::WStyle_NoBorder | WType_TopLevel | WStyle_StaysOnTop | WX11BypassWM ) { @@ -137,6 +154,10 @@ InquireServersGUI::InquireServersGUI() myThread->start(); } +/*! + Sets pixmap of splash screen + \param pix - new pixmap +*/ void InquireServersGUI::setPixmap( QPixmap pix ) { if ( !pix.isNull() ) @@ -148,21 +169,28 @@ void InquireServersGUI::setPixmap( QPixmap pix ) } } +/*! + Destructor +*/ InquireServersGUI::~InquireServersGUI() { delete myThread; } +/*! + Gets parameters from qApp + \param _argc - variable to return number of arguments + \param _argv - variable to return array of arguments +*/ void InquireServersGUI::getArgs( int& _argc, char *** _argv) { _argc = qApp->argc(); *_argv = qApp->argv(); } -//================================================================================= -// function : ClickOnCancel() -// purpose : cancel loading of SALOME -//================================================================================= +/*! + Cancel loading of SALOME +*/ void InquireServersGUI::ClickOnCancel() { myThread->stop(); //it's necessary to stop asking servers @@ -170,6 +198,9 @@ void InquireServersGUI::ClickOnCancel() qApp->exit( 1 ); } +/*! + Custom event filter +*/ void InquireServersGUI::customEvent( QCustomEvent* pe ) { switch( pe->type() ) @@ -204,11 +235,17 @@ void InquireServersGUI::customEvent( QCustomEvent* pe ) } } +/*! + \return status of thread exit +*/ int InquireServersGUI::getExitStatus() { return myThread->getExitStatus(); } +/*! + Constructor +*/ InquireServersQThread::InquireServersQThread( InquireServersGUI* r ) : receiver(r), myExitStatus(0) { @@ -258,6 +295,9 @@ InquireServersQThread::InquireServersQThread( InquireServersGUI* r ) } } +/*! + The main loop of this thread +*/ void InquireServersQThread::run() { while ( IsChecking && receiver ) @@ -305,12 +345,18 @@ void InquireServersQThread::run() qApp->exit( myExitStatus ); } +/*! + Stops this thread +*/ void InquireServersQThread::stop() { IsChecking = false; myExitStatus = 1; } +/*! + Destructor +*/ InquireServersQThread::~InquireServersQThread() { } diff --git a/src/Session/InquireServersQThread.h b/src/Session/InquireServersQThread.h index 82d58dc7d..2eca8fe32 100755 --- a/src/Session/InquireServersQThread.h +++ b/src/Session/InquireServersQThread.h @@ -1,11 +1,24 @@ -// Copyright (C) 2003 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : InquireServersQThread.h // Author : Vasily RUSYAEV // Module : SALOME -// $Header$ #include #include @@ -13,11 +26,10 @@ #include -/********************************************************** -** Class: InquireEvent -** Descr: Contains QCustomEvents for posting to InquireServersQThread -** Level: Private -***********************************************************/ +/*! + \class InquireEvent + Contains QCustomEvents for posting to InquireServersQThread +*/ class SESSION_EXPORT InquireEvent : public QCustomEvent { public: diff --git a/src/Session/Makefile.in b/src/Session/Makefile.in index 226711e2b..6379a1395 100755 --- a/src/Session/Makefile.in +++ b/src/Session/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -38,6 +38,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl EXPORT_HEADERS= Session_Session_i.hxx \ Session_ServerLauncher.hxx \ Session_ServerThread.hxx \ + Session_ServerCheck.hxx \ SalomeApp_Engine_i.hxx # Libraries targets @@ -46,11 +47,10 @@ LIB = libSalomeSession.la LIB_SRC=Session_Session_i.cxx \ Session_ServerThread.cxx \ Session_ServerLauncher.cxx \ - Session_SignalsHandler.cxx \ + Session_ServerCheck.cxx \ SalomeApp_Engine_i.cxx \ - InquireServersQThread.cxx -LIB_MOC = InquireServersQThread.h +LIB_MOC = # Executables targets BIN = SALOME_Session_Server @@ -59,9 +59,9 @@ LIB_SERVER_IDL = SALOME_Session.idl SalomeApp_Engine.idl BIN_SERVER_IDL = BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl SALOME_GenericObj.idl -CPPFLAGS += $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) -I$(KERNEL_ROOT_DIR)/include/salome -I$(OCC_INCLUDES) +CPPFLAGS += $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) -I$(OCC_INCLUDES) CXXFLAGS += $(OCC_CXXFLAGS) $(BOOST_CPPFLAGS) -LDFLAGS += $(QT_MT_LIBS) -L$(KERNEL_ROOT_DIR)/lib/salome -lSalomeNS -lsuit -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lwith_loggerTraceCollector -lEvent -lCASCatch -lSalomeCatalog -lSalomeDS $(CAS_KERNEL) +LDFLAGS += $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS -lsuit -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lwith_loggerTraceCollector -lEvent -lSalomeCatalog -lSalomeDSClient $(CAS_KERNEL) LDFLAGSFORBIN= $(LDFLAGS) $(OMNIORB_LIBS) $(HDF5_LIBS) -lqtx -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index ac7738582..21ceec290 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,8 +31,6 @@ #include "SALOME_NamingService.hxx" #include "SALOMETraceCollector.hxx" -#include "InquireServersQThread.h" // splash - #include #ifndef WNT #include @@ -42,6 +40,7 @@ #include #include #include +#include #include "Utils_SALOME_Exception.hxx" #include "Utils_CorbaException.hxx" @@ -54,17 +53,17 @@ #include #include "Session_Session_i.hxx" #include "Session_ServerLauncher.hxx" +#include "Session_ServerCheck.hxx" +#include #include "SUIT_Tools.h" #include "SUIT_Session.h" #include "SUIT_Application.h" +#include "SUIT_Desktop.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" - #include "SUIT_ExceptionHandler.h" -extern "C" int HandleSignals( QApplication *theQApplication ); - /*! - read arguments, define list of server to launch with their arguments. * - wait for naming service * - create and run a thread for launch of all servers @@ -182,10 +181,39 @@ public: QString version() const { return myExtAppVersion; } protected: - QString userFileName( const QString& appName ) const + QString userFileName( const QString& appName, const bool for_load ) const { if ( version().isNull() ) return ""; - return SUIT_ResourceMgr::userFileName( myExtAppName ); + return SUIT_ResourceMgr::userFileName( myExtAppName, for_load ); + } + + virtual int userFileId( const QString& _fname ) const + { + QRegExp exp( "\\.SalomeApprc\\.([a-zA-Z0-9.]+)$" ); + QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" ); + + QString fname = QFileInfo( _fname ).fileName(); + if( exp.exactMatch( fname ) ) + { + QStringList vers = QStringList::split( ".", exp.cap( 1 ) ); + int major=0, minor=0; + major = vers[0].toInt(); + minor = vers[1].toInt(); + if( vers_exp.search( vers[2] )==-1 ) + return -1; + int release = 0, dev1 = 0, dev2 = 0; + release = vers_exp.cap( 1 ).toInt(); + dev1 = vers_exp.cap( 2 )[ 0 ].latin1(); + dev2 = vers_exp.cap( 3 ).toInt(); + + int dev = dev1*100+dev2, id = major; + id*=100; id+=minor; + id*=100; id+=release; + id*=10000; id+=dev; + return id; + } + + return -1; } public: @@ -233,7 +261,10 @@ private: class GetInterfaceThread : public QThread { public: - GetInterfaceThread( SALOME::Session_var s ) : session ( s ) {} + GetInterfaceThread( SALOME::Session_var s ) : session ( s ) + { + start(); + } protected: virtual void run() { @@ -258,19 +289,87 @@ bool isFound( const char* str, int argc, char** argv ) // ---------------------------- MAIN ----------------------- int main( int argc, char **argv ) { + // Install Qt debug messages handler qInstallMsgHandler( MessageOutput ); - - // QApplication should be create before all other operations - // When uses QApplication::libraryPaths() ( example, QFile::encodeName() ) - // qApp used for detection of the executable dir path. + + // Create Qt application instance; + // this should be done the very first! SALOME_QApplication _qappl( argc, argv ); ASSERT( QObject::connect( &_qappl, SIGNAL( lastWindowClosed() ), &_qappl, SLOT( quit() ) ) ); + // Add application library path (to search style plugin etc...) QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) ); _qappl.addLibraryPath( path ); + // Set SALOME style to the application _qappl.setStyle( "salome" ); + bool isGUI = isFound( "GUI", argc, argv ); + bool isSplash = isFound( "SPLASH", argc, argv ); + // Show splash screen (only if both the "GUI" and "SPLASH" parameters are set) + QtxSplash* splash = 0; + if ( isGUI && isSplash ) { + // ...create resource manager + SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) ); + resMgr.setCurrentFormat( "xml" ); + resMgr.loadLanguage( "LightApp", "en" ); + // ...get splash preferences + QString splashIcon, splashInfo, splashTextColors, splashProgressColors; + resMgr.value( "splash", "image", splashIcon ); + resMgr.value( "splash", "info", splashInfo, false ); + resMgr.value( "splash", "text_colors", splashTextColors ); + resMgr.value( "splash", "progress_colors", splashProgressColors ); + QPixmap px( splashIcon ); + if ( px.isNull() ) // try to get splash pixmap from resources + px = resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) ); + if ( !px.isNull() ) { + // ...set splash pixmap + splash = QtxSplash::splash( px ); + // ...set splash text colors + if ( !splashTextColors.isEmpty() ) { + QStringList colors = QStringList::split( "|", splashTextColors ); + QColor c1, c2; + if ( colors.count() > 0 ) c1 = QColor( colors[0] ); + if ( colors.count() > 1 ) c2 = QColor( colors[1] ); + splash->setTextColors( c1, c2 ); + } + else { + splash->setTextColors( Qt::white, Qt::black ); + } + // ...set splash progress colors + if ( !splashProgressColors.isEmpty() ) { + QStringList colors = QStringList::split( "|", splashProgressColors ); + QColor c1, c2; + int gradType = QtxSplash::Vertical; + if ( colors.count() > 0 ) c1 = QColor( colors[0] ); + if ( colors.count() > 1 ) c2 = QColor( colors[1] ); + if ( colors.count() > 2 ) gradType = colors[2].toInt(); + splash->setProgressColors( c1, c2, gradType ); + } + // ...set splash text font + QFont f = splash->font(); + f.setBold( true ); + splash->setFont( f ); + // ...show splash initial status + if ( !splashInfo.isEmpty() ) { + splashInfo.replace( QRegExp( "%A" ), QObject::tr( "APP_NAME" ) ); + splashInfo.replace( QRegExp( "%V" ), QObject::tr( "ABOUT_VERSION" ).arg( salomeVersion() ) ); + splashInfo.replace( QRegExp( "%L" ), QObject::tr( "ABOUT_LICENSE" ) ); + splashInfo.replace( QRegExp( "%C" ), QObject::tr( "ABOUT_COPYRIGHT" ) ); + splashInfo.replace( QRegExp( "\\\\n" ), "\n" ); + splash->message( splashInfo ); + } + // ...set 'hide on click' flag +#ifdef _DEBUG_ + splash->setHideOnClick( true ); +#endif + // ...show splash + splash->show(); + qApp->processEvents(); + } + } + + // Initialization int result = -1; CORBA::ORB_var orb; @@ -282,29 +381,26 @@ int main( int argc, char **argv ) Session_ServerLauncher* myServerLauncher = 0; try { - - // Python initialisation : only once - - int _argc = 1; + // ...initialize Python (only once) + int _argc = 1; char* _argv[] = {""}; KERNEL_PYTHON::init_python( _argc,_argv ); PyEval_RestoreThread( KERNEL_PYTHON::_gtstate ); if ( !KERNEL_PYTHON::salome_shared_modules_module ) // import only once KERNEL_PYTHON::salome_shared_modules_module = PyImport_ImportModule( "salome_shared_modules" ); - if ( !KERNEL_PYTHON::salome_shared_modules_module ) - { + if ( !KERNEL_PYTHON::salome_shared_modules_module ) { INFOS( "salome_shared_modules_module == NULL" ); PyErr_Print(); } PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate ); - // Create ORB, get RootPOA object, NamingService, etc. + // ...create ORB, get RootPOA object, NamingService, etc. ORB_INIT &init = *SINGLETON_::Instance(); ASSERT( SINGLETON_::IsAlreadyExisting() ); int orbArgc = 1; orb = init( orbArgc, argv ); - // Install SALOME thread event handler + // ...install SALOME thread event handler SALOME_Event::GetSessionThread(); CORBA::Object_var obj = orb->resolve_initial_references( "RootPOA" ); @@ -339,70 +435,67 @@ int main( int argc, char **argv ) INFOS( "Caught unknown exception." ); } - // CORBA Servant Launcher - QMutex _GUIMutex; - QWaitCondition _ServerLaunch, _SessionStarted; - - if ( !result ) - { - _GUIMutex.lock(); // to block Launch server thread until wait( mutex ) - - // Activate embedded CORBA servers: Registry, SALOMEDS, etc. - myServerLauncher = new Session_ServerLauncher( argc, argv, orb, poa, &_GUIMutex, &_ServerLaunch, &_SessionStarted ); - myServerLauncher->start(); - - _ServerLaunch.wait( &_GUIMutex ); // to be reseased by Launch server thread when ready: + QMutex _GUIMutex, _SessionMutex, _SplashMutex; + QWaitCondition _ServerLaunch, _SessionStarted, _SplashStarted; + + // lock session mutex to ensure that GetInterface is not called + // until all initialization is done + _SessionMutex.lock(); + + if ( !result ) { + // Start embedded servers launcher (Registry, SALOMEDS, etc.) + // ...lock mutex to block embedded servers launching thread until wait( mutex ) + _GUIMutex.lock(); + // ...create launcher + myServerLauncher = new Session_ServerLauncher( argc, argv, orb, poa, &_GUIMutex, &_ServerLaunch, &_SessionMutex, &_SessionStarted ); + // ...block this thread until launcher is ready + _ServerLaunch.wait( &_GUIMutex ); - // show splash screen if "SPLASH" parameter was passed ( default ) - if ( isFound( "SPLASH", argc, argv ) ) - { - // create temporary resource manager just to load splash icon - SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) ); - resMgr.setCurrentFormat( "xml" ); - resMgr.loadLanguage( "LightApp", "en" ); - - // create splash object: widget ( splash with progress bar ) and "pinging" thread - InquireServersGUI splash; - splash.setPixmap( resMgr.loadPixmap( "LightApp", QObject::tr( "ABOUT_SPLASH" ) ) ); - SUIT_Tools::centerWidget( &splash, _qappl.desktop() ); - - _qappl.setMainWidget( &splash ); - QObject::connect( &_qappl, SIGNAL( lastWindowClosed() ), &_qappl, SLOT( quit() ) ); - splash.show(); // display splash with running progress bar - _qappl.exec(); // wait untill splash closes ( progress runs till end or Cancel is pressed ) - - result = splash.getExitStatus(); // 1 is error + // Start servers check thread (splash) + if ( splash ) { + // ...lock mutex to block splash thread until wait( mutex ) + _SplashMutex.lock(); + // ...create servers checking thread + Session_ServerCheck sc( &_SplashMutex, &_SplashStarted ); + // ...block this thread until servers checking is finished + _SplashStarted.wait( &_SplashMutex ); + // ...unlock mutex 'cause it is no more needed + _SplashMutex.unlock(); + // get servers checking thread status + result = splash->error(); + QString info = splash->message().isEmpty() ? "%1" : QString( "%1\n%2" ).arg( splash->message() ); + splash->setStatus( info.arg( "Activating desktop..." ) ); } - else - _SessionStarted.wait(); - } - // call Session::GetInterface() if "GUI" parameter was passed ( default ) - if ( !result && isFound( "GUI", argc, argv ) ) - { - CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" ); - SALOME::Session_var session = SALOME::Session::_narrow( obj ) ; - ASSERT ( ! CORBA::is_nil( session ) ); - - INFOS( "Session activated, Launch IAPP..." ); - guiThread = new GetInterfaceThread( session ); - guiThread->start(); + // Finalize embedded servers launcher + // ...block this thread until launcher is finished + _ServerLaunch.wait( &_GUIMutex ); + // ...unlock mutex 'cause it is no more needed + _GUIMutex.unlock(); } - if ( !result ) - { + if ( !result ) { + // Launch GUI activator + if ( isGUI ) { + // ...retrieve Session interface reference + CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" ); + SALOME::Session_var session = SALOME::Session::_narrow( obj ) ; + ASSERT ( ! CORBA::is_nil( session ) ); + // ...create GUI launcher + INFOS( "Session activated, Launch IAPP..." ); + guiThread = new GetInterfaceThread( session ); + } // GUI activation // Allow multiple activation/deactivation of GUI - while ( true ) - { + while ( true ) { MESSAGE( "waiting wakeAll()" ); - _ServerLaunch.wait( &_GUIMutex ); // to be reseased by Launch server thread when ready: + _SessionStarted.wait( &_SessionMutex ); // to be reseased by Launch server thread when ready: // atomic operation lock - unlock on mutex // unlock mutex: serverThread runs, calls _ServerLaunch->wakeAll() // this thread wakes up, and lock mutex - _GUIMutex.unlock(); + _SessionMutex.unlock(); // SUIT_Session creation aGUISession = new SALOME_Session(); @@ -417,7 +510,15 @@ int main( int argc, char **argv ) // aGUISession contains SalomeApp_ExceptionHandler // Run GUI loop MESSAGE( "run(): starting the main event loop" ); + + if ( splash ) + splash->finish( aGUIApp->desktop() ); + result = _qappl.exec(); + + if ( splash ) + delete splash; + splash = 0; if ( result == SUIT_Session::FROM_GUI ) // desktop is closed by user from GUI break; @@ -427,10 +528,13 @@ int main( int argc, char **argv ) aGUISession = 0; // Prepare _GUIMutex for a new GUI activation - _GUIMutex.lock(); + _SessionMutex.lock(); } } + // unlock Session mutex + _SessionMutex.unlock(); + if ( myServerLauncher ) myServerLauncher->KillAll(); // kill embedded servers diff --git a/src/Session/SalomeApp_Engine_i.cxx b/src/Session/SalomeApp_Engine_i.cxx index 27cc1cdd3..813270515 100644 --- a/src/Session/SalomeApp_Engine_i.cxx +++ b/src/Session/SalomeApp_Engine_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,11 +38,17 @@ using namespace std; SalomeApp_Engine_i* SalomeApp_Engine_i::myInstance = NULL; +/*! + Constructor +*/ SalomeApp_Engine_i::SalomeApp_Engine_i() { myInstance = this; } +/*! + Destructor +*/ SalomeApp_Engine_i::~SalomeApp_Engine_i() { } @@ -163,6 +169,9 @@ void SalomeApp_Engine_i::SetListOfFiles (const ListOfFiles theListOfFiles, mapOfListOfFiles[componentName] = theListOfFiles; } +/*! + \return shared instance of engine +*/ SalomeApp_Engine_i* SalomeApp_Engine_i::GetInstance() { return myInstance; diff --git a/src/Session/SalomeApp_Engine_i.hxx b/src/Session/SalomeApp_Engine_i.hxx index 67c29f993..abadbdd67 100755 --- a/src/Session/SalomeApp_Engine_i.hxx +++ b/src/Session/SalomeApp_Engine_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/Session/Session_ServerCheck.hxx b/src/Session/Session_ServerCheck.hxx index 0f84abe18..8de6a6d41 100644 --- a/src/Session/Session_ServerCheck.hxx +++ b/src/Session/Session_ServerCheck.hxx @@ -22,11 +22,7 @@ #if !defined(SESSION_SERVERCHECK_HXX) #define SESSION_SERVERCHECK_HXX -#ifdef WNT -#include -#else -#define SALOME_WNT_EXPORT -#endif +#include #include #include @@ -37,7 +33,7 @@ class QWaitCondition; /*! Class Session_ServerCheck : check SALOME servers */ -class SALOME_WNT_EXPORT Session_ServerCheck : public QThread +class SESSION_EXPORT Session_ServerCheck : public QThread { public: // constructor diff --git a/src/Session/Session_ServerLauncher.cxx b/src/Session/Session_ServerLauncher.cxx index b15f682a5..d4b055416 100755 --- a/src/Session/Session_ServerLauncher.cxx +++ b/src/Session/Session_ServerLauncher.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -31,29 +31,24 @@ #include "Utils_SALOME_Exception.hxx" #include "utilities.h" using namespace std; -//============================================================================= /*! - * default constructor not for use + default constructor not for use */ -//============================================================================= - Session_ServerLauncher::Session_ServerLauncher() { ASSERT(0); // must not be called } -//============================================================================= /*! - * constructor - */ -//============================================================================= - + constructor +*/ Session_ServerLauncher::Session_ServerLauncher(int argc, char ** argv, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, QMutex *GUIMutex, QWaitCondition *ServerLaunch, + QMutex *SessionMutex, QWaitCondition *SessionStarted) { _argc = argc; @@ -62,45 +57,51 @@ Session_ServerLauncher::Session_ServerLauncher(int argc, _root_poa = PortableServer::POA::_duplicate(poa); _GUIMutex = GUIMutex; _ServerLaunch = ServerLaunch; + _SessionMutex = SessionMutex; _SessionStarted = SessionStarted; + + // start thread + start(); } -//============================================================================= /*! - * destructor - */ -//============================================================================= - + destructor +*/ Session_ServerLauncher::~Session_ServerLauncher() { } -//============================================================================= /*! - * Check args and activate servers - */ -//============================================================================= - + Check args and activate servers +*/ void Session_ServerLauncher::run() { - _GUIMutex->lock(); // lock released by calling thread when ready: wait(mutex) - _GUIMutex->unlock(); + // wait until main thread is ready + _GUIMutex->lock(); // ... lock mutex (it is unlocked my calling thread + // wait condition's wait(mutex) + _GUIMutex->unlock(); // ... and unlock it 'cause it is not more needed + + // wake main thread _ServerLaunch->wakeAll(); CheckArgs(); ActivateAll(); - _SessionStarted->wakeAll(); // wake main thread + // wait until main thread is ready + _GUIMutex->lock(); // ... lock mutex (it is unlocked my calling thread + // wait condition's wait(mutex) + _GUIMutex->unlock(); // ... and unlock it 'cause it is not more needed - _orb->run(); // this thread wait, during omniORB process events + // wake main thread + _ServerLaunch->wakeAll(); + + // run ORB + _orb->run(); // this thread waits, during omniORB process events } -//============================================================================= /*! - * controls and dispatchs arguments given with command - */ -//============================================================================= - + controls and dispatchs arguments given with command +*/ void Session_ServerLauncher::CheckArgs() { int argState = 0; @@ -175,12 +176,6 @@ void Session_ServerLauncher::CheckArgs() throw SALOME_Exception(LOCALIZED("Error in command arguments, missing parenthesis ')'")); } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerLauncher::ActivateAll() { list::iterator itServ; @@ -201,7 +196,7 @@ void Session_ServerLauncher::ActivateAll() std::cout << "*** activating [" << argc << "] : " << argv[0] << std::endl; Session_ServerThread* aServerThread - = new Session_ServerThread(argc, argv, _orb,_root_poa,_GUIMutex); + = new Session_ServerThread(argc, argv, _orb,_root_poa); _serverThreads.push_front(aServerThread); aServerThread->Init(); @@ -214,18 +209,15 @@ void Session_ServerLauncher::ActivateAll() char** argv = new char*[argc]; argv[0] = "Session"; Session_SessionThread* aServerThread - = new Session_SessionThread(argc, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch); + = new Session_SessionThread(argc, argv, _orb,_root_poa,_SessionMutex,_SessionStarted); _serverThreads.push_front(aServerThread); aServerThread->Init(); } -//============================================================================= /*! - * Destruction des classes serveur dans l'ordre inverse de creation - */ -//============================================================================= - + Destruction des classes serveur dans l'ordre inverse de creation +*/ void Session_ServerLauncher::KillAll() { MESSAGE("Session_ServerLauncher::KillAll()"); diff --git a/src/Session/Session_ServerLauncher.hxx b/src/Session/Session_ServerLauncher.hxx index 559833919..b3773adf1 100755 --- a/src/Session/Session_ServerLauncher.hxx +++ b/src/Session/Session_ServerLauncher.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -65,6 +65,7 @@ public: PortableServer::POA_ptr poa, QMutex *GUIMutex, QWaitCondition *ServerLaunch, + QMutex *SessionMutex, QWaitCondition *SessionStarted); virtual ~Session_ServerLauncher(); void run(); @@ -77,13 +78,14 @@ protected: private: int _argc; char ** _argv; - CORBA::ORB_var _orb; - PortableServer::POA_var _root_poa; - QMutex* _GUIMutex; - QWaitCondition *_ServerLaunch; - QWaitCondition *_SessionStarted; - list _argServToLaunch; - vector _argCopy; + CORBA::ORB_var _orb; + PortableServer::POA_var _root_poa; + QMutex* _GUIMutex; + QWaitCondition* _ServerLaunch; + QMutex* _SessionMutex; + QWaitCondition* _SessionStarted; + list _argServToLaunch; + vector _argCopy; list _serverThreads; }; diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 7e3714518..d9ef4f806 100755 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -34,7 +34,8 @@ #include "SALOME_Container_i.hxx" #include "SALOME_ContainerManager.hxx" -#include "SALOMEDS_StudyManager_i.hxx" +#include +#include #include "SALOME_ModuleCatalog_impl.hxx" #include "RegistryService.hxx" #include "Session_Session_i.hxx" @@ -61,58 +62,44 @@ const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container", "SalomeAppEngine", "ContainerManager"}; -//============================================================================= /*! - * default constructor not for use - */ -//============================================================================= - + default constructor not for use +*/ Session_ServerThread::Session_ServerThread() { ASSERT(0); // must not be called } -//============================================================================= /*! - * constructor - */ -//============================================================================= - + constructor +*/ Session_ServerThread::Session_ServerThread(int argc, char ** argv, CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - QMutex *GUIMutex) + PortableServer::POA_ptr poa) { //MESSAGE("Session_ServerThread Constructor " << argv[0]); _argc = argc; _argv = argv; _orb = CORBA::ORB::_duplicate(orb); _root_poa = PortableServer::POA::_duplicate(poa); - _GUIMutex = GUIMutex; _servType =-1; _NS = new SALOME_NamingService(_orb); // one instance per server to limit // multi thread coherence problems } -//============================================================================= /*! - * destructor - */ -//============================================================================= - + destructor +*/ Session_ServerThread::~Session_ServerThread() { //MESSAGE("~Session_ServerThread "<< _argv[0]); } -//============================================================================= /*! - * run the thread : activate one servant, the servant type is given by - * argument _argv[0] - */ -//============================================================================= - + run the thread : activate one servant, the servant type is given by + argument _argv[0] +*/ void Session_ServerThread::Init() { MESSAGE("Session_ServerThread::Init "<< _argv[0]); @@ -185,12 +172,6 @@ void Session_ServerThread::Init() } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateModuleCatalog(int argc, char ** argv) { @@ -230,12 +211,6 @@ void Session_ServerThread::ActivateModuleCatalog(int argc, } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateSALOMEDS(int argc, char ** argv) { @@ -246,15 +221,7 @@ void Session_ServerThread::ActivateSALOMEDS(int argc, // counted objects, they will be deleted by the POA when they are no // longer needed. - SALOMEDS_StudyManager_i * myStudyManager_i - = new SALOMEDS_StudyManager_i(_orb,_root_poa); - - // Activate the objects. This tells the POA that the objects are - // ready to accept requests. - - PortableServer::ObjectId_var myStudyManager_iid - = _root_poa->activate_object(myStudyManager_i); - myStudyManager_i->register_name("/myStudyManager"); + ClientFactory::createStudyManager(_orb,_root_poa); } catch(CORBA::SystemException&) { @@ -277,12 +244,6 @@ void Session_ServerThread::ActivateSALOMEDS(int argc, } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateRegistry(int argc, char ** argv) { @@ -339,12 +300,6 @@ void Session_ServerThread::ActivateRegistry(int argc, } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateContainerManager(int argc, char ** argv) { @@ -377,12 +332,6 @@ void Session_ServerThread::ActivateContainerManager(int argc, } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateContainer(int argc, char ** argv) { @@ -467,12 +416,6 @@ void Session_ServerThread::ActivateContainer(int argc, } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/) { try @@ -500,29 +443,30 @@ void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/) } } -//============================================================================= -/*! - * - */ -//============================================================================= - void Session_ServerThread::ActivateSession(int argc, char ** argv) { MESSAGE("Session_ServerThread::ActivateSession() not implemented!"); } +/*! + constructor +*/ Session_SessionThread::Session_SessionThread(int argc, char** argv, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, QMutex* GUIMutex, QWaitCondition* GUILauncher) -: Session_ServerThread(argc, argv, orb, poa, GUIMutex), +: Session_ServerThread(argc, argv, orb, poa), + _GUIMutex( GUIMutex ), _GUILauncher( GUILauncher ) { } +/*! + destructor +*/ Session_SessionThread::~Session_SessionThread() { } diff --git a/src/Session/Session_ServerThread.hxx b/src/Session/Session_ServerThread.hxx index 1041c0f35..04ded4d2e 100755 --- a/src/Session/Session_ServerThread.hxx +++ b/src/Session/Session_ServerThread.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -52,8 +52,7 @@ public: Session_ServerThread(int argc, char ** argv, CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - QMutex *GUIMutex); + PortableServer::POA_ptr poa); virtual ~Session_ServerThread(); void Init(); protected: @@ -70,7 +69,6 @@ protected: int _servType; CORBA::ORB_var _orb; PortableServer::POA_var _root_poa; - QMutex* _GUIMutex; SALOME_NamingService * _NS; }; @@ -90,6 +88,7 @@ public: protected: virtual void ActivateSession ( int argc, char ** argv ); private: + QMutex* _GUIMutex; QWaitCondition* _GUILauncher; }; diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index d60c3e09d..ee239674e 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -45,12 +45,9 @@ using namespace std; -//============================================================================= -/*! SALOME_Session_i - * constructor - */ -//============================================================================= - +/*! + constructor +*/ SALOME_Session_i::SALOME_Session_i(int argc, char ** argv, CORBA::ORB_ptr orb, @@ -69,12 +66,9 @@ SALOME_Session_i::SALOME_Session_i(int argc, //MESSAGE("constructor end"); } -//============================================================================= -/*! GetVisuComponent - * returns Visu component - */ -//============================================================================= - +/*! + returns Visu component +*/ Engines::Component_ptr SALOME_Session_i::GetComponent(const char* theLibraryName) { typedef Engines::Component_ptr TGetImpl(CORBA::ORB_ptr, @@ -87,24 +81,18 @@ Engines::Component_ptr SALOME_Session_i::GetComponent(const char* theLibraryName return Engines::Component::_nil(); } -//============================================================================= -/*! ~SALOME_Session_i - * destructor - */ -//============================================================================= - +/*! + destructor +*/ SALOME_Session_i::~SALOME_Session_i() { //MESSAGE("destructor end"); } -//============================================================================= -/*! NSregister - * tries to find the Corba Naming Service and to register the session, - * gives naming service interface to _IAPPThread - */ -//============================================================================= - +/*! + tries to find the Corba Naming Service and to register the session, + gives naming service interface to _IAPPThread +*/ void SALOME_Session_i::NSregister() { SALOME::Session_ptr pSession = SALOME::Session::_narrow(_this()); @@ -125,13 +113,10 @@ void SALOME_Session_i::NSregister() //MESSAGE("Session registered in Naming Service"); } -//============================================================================= -/*! GetInterface - * Launches the GUI if there is none. - * The Corba method is oneway (corba client does'nt wait for GUI completion) - */ -//============================================================================= - +/*! + Launches the GUI if there is none. + The Corba method is oneway (corba client does'nt wait for GUI completion) +*/ void SALOME_Session_i::GetInterface() { _GUIMutex->lock(); @@ -143,11 +128,9 @@ void SALOME_Session_i::GetInterface() } } -//============================================================================= -/*! StopSession - * Kills the session if there are no active studies nore GUI - */ -//============================================================================= +/*! + Kills the session if there are no active studies nore GUI +*/ class CloseEvent : public SALOME_Event { public: @@ -159,18 +142,18 @@ public: } }; +/*! + Processes event to close session +*/ void SALOME_Session_i::StopSession() { ProcessVoidEvent( new CloseEvent() ); } -//============================================================================= -/*! StatSession - * Send a SALOME::StatSession structure (see idl) to the client - * (number of running studies and presence of GUI) - */ -//============================================================================= - +/*! + Send a SALOME::StatSession structure (see idl) to the client + (number of running studies and presence of GUI) +*/ class QtLock { public: @@ -209,12 +192,32 @@ CORBA::Long SALOME_Session_i::GetActiveStudyId() { long aStudyId=-1; if ( SUIT_Session::session() && SUIT_Session::session()->activeApplication() ) { - aStudyId = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + if ( SUIT_Session::session()->activeApplication()->activeStudy() ) // mkr : IPAL12128 + aStudyId = SUIT_Session::session()->activeApplication()->activeStudy()->id(); } return aStudyId; } bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint) -{ +{ + class TEvent: public SALOME_Event { + int _savePoint; + public: + TEvent(int savePoint) { _savePoint = savePoint; } + virtual void Execute() { + SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy(); + if ( study ) { + study->restoreState(_savePoint); + } + } + }; + + if(SUIT_Session::session() && SUIT_Session::session()->activeApplication() ) { + SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy(); + if(!study) SUIT_Session::session()->activeApplication()->createEmptyStudy(); + ProcessVoidEvent( new TEvent(theSavePoint) ); + return true; + } + return false; } diff --git a/src/Session/Session_Session_i.hxx b/src/Session/Session_Session_i.hxx index ccc4424fc..3b06ab27f 100755 --- a/src/Session/Session_Session_i.hxx +++ b/src/Session/Session_Session_i.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/Session/Session_SignalsHandler.cxx b/src/Session/Session_SignalsHandler.cxx deleted file mode 100755 index 4eeface46..000000000 --- a/src/Session/Session_SignalsHandler.cxx +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org - - -#include -#include - -#include -#include -#include - -extern "C" int HandleSignals(QApplication *theQApplication) -{ - int aRet = -1; - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - - CASCatch_TRY { - aRet = theQApplication->exec(); - } - CASCatch_CATCH(CASCatch_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); - throw std::runtime_error( aFail->GetError() ); - } - - aCatchSignals.Deactivate(); - return aRet; -} diff --git a/src/Style/Makefile.in b/src/Style/Makefile.in index 1c79d2891..6de6bc78d 100644 --- a/src/Style/Makefile.in +++ b/src/Style/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Vladimir Klyachin (OCN) # Module : SalomeApp @@ -55,7 +73,7 @@ $(INSTALL_PLUGINDIR): mkdir -p $@ $(INSTALL_COPYLIB): - (cd $(bindir)/styles; ln -sf $(patsubst %.la, ../../../lib/salome/%.so, $(filter %.la, $(LIB))) $@) || true + (cd $(bindir)/styles; ln -sf $(patsubst %.la, ../../../lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.la, $(LIB))) $@) || true @CONCLUDE@ diff --git a/src/Style/SalomeStyle.cxx b/src/Style/SalomeStyle.cxx index 8126eb8ec..d35196cf5 100644 --- a/src/Style/SalomeStyle.cxx +++ b/src/Style/SalomeStyle.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SalomeStyle.h" @@ -129,16 +129,25 @@ static const char* const minimize_xpm[] = { Descr: Style for SALOME platform */ +/*! + Constructor +*/ SalomeStyle::SalomeStyle() : myTitleParent( 0 ) { qApp->installEventFilter( this ); } +/*! + Destructor +*/ SalomeStyle::~SalomeStyle() { } +/*! + Delayed initialization of style +*/ void SalomeStyle::polish( QWidget* w ) { if ( !w ) @@ -182,6 +191,9 @@ void SalomeStyle::polish( QWidget* w ) PARENT_STYLE::polish( w ); } +/*! + Custom event filter +*/ bool SalomeStyle::eventFilter( QObject* o, QEvent* e ) { if ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut ) @@ -223,6 +235,12 @@ double linear( double x ) return x; } +/*! + Mixes two colors, part of first is 1-t, part of second is t + \param t - part parameter + \param c1, c2 - colors + \param res - result color +*/ void SalomeStyle::mix( const double t, const QColor& c1, const QColor& c2, QColor& res ) { if( t<0.0 || t>1.0 ) @@ -234,6 +252,11 @@ void SalomeStyle::mix( const double t, const QColor& c1, const QColor& c2, QColo res.setRgb( r, g, b ); } +/*! + Mixes two colors, part of first is 1-t, part of second is t + \param t - part parameter + \param rgb1, rgb2 - colors (result is stored in rgb1) +*/ void SalomeStyle::mix( const double t, QRgb& rgb1, const QRgb& rgb2 ) { if( t<0.0 || t>1.0 ) @@ -247,6 +270,12 @@ void SalomeStyle::mix( const double t, QRgb& rgb1, const QRgb& rgb2 ) rgb1 = qRgba( c[0][0], c[0][1], c[0][2], qAlpha( rgb1 ) ); } +/*! + Mixes colors of pixmap points with other color + \param t - part parameter + \param pix - pixmap to be processed + \param col - other color +*/ void SalomeStyle::mix( const double t, QPixmap& pix, const QColor& col ) { if( t<0.0 || t>1.0 ) @@ -277,6 +306,11 @@ void SalomeStyle::mix( const double t, QPixmap& pix, const QColor& col ) pix = anImage; } +/*! + Converts pixmap to grayscale + \param pix - pixmap to be processed + \param k - factor (gray value after conversion will be multiplied on it and truncated by 255.0) +*/ void SalomeStyle::toGrayscale( QPixmap& pix, double k ) { QImage anImage = pix.convertToImage(); @@ -306,6 +340,14 @@ void SalomeStyle::toGrayscale( QPixmap& pix, double k ) pix = anImage; } +/*! + Draws gradient filling + \param p - painter + \param r - rect + \param c1, c2 - two colors of gradient + \param d - direction of gradient + \param f - gradient function (maps co-ordinate to part parameter) +*/ void SalomeStyle::drawGradient( QPainter* p, const QRect& r, const QColor& c1, const QColor& c2, const Direction d, gradient_func f ) const @@ -338,6 +380,15 @@ void SalomeStyle::drawGradient( QPainter* p, const QRect& r, p->restore(); } +/*! + Draws primitive element + \param pe - type of primitive element + \param p - painter + \param r - rect + \param cg - group of colors + \param flags - is used to control how the PrimitiveElement is drawn + \param opt - can be used to control how various PrimitiveElements are drawn +*/ void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect& r, const QColorGroup& cg, SFlags flags, const QStyleOption& opt ) const { @@ -551,6 +602,16 @@ void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect& } } +/*! + Draws control element + \param element - type of control element + \param p - painter + \param widget - widget + \param r - rect + \param cg - group of colors + \param flags - is used to control how the element is drawn + \param opt - can be used to control how various elements are drawn +*/ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidget* widget, const QRect& r, const QColorGroup& cg, SFlags flags, const QStyleOption& opt ) const { @@ -1058,6 +1119,11 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge } } +/*! + \return the sub-area for the widget in logical coordinates + \param subrect - type of sub area + \param w - widget +*/ QRect SalomeStyle::subRect( SubRect subrect, const QWidget* w ) const { QRect r = PARENT_STYLE::subRect( subrect, w ); @@ -1076,6 +1142,16 @@ QRect SalomeStyle::subRect( SubRect subrect, const QWidget* w ) const return r; } +/*! + Draws the ComplexControl + \param control - type of complex control element + \param p - painter + \param widget - widget + \param r - rect + \param cg - group of colors + \param flags, controls, active - is used to control how the element is drawn + \param opt - can be used to control how various elements are drawn +*/ void SalomeStyle::drawComplexControl( ComplexControl control, QPainter* p, const QWidget* widget, const QRect& r, const QColorGroup& cg, SFlags flags, SCFlags controls, SCFlags active, const QStyleOption& opt ) const @@ -1127,6 +1203,12 @@ void SalomeStyle::drawComplexControl( ComplexControl control, QPainter* p, const } } +/*! + \return pixmap by type + \param st - type of pixmap + \param w - widget + \param opt - style option flags +*/ QPixmap SalomeStyle::stylePixmap( StylePixmap st, const QWidget* w, const QStyleOption& opt ) const { switch ( st ) @@ -1145,6 +1227,11 @@ QPixmap SalomeStyle::stylePixmap( StylePixmap st, const QWidget* w, const QStyle } } +/*! + \return the pixel size + \param pm - type of pixel metrics + \param widget - widget +*/ int SalomeStyle::pixelMetric( PixelMetric pm, const QWidget* widget ) const { int ret = 0; @@ -1186,6 +1273,12 @@ int SalomeStyle::pixelMetric( PixelMetric pm, const QWidget* widget ) const return ret; } +/*! + \return corrected title text + \param txt - title text + \param w - possible width + \param fm - font metrics +*/ QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetrics& fm ) const { QString res = txt.stripWhiteSpace(); @@ -1205,22 +1298,31 @@ QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetr /*! Class: SalomeStylePlugin [Internal] - Descr: Plugin for Qt style mechanism + Constructor */ - SalomeStylePlugin::SalomeStylePlugin() { } +/*! + Destructor +*/ SalomeStylePlugin::~SalomeStylePlugin() { } +/*! + \return keys of styles of plugin +*/ QStringList SalomeStylePlugin::keys() const { return QStringList() << "salome"; } +/*! + \return just created style + \param str - style key +*/ QStyle* SalomeStylePlugin::create( const QString& str ) { if ( str == "salome" ) diff --git a/src/Style/SalomeStyle.h b/src/Style/SalomeStyle.h index 32eec36bf..e6cdd5807 100644 --- a/src/Style/SalomeStyle.h +++ b/src/Style/SalomeStyle.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef SALOMESTYLE_H #define SALOMESTYLE_H diff --git a/src/TOOLSGUI/Makefile.in b/src/TOOLSGUI/Makefile.in index e8e183e7f..bec8e5a2b 100755 --- a/src/TOOLSGUI/Makefile.in +++ b/src/TOOLSGUI/Makefile.in @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -57,10 +57,10 @@ LIB_MOC = ToolsGUI_CatalogGeneratorDlg.h \ LIB_CLIENT_IDL = SALOME_Registry.idl SALOME_Exception.idl -CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -CXXFLAGS += $(OCC_CXXFLAGS) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) +CXXFLAGS += $(OCC_CXXFLAGS) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) -LDFLAGS += $(QT_MT_LIBS) -lsuit $(CAS_KERNEL) -L$(KERNEL_ROOT_DIR)/lib/salome -lSalomeNS -lOpUtil +LDFLAGS += $(QT_MT_LIBS) -lsuit $(CAS_KERNEL) $(KERNEL_LDFLAGS) -lSalomeNS -lOpUtil @CONCLUDE@ diff --git a/src/TOOLSGUI/ToolsGUI.cxx b/src/TOOLSGUI/ToolsGUI.cxx index ac2ca02a7..25b8aeee9 100755 --- a/src/TOOLSGUI/ToolsGUI.cxx +++ b/src/TOOLSGUI/ToolsGUI.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -28,10 +28,9 @@ #include "ToolsGUI.h" -//======================================================================= -// name : GetVisibility -// Purpose : Verify whether object is visible or not -//======================================================================= +/*! + \return true if object is visible +*/ bool ToolsGUI::GetVisibility( _PTR(Study) theStudy, _PTR(SObject) theObj, void* theId ) @@ -46,10 +45,13 @@ bool ToolsGUI::GetVisibility( _PTR(Study) theStudy, return false; } -//======================================================================= -// name : SetVisibility -// Purpose : Set flag visibility of object -//======================================================================= +/*! + Set flag visibility of object + \param theStudy - study + \param theEntry - entry + \param theValue - flag visibility + \param theId - id +*/ bool ToolsGUI::SetVisibility( _PTR(Study) theStudy, const char* theEntry, const bool theValue, @@ -77,8 +79,3 @@ bool ToolsGUI::SetVisibility( _PTR(Study) theStudy, return false; } - - - - - diff --git a/src/TOOLSGUI/ToolsGUI.h b/src/TOOLSGUI/ToolsGUI.h index cb54ffdfc..ceb117928 100755 --- a/src/TOOLSGUI/ToolsGUI.h +++ b/src/TOOLSGUI/ToolsGUI.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx index d06d2e0e3..5cf6f399e 100755 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -59,10 +59,9 @@ using namespace std; #define MARGIN_SIZE 11 #define MIN_EDIT_SIZE 250 -//================================================================================= -// class : ToolsGUI_CatalogGeneratorDlg() -// purpose : Constructor -//================================================================================= +/*! + Constructor +*/ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, const char* name ) : QDialog( parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) { @@ -202,98 +201,88 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con updateButtonState(); } -//================================================================================= -// function : ~ToolsGUI_CatalogGeneratorDlg() -// purpose : destructor -//================================================================================= +/*! + destructor +*/ ToolsGUI_CatalogGeneratorDlg::~ToolsGUI_CatalogGeneratorDlg() { } -//================================================================================= -// function : getIdlFile() -// purpose : gets IDL file name entered -//================================================================================= +/*! + \return IDL file name entered +*/ QString ToolsGUI_CatalogGeneratorDlg::getIdlFile() { return myIdlEdit->text().stripWhiteSpace(); } -//================================================================================= -// function : getXmlFile() -// purpose : gets XML file name entered -//================================================================================= +/*! + \return XML file name entered +*/ QString ToolsGUI_CatalogGeneratorDlg::getXmlFile() { return myXmlEdit->text().stripWhiteSpace(); } -//================================================================================= -// function : getPngFile() -// purpose : gets PNG file name entered -//================================================================================= +/*! + \return PNG file name entered +*/ QString ToolsGUI_CatalogGeneratorDlg::getPngFile() { return myPngEdit->text().stripWhiteSpace(); } -//================================================================================= -// function : getAuthor() -// purpose : gets author -//================================================================================= +/*! + \return author +*/ QString ToolsGUI_CatalogGeneratorDlg::getAuthor() { return myAuthorEdit->text().stripWhiteSpace(); } -//================================================================================= -// function : getVersion() -// purpose : gets version number -//================================================================================= +/*! + \return version number +*/ QString ToolsGUI_CatalogGeneratorDlg::getVersion() { return myVersionEdit->text().stripWhiteSpace(); } -//================================================================================= -// function : getCompName() -// purpose : gets name of the component -//================================================================================= +/*! + \return name of the component +*/ QString ToolsGUI_CatalogGeneratorDlg::getCompName() { return myCompName->text().stripWhiteSpace(); } -//================================================================================= -// function : getCompUserName() -// purpose : gets username of the component -//================================================================================= +/*! + \return username of the component +*/ QString ToolsGUI_CatalogGeneratorDlg::getCompUserName() { return myCompUserName->text().stripWhiteSpace(); } -//================================================================================= -// function : getCompType() -// purpose : gets type of the component -//================================================================================= +/*! + \return type of the component +*/ QString ToolsGUI_CatalogGeneratorDlg::getCompMultiStd() { return myCompMultiStd->text().stripWhiteSpace(); } -//================================================================================= -// function : getComptype() -// purpose : gets type of the component -//================================================================================= + +/*! + \return type of the component +*/ QString ToolsGUI_CatalogGeneratorDlg::getCompType() { return myCompType->text().stripWhiteSpace(); } -//================================================================================= -// function : getIdlPath() -// purpose : gets IDL path of modules -//================================================================================= +/*! + \return IDL path of modules +*/ QString ToolsGUI_CatalogGeneratorDlg::getIdlPath() { cout << "QAD_Desktop::getCatalogue() is not implemented!!"; @@ -325,10 +314,9 @@ QString ToolsGUI_CatalogGeneratorDlg::getIdlPath() */ } -//================================================================================= -// function : onBrowseBtnClicked() -// purpose : <...> (Browse) buttons slot -//================================================================================= +/*! + SLOT: called on Browse button click +*/ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked() { QPushButton* send = (QPushButton*)sender(); @@ -356,20 +344,18 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked() updateButtonState(); } -//================================================================================= -// function : updateButtonState() -// purpose : Updates button's state -//================================================================================= +/*! + Updates button's state +*/ void ToolsGUI_CatalogGeneratorDlg::updateButtonState() { myApplyBtn->setEnabled( !myIdlEdit->text().stripWhiteSpace().isEmpty() && !myXmlEdit->text().stripWhiteSpace().isEmpty() ); } -//================================================================================= -// function : onApply() -// purpose : button slot, performs IDL->XML conversion -//================================================================================= +/*! + button slot, performs IDL->XML conversion +*/ void ToolsGUI_CatalogGeneratorDlg::onApply() { QString IDLpath = getIdlPath(); diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h index 5da0d5cc6..9169f0dde 100755 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,10 +36,6 @@ class QLineEdit; class QPushButton; -//================================================================================= -// class : ToolsGUI_CatalogGeneratorDlg -// purpose : -//================================================================================= class Standard_EXPORT ToolsGUI_CatalogGeneratorDlg : public QDialog { Q_OBJECT diff --git a/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx b/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx index bd1ed427a..4581ab882 100755 --- a/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx +++ b/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -36,6 +36,9 @@ using namespace std; +/*! + Constructor +*/ ToolsGUI_HelpWindow::ToolsGUI_HelpWindow(QWidget* parent, const char* name ) : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose ) { diff --git a/src/TOOLSGUI/ToolsGUI_HelpWindow.h b/src/TOOLSGUI/ToolsGUI_HelpWindow.h index 61ff116c6..b4849baf0 100755 --- a/src/TOOLSGUI/ToolsGUI_HelpWindow.h +++ b/src/TOOLSGUI/ToolsGUI_HelpWindow.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx b/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx index 04d96c00a..7d4fcb0da 100755 --- a/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx +++ b/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx @@ -1,8 +1,20 @@ -// SALOME RegistryDisplay : GUI for Registry server implementation -// -// Copyright (C) 2003 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : ToolsGUI_IntervalWindow.cxx // Author : Oksana TCHEBANOVA @@ -20,8 +32,11 @@ #define SPACING_SIZE 6 #define MIN_SPIN_WIDTH 100 +/*! + Constructor +*/ ToolsGUI_IntervalWindow::ToolsGUI_IntervalWindow ( QWidget* parent ) - : QDialog( parent, "ToolsGUI_IntervalWindow" , true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ) +: QDialog( parent, "ToolsGUI_IntervalWindow" , true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ) { BEGIN_OF("ToolsGUI_IntervalWindow constructor") setCaption( tr( "Refresh Interval" ) ); @@ -73,8 +88,13 @@ ToolsGUI_IntervalWindow::ToolsGUI_IntervalWindow ( QWidget* parent ) END_OF("ToolsGUI_IntervalWindow constructor") } + +/*! + Destructor +*/ ToolsGUI_IntervalWindow::~ToolsGUI_IntervalWindow() {} -/* + +/*! Sets start interval size */ void ToolsGUI_IntervalWindow::setValue(const int size) @@ -82,24 +102,24 @@ void ToolsGUI_IntervalWindow::setValue(const int size) mySpinBox->setValue(size); } -/* - Gets interval size +/*! + \return interval size */ int ToolsGUI_IntervalWindow::getValue() { return mySpinBox->value(); } -/* - gets a pointer to myButtonOk +/*! + \return a pointer to myButtonOk */ QPushButton* ToolsGUI_IntervalWindow::Ok() { return myButtonOk; } -/* - gets a pointer to myButtonCancel +/*! + \return a pointer to myButtonCancel */ QPushButton* ToolsGUI_IntervalWindow::Cancel() { diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h index 3b53d7de8..242373657 100755 --- a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h +++ b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h @@ -1,8 +1,20 @@ -// SALOME RegistryDisplay : GUI for Registry server implementation -// -// Copyright (C) 2003 CEA/DEN, EDF R&D +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : IntervalWindow.hxx // Author : Oksana TCHEBANOVA diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index 332454c73..b6f3e34a5 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -356,9 +356,11 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info) a.append( BOLD( QString::number( int( c_info.uid ) ) ) ); a.append( QString( " )
" ) + tr( "in directory" ) + QString( " " )); a.append( BOLD( c_info.cdir ) ); - + + time_t aTime; a.append( QString( "
" ) + tr( "begins" ) + QString( " " ) ); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; a.append( BOLD( t1 ) ); delete [] t1; @@ -366,7 +368,8 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info) if (c_info.tc_hello != 0 ) { - char * t2 = (char * )duplicate(ctime(&c_info.tc_hello)); + aTime = time_t(c_info.tc_hello); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; a.append( tr( "last signal" ) + QString(" : ") ); a.append( BOLD( t2 ) ); @@ -375,7 +378,8 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info) } if ((c_info.tc_end - c_info.difftime) != 0) { - char * t3 = (char * )duplicate(ctime(&c_info.tc_end)); + aTime = time_t(c_info.tc_end); + char * t3 = (char * )duplicate(ctime(&aTime)); t3 [strlen(t3) -1 ] = ' '; a.append( tr( "ends" ) + QString( " " ) ); a.append( BOLD( t3 ) ); @@ -463,6 +467,7 @@ void ToolsGUI_RegWidget::InfoHistory() _history->clear(); try { + time_t aTime; _serverhistory = _VarComponents->history(); for (CORBA::ULong i=0; i<_serverhistory->length(); i++) { @@ -470,9 +475,11 @@ void ToolsGUI_RegWidget::InfoHistory() ASSERT( c_info.name!=NULL); QString a; a.setNum(int(c_info.pid)); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; - char * t2 = (char * )duplicate(ctime(&c_info.tc_end)); + aTime = time_t(c_info.tc_end); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\ a, QString(c_info.pwname), QString(c_info.machine), \ @@ -503,6 +510,7 @@ void ToolsGUI_RegWidget::InfoReg() _clients->clear(); try { + time_t aTime; _serverclients = _VarComponents->getall(); for (CORBA::ULong i=0; i<_serverclients->length(); i++) { @@ -510,9 +518,11 @@ void ToolsGUI_RegWidget::InfoReg() ASSERT( c_info.name!=NULL); QString a; a.setNum(int(c_info.pid)); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; - char * t2 = (char * )duplicate(ctime(&c_info.tc_hello)); + aTime = time_t(c_info.tc_hello); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\ a, QString(c_info.pwname), QString(c_info.machine), \ @@ -567,6 +577,9 @@ void ToolsGUI_RegWidget::slotSelectRefresh() END_OF("slotSelectRefresh"); } +/*! + SLOT: called when IntervalWindow's OK button is clicked +*/ void ToolsGUI_RegWidget::slotIntervalOk() { BEGIN_OF("slotIntervalOk"); diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.h b/src/TOOLSGUI/ToolsGUI_RegWidget.h index 6d3a66f04..be40bc8a2 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.h +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/TOOLSGUI/resources/ToolsGUI_msg_en.po b/src/TOOLSGUI/resources/ToolsGUI_msg_en.po index 09ad7be89..cfab19fbb 100755 --- a/src/TOOLSGUI/resources/ToolsGUI_msg_en.po +++ b/src/TOOLSGUI/resources/ToolsGUI_msg_en.po @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/VTKViewer/Makefile.in b/src/VTKViewer/Makefile.in index dd5f7ea29..9fee23fb8 100755 --- a/src/VTKViewer/Makefile.in +++ b/src/VTKViewer/Makefile.in @@ -1,3 +1,21 @@ +# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# # File : Makefile.in # Author : Vladimir Klyachin (OCN) # Module : VTKViewer @@ -12,18 +30,18 @@ VPATH=.:@srcdir@:@srcdir@/resources @COMMENCE@ # header files -EXPORT_HEADERS= VTKViewer_Actor.h \ - VTKViewer_CellRectPicker.h \ +EXPORT_HEADERS= \ + VTKViewer.h \ + VTKViewer_CellLocationsArray.h \ + VTKViewer_Actor.h \ VTKViewer_ExtractUnstructuredGrid.h \ VTKViewer_ConvexTool.h \ VTKViewer_Filter.h \ VTKViewer_GeometryFilter.h \ VTKViewer_AppendFilter.h \ VTKViewer_Algorithm.h \ - VTKViewer.h \ VTKViewer_InteractorStyle.h \ VTKViewer_PassThroughFilter.h \ - VTKViewer_RectPicker.h \ VTKViewer_RenderWindow.h \ VTKViewer_RenderWindowInteractor.h \ VTKViewer_ShrinkFilter.h \ @@ -39,48 +57,46 @@ EXPORT_HEADERS= VTKViewer_Actor.h \ PO_FILES = \ VTKViewer_images.po \ - VTKViewer_msg_en.po \ - VTKViewerM_images.po \ - VTKViewerM_msg_en.po - + VTKViewer_msg_en.po + # Libraries targets LIB = libVTKViewer.la -LIB_SRC= VTKViewer_Actor.cxx \ - VTKViewer_CellRectPicker.cxx \ - VTKViewer_ExtractUnstructuredGrid.cxx \ - VTKViewer_Filter.cxx \ - VTKViewer_GeometryFilter.cxx \ - VTKViewer_AppendFilter.cxx \ - VTKViewer_InteractorStyle.cxx \ - VTKViewer_PassThroughFilter.cxx \ - VTKViewer_RectPicker.cxx \ - VTKViewer_RenderWindow.cxx \ - VTKViewer_RenderWindowInteractor.cxx \ - VTKViewer_ShrinkFilter.cxx \ - VTKViewer_Transform.cxx \ - VTKViewer_TransformFilter.cxx \ - VTKViewer_Trihedron.cxx \ - VTKViewer_Utilities.cxx \ - VTKViewer_VectorText.cxx \ - VTKViewer_ViewManager.cxx \ - VTKViewer_ViewModel.cxx \ - VTKViewer_ConvexTool.cxx \ - VTKViewer_ViewWindow.cxx +LIB_SRC= \ + VTKViewer_CellLocationsArray.cxx \ + VTKViewer_Actor.cxx \ + VTKViewer_ExtractUnstructuredGrid.cxx \ + VTKViewer_Filter.cxx \ + VTKViewer_GeometryFilter.cxx \ + VTKViewer_AppendFilter.cxx \ + VTKViewer_InteractorStyle.cxx \ + VTKViewer_PassThroughFilter.cxx \ + VTKViewer_RenderWindow.cxx \ + VTKViewer_RenderWindowInteractor.cxx \ + VTKViewer_ShrinkFilter.cxx \ + VTKViewer_Transform.cxx \ + VTKViewer_TransformFilter.cxx \ + VTKViewer_Trihedron.cxx \ + VTKViewer_Utilities.cxx \ + VTKViewer_VectorText.cxx \ + VTKViewer_ViewManager.cxx \ + VTKViewer_ViewModel.cxx \ + VTKViewer_ConvexTool.cxx \ + VTKViewer_ViewWindow.cxx LIB_MOC = \ - VTKViewer_RenderWindow.h \ - VTKViewer_RenderWindowInteractor.h \ - VTKViewer_ViewManager.h \ - VTKViewer_ViewModel.h \ - VTKViewer_ViewWindow.h + VTKViewer_RenderWindow.h \ + VTKViewer_RenderWindowInteractor.h \ + VTKViewer_ViewManager.h \ + VTKViewer_ViewModel.h \ + VTKViewer_ViewWindow.h BIN = VTKViewer CPPFLAGS+=$(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) -LDFLAGS+=$(VTK_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) +LDFLAGS+=$(VTK_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) -lqtx -lsuit -LDFLAGSFORBIN=$(LDFLAGS) -lqtx -lsuit +LDFLAGSFORBIN=$(LDFLAGS) @CONCLUDE@ \ No newline at end of file diff --git a/src/VTKViewer/VTKViewer.cxx b/src/VTKViewer/VTKViewer.cxx index 9755466c0..6a548f1df 100644 --- a/src/VTKViewer/VTKViewer.cxx +++ b/src/VTKViewer/VTKViewer.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer.h b/src/VTKViewer/VTKViewer.h index 27934b610..77de94830 100755 --- a/src/VTKViewer/VTKViewer.h +++ b/src/VTKViewer/VTKViewer.h @@ -14,14 +14,27 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + +#ifndef VTKVIEWER_H +#define VTKVIEWER_H + #ifdef WNT -#ifdef VTKVIEWER_EXPORTS -#define VTKVIEWER_EXPORT __declspec( dllexport ) +# ifdef VTKVIEWER_EXPORTS +# define VTKVIEWER_EXPORT __declspec( dllexport ) +# else +# define VTKVIEWER_EXPORT __declspec( dllimport ) +# endif #else -#define VTKVIEWER_EXPORT __declspec( dllimport ) +# define VTKVIEWER_EXPORT #endif -#else -#define VTKVIEWER_EXPORT + +#include + +#if !defined(vtkFloatingPointType) +# define vtkFloatingPointType vtkFloatingPointType + typedef float vtkFloatingPointType; +#endif + #endif diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index da05fc98d..5f0e621e7 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -60,11 +60,11 @@ int VTKViewer_POINT_SIZE = 5; int VTKViewer_LINE_WIDTH = 3; -//---------------------------------------------------------------------------- vtkStandardNewMacro(VTKViewer_Actor); - -//---------------------------------------------------------------------------- +/*! + Constructor +*/ VTKViewer_Actor ::VTKViewer_Actor(): myIsHighlighted(false), @@ -86,8 +86,9 @@ VTKViewer_Actor myPassFilter.push_back(VTKViewer_PassThroughFilter::New()); } - -//---------------------------------------------------------------------------- +/*! + Destructor +*/ VTKViewer_Actor ::~VTKViewer_Actor() { @@ -104,8 +105,9 @@ VTKViewer_Actor myProperty->Delete(); } - -//---------------------------------------------------------------------------- +/*! + \return name +*/ const char* VTKViewer_Actor ::getName() @@ -113,6 +115,10 @@ VTKViewer_Actor return myName.c_str(); } +/*! + Sets name + \param theName - new name +*/ void VTKViewer_Actor ::setName(const char* theName) @@ -120,8 +126,9 @@ VTKViewer_Actor myName = theName; } - -//---------------------------------------------------------------------------- +/*! + To publish the actor an all its internal devices +*/ void VTKViewer_Actor ::AddToRender(vtkRenderer* theRenderer) @@ -129,6 +136,9 @@ VTKViewer_Actor theRenderer->AddActor(this); } +/*! + To remove the actor an all its internal devices +*/ void VTKViewer_Actor ::RemoveFromRender(vtkRenderer* theRenderer) @@ -136,13 +146,18 @@ VTKViewer_Actor theRenderer->RemoveActor(this); } +/*! + Used to obtain all dependent actors +*/ void VTKViewer_Actor ::GetChildActors(vtkActorCollection*) {} - -//---------------------------------------------------------------------------- +/*! + Apply view transformation + \param theTransform - view transformation +*/ void VTKViewer_Actor ::SetTransform(VTKViewer_Transform* theTransform) @@ -151,6 +166,9 @@ VTKViewer_Actor } +/*! + To insert some additional filters and then sets the given #vtkMapper +*/ void VTKViewer_Actor ::SetMapper(vtkMapper* theMapper) @@ -158,6 +176,9 @@ VTKViewer_Actor InitPipeLine(theMapper); } +/*! + Initialization +*/ void VTKViewer_Actor ::InitPipeLine(vtkMapper* theMapper) @@ -192,15 +213,23 @@ VTKViewer_Actor Superclass::SetMapper(theMapper); } - -//---------------------------------------------------------------------------- +/*! + Renders actor +*/ void VTKViewer_Actor ::Render(vtkRenderer *ren, vtkMapper* m) { + if(vtkDataSet* aDataSet = GetInput()){ + static vtkFloatingPointType PERCENTS_OF_DETAILS = 0.50; + vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS); + if(aNbOfPoints > 0) + SetNumberOfCloudPoints(aNbOfPoints); + } + if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - float aFactor, aUnit; + vtkFloatingPointType aFactor, aUnit; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -215,7 +244,10 @@ VTKViewer_Actor } } - +/*! + Set ResolveCoincidentTopology flag + \param theIsResolve - new flag value +*/ void VTKViewer_Actor ::SetResolveCoincidentTopology(bool theIsResolve) @@ -223,31 +255,45 @@ VTKViewer_Actor myIsResolveCoincidentTopology = theIsResolve; } +/*! + Set polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ void VTKViewer_Actor -::SetPolygonOffsetParameters(float factor, float units) +::SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; } +/*! + Get polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ void VTKViewer_Actor -::GetPolygonOffsetParameters(float& factor, float& units) +::GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; } - -//---------------------------------------------------------------------------- -float +/*! + \return shrink factor +*/ +vtkFloatingPointType VTKViewer_Actor ::GetShrinkFactor() { return 1.0; } +/*! + \return true if the actor is shrunkable +*/ bool VTKViewer_Actor ::IsShrunkable() @@ -255,6 +301,9 @@ VTKViewer_Actor return false; } +/*! + \return true if the actor is shrunk +*/ bool VTKViewer_Actor ::IsShrunk() @@ -262,18 +311,25 @@ VTKViewer_Actor return false; } +/*! + Insert shrink filter into pipeline +*/ void VTKViewer_Actor ::SetShrink() {} +/*! + Remove shrink filter from pipeline +*/ void VTKViewer_Actor ::UnShrink() {} - -//---------------------------------------------------------------------------- +/*! + Allows to get initial #vtkDataSet +*/ vtkDataSet* VTKViewer_Actor ::GetInput() @@ -281,7 +337,9 @@ VTKViewer_Actor return myPassFilter.front()->GetOutput(); } - +/*! + To calculatate last modified time +*/ unsigned long int VTKViewer_Actor ::GetMTime() @@ -296,8 +354,10 @@ VTKViewer_Actor return mTime; } - -//---------------------------------------------------------------------------- +/*! + Set representation (VTK_SURFACE, VTK_POINTS, VTK_WIREFRAME and so on) + param theMode - new mode +*/ void VTKViewer_Actor ::SetRepresentation(int theMode) @@ -305,18 +365,25 @@ VTKViewer_Actor switch(myRepresentation){ case VTK_POINTS : case VTK_SURFACE : - myProperty->DeepCopy(GetProperty()); + myProperty->SetAmbient(GetProperty()->GetAmbient()); + myProperty->SetDiffuse(GetProperty()->GetDiffuse()); + myProperty->SetSpecular(GetProperty()->GetSpecular()); + break; } + switch(theMode){ case VTK_POINTS : case VTK_SURFACE : - GetProperty()->DeepCopy(myProperty); + GetProperty()->SetAmbient(myProperty->GetAmbient()); + GetProperty()->SetDiffuse(myProperty->GetDiffuse()); + GetProperty()->SetSpecular(myProperty->GetSpecular()); break; default: GetProperty()->SetAmbient(1.0); GetProperty()->SetDiffuse(0.0); GetProperty()->SetSpecular(0.0); } + switch(theMode){ case 3 : myGeomFilter->SetInside(true); @@ -340,9 +407,13 @@ VTKViewer_Actor myGeomFilter->SetInside(false); break; } + myRepresentation = theMode; } +/*! + \return current representation mode +*/ int VTKViewer_Actor ::GetRepresentation() @@ -350,8 +421,9 @@ VTKViewer_Actor return myRepresentation; } - -//---------------------------------------------------------------------------- +/*! + Maps VTK index of a node to corresponding object index +*/ int VTKViewer_Actor ::GetNodeObjId(int theVtkID) @@ -359,13 +431,19 @@ VTKViewer_Actor return theVtkID; } -float* +/*! + Get coordinates of a node for given object index +*/ +vtkFloatingPointType* VTKViewer_Actor ::GetNodeCoord(int theObjID) { return GetInput()->GetPoint(theObjID); } +/*! + Get corresponding #vtkCell for given object index +*/ vtkCell* VTKViewer_Actor ::GetElemCell(int theObjID) @@ -373,6 +451,9 @@ VTKViewer_Actor return GetInput()->GetCell(theObjID); } +/*! + Maps VTK index of a cell to corresponding object index +*/ int VTKViewer_Actor ::GetElemObjId(int theVtkID) @@ -381,11 +462,9 @@ VTKViewer_Actor } -//================================================================================= -// function : GetObjDimension -// purpose : Return object dimension. -// Virtual method shoulb be redifined by derived classes -//================================================================================= +/*! + \return object dimension. Virtual method should be redifined by derived classes +*/ int VTKViewer_Actor ::GetObjDimension( const int theObjId ) @@ -395,7 +474,10 @@ VTKViewer_Actor return 0; } - +/*! + Infinitive means actor without size (point for example), + which is not taken into account in calculation of boundaries of the scene +*/ void VTKViewer_Actor ::SetInfinitive(bool theIsInfinite) @@ -403,16 +485,34 @@ VTKViewer_Actor myIsInfinite = theIsInfinite; } - +/*! + \return infinive flag +*/ bool VTKViewer_Actor ::IsInfinitive() { - return myIsInfinite; -} + if(myIsInfinite) + return true; + static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; + vtkFloatingPointType aBounds[6]; + GetBounds(aBounds); + for(int i = 0; i < 6; i++) + if(fabs(aBounds[i]) > MAX_DISTANCE) + return true; + + static vtkFloatingPointType MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT; + if(GetLength() < MIN_DISTANCE) + return true; + + return false; +} -float* +/*! + \return current bounding box +*/ +vtkFloatingPointType* VTKViewer_Actor ::GetBounds() { @@ -420,15 +520,17 @@ VTKViewer_Actor } +/*! + \return current bounding box +*/ void VTKViewer_Actor -::GetBounds(float theBounds[6]) +::GetBounds(vtkFloatingPointType theBounds[6]) { Superclass::GetBounds(theBounds); } -//---------------------------------------------------------------------------- bool VTKViewer_Actor ::IsSetCamera() const @@ -445,7 +547,7 @@ VTKViewer_Actor void VTKViewer_Actor -::SetSize( const float ) +::SetSize( const vtkFloatingPointType ) {} @@ -454,16 +556,16 @@ VTKViewer_Actor ::SetCamera( vtkCamera* ) {} -//---------------------------------------------------------------------------- + void VTKViewer_Actor -::SetOpacity(float theOpacity) +::SetOpacity(vtkFloatingPointType theOpacity) { myOpacity = theOpacity; GetProperty()->SetOpacity(theOpacity); } -float +vtkFloatingPointType VTKViewer_Actor ::GetOpacity() { @@ -471,25 +573,38 @@ VTKViewer_Actor } +/*! + Change color +*/ void VTKViewer_Actor -::SetColor(float r,float g,float b) +::SetColor(vtkFloatingPointType r, + vtkFloatingPointType g, + vtkFloatingPointType b) { GetProperty()->SetColor(r,g,b); } +/*! + Change color +*/ void VTKViewer_Actor -::SetColor(const float theRGB[3]) +::SetColor(const vtkFloatingPointType theRGB[3]) { SetColor(theRGB[0],theRGB[1],theRGB[2]); } +/*! + Get color +*/ void VTKViewer_Actor -::GetColor(float& r,float& g,float& b) +::GetColor(vtkFloatingPointType& r, + vtkFloatingPointType& g, + vtkFloatingPointType& b) { - float aColor[3]; + vtkFloatingPointType aColor[3]; GetProperty()->GetColor(aColor); r = aColor[0]; g = aColor[1]; @@ -497,7 +612,9 @@ VTKViewer_Actor } -//---------------------------------------------------------------------------- +/*! + \return display mode +*/ int VTKViewer_Actor ::getDisplayMode() @@ -505,6 +622,9 @@ VTKViewer_Actor return myDisplayMode; } +/*! + Change display mode +*/ void VTKViewer_Actor ::setDisplayMode(int theMode) @@ -514,7 +634,9 @@ VTKViewer_Actor } -//---------------------------------------------------------------------------- +/*! + \return true if the descendant of the VTKViewer_Actor will implement its own highlight or not +*/ bool VTKViewer_Actor ::hasHighlight() @@ -522,6 +644,9 @@ VTKViewer_Actor return false; } +/*! + \return true if the VTKViewer_Actor is already highlighted +*/ bool VTKViewer_Actor ::isHighlighted() @@ -529,6 +654,9 @@ VTKViewer_Actor return myIsHighlighted; } +/*! + Set preselection mode +*/ void VTKViewer_Actor ::SetPreSelected(bool thePreselect) @@ -536,8 +664,9 @@ VTKViewer_Actor myIsPreselected = thePreselect; } - -//---------------------------------------------------------------- +/*! + Just to update visibility of the highlight devices +*/ void VTKViewer_Actor ::highlight(bool theIsHighlight) diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index 55711a8c0..a0d9c4ba0 100755 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -77,27 +77,31 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Change opacity virtual void - SetOpacity(float theOpacity); + SetOpacity(vtkFloatingPointType theOpacity); //! Get current opacity virtual - float + vtkFloatingPointType GetOpacity(); //! Change color virtual void - SetColor(float r,float g,float b); + SetColor(vtkFloatingPointType r, + vtkFloatingPointType g, + vtkFloatingPointType b); //! Get current color virtual void - GetColor(float& r,float& g,float& b); + GetColor(vtkFloatingPointType& r, + vtkFloatingPointType& g, + vtkFloatingPointType& b); //! Change color virtual void - SetColor(const float theRGB[3]); + SetColor(const vtkFloatingPointType theRGB[3]); //---------------------------------------------------------------------------- // For selection mapping purpose @@ -108,7 +112,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Get coordinates of a node for given object index virtual - float* + vtkFloatingPointType* GetNodeCoord(int theObjID); //! Maps VTK index of a cell to corresponding object index @@ -184,12 +188,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! To calcualte current bounding box virtual - float* + vtkFloatingPointType* GetBounds(); //! To calcualte current bounding box void - GetBounds(float bounds[6]); + GetBounds(vtkFloatingPointType bounds[6]); //---------------------------------------------------------------------------- virtual @@ -202,7 +206,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor virtual void - SetSize( const float ); + SetSize( const vtkFloatingPointType ); virtual void @@ -215,11 +219,13 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Set ResolveCoincidentTopology parameters void - SetPolygonOffsetParameters(float factor, float units); + SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units); //! Get current ResolveCoincidentTopology parameters void - GetPolygonOffsetParameters(float& factor, float& units); + GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units); virtual void @@ -228,7 +234,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //---------------------------------------------------------------------------- //! Get current shrink factor virtual - float + vtkFloatingPointType GetShrinkFactor(); //! Is the actor is shrunkable @@ -295,12 +301,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor protected: //---------------------------------------------------------------------------- bool myIsResolveCoincidentTopology; - float myPolygonOffsetFactor; - float myPolygonOffsetUnits; + vtkFloatingPointType myPolygonOffsetFactor; + vtkFloatingPointType myPolygonOffsetUnits; std::string myName; - float myOpacity; + vtkFloatingPointType myOpacity; int myDisplayMode; bool myIsInfinite; diff --git a/src/VTKViewer/VTKViewer_Algorithm.h b/src/VTKViewer/VTKViewer_Algorithm.h index 6dcde3a40..b533f149b 100644 --- a/src/VTKViewer/VTKViewer_Algorithm.h +++ b/src/VTKViewer/VTKViewer_Algorithm.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index dce05c44e..4218c4f20 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.cxx +++ b/src/VTKViewer/VTKViewer_AppendFilter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -28,38 +28,15 @@ #include "VTKViewer_AppendFilter.h" -#include "VTKViewer_ConvexTool.h" - -#include -#include +#include #include -#include -#include -#include +#include +#include #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include - -#include -#include -using namespace std; - -#ifdef _DEBUG_ -//static int MYDEBUG = 0; -//static int MYDEBUGWITHFILES = 0; -#else -//static int MYDEBUG = 0; -//static int MYDEBUGWITHFILES = 0; -#endif +#include #if defined __GNUC__ #if __GNUC__ == 2 @@ -73,7 +50,7 @@ vtkStandardNewMacro(VTKViewer_AppendFilter); VTKViewer_AppendFilter ::VTKViewer_AppendFilter() { - myDoMappingFlag=false; + myDoMappingFlag = false; } VTKViewer_AppendFilter @@ -84,7 +61,12 @@ void VTKViewer_AppendFilter ::SetDoMappingFlag(const bool theFlag) { - myDoMappingFlag=theFlag; + if(myDoMappingFlag == theFlag) + return; + + myDoMappingFlag = theFlag; + + this->Modified(); } bool @@ -98,7 +80,12 @@ void VTKViewer_AppendFilter ::SetPoints(vtkPoints* thePoints) { + if(GetPoints() == thePoints) + return; + myPoints = thePoints; + + this->Modified(); } vtkPoints* @@ -112,199 +99,153 @@ void VTKViewer_AppendFilter ::Execute() { - if (myPoints.GetPointer()) { + if(myPoints.GetPointer()) MakeOutput(); - } - else { - vtkAppendFilter::Execute(); - } - if (myDoMappingFlag){ + else + Superclass::Execute(); + + if(myDoMappingFlag) DoMapping(); - } } + void VTKViewer_AppendFilter -::Reset() +::DoMapping() { - myNodeIds.clear(); - myCellIds.clear(); myNodeRanges.clear(); myCellRanges.clear(); - myNodeMapObjIDVtkID.clear(); - myCellMapObjIDVtkID.clear(); + + vtkIdType aPntStartId = 0; + vtkIdType aCellStartId = 0; + + for(vtkIdType aDataSetId = 0; aDataSetId < this->NumberOfInputs; ++aDataSetId){ + vtkDataSet* aDataSet = (vtkDataSet *)(this->Inputs[aDataSetId]); + // Do mapping of the nodes + if(!myPoints.GetPointer()){ + vtkIdType aNbPnts = aDataSet->GetNumberOfPoints(); + myNodeRanges.push_back(aPntStartId + aNbPnts); + aPntStartId += aNbPnts; + } + // Do mapping of the cells + vtkIdType aNbCells = aDataSet->GetNumberOfCells(); + myCellRanges.push_back(aCellStartId + aNbCells); + aCellStartId += aNbCells; + } } -//================================================================== -// function: DoMapping -// purpose : -//================================================================== -void -VTKViewer_AppendFilter -::DoMapping() + +namespace { - int i, j, i1, i2, iNodeCnt, iCellCnt; - IteratorOfDataMapOfIntegerInteger aMapIt; - vtkIdType aNbPnts, aNbCells, aId; - vtkDataSet *pDS; - // - Reset(); - // - iNodeCnt=0; - iCellCnt=0; - for (i=0; iGetNumberOfPoints(); - i1=myNodeIds.size(); - i2=i1+aNbPnts-1; - myNodeRanges.push_back(i1); - myNodeRanges.push_back(i2); - // - for(j=0; jGetNumberOfCells(); - i1=myCellIds.size(); - i2=i1+aNbCells-1; - myCellRanges.push_back(i1); - myCellRanges.push_back(i2); - for(j=0; j= aNbInputs) + return -1; + + vtkIdType aStartId = theRanges[theInputDataSetID]; + return aStartId + theInputID; } } -//--------------------------------------------------------------- vtkIdType VTKViewer_AppendFilter -::GetPointOutputID(vtkIdType theInputID) +::GetPointOutputID(vtkIdType theInputID, + vtkIdType theInputDataSetID) { - if (myPoints.GetPointer()) { + if(myPoints.GetPointer()) return theInputID; - } - // - int aVtkID=-1; - IteratorOfDataMapOfIntegerInteger aMapIt; - // - aMapIt=myNodeMapObjIDVtkID.find(theInputID); - if (aMapIt!=myNodeMapObjIDVtkID.end()) { - // found - PairOfDataMapOfIntegerInteger& aPair=(*aMapIt); - aVtkID=aPair.second; - } - return aVtkID; + + return GetOutputID(theInputID,theInputDataSetID,myNodeRanges); } -//--------------------------------------------------------------- vtkIdType VTKViewer_AppendFilter -::GetCellOutputID(vtkIdType theInputID) +::GetCellOutputID(vtkIdType theInputID, + vtkIdType theInputDataSetID) { - int aVtkID=-1; - IteratorOfDataMapOfIntegerInteger aMapIt; - // - aMapIt=myCellMapObjIDVtkID.find(theInputID); - if (aMapIt!=myCellMapObjIDVtkID.end()) { - // found - PairOfDataMapOfIntegerInteger& aPair=(*aMapIt); - aVtkID=aPair.second; - } - return aVtkID; + if(myPoints.GetPointer()) + return theInputID; + + return GetOutputID(theInputID,theInputDataSetID,myCellRanges); } -//--------------------------------------------------------------- -vtkIdType +namespace +{ + void + GetInputID(vtkIdType theOutputID, + vtkIdType& theInputID, + vtkIdType& theStartID, + vtkIdType& theInputDataSetID, + const VTKViewer_AppendFilter::TVectorIds& theRanges) + { + theInputID = theStartID = theInputDataSetID = -1; + + if(theRanges.empty()) + return; + + const vtkIdType& aRangeEnd = theRanges.back(); + if(theOutputID < 0 || theOutputID >= aRangeEnd) + return; + + vtkIdType aStartId = 0; + vtkIdType aNbInputs = theRanges.size(); + for(vtkIdType aDataSetId = 0; aDataSetId < aNbInputs; ++aDataSetId){ + vtkIdType aRange = theRanges[aDataSetId]; + if(aRange > theOutputID){ + theInputID = theOutputID - aStartId; + theInputDataSetID = aDataSetId; + theStartID = aStartId; + break; + } + aStartId = aRange; + } + } +} + +void VTKViewer_AppendFilter -::GetPointInputID(vtkIdType theOutputID, +::GetPointInputID(vtkIdType theOutputID, + vtkIdType& theInputID, + vtkIdType& theStartID, vtkIdType& theInputDataSetID) { - if (myPoints.GetPointer()) { - theInputDataSetID=0; - return theOutputID; - } - // - int aNb, aNbRanges, aRetID, i, i1, i2, j; - // - aRetID=-1; - theInputDataSetID=-1; - // - aNb=myNodeIds.size(); - if (theOutputID<0 || theOutputID>=aNb) { - return aRetID; - } - // - aRetID=(int)myNodeIds[theOutputID]; - // - aNbRanges=myNodeRanges.size()/2; - for (i=0; i=i1 && theOutputID<=i2) { - theInputDataSetID=i; - } + if(myPoints.GetPointer()) { + theStartID = theInputDataSetID = 0; + theInputID = theOutputID; + return; } - // - return aRetID; + + ::GetInputID(theOutputID, + theInputID, + theStartID, + theInputDataSetID, + myNodeRanges); } -//--------------------------------------------------------------- -vtkIdType +void VTKViewer_AppendFilter -::GetCellInputID(vtkIdType theOutputID, +::GetCellInputID(vtkIdType theOutputID, + vtkIdType& theInputID, + vtkIdType& theStartID, vtkIdType& theInputDataSetID) { - int aNb, aNbRanges, aRetID, i, i1, i2, j; - // - aRetID=-1; - theInputDataSetID=-1; - // - aNb=myCellIds.size(); - if (theOutputID<0 || theOutputID>=aNb) { - return aRetID; - } - // - aRetID=(int)myCellIds[theOutputID]; - // - aNbRanges=myCellRanges.size()/2; - for (i=0; i=i1 && theOutputID<=i2) { - theInputDataSetID=i; - } - } - // - return aRetID; + ::GetInputID(theOutputID, + theInputID, + theStartID, + theInputDataSetID, + myCellRanges); } -//--------------------------------------------------------------- void VTKViewer_AppendFilter ::MakeOutput() diff --git a/src/VTKViewer/VTKViewer_AppendFilter.h b/src/VTKViewer/VTKViewer_AppendFilter.h index f9c6b245a..c9a756381 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.h +++ b/src/VTKViewer/VTKViewer_AppendFilter.h @@ -1,3 +1,21 @@ +// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef VTKVIEWER_APPENDFILTER_H #define VTKVIEWER_APPENDFILTER_H @@ -36,19 +54,27 @@ public: GetPoints(); vtkIdType - GetPointOutputID(vtkIdType theInputID); + GetPointOutputID(vtkIdType theInputID, + vtkIdType theInputDataSetID); vtkIdType - GetCellOutputID(vtkIdType theInputID); + GetCellOutputID(vtkIdType theInputID, + vtkIdType theInputDataSetID); - vtkIdType - GetPointInputID(vtkIdType theOutputID, - vtkIdType& theInputDataSetID); + void + GetPointInputID(vtkIdType theOutputID, + vtkIdType& theInputID, + vtkIdType& theStartID, + vtkIdType& theInputDataSetID); - vtkIdType - GetCellInputID(vtkIdType theOutputID, + void + GetCellInputID(vtkIdType theOutputID, + vtkIdType& theInputID, + vtkIdType& theStartID, vtkIdType& theInputDataSetID); + typedef std::vector TVectorIds; + protected: /*! \fn VTKViewer_AppendFilter(); * \brief Constructor @@ -69,23 +95,10 @@ protected: void MakeOutput(); - // + bool myDoMappingFlag; + TVectorIds myNodeRanges; + TVectorIds myCellRanges; vtkSmartPointer myPoints; - -private: - typedef std::vector TVectorId; - typedef std::vector VectorInt; - typedef std::map DataMapOfIntegerInteger; - typedef DataMapOfIntegerInteger::iterator IteratorOfDataMapOfIntegerInteger; - typedef DataMapOfIntegerInteger::value_type PairOfDataMapOfIntegerInteger; -private: - bool myDoMappingFlag; - TVectorId myNodeIds; - TVectorId myCellIds; - VectorInt myNodeRanges; - VectorInt myCellRanges; - DataMapOfIntegerInteger myNodeMapObjIDVtkID; - DataMapOfIntegerInteger myCellMapObjIDVtkID; }; #endif diff --git a/src/VTKViewer/VTKViewer_CellRectPicker.cxx b/src/VTKViewer/VTKViewer_CellRectPicker.cxx index 36b1741b5..016da1f75 100755 --- a/src/VTKViewer/VTKViewer_CellRectPicker.cxx +++ b/src/VTKViewer/VTKViewer_CellRectPicker.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include diff --git a/src/VTKViewer/VTKViewer_CellRectPicker.h b/src/VTKViewer/VTKViewer_CellRectPicker.h index 8cbbe245d..f50636ab2 100755 --- a/src/VTKViewer/VTKViewer_CellRectPicker.h +++ b/src/VTKViewer/VTKViewer_CellRectPicker.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : VTKViewer_CellRectPicker.h // Author : Natalia KOPNOVA diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 679e48428..988522562 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -25,866 +25,566 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com #include "VTKViewer_ConvexTool.h" -#include -#include -#include -#include -#include -#include - #include -#include +#include #include -#include - -typedef vtkUnstructuredGrid TInput; -typedef std::set TUIDS; // unique ids -typedef std::map TPTOIDS; // id points -> unique ids - -namespace CONVEX_TOOL -{ - // all pairs - typedef std::pair TPair; - typedef std::set TSet; - - void - WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName) - { - vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); - aWriter->SetFileName(theFileName.c_str()); - aWriter->SetInput(theDataSet); - aWriter->Write(); - aWriter->Delete(); - } +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -static float FACE_ANGLE_TOLERANCE=1.5; -#define EPS 1.0e-38 -#define EPS_T 1.0e-3 - -#ifdef _DEBUG_ - static int MYDEBUG = 0; - static int MYDEBUG_REMOVE = 0; -#else - static int MYDEBUG = 0; - static int MYDEBUG_REMOVE = 0; -#endif - -/*! \fn static void GetCenter(TInput* theGrid,TCell theptIds,float *center) - * \brief Calculation of geometry center. - * \param theGrid - TInput cell. - * \param theptIds - point ids. - * \retval center - output array[3] with coordinates of geometry center. - */ -static void GetCenter(vtkPoints* thePoints,float center[3]) +namespace { - float p[3]; - center[0] = center[1] = center[2] = 0.0; + typedef std::vector TConnectivities; - int numPts = thePoints->GetNumberOfPoints(); - if (numPts == 0) return; - - // get the center of the cell - for (int i = 0; i < numPts; i++) + struct TPolygon { - thePoints->GetPoint(i, p); - for (int j = 0; j < 3; j++) + TConnectivities myConnectivities; + vtkFloatingPointType myOrigin[3]; + vtkFloatingPointType myNormal[3]; + TPolygon(const TConnectivities& theConnectivities, + vtkFloatingPointType theOrigin[3], + vtkFloatingPointType theNormal[3]): + myConnectivities(theConnectivities) { - center[j] += p[j]; + myOrigin[0] = theOrigin[0]; + myOrigin[1] = theOrigin[1]; + myOrigin[2] = theOrigin[2]; + + myNormal[0] = theNormal[0]; + myNormal[1] = theNormal[1]; + myNormal[2] = theNormal[2]; } - } - for (int j = 0; j < 3; j++) - { - center[j] /= numPts; - } + }; + + typedef std::vector TPolygons; } -/*! \fn static void ReverseIds(TCell &theIds) - * \brief Reverse ids. - * \param theIds - points ids. - * \retval theIds - example input:(1,2,3,4) -> output:(4,3,2,1) - */ -static void ReverseIds(TCell &theIds) +/*! + Constructor +*/ +VTKViewer_Triangulator +::VTKViewer_Triangulator(): + myInput(NULL), + myCellId(-1), + myShowInside(-1), + myAllVisible(-1), + myCellsVisibility(NULL), + myCellIds(vtkIdList::New()) +{} + + +/*! + Destructor +*/ +VTKViewer_Triangulator +::~VTKViewer_Triangulator() { - int i; - vtkIdType tmp; - vtkIdType npts=theIds.size(); - - for(i=0;i<(npts/2);i++){ - tmp = theIds[i]; - theIds[i] = theIds[npts-i-1]; - theIds[npts-i-1] = tmp; - } + myCellIds->Delete(); } -/*! \fn void GetFriends(const TPTOIDS p2faces,const TCellArray f2points,TPTOIDS& face2face_output) - * \brief Caclulation of connected faces (faceId -> (faceId1,faceId2, ...)) - * \param p2faces - point to faces ids map. - * \param f2points - faces to points ids map. - * \retval face2face_output - faces to faces ids map. - */ -void GetFriends(const TPTOIDS p2faces,const TCellArray f2points,TPTOIDS& face2face_output) -{ - TCellArray::const_iterator f2pIter = f2points.begin(); - for( ; f2pIter!=f2points.end() ; f2pIter++ ){ - vtkIdType faceId = f2pIter->first; - TCell face_points = f2pIter->second; - int nb_face_points = face_points.size(); - - vtkIdType id1; - vtkIdType id2; - TPTOIDS::const_iterator faces1; - TPTOIDS::const_iterator faces2; - - id1 = face_points[0]; - faces1 = p2faces.find(id1); - - TUIDS output_faces; - - for(int i=1 ; i& theVTK2ObjIds, + bool theIsCheckConvex) +{ + myInput = theInput; + myCellId = theCellId; + myShowInside = theShowInside; + myAllVisible = theAllVisible; + myCellsVisibility = theCellsVisibility; - faces2 = p2faces.find(id2); - - std::set_intersection(faces1->second.begin(), faces1->second.end(), faces2->second.begin(), faces2->second.end(), - std::inserter(output_faces,output_faces.begin())); - - id1 = id2; - faces1 = faces2; - } - id1 = face_points[0]; - faces1 = p2faces.find(id1); - std::set_intersection(faces1->second.begin(), faces1->second.end(), faces2->second.begin(), faces2->second.end(), - std::inserter(output_faces,output_faces.begin())); - - output_faces.erase(faceId); // erase the face id for which we found friends + vtkPoints *aPoints = InitPoints(); + vtkIdType aNumPts = GetNbOfPoints(); + //cout<<"Triangulator - aNumPts = "<(cout, " ")); - cout << endl; + if(aNumPts == 0) + return true; + + // To calculate the bary center of the cell + vtkFloatingPointType aCellCenter[3] = {0.0, 0.0, 0.0}; + { + vtkFloatingPointType aPntCoord[3]; + for (int aPntId = 0; aPntId < aNumPts; aPntId++) { + aPoints->GetPoint(GetPointId(aPntId),aPntCoord); + //cout<<"\taPntId = "<"; - float *p[4]; - float v1[3],v2[3],v3[3]; - p[0] = theGrid->GetPoint(A1); - p[1] = theGrid->GetPoint(A2); - p[2] = theGrid->GetPoint(B1); - p[3] = theGrid->GetPoint(C1); - - for(int i=0;i<3;i++){ - v1[i] = p[1][i] - p[0][i]; - v2[i] = p[2][i] - p[0][i]; - v3[i] = p[3][i] - p[0][i]; - } - - - float vec_b1[3]; - vtkMath::Cross(v2,v1,vec_b1); - float vec_b2[3]; - vtkMath::Cross(v1,v3,vec_b2); + vtkFloatingPointType aCellLength = GetCellLength(); + int aNumFaces = GetNumFaces(); - float b1 = vtkMath::Norm(vec_b1); + static vtkFloatingPointType EPS = 1.0E-2; + vtkFloatingPointType aDistEps = aCellLength * EPS; + //cout<<"\taCellLength = "<=1.0 ? 0.0 : 180*acosf(aCos)/vtkMath::Pi(); - - if( angle <= FACE_ANGLE_TOLERANCE) - status = true; - if (MYDEBUG){ - for(int k=0;k<4;k++){ - cout << " ("; - for(int j=0;j<2;j++){ - cout << p[k][j] << ","; - } - cout << p[k][2] << ") "; - } - if(status) cout << "angle="< TPointIds; + TPointIds anInitialPointIds; + for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++) + anInitialPointIds.insert(GetPointId(aPntId)); - return status; -} - -/*! \fn void GetAllFacesOnOnePlane( TPTOIDS theFaces, vtkIdType faceId,TUIDS &new_faces, TCell &new_faces_v2 ) - * \brief Calculate faces which on one plane. - * \param theFaces - - * \param faceId - - * \param new_faces - - * \param new_faces_v2 - - */ -void GetAllFacesOnOnePlane( TPTOIDS theFaces, vtkIdType faceId, - TUIDS &new_faces, TCell &new_faces_v2 ) -{ - if (new_faces.find(faceId) != new_faces.end()) return; + // To initialize set of points by face that belong to the cell and backward + typedef std::set TFace2Visibility; + TFace2Visibility aFace2Visibility; - new_faces.insert(new_faces.begin(),faceId); - new_faces_v2.push_back(faceId); - - TPTOIDS::const_iterator aIter1 = theFaces.find(faceId); - if(aIter1!=theFaces.end()){ - TUIDS::const_iterator aIter2 = (aIter1->second).begin(); - for(;aIter2!=(aIter1->second).end();aIter2++){ - if (new_faces.find(*aIter2) != new_faces.end()) continue; - GetAllFacesOnOnePlane(theFaces,*aIter2, - new_faces,new_faces_v2); // recurvise - } - } - return; -} + typedef std::set TFace2PointIds; + TFace2PointIds aFace2PointIds; -/*! \fn void GetSumm(TCell v1,TCell v2,TCell &output) - * \brief Gluing two faces (gluing points ids) - * \param v1 - first face - * \param v2 - second face - * \param output - output face. - */ -void GetSumm(TCell v1,TCell v2,TCell &output) -{ - output.clear(); - - if(MYDEBUG) cout << "========================================="<(cout, " ")); - if(MYDEBUG) cout << "\tv2:"; - if(MYDEBUG) std::copy(v2.begin(), v2.end(), std::ostream_iterator(cout, " ")); - if(MYDEBUG) cout << endl; - - TUIDS v1_set; - std::copy(v1.begin(), v1.end(), std::inserter(v1_set,v1_set.begin())); - TUIDS v2_set; - std::copy(v2.begin(), v2.end(), std::inserter(v2_set,v2_set.begin())); - TUIDS tmpIntersection; - std::set_intersection(v1_set.begin(),v1_set.end(),v2_set.begin(),v2_set.end(), std::inserter(tmpIntersection,tmpIntersection.begin())); - if(MYDEBUG) std::copy(tmpIntersection.begin(),tmpIntersection.end(), std::ostream_iterator(cout, " ")); - if(MYDEBUG) cout << endl; - - if(tmpIntersection.size() < 2) - if(MYDEBUG) cout << __FILE__ << "[" << __LINE__ << "]: Warning ! Wrong ids" << endl; - - TCell::iterator v1_iter = v1.begin(); - - for(;v1_iter!=v1.end();v1_iter++){ - - vtkIdType curr_id = *v1_iter; - - output.push_back(curr_id); + for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) { + vtkCell* aFace = GetFace(aFaceId); - if(tmpIntersection.find(curr_id) != tmpIntersection.end()){ - TCell::iterator v1_iter_tmp; - v1_iter_tmp = v1_iter; - v1_iter++; - - if(v1_iter==v1.end()) v1_iter=v1.begin(); - - curr_id = *v1_iter; - - if(tmpIntersection.find(curr_id) != tmpIntersection.end()){ - TCell::iterator v2_iter = v2.begin(); - for(;v2_iter!=v2.end();v2_iter++){ - vtkIdType v2_id = *v2_iter; - if(tmpIntersection.find(v2_id) == tmpIntersection.end()) - output.push_back(v2_id); - } - } - - v1_iter = v1_iter_tmp; - curr_id = *v1_iter; + GetCellNeighbors(theCellId, aFace, myCellIds); + if((!myAllVisible && !myCellsVisibility[myCellIds->GetId(0)]) || + myCellIds->GetNumberOfIds() <= 0 || myShowInside) + { + TPointIds aPointIds; + vtkIdList *anIdList = aFace->PointIds; + aPointIds.insert(anIdList->GetId(0)); + aPointIds.insert(anIdList->GetId(1)); + aPointIds.insert(anIdList->GetId(2)); + aFace2PointIds.insert(aPointIds); + aFace2Visibility.insert(aFaceId); } } - if(MYDEBUG) cout << "Result: " ; - if(MYDEBUG) std::copy(output.begin(),output.end(),std::ostream_iterator(cout, " ")); - if(MYDEBUG) cout << endl; -} - -static void GetAndRemoveIdsOnOneLine(vtkPoints* points, - TUIDS input_points_ids, - TUIDS input_two_points_ids, - TUIDS& out_two_points_ids, - TUIDS& removed_points_ids){ - if (MYDEBUG_REMOVE) cout << EPS <GetPoint(current_points_ids[0],P[0]); - points->GetPoint(current_points_ids[1],P[1]); - TUIDS::iterator aPointsIter = input_points_ids.begin(); - for(;aPointsIter!=input_points_ids.end();aPointsIter++){ - if(iscurrent_points_changed){ - points->GetPoint(current_points_ids[0],P[0]); - points->GetPoint(current_points_ids[1],P[1]); - iscurrent_points_changed = false; - if (MYDEBUG_REMOVE) - cout << " " << current_points_ids[0] << " " << current_points_ids[1] << endl; - } - // check: is point on line input_two_points_ids - points->GetPoint(*aPointsIter,P[2]); - if (MYDEBUG_REMOVE) { - cout << "\t" << current_points_ids[0] << ":"< coeff[0][0] = (x-x1), coeff[0][1] = x2-x1 - // y-y1=(y2-y1)*t -> coeff[1][0] = (y-y1), coeff[1][1] = y2-y1 - // z-z1=(z2-z1)*t -> coeff[2][0] = (z-z1), coeff[2][1] = z2-z1 - float coeff[3][2]; - for(int i=0;i<3;i++){ - coeff[i][0] = P[2][i]-P[0][i]; - coeff[i][1] = P[1][i]-P[0][i]; - } - bool isok_coord[3]; - bool isok = true; - float t[3]; - for(int i=0;i<3;i++){ - isok_coord[i] = false; - if( fabs(coeff[i][0]) <= EPS && fabs(coeff[i][1]) <= EPS) { - isok_coord[i] = true; - continue; - } - if( fabs(coeff[i][1]) <= EPS && fabs(coeff[i][0]) > EPS) {isok = false;t[i]=1.0/EPS;break;} - t[i] = (coeff[i][0])/(coeff[i][1]); - } - for(int i=0;i<3;i++) - if (MYDEBUG_REMOVE) - cout << __LINE__ << " " - << coeff[i][0] << ","<t[0],t[1],t[2] - // anilize bounds of line - for(int i=0;i<3;i++){ - for(int j=0;j<3;j++) - if(!isok_coord[j]) param[i] = (P[i][j]-P[0][j])/(P[1][j]-P[0][j]); - } - if (MYDEBUG_REMOVE) cout << "Params: " << param[0] << "," << param[1] << "," << param[2] << endl; - vtkIdType imax,imin; - float min,max; - for(vtkIdType i=0;i<3;i++) - if(!isok_coord[i]){ - min = param[0];imin=0; - max = param[0];imax=0; - break; - } - for(vtkIdType i=0;i<3;i++){ - if(min > param[i]) {min = param[i]; imin=i;} - if(max < param[i]) {max = param[i]; imax=i;} - } - if (MYDEBUG_REMOVE) - cout << "\t min="<"< RemoveAllUnneededPoints(vtkConvexPointSet* convex){ - vtkSmartPointer out = vtkConvexPointSet::New(); - - TUIDS two_points,input_points,out_two_points_ids,removed_points_ids,loc_removed_points_ids; - vtkIdList* aPointIds = convex->GetPointIds(); - int numIds = aPointIds->GetNumberOfIds(); - if (numIds<2) return out; - TSet good_point_ids; - TSet aLists[numIds-2]; - for(int i=0;iGetId(aFirId) << "," << aSecId <<":"<GetId(aSecId)<< " --- "; - for(vtkIdType k=aSecId+1;kGetId(k) << ","; - } - if (MYDEBUG_REMOVE) { - cout << endl; - cout << "\t"; - for(TUIDS::iterator aDelIter = loc_removed_points_ids.begin();aDelIter!=loc_removed_points_ids.end();aDelIter++) - cout << *aDelIter<<","; - cout << endl; - } - GetAndRemoveIdsOnOneLine(convex->Points, - input_points, - two_points, - out_two_points_ids, - loc_removed_points_ids); - TUIDS::iterator aOutIter = out_two_points_ids.begin(); - vtkIdType aFirst=*aOutIter;aOutIter++;vtkIdType aSecond=*aOutIter; - TPair aPair(aFirst,aSecond); - good_point_ids.insert(aPair); - if (MYDEBUG_REMOVE){ - cout << "Output: "; - TUIDS::iterator aIter = out_two_points_ids.begin(); - for(;aIter!=out_two_points_ids.end();aIter++) - cout << *aIter << ","; - cout << " --- "; - } - TUIDS::iterator aDelIter = loc_removed_points_ids.begin(); - for(;aDelIter!=loc_removed_points_ids.end();aDelIter++){ - removed_points_ids.insert(*aDelIter); - if (MYDEBUG_REMOVE) cout << *aDelIter << ","; - } - if (MYDEBUG_REMOVE) cout << endl; - } - } - if (MYDEBUG_REMOVE) { - cout << "============ Resultat ================" <Points->SetNumberOfPoints(result_ids.size()); - out->PointIds->SetNumberOfIds(result_ids.size()); - int aId=0; - if(MYDEBUG_REMOVE) cout << "Result out:"; - for(TUIDS::iterator aIter=result_ids.begin();aIter!=result_ids.end();aIter++,aId++){ - float P[3]; - convex->Points->GetPoint(*aIter,P); - out->Points->SetPoint(aId,P); - out->PointIds->SetId(aId,aPointIds->GetId(*aIter)); - if (MYDEBUG_REMOVE) cout << *aIter << ":" << aPointIds->GetId(*aIter) << " , "; - } - if(MYDEBUG_REMOVE) cout << endl; - out->Modified(); - out->Initialize(); - - return out; -} -void GetPolygonalFaces(vtkUnstructuredGrid* theGrid,int cellId,TCellArray &outputCellArray) -{ - if (theGrid->GetCellType(cellId) == VTK_CONVEX_POINT_SET){ - // get vtkCell type = VTK_CONVEX_POINT_SET - if(vtkConvexPointSet* convex_in = static_cast(theGrid->GetCell(cellId))){ - vtkSmartPointer convex = RemoveAllUnneededPoints(convex_in); - TCellArray f2points; - float convex_center[3]; // convex center point coorinat - int aNbFaces = convex->GetNumberOfFaces(); - int numPts = convex->GetNumberOfPoints(); - if(MYDEBUG_REMOVE) cout << "aNbFaces="<GetPoint(aIds[0]); - id_1 = theGrid->GetPoint(aIds[1]); - id_n = theGrid->GetPoint(aIds[numFacePts-1]); - - for(i=0;i<3;i++){ - v_a[i] = id_1[i] - id_0[i]; - v_b[i] = id_n[i] - id_0[i]; - v_convex2face[i] = id_0[i] - convex_center[i]; - } + ::TPolygons aPolygons; - if (vtkMath::Determinant3x3(v_a,v_b,v_convex2face) < 0){ - ReverseIds(aIds); - } + for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) { + if(aFace2Visibility.find(aFaceId) == aFace2Visibility.end()) + continue; - for(i=0;i<(int)aIds.size();i++){ - TUIDS &acell = p2faces[aIds[i]]; - acell.insert(faceId); - } - - f2points[faceId] = aIds; + vtkCell* aFace = GetFace(aFaceId); - } - - TPTOIDS face2face; - GetFriends(p2faces,f2points,face2face); + vtkIdList *anIdList = aFace->PointIds; + vtkIdType aNewPts[3] = {anIdList->GetId(0), anIdList->GetId(1), anIdList->GetId(2)}; + + // To initialize set of points for the plane where the trinangle face belong to + TPointIds aPointIds; + aPointIds.insert(aNewPts[0]); + aPointIds.insert(aNewPts[1]); + aPointIds.insert(aNewPts[2]); + + // To get know, if the points of the trinagle were already observed + bool anIsObserved = aFace2PointIds.find(aPointIds) == aFace2PointIds.end(); + //cout<<"\taFaceId = "<GetPoint(aNewPts[0],aCoord[0]); + aPoints->GetPoint(aNewPts[1],aCoord[1]); + aPoints->GetPoint(aNewPts[2],aCoord[2]); - TPTOIDS face2points; + // To calculate plane normal + vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0], + aCoord[1][1] - aCoord[0][1], + aCoord[1][2] - aCoord[0][2] }; - // copy TCellArray::f2points to TPTOIDS::face2points - for(TCellArray::iterator f2points_iter=f2points.begin(); - f2points_iter!=f2points.end(); - f2points_iter++){ - - TUIDS tmp; - for(TCell::iterator points_iter=(f2points_iter->second).begin(); - points_iter!=(f2points_iter->second).end(); - points_iter++) - tmp.insert(*points_iter); - - face2points[f2points_iter->first] = tmp; - } // end copy - + vtkFloatingPointType aVector02[3] = { aCoord[2][0] - aCoord[0][0], + aCoord[2][1] - aCoord[0][1], + aCoord[2][2] - aCoord[0][2] }; - TPTOIDS new_face2faces; // which connected and in one plane + // To calculate the normal for the triangle + vtkFloatingPointType aNormal[3]; + vtkMath::Cross(aVector02,aVector01,aNormal); - TPTOIDS::const_iterator aF2FIter = face2face.begin(); - for(;aF2FIter!=face2face.end();aF2FIter++){ - vtkIdType f_key = aF2FIter->first; - TUIDS &faces = new_face2faces[f_key]; - //faces.insert(f_key); - TUIDS f_friends = aF2FIter->second; - TUIDS::const_iterator a_friends_iter = f_friends.begin(); - for(;a_friends_iter!=f_friends.end();a_friends_iter++){ - vtkIdType friend_id = *a_friends_iter; - if( IsConnectedFacesOnOnePlane(theGrid,f_key,friend_id, - (face2points.find(f_key))->second, - (face2points.find(friend_id))->second)){ - faces.insert(friend_id); - } // end if - - } // end a_friends_iter - } // end aF2FIter + vtkMath::Normalize(aNormal); - if(MYDEBUG) + // To calculate what points belong to the plane + // To calculate bounds of the point set + vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0}; { - TPTOIDS::const_iterator new_face2face_iter = new_face2faces.begin(); - cout << "Connected faces and on plane:" << endl; - for(;new_face2face_iter!=new_face2faces.end();new_face2face_iter++){ - cout << "Group ["<first<<"] :"; - TUIDS::const_iterator new_faces_iter = (new_face2face_iter->second).begin(); - for(;new_faces_iter!=(new_face2face_iter->second).end();new_faces_iter++) - cout << " " << *new_faces_iter ; - cout << endl; + TPointIds::const_iterator anIter = anInitialPointIds.begin(); + TPointIds::const_iterator anEndIter = anInitialPointIds.end(); + for(; anIter != anEndIter; anIter++){ + vtkFloatingPointType aPntCoord[3]; + vtkIdType aPntId = *anIter; + aPoints->GetPoint(aPntId,aPntCoord); + vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]); + //cout<<"\t\taPntId = "< 0){ + aNormal[0] = -aNormal[0]; + aNormal[1] = -aNormal[1]; + aNormal[2] = -aNormal[2]; + } + + // To calculate the primary direction for point set + vtkFloatingPointType aVector0[3] = { aCoord[0][0] - aCenter[0], + aCoord[0][1] - aCenter[1], + aCoord[0][2] - aCenter[2] }; + vtkMath::Normalize(aVector0); + + //cout<<"\t\taCenter = {"<first) != already_in.end()) - continue; - if(new_face2face_iter->second.size() > 1) - continue; - - TCell &tmp_v2 = output_newid2face_v2[k]; - tmp_v2.push_back(new_face2face_iter->first); - already_in.insert(new_face2face_iter->first); + TFace2PointIds::const_iterator anIter = aFace2PointIds.begin(); + TFace2PointIds::const_iterator anEndIter = aFace2PointIds.end(); + for(; anIter != anEndIter; anIter++){ + const TPointIds& anIds = *anIter; + TPointIds anIntersection; + std::set_intersection(aPointIds.begin(),aPointIds.end(), + anIds.begin(),anIds.end(), + std::inserter(anIntersection,anIntersection.begin())); - TUIDS::const_iterator new_faces_iter = (new_face2face_iter->second).begin(); - for(;new_faces_iter!=(new_face2face_iter->second).end();new_faces_iter++){ - if(already_in.find(*new_faces_iter) != already_in.end()) continue; - already_in.insert(*new_faces_iter); - - already_in_tmp.clear(); - already_in_tmp.insert(new_face2face_iter->first); - - TUIDS &tmp = output_newid2face[k]; - GetAllFacesOnOnePlane(new_face2faces,*new_faces_iter, - already_in_tmp,tmp_v2); - - for(TUIDS::const_iterator aIter=already_in_tmp.begin(); - aIter!=already_in_tmp.end(); - aIter++) - { - already_in.insert(*aIter); - tmp.insert(*aIter); - } + if(anIntersection == anIds){ + aRemoveFace2PointIds.insert(anIds); } - k++; } } - if(MYDEBUG) { - cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<first<<"] :"; - TUIDS::const_iterator new_faces_iter = (new_face2face_iter->second).begin(); - for(;new_faces_iter!=(new_face2face_iter->second).end();new_faces_iter++) - cout << " " << *new_faces_iter ; - cout << endl; - } - } - cout << "++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++"<first<<"] :"; - TCell::const_iterator new_faces_iter = (new_face2face_iter->second).begin(); - for(;new_faces_iter!=(new_face2face_iter->second).end();new_faces_iter++) - cout << " " << *new_faces_iter ; - cout << endl; - } + // To remove from the set of points by face those that belong to the plane + { + TFace2PointIds::const_iterator anIter = aRemoveFace2PointIds.begin(); + TFace2PointIds::const_iterator anEndIter = aRemoveFace2PointIds.end(); + for(; anIter != anEndIter; anIter++){ + const TPointIds& anIds = *anIter; + aFace2PointIds.erase(anIds); } } - TCellArray output_new_face2ids; -// { -// TPTOIDS::const_iterator new_face2face_iter = output_newid2face.begin(); -// for(;new_face2face_iter!=output_newid2face.end();new_face2face_iter++){ - -// vtkIdType new_faceId = new_face2face_iter->first; -// TUIDS::const_iterator new_faces_iter = (new_face2face_iter->second).begin(); -// vtkIdType fId0 = *new_faces_iter; -// TCellArray::const_iterator pIds0_iter = f2points.find(fId0); -// TCell pIds0 = pIds0_iter->second; -// TCell &output = output_new_face2ids[new_faceId]; -// new_faces_iter++; -// if(new_face2face_iter->second.size() > 2 ){} -// for(;new_faces_iter!=(new_face2face_iter->second).end();new_faces_iter++){ - -// vtkIdType faceId = *new_faces_iter; -// // find how much nodes in face (f2points) -// TCellArray::const_iterator pIds_iter = f2points.find(faceId); -// TCell pIds = pIds_iter->second; - -// GetSumm(pIds0,pIds,output); -// pIds0 = output; - -// } // end new_faces_iter - -// } // new_face2face_iter -// } + // To sort the planar set of the points accrding to the angle { - TCellArray::const_iterator new_face2face_iter = output_newid2face_v2.begin(); - for(;new_face2face_iter!=output_newid2face_v2.end();new_face2face_iter++){ + typedef std::map TSortedPointIds; + TSortedPointIds aSortedPointIds; + + TPointIds::const_iterator anIter = aPointIds.begin(); + TPointIds::const_iterator anEndIter = aPointIds.end(); + for(; anIter != anEndIter; anIter++){ + vtkFloatingPointType aPntCoord[3]; + vtkIdType aPntId = *anIter; + aPoints->GetPoint(aPntId,aPntCoord); + vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0], + aPntCoord[1] - aCenter[1], + aPntCoord[2] - aCenter[2] }; + vtkMath::Normalize(aVector); - vtkIdType new_faceId = new_face2face_iter->first; - TCell::const_iterator new_faces_iter = (new_face2face_iter->second).begin(); - vtkIdType fId0 = *new_faces_iter; - TCellArray::const_iterator pIds0_iter = f2points.find(fId0); - TCell pIds0 = pIds0_iter->second; - TCell &output = output_new_face2ids[new_faceId]; - new_faces_iter++; - if(new_face2face_iter->second.size() == 1 ){ - TCellArray::const_iterator pIds_iter = f2points.find(fId0); - TCell pIds = pIds_iter->second; - output = pIds; - continue; + vtkFloatingPointType aCross[3]; + vtkMath::Cross(aVector,aVector0,aCross); + bool aGreaterThanPi = vtkMath::Dot(aCross,aNormal) < 0; + vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0); + if(aCosinus > 1.0) + aCosinus = 1.0; + if(aCosinus < -1.0) + aCosinus = -1.0; + static vtkFloatingPointType a2Pi = 2.0 * vtkMath::Pi(); + vtkFloatingPointType anAngle = acos(aCosinus); + //cout<<"\t\t\taPntId = "<second).end();new_faces_iter++){ - - vtkIdType faceId = *new_faces_iter; - // find how much nodes in face (f2points) - TCellArray::const_iterator pIds_iter = f2points.find(faceId); - TCell pIds = pIds_iter->second; - - GetSumm(pIds0,pIds,output); - pIds0 = output; + aSortedPointIds[anAngle] = aPntId; + } - } // end new_faces_iter - - } // new_face2face_iter + if(!aSortedPointIds.empty()){ + int aNumFacePts = aSortedPointIds.size(); + ::TConnectivities aConnectivities(aNumFacePts); + TSortedPointIds::const_iterator anIter = aSortedPointIds.begin(); + TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end(); + for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){ + vtkIdType aPntId = anIter->second; + aConnectivities[anId] = GetConnectivity(aPntId); + } + aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal)); + } } - - if(MYDEBUG) { - cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<GetPoint(anId,aPntCoord); + vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord); + //cout<<"\t\taPntId = "<InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]); + if(theStoreMapping) + theVTK2ObjIds.push_back(theCellId); + theOutputCD->CopyData(thInputCD,theCellId,aNewCellId); + } + } + + //cout<<"\tTriangulator - Ok\n"; + return true; } + +/*! + Constructor +*/ +VTKViewer_OrderedTriangulator +::VTKViewer_OrderedTriangulator(): + myCell(vtkGenericCell::New()) +{} + +/*! + Destructor +*/ +VTKViewer_OrderedTriangulator +::~VTKViewer_OrderedTriangulator() +{ + myCell->Delete(); +} + +vtkPoints* +VTKViewer_OrderedTriangulator +::InitPoints() +{ + myInput->GetCell(myCellId,myCell); + return myInput->GetPoints(); +} + +vtkIdType +VTKViewer_OrderedTriangulator +::GetNbOfPoints() +{ + return myCell->GetNumberOfPoints(); +} + +vtkIdType +VTKViewer_OrderedTriangulator +::GetPointId(vtkIdType thePointId) +{ + return myCell->GetPointId(thePointId); +} + +vtkFloatingPointType +VTKViewer_OrderedTriangulator +::GetCellLength() +{ + return sqrt(myCell->GetLength2()); +} + +vtkIdType +VTKViewer_OrderedTriangulator +::GetNumFaces() +{ + return myCell->GetNumberOfFaces(); +} + +vtkCell* +VTKViewer_OrderedTriangulator +::GetFace(vtkIdType theFaceId) +{ + return myCell->GetFace(theFaceId); +} + +void +VTKViewer_OrderedTriangulator +::GetCellNeighbors(vtkIdType theCellId, + vtkCell* theFace, + vtkIdList* theCellIds) +{ + vtkIdList *anIdList = theFace->PointIds; + myInput->GetCellNeighbors(theCellId, anIdList, theCellIds); +} + +vtkIdType +VTKViewer_OrderedTriangulator +::GetConnectivity(vtkIdType thePntId) +{ + return thePntId; +} + +/*! + Constructor +*/ +VTKViewer_DelaunayTriangulator +::VTKViewer_DelaunayTriangulator(): + myUnstructuredGrid(vtkUnstructuredGrid::New()), + myGeometryFilter(vtkGeometryFilter::New()), + myDelaunay3D(vtkDelaunay3D::New()), + myFaceIds(vtkIdList::New()), + myPoints(vtkPoints::New()), + myPolyData(NULL), + myPointIds(NULL) +{ + myDelaunay3D->SetInput(myUnstructuredGrid); + myGeometryFilter->SetInput(myDelaunay3D->GetOutput()); +} + + + +/*! + Destructor +*/ +VTKViewer_DelaunayTriangulator +::~VTKViewer_DelaunayTriangulator() +{ + myUnstructuredGrid->Delete(); + myGeometryFilter->Delete(); + myDelaunay3D->Delete(); + myFaceIds->Delete(); + myPoints->Delete(); +} + + +vtkPoints* +VTKViewer_DelaunayTriangulator +::InitPoints() +{ + myUnstructuredGrid->Initialize(); + myUnstructuredGrid->Allocate(); + myUnstructuredGrid->SetPoints(myPoints); + + vtkIdType aNumPts; + myInput->GetCellPoints(myCellId,aNumPts,myPointIds); + { + vtkFloatingPointType aPntCoord[3]; + myPoints->SetNumberOfPoints(aNumPts); + vtkPoints *anInputPoints = myInput->GetPoints(); + for (int aPntId = 0; aPntId < aNumPts; aPntId++) { + anInputPoints->GetPoint(myPointIds[aPntId],aPntCoord); + myPoints->SetPoint(aPntId,aPntCoord); + } + } + + myGeometryFilter->Update(); + myPolyData = myGeometryFilter->GetOutput(); + + return myPoints; +} + +vtkIdType +VTKViewer_DelaunayTriangulator +::GetNbOfPoints() +{ + return myPoints->GetNumberOfPoints(); +} + +vtkIdType +VTKViewer_DelaunayTriangulator +::GetPointId(vtkIdType thePointId) +{ + return thePointId; +} + +vtkFloatingPointType +VTKViewer_DelaunayTriangulator +::GetCellLength() +{ + return myPolyData->GetLength(); +} + +vtkIdType +VTKViewer_DelaunayTriangulator +::GetNumFaces() +{ + return myPolyData->GetNumberOfCells(); +} + +vtkCell* +VTKViewer_DelaunayTriangulator +::GetFace(vtkIdType theFaceId) +{ + return myPolyData->GetCell(theFaceId); +} + +void +VTKViewer_DelaunayTriangulator +::GetCellNeighbors(vtkIdType theCellId, + vtkCell* theFace, + vtkIdList* theCellIds) +{ + myFaceIds->Reset(); + vtkIdList *anIdList = theFace->PointIds; + myFaceIds->InsertNextId(myPointIds[anIdList->GetId(0)]); + myFaceIds->InsertNextId(myPointIds[anIdList->GetId(1)]); + myFaceIds->InsertNextId(myPointIds[anIdList->GetId(2)]); + + myInput->GetCellNeighbors(theCellId, myFaceIds, theCellIds); +} + + +vtkIdType +VTKViewer_DelaunayTriangulator +::GetConnectivity(vtkIdType thePntId) +{ + return myPointIds[thePntId]; } diff --git a/src/VTKViewer/VTKViewer_ConvexTool.h b/src/VTKViewer/VTKViewer_ConvexTool.h index ed303af03..2bf024d5e 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.h +++ b/src/VTKViewer/VTKViewer_ConvexTool.h @@ -15,34 +15,189 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef _VTKViewer_ConvexTool_H #define _VTKViewer_ConvexTool_H -#include +#include "VTKViewer.h" + #include -#include -typedef std::vector TCell; // ptsIds -typedef std::map TCellArray; // CellId, TCell +#include + +class vtkUnstructuredGrid; +class vtkGeometryFilter; +class vtkGenericCell; +class vtkDelaunay3D; +class vtkPolyData; +class vtkCellData; +class vtkPoints; +class vtkIdList; +class vtkCell; + +class VTKVIEWER_EXPORT VTKViewer_Triangulator +{ + public: + VTKViewer_Triangulator(); + + ~VTKViewer_Triangulator(); + + bool + Execute(vtkUnstructuredGrid *theInput, + vtkCellData* thInputCD, + vtkIdType theCellId, + int theShowInside, + int theAllVisible, + const char* theCellsVisibility, + vtkPolyData *theOutput, + vtkCellData* theOutputCD, + int theStoreMapping, + std::vector& theVTK2ObjIds, + bool theIsCheckConvex); + + protected: + vtkIdList* myCellIds; + + vtkUnstructuredGrid *myInput; + vtkIdType myCellId; + int myShowInside; + int myAllVisible; + const char* myCellsVisibility; + + virtual + vtkPoints* + InitPoints() = 0; + + virtual + vtkIdType + GetNbOfPoints() = 0; + + virtual + vtkIdType + GetPointId(vtkIdType thePointId) = 0; -/*! This package \namespace CONVEX_TOOL used for: - * calculation of VTK_POLYGON cell array from VTK_TRIANGLE (triangulation) - * of VTK_CONVEX_POINT_SET cell type. - */ -namespace CONVEX_TOOL + virtual + vtkFloatingPointType + GetCellLength() = 0; + + virtual + vtkIdType + GetNumFaces() = 0; + + virtual + vtkCell* + GetFace(vtkIdType theFaceId) = 0; + + virtual + void + GetCellNeighbors(vtkIdType theCellId, + vtkCell* theFace, + vtkIdList* theCellIds) = 0; + + virtual + vtkIdType + GetConnectivity(vtkIdType thePntId) = 0; +}; + + +class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangulator { - /*! \fn void CONVEX_TOOL::GetPolygonalFaces(vtkUnstructuredGrid* theCell,int cellId,TCellArray &outputCellArray) - * \brief Main function. - * \param theCell - vtkUnstructuredGrid cell pointer - * \param cellId - id of cell type VTK_CONVEX_POINT_SET - * \retval outputCellArray - output array with new cells types VTK_POLYGON - */ - void - WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName); - void GetPolygonalFaces(vtkUnstructuredGrid* theCell,int cellId,TCellArray &outputCellArray); -} + public: + + VTKViewer_OrderedTriangulator(); + + ~VTKViewer_OrderedTriangulator(); + + protected: + vtkGenericCell *myCell; + + virtual + vtkPoints* + InitPoints(); + + virtual + vtkIdType + GetNbOfPoints(); + + vtkIdType + GetPointId(vtkIdType thePointId); + + virtual + vtkFloatingPointType + GetCellLength(); + + virtual + vtkIdType + GetNumFaces(); + + virtual + vtkCell* + GetFace(vtkIdType theFaceId); + + virtual + void + GetCellNeighbors(vtkIdType theCellId, + vtkCell* theFace, + vtkIdList* theCellIds); + + virtual + vtkIdType + GetConnectivity(vtkIdType thePntId); +}; + + +class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangulator +{ + public: + + VTKViewer_DelaunayTriangulator(); + + ~VTKViewer_DelaunayTriangulator(); + + protected: + vtkUnstructuredGrid* myUnstructuredGrid; + vtkGeometryFilter* myGeometryFilter; + vtkDelaunay3D* myDelaunay3D; + vtkPolyData* myPolyData; + vtkIdType *myPointIds; + vtkIdList* myFaceIds; + vtkPoints* myPoints; + + virtual + vtkPoints* + InitPoints(); + + virtual + vtkIdType + GetNbOfPoints(); + + vtkIdType + GetPointId(vtkIdType thePointId); + + virtual + vtkFloatingPointType + GetCellLength(); + + virtual + vtkIdType + GetNumFaces(); + + virtual + vtkCell* + GetFace(vtkIdType theFaceId); + + virtual + void + GetCellNeighbors(vtkIdType theCellId, + vtkCell* theFace, + vtkIdList* theCellIds); + + virtual + vtkIdType + GetConnectivity(vtkIdType thePntId); +}; + #endif // _VTKViewer_ConvexTool_H diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 0aef6c3a1..5cb422e11 100755 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // File: VISU_ExtractUnstructuredGrid.cxx @@ -26,13 +26,12 @@ #include "VTKViewer_ExtractUnstructuredGrid.h" -//#include "utilities.h" +#include "VTKViewer_CellLocationsArray.h" #include #include #include #include -#include #include #include @@ -238,7 +237,7 @@ void VTKViewer_ExtractUnstructuredGrid::Execute(){ } } if((aNbElems = aConnectivity->GetNumberOfCells())){ - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbElems); aConnectivity->InitTraversal(); @@ -327,7 +326,7 @@ void VTKViewer_ExtractUnstructuredGrid::Execute(){ } } if((aNbElems = aConnectivity->GetNumberOfCells())){ - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbElems); aConnectivity->InitTraversal(); diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h index a820bd25b..f5251a2b2 100755 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H #define VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H diff --git a/src/VTKViewer/VTKViewer_Filter.cxx b/src/VTKViewer/VTKViewer_Filter.cxx index 3d1e9a20e..f33ea7bae 100755 --- a/src/VTKViewer/VTKViewer_Filter.cxx +++ b/src/VTKViewer/VTKViewer_Filter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer_Filter.h b/src/VTKViewer/VTKViewer_Filter.h index 407bace53..7e72b8df5 100755 --- a/src/VTKViewer/VTKViewer_Filter.h +++ b/src/VTKViewer/VTKViewer_Filter.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer_Functor.h b/src/VTKViewer/VTKViewer_Functor.h index 26fb08e61..7aa5630be 100644 --- a/src/VTKViewer/VTKViewer_Functor.h +++ b/src/VTKViewer/VTKViewer_Functor.h @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 37a9dda64..a95e47dec 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -27,6 +27,7 @@ // $Header$ #include "VTKViewer_GeometryFilter.h" +#include "VTKViewer_ConvexTool.h" #include #include @@ -45,11 +46,6 @@ #include #include -#include -#include -#include -#include - #include #include #include @@ -62,7 +58,7 @@ #endif #endif -#define USE_ROBUST_TRIANGULATION +//#define USE_ROBUST_TRIANGULATION //---------------------------------------------------------------------------- vtkCxxRevisionMacro(VTKViewer_GeometryFilter, "$Revision$"); @@ -81,7 +77,6 @@ VTKViewer_GeometryFilter {} -//---------------------------------------------------------------------------- void VTKViewer_GeometryFilter ::Execute() @@ -102,7 +97,6 @@ VTKViewer_GeometryFilter } -//---------------------------------------------------------------------------- void VTKViewer_GeometryFilter ::UnstructuredGridExecute() @@ -128,28 +122,19 @@ VTKViewer_GeometryFilter vtkPolyData *output = this->GetOutput(); vtkPointData *outputPD = output->GetPointData(); -#ifdef USE_ROBUST_TRIANGULATION - vtkUnstructuredGrid* anUnstructuredGrid = vtkUnstructuredGrid::New(); - vtkPoints* aDelaunayPoints = vtkPoints::New(); - - vtkDelaunay3D* aDelaunay3D = vtkDelaunay3D::New(); - aDelaunay3D->SetInput(anUnstructuredGrid); - - vtkGeometryFilter* aGeometryFilter = vtkGeometryFilter::New(); - aGeometryFilter->SetInput(aDelaunay3D->GetOutput()); -#endif + VTKViewer_OrderedTriangulator anOrderedTriangulator; + VTKViewer_DelaunayTriangulator aDelaunayTriangulator; vtkCellData *outputCD = output->GetCellData(); vtkGenericCell *cell = vtkGenericCell::New(); - vtkIdList *cellIds = vtkIdList::New(); vtkIdList *faceIds = vtkIdList::New(); char *cellVis; vtkIdType newCellId; int faceId, *faceVerts, numFacePts; - float *x; + vtkFloatingPointType *x; int PixelConvert[4], aNewPts[VTK_CELL_SIZE]; // ghost cell stuff unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel()); @@ -306,299 +291,30 @@ VTKViewer_GeometryFilter break; case VTK_CONVEX_POINT_SET: { - //cout<<"cellId = "<Initialize(); - anUnstructuredGrid->Allocate(); - anUnstructuredGrid->SetPoints(aDelaunayPoints); - - vtkIdType *aPts; - input->GetCellPoints(cellId,aNumPts,aPts); - { - float aPntCoord[3]; - aDelaunayPoints->SetNumberOfPoints(aNumPts); - vtkPoints *anInputPoints = input->GetPoints(); - for (int aPntId = 0; aPntId < aNumPts; aPntId++) { - anInputPoints->GetPoint(aPts[aPntId],aPntCoord); - aDelaunayPoints->SetPoint(aPntId,aPntCoord); - } - } -#else - input->GetCell(cellId,cell); - aPoints = input->GetPoints(); - aNumPts = cell->GetNumberOfPoints(); -#endif - // To calculate the bary center of the cell - float aCellCenter[3] = {0.0, 0.0, 0.0}; - { - float aPntCoord[3]; - for (int aPntId = 0; aPntId < aNumPts; aPntId++) { -#ifdef USE_ROBUST_TRIANGULATION - aPoints->GetPoint(aPntId,aPntCoord); -#else - aPoints->GetPoint(cell->GetPointId(aPntId),aPntCoord); -#endif - //cout<<"\t\taPntId = "<Update(); - vtkPolyData* aPolyData = aGeometryFilter->GetOutput(); - - float aCellLength = aPolyData->GetLength(); - int aNumFaces = aPolyData->GetNumberOfCells(); -#else - float aCellLength = sqrt(cell->GetLength2()); - int aNumFaces = cell->GetNumberOfFaces(); -#endif - - static float EPS = 1.0E-5; - float aDistEps = aCellLength * EPS; - - // To initialize set of points that belong to the cell - typedef std::set TPointIds; - TPointIds anInitialPointIds; - for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){ -#ifdef USE_ROBUST_TRIANGULATION - anInitialPointIds.insert(aPntId); -#else - anInitialPointIds.insert(cell->GetPointId(aPntId)); -#endif - } - - // To initialize set of points by face that belong to the cell and backward - typedef std::set TFace2Visibility; - TFace2Visibility aFace2Visibility; - - typedef std::set TFace2PointIds; - TFace2PointIds aFace2PointIds; - - for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) { -#ifdef USE_ROBUST_TRIANGULATION - vtkCell* aFace = aPolyData->GetCell(aFaceId); -#else - vtkCell* aFace = cell->GetFace(aFaceId); -#endif - vtkIdList *anIdList = aFace->PointIds; - aNewPts[0] = anIdList->GetId(0); - aNewPts[1] = anIdList->GetId(1); - aNewPts[2] = anIdList->GetId(2); - -#ifdef USE_ROBUST_TRIANGULATION - faceIds->Reset(); - faceIds->InsertNextId(aPts[aNewPts[0]]); - faceIds->InsertNextId(aPts[aNewPts[1]]); - faceIds->InsertNextId(aPts[aNewPts[2]]); - input->GetCellNeighbors(cellId, faceIds, cellIds); -#else - input->GetCellNeighbors(cellId, anIdList, cellIds); -#endif - if((!allVisible && !cellVis[cellIds->GetId(0)]) || - cellIds->GetNumberOfIds() <= 0 || - myShowInside) - { - TPointIds aPointIds; - aPointIds.insert(aNewPts[0]); - aPointIds.insert(aNewPts[1]); - aPointIds.insert(aNewPts[2]); - - aFace2PointIds.insert(aPointIds); - aFace2Visibility.insert(aFaceId); - } - } - - for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) { - if(aFace2Visibility.find(aFaceId) == aFace2Visibility.end()) - continue; - -#ifdef USE_ROBUST_TRIANGULATION - vtkCell* aFace = aPolyData->GetCell(aFaceId); -#else - vtkCell* aFace = cell->GetFace(aFaceId); -#endif - vtkIdList *anIdList = aFace->PointIds; - aNewPts[0] = anIdList->GetId(0); - aNewPts[1] = anIdList->GetId(1); - aNewPts[2] = anIdList->GetId(2); - - // To initialize set of points for the plane where the trinangle face belong to - TPointIds aPointIds; - aPointIds.insert(aNewPts[0]); - aPointIds.insert(aNewPts[1]); - aPointIds.insert(aNewPts[2]); - - // To get know, if the points of the trinagle were already observed - bool anIsObserved = aFace2PointIds.find(aPointIds) == aFace2PointIds.end(); - //cout<<"\taFaceId = "<GetPoint(aNewPts[0],aCoord[0]); - aPoints->GetPoint(aNewPts[1],aCoord[1]); - aPoints->GetPoint(aNewPts[2],aCoord[2]); - - // To calculate plane normal - float aVector01[3] = { aCoord[1][0] - aCoord[0][0], - aCoord[1][1] - aCoord[0][1], - aCoord[1][2] - aCoord[0][2] }; + bool anIsOk = anOrderedTriangulator.Execute(input, + cd, + cellId, + myShowInside, + allVisible, + cellVis, + output, + outputCD, + myStoreMapping, + myVTK2ObjIds, + true); + if(!anIsOk) + aDelaunayTriangulator.Execute(input, + cd, + cellId, + myShowInside, + allVisible, + cellVis, + output, + outputCD, + myStoreMapping, + myVTK2ObjIds, + false); - float aVector02[3] = { aCoord[2][0] - aCoord[0][0], - aCoord[2][1] - aCoord[0][1], - aCoord[2][2] - aCoord[0][2] }; - - float aCross21[3]; - vtkMath::Cross(aVector02,aVector01,aCross21); - - vtkMath::Normalize(aCross21); - - // To calculate what points belong to the plane - // To calculate bounds of the point set - float aCenter[3] = {0.0, 0.0, 0.0}; - { - TPointIds::const_iterator anIter = anInitialPointIds.begin(); - TPointIds::const_iterator anEndIter = anInitialPointIds.end(); - for(; anIter != anEndIter; anIter++){ - float aPntCoord[3]; - vtkIdType aPntId = *anIter; - aPoints->GetPoint(aPntId,aPntCoord); - float aDist = vtkPlane::DistanceToPlane(aPntCoord,aCross21,aCoord[0]); - //cout<<"\t\taPntId = "< 0){ - aCross21[0] = -aCross21[0]; - aCross21[1] = -aCross21[1]; - aCross21[2] = -aCross21[2]; - } - - vtkMath::Normalize(aVector0); - - //cout<<"\t\taCenter = {"< TSortedPointIds; - TSortedPointIds aSortedPointIds; - - TPointIds::const_iterator anIter = aPointIds.begin(); - TPointIds::const_iterator anEndIter = aPointIds.end(); - for(; anIter != anEndIter; anIter++){ - float aPntCoord[3]; - vtkIdType aPntId = *anIter; - aPoints->GetPoint(aPntId,aPntCoord); - float aVector[3] = { aPntCoord[0] - aCenter[0], - aPntCoord[1] - aCenter[1], - aPntCoord[2] - aCenter[2] }; - vtkMath::Normalize(aVector); - - float aCross[3]; - vtkMath::Cross(aVector,aVector0,aCross); - bool aGreaterThanPi = vtkMath::Dot(aCross,aCross21) < 0; - float aCosinus = vtkMath::Dot(aVector,aVector0); - if(aCosinus > 1.0) - aCosinus = 1.0; - if(aCosinus < -1.0) - aCosinus = -1.0; - static float a2Pi = 2.0 * vtkMath::Pi(); - float anAngle = acos(aCosinus); - //cout<<"\t\taPntId = "< aConnectivities(numFacePts); - TSortedPointIds::const_iterator anIter = aSortedPointIds.begin(); - TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end(); - for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){ - vtkIdType aPntId = anIter->second; -#ifdef USE_ROBUST_TRIANGULATION - aConnectivities[anId] = aPts[aPntId]; -#else - aConnectivities[anId] = aPntId; -#endif - } - newCellId = output->InsertNextCell(aCellType,numFacePts,&aConnectivities[0]); - if(myStoreMapping) - myVTK2ObjIds.push_back(cellId); - outputCD->CopyData(cd,cellId,newCellId); - } - } - } - } - break; } case VTK_TETRA: { @@ -1029,14 +745,6 @@ VTKViewer_GeometryFilter vtkDebugMacro(<<"Extracted " << input->GetNumberOfPoints() << " points," << output->GetNumberOfCells() << " cells."); -#ifdef USE_ROBUST_TRIANGULATION - anUnstructuredGrid->Delete(); - aDelaunayPoints->Delete(); - - aDelaunay3D->Delete(); - aGeometryFilter->Delete(); -#endif - cell->Delete(); cellIds->Delete(); @@ -1049,7 +757,6 @@ VTKViewer_GeometryFilter } -//---------------------------------------------------------------------------- void VTKViewer_GeometryFilter ::SetInside(int theShowInside) @@ -1069,7 +776,6 @@ VTKViewer_GeometryFilter } -//---------------------------------------------------------------------------- void VTKViewer_GeometryFilter ::SetWireframeMode(int theIsWireframeMode) @@ -1089,7 +795,6 @@ VTKViewer_GeometryFilter } -//---------------------------------------------------------------------------- void VTKViewer_GeometryFilter ::SetStoreMapping(int theStoreMapping) @@ -1109,12 +814,8 @@ VTKViewer_GeometryFilter } -//---------------------------------------------------------------------------- -vtkIdType VTKViewer_GeometryFilter::GetElemObjId(int theVtkID) -{ - if ( myVTK2ObjIds.empty() || theVtkID > (int)myVTK2ObjIds.size() ) - return -1; - +vtkIdType VTKViewer_GeometryFilter::GetElemObjId(int theVtkID){ + if(myVTK2ObjIds.empty() || theVtkID > myVTK2ObjIds.size()) return -1; #if defined __GNUC_2__ return myVTK2ObjIds[theVtkID]; #else diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.h b/src/VTKViewer/VTKViewer_GeometryFilter.h index 329064036..a74b70733 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.h +++ b/src/VTKViewer/VTKViewer_GeometryFilter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_GEOMETRYFILTER_H #define VTKVIEWER_GEOMETRYFILTER_H diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index 1f69e6085..6bc13e78e 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -30,10 +30,8 @@ #include "VTKViewer_Actor.h" #include "VTKViewer_Utilities.h" #include "VTKViewer_Trihedron.h" -#include "VTKViewer_RectPicker.h" #include "VTKViewer_ViewWindow.h" #include "VTKViewer_RenderWindow.h" -#include "VTKViewer_CellRectPicker.h" #include "VTKViewer_RenderWindowInteractor.h" //#include "SALOME_Actor.h" @@ -86,10 +84,10 @@ static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId) return anEdgeId; } */ -//---------------------------------------------------------------------------- + vtkStandardNewMacro(VTKViewer_InteractorStyle); -//---------------------------------------------------------------------------- + /*!Constructor.*/ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle() { @@ -108,14 +106,14 @@ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle() OnSelectionModeChanged(); } -//---------------------------------------------------------------------------- + /*!Destructor.*/ VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle() { m_ViewWnd->RemoveActor(myPreSelectionActor); } -//---------------------------------------------------------------------------- + /*!Set preselection properties. *\param theRed - red color. *\param theGreen - green color. @@ -132,7 +130,7 @@ void VTKViewer_InteractorStyle::setPreselectionProp(const double& theRed, const myPreSelectionActor->GetProperty()->SetPointSize(theWidth); } -//---------------------------------------------------------------------------- + /*!Set render window interactor *\param theInteractor - interactor. */ @@ -141,7 +139,7 @@ void VTKViewer_InteractorStyle::SetInteractor(vtkRenderWindowInteractor *theInte Superclass::SetInteractor(theInteractor); } -//---------------------------------------------------------------------------- + /*!Set view window. *\param theViewWnd - SALOME VTKViewer_ViewWindow */ @@ -151,7 +149,7 @@ void VTKViewer_InteractorStyle::setViewWnd(VTKViewer_ViewWindow* theViewWnd ){ myPreSelectionActor->Delete(); } -//---------------------------------------------------------------------------- + /*!Set GUI window. *\param theWindow - QWidget window. */ @@ -159,15 +157,14 @@ void VTKViewer_InteractorStyle::setGUIWindow(QWidget* theWindow){ myGUIWindow = theWindow; } -//---------------------------------------------------------------------------- -/*!Set triedron. + +/*!Set trihedron. *\param theTrihedron - SALOME VTKViewer_Trihedron */ void VTKViewer_InteractorStyle::setTriedron(VTKViewer_Trihedron* theTrihedron){ m_Trihedron = theTrihedron; } -//---------------------------------------------------------------------------- /*!Rotate camera. *\param dx - *\param dy - @@ -199,7 +196,6 @@ void VTKViewer_InteractorStyle::RotateXY(int dx, int dy) myGUIWindow->update(); } -//---------------------------------------------------------------------------- void VTKViewer_InteractorStyle::PanXY(int x, int y, int oldX, int oldY) { TranslateView(x, y, oldX, oldY); @@ -208,7 +204,6 @@ void VTKViewer_InteractorStyle::PanXY(int x, int y, int oldX, int oldY) } -//---------------------------------------------------------------------------- /*! Move the position of the camera along the direction of projection. (dx,dy)*/ void VTKViewer_InteractorStyle::DollyXY(int dx, int dy) { @@ -231,8 +226,6 @@ void VTKViewer_InteractorStyle::DollyXY(int dx, int dy) myGUIWindow->update(); } -//---------------------------------------------------------------------------- -/*!*/ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY) { vtkCamera *cam; @@ -259,7 +252,6 @@ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY) } -//---------------------------------------------------------------------------- /*!On mouse move event. *\param ctrl - CTRL (not used) *\param shift - SHIFT (on/off - integer 0/1) @@ -278,7 +270,6 @@ void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), } -//---------------------------------------------------------------------------- /*!On Left button down event. *\param ctrl - CTRL (on/off - integer 0/1) *\param shift - SHIFT (on/off - integer 0/1) @@ -315,7 +306,6 @@ void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, } -//---------------------------------------------------------------------------- /*!On left button up event. *\param ctrl - CTRL (not used) *\param shift - SHIFT (on/off - integer 0/1) @@ -336,7 +326,6 @@ void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl), } -//---------------------------------------------------------------------------- /*!On left button up event. *\param ctrl - CTRL (on/off - integer 0/1) *\param shift - SHIFT (on/off - integer 0/1) @@ -374,7 +363,6 @@ void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl, } -//---------------------------------------------------------------------------- /*!On middle button up event. *\param ctrl - CTRL (not used) *\param shift - SHIFT (on/off - integer 0/1) @@ -395,7 +383,6 @@ void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl), } -//---------------------------------------------------------------------------- /*!On right button down event. *\param ctrl - CTRL (on/off - integer 0/1) *\param shift - SHIFT (on/off - integer 0/1) @@ -432,7 +419,6 @@ void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl, } } -//---------------------------------------------------------------------------- /*!On right button up event. *\param ctrl - CTRL (not used) *\param shift - SHIFT (on/off - integer 0/1) @@ -452,8 +438,7 @@ void VTKViewer_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl), } } -//---------------------------------------------------------------------------- -/** @name XPM - x pixmaps. */ +/*! @name XPM - x pixmaps. */ //@{ /*!Image Zoom cursor*/ const char* imageZoomCursor[] = { @@ -534,7 +519,6 @@ const char* imageRotateCursor[] = { "................................"}; //@} -//---------------------------------------------------------------------------- /*! Loads cursors for viewer operations - zoom, pan, etc...*/ void VTKViewer_InteractorStyle::loadCursors() { @@ -549,7 +533,6 @@ void VTKViewer_InteractorStyle::loadCursors() } -//---------------------------------------------------------------------------- /*! event filter - controls mouse and keyboard events during viewer operations*/ bool VTKViewer_InteractorStyle::eventFilter(QObject* object, QEvent* event) { @@ -563,7 +546,6 @@ bool VTKViewer_InteractorStyle::eventFilter(QObject* object, QEvent* event) } -//---------------------------------------------------------------------------- /*! starts Zoom operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startZoom() { @@ -578,7 +560,6 @@ void VTKViewer_InteractorStyle::startZoom() } -//---------------------------------------------------------------------------- /*! starts Pan operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startPan() { @@ -592,7 +573,6 @@ void VTKViewer_InteractorStyle::startPan() qApp->installEventFilter(this); } -//---------------------------------------------------------------------------- /*! starts Rotate operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startRotate() { @@ -607,7 +587,6 @@ void VTKViewer_InteractorStyle::startRotate() } -//---------------------------------------------------------------------------- /*! starts Spin operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startSpin() { @@ -623,7 +602,6 @@ void VTKViewer_InteractorStyle::startSpin() -//---------------------------------------------------------------------------- /*! starts Fit Area operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startFitArea() { @@ -638,7 +616,6 @@ void VTKViewer_InteractorStyle::startFitArea() } -//---------------------------------------------------------------------------- /*!View fit all.*/ void VTKViewer_InteractorStyle::ViewFitAll() { int aTriedronWasVisible = false; @@ -660,7 +637,6 @@ void VTKViewer_InteractorStyle::ViewFitAll() { } -//---------------------------------------------------------------------------- /*! starts Global Panning operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startGlobalPan() { @@ -684,7 +660,6 @@ void VTKViewer_InteractorStyle::startGlobalPan() } -//---------------------------------------------------------------------------- /*!\retval TRUE if needs redrawing*/ bool VTKViewer_InteractorStyle::needsRedrawing() { @@ -696,7 +671,6 @@ bool VTKViewer_InteractorStyle::needsRedrawing() } -//---------------------------------------------------------------------------- /*! fits viewer contents to rectangle *\param left - left side *\param top - top side @@ -735,7 +709,6 @@ void VTKViewer_InteractorStyle::fitRect(const int left, } -//---------------------------------------------------------------------------- /*! starts viewer operation (!internal usage!)*/ void VTKViewer_InteractorStyle::startOperation(int operation) { @@ -764,7 +737,6 @@ void VTKViewer_InteractorStyle::startOperation(int operation) } -//---------------------------------------------------------------------------- /*! sets proper cursor for window when viewer operation is activated*/ void VTKViewer_InteractorStyle::setCursor(const int operation) { @@ -805,7 +777,6 @@ void VTKViewer_InteractorStyle::setCursor(const int operation) } -//---------------------------------------------------------------------------- /*! called when viewer operation started (!put necessary initialization here!)*/ void VTKViewer_InteractorStyle::onStartOperation() { @@ -832,7 +803,6 @@ void VTKViewer_InteractorStyle::onStartOperation() } -//---------------------------------------------------------------------------- /*! called when viewer operation finished (!put necessary post-processing here!)*/ void VTKViewer_InteractorStyle::onFinishOperation() { @@ -1366,17 +1336,17 @@ void VTKViewer_InteractorStyle::Place(const int theX, const int theY) void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY) { vtkCamera *cam = this->CurrentRenderer->GetActiveCamera(); - double viewFocus[4], focalDepth, viewPoint[3]; - float newPickPoint[4], oldPickPoint[4], motionVector[3]; + vtkFloatingPointType viewFocus[4], focalDepth, viewPoint[3]; + vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3]; cam->GetFocalPoint(viewFocus); this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1], viewFocus[2], viewFocus); focalDepth = viewFocus[2]; - this->ComputeDisplayToWorld(double(toX), double(toY), + this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY), focalDepth, newPickPoint); - this->ComputeDisplayToWorld(double(fromX),double(fromY), + this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY), focalDepth, oldPickPoint); // camera motion is reversed @@ -1400,17 +1370,17 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, const int left, const int top, const int right, const int bottom) { - float* aBounds = theActor->GetBounds(); - float aMin[3], aMax[3]; + vtkFloatingPointType* aBounds = theActor->GetBounds(); + vtkFloatingPointType aMin[3], aMax[3]; ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin); ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax); if (aMin[0] > aMax[0]) { - float aBuf = aMin[0]; + vtkFloatingPointType aBuf = aMin[0]; aMin[0] = aMax[0]; aMax[0] = aBuf; } if (aMin[1] > aMax[1]) { - float aBuf = aMin[1]; + vtkFloatingPointType aBuf = aMin[1]; aMin[1] = aMax[1]; aMax[1] = aBuf; } @@ -1424,17 +1394,17 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, const int left, const int top, const int right, const int bottom) { - float* aBounds = theCell->GetBounds(); - float aMin[3], aMax[3]; + vtkFloatingPointType* aBounds = theCell->GetBounds(); + vtkFloatingPointType aMin[3], aMax[3]; ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin); ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax); if (aMin[0] > aMax[0]) { - float aBuf = aMin[0]; + vtkFloatingPointType aBuf = aMin[0]; aMin[0] = aMax[0]; aMax[0] = aBuf; } if (aMin[1] > aMax[1]) { - float aBuf = aMin[1]; + vtkFloatingPointType aBuf = aMin[1]; aMin[1] = aMax[1]; aMax[1] = aBuf; } @@ -1443,11 +1413,11 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, } /*!Checks: is given point \a thePoint in rectangle*/ -bool VTKViewer_InteractorStyle::IsInRect(float* thePoint, - const int left, const int top, - const int right, const int bottom) +bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint, + const int left, const int top, + const int right, const int bottom) { - float aPnt[3]; + vtkFloatingPointType aPnt[3]; ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt); return ((aPnt[0]>left) && (aPnt[0]bottom) && (aPnt[1]GetRenderers(); theRenderers->InitTraversal(); diff --git a/src/VTKViewer/VTKViewer_RenderWindow.h b/src/VTKViewer/VTKViewer_RenderWindow.h index c83b0307e..e85b1c549 100755 --- a/src/VTKViewer/VTKViewer_RenderWindow.h +++ b/src/VTKViewer/VTKViewer_RenderWindow.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_RENDERWINDOW_H #define VTKVIEWER_RENDERWINDOW_H diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index daf93e15c..9445c5b15 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "VTKViewer_RenderWindowInteractor.h" #include "VTKViewer_RenderWindow.h" @@ -118,6 +118,11 @@ VTKViewer_RenderWindowInteractor::~VTKViewer_RenderWindowInteractor() myPointPicker->Delete(); } +/*! + Print interactor to stream + \param os - stream + \param indent +*/ void VTKViewer_RenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent) { vtkRenderWindowInteractor::PrintSelf(os, indent) ; @@ -214,34 +219,6 @@ void VTKViewer_RenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver vtkRenderWindowInteractor::SetInteractorStyle(theInteractor); } - -/* -void VTKViewer_RenderWindowInteractor::SetSelectionMode(Selection_Mode theMode) -{ - myCellActor->SetVisibility(false); - myEdgeActor->SetVisibility(false); - myPointActor->SetVisibility(false); - - switch(theMode){ - case ActorSelection: - this->SetPicker(myBasicPicker); - break; - case NodeSelection: - this->SetPicker(myPointPicker); - break; - case CellSelection: - case EdgeSelection: - case FaceSelection: - case VolumeSelection: - case EdgeOfCellSelection: - this->SetPicker(myCellPicker); - break; - } - - myInteractorStyle->OnSelectionModeChanged(); -} -*/ - /*!Sets selection properties. *\param theRed - red component of color *\param theGreen - green component of color @@ -351,8 +328,9 @@ int VTKViewer_RenderWindowInteractor::CreateTimer(int vtkNotUsed(timertype)) return 1 ; } -/**@see CreateTimer(int ) - *\retval 1 +/*! + \sa CreateTimer(int ) + \retval 1 */ int VTKViewer_RenderWindowInteractor::DestroyTimer(void) { @@ -623,6 +601,9 @@ void VTKViewer_RenderWindowInteractor::Display( VTKViewer_Actor* theActor, bool emit RenderWindowModified(); } +/*! + default key press event (empty implementation) +*/ void VTKViewer_RenderWindowInteractor::KeyPressed(QKeyEvent *event) { /// NOT_IMPLEMENTED @@ -698,7 +679,7 @@ void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfIn TUpdateActor theFun) { (*theFun)(theMapIndex,theMapActor,theActor); - float aPos[3]; + vtkFloatingPointType aPos[3]; theMapActor->GetPosition(aPos); theActor->SetPosition(aPos); } diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.h b/src/VTKViewer/VTKViewer_RenderWindowInteractor.h index 9d06598b8..435e5b4b8 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.h +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_RENDERWINDOWINTERACTOR_H #define VTKVIEWER_RENDERWINDOWINTERACTOR_H diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx index b2825687a..b4a7fb6a2 100755 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -55,13 +55,13 @@ void VTKViewer_ShrinkFilter::Execute() int i, j, numIds, abort=0; vtkIdType cellId, numCells, numPts; vtkIdType oldId, newId; - float center[3], *p, pt[3]; + vtkFloatingPointType center[3], *p, pt[3]; vtkPointData *pd, *outPD;; vtkIdList *ptIds, *newPtIds; vtkDataSet *input= this->GetInput(); vtkUnstructuredGrid *output = this->GetOutput(); vtkIdType tenth; - float decimal; + vtkFloatingPointType decimal; vtkDebugMacro(<<"Shrinking cells"); diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.h b/src/VTKViewer/VTKViewer_ShrinkFilter.h index 9b60d4978..4d2a416bb 100755 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.h +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_SHRINKFILTER_H #define VTKVIEWER_SHRINKFILTER_H diff --git a/src/VTKViewer/VTKViewer_Transform.cxx b/src/VTKViewer/VTKViewer_Transform.cxx index d0f7db712..4526d4555 100755 --- a/src/VTKViewer/VTKViewer_Transform.cxx +++ b/src/VTKViewer/VTKViewer_Transform.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer_Transform.h b/src/VTKViewer/VTKViewer_Transform.h index 478d982c6..9ef364577 100755 --- a/src/VTKViewer/VTKViewer_Transform.h +++ b/src/VTKViewer/VTKViewer_Transform.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_TRANSFORM_H #define VTKVIEWER_TRANSFORM_H diff --git a/src/VTKViewer/VTKViewer_TransformFilter.cxx b/src/VTKViewer/VTKViewer_TransformFilter.cxx index f54e97de1..cdfc14a1f 100755 --- a/src/VTKViewer/VTKViewer_TransformFilter.cxx +++ b/src/VTKViewer/VTKViewer_TransformFilter.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // diff --git a/src/VTKViewer/VTKViewer_TransformFilter.h b/src/VTKViewer/VTKViewer_TransformFilter.h index ecc2b3cb2..3087a03e9 100755 --- a/src/VTKViewer/VTKViewer_TransformFilter.h +++ b/src/VTKViewer/VTKViewer_TransformFilter.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_TRANSFORMFILTER_H #define VTKVIEWER_TRANSFORMFILTER_H diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index a6670cb87..c426e0280 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "VTKViewer_Trihedron.h" #include "VTKViewer_Actor.h" @@ -44,7 +44,10 @@ VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT; } -float* +/*! + \return bounding box +*/ +vtkFloatingPointType* VTKViewer_UnScaledActor ::GetBounds() { @@ -65,19 +68,20 @@ void VTKViewer_UnScaledActor::SetSize(int theSize) void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) { if(theRenderer){ - float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; + vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]); theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]); - float aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ - (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ - (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); + vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ + (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ + (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); int* aSize = theRenderer->GetRenderWindow()->GetSize(); - float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1])); + vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); - float aLength = aDataSet->GetLength(); - float aPrecision = 1.0E-3; - float anOldScale = GetScale()[0]; - float aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1])); + aDataSet->Update(); + vtkFloatingPointType aLength = aDataSet->GetLength(); + vtkFloatingPointType aPrecision = 1.0E-3; + vtkFloatingPointType anOldScale = GetScale()[0]; + vtkFloatingPointType aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1])); if(fabs(aScale - anOldScale)/aScale > aPrecision){ SetScale(aScale); } @@ -104,6 +108,9 @@ void VTKViewer_LineActor::Render(vtkRenderer *theRenderer) vtkFollower::Render(theRenderer); } +/*! + Constructor +*/ VTKViewer_Axis::VTKViewer_Axis() { /*! \li Initialize the Line pipe-line representation*/ @@ -152,6 +159,9 @@ VTKViewer_Axis::VTKViewer_Axis() myVisibility = VTKViewer_Trihedron::eOn; } +/*! + Destructor +*/ VTKViewer_Axis::~VTKViewer_Axis() { /*! \li Destroy of the Label pipe-line representation */ @@ -179,6 +189,9 @@ VTKViewer_Axis::~VTKViewer_Axis() myLineSource->Delete(); } +/*! Add to renderer + * \param theRenderer - vtkRenderer pointer + */ void VTKViewer_Axis::AddToRender(vtkRenderer* theRenderer){ /*! \li Order of the calls are important*/ theRenderer->AddActor(myLineActor); @@ -186,6 +199,9 @@ void VTKViewer_Axis::AddToRender(vtkRenderer* theRenderer){ theRenderer->AddActor(myArrowActor); } +/*! Remove actor of acis from \a theRenderer which are in myPresent. + * \param theRenderer - vtkRenderer pointer + */ void VTKViewer_Axis::RemoveFromRender(vtkRenderer* theRenderer){ /*! \li Order of the calls are important*/ theRenderer->RemoveActor(myLineActor); @@ -193,6 +209,7 @@ void VTKViewer_Axis::RemoveFromRender(vtkRenderer* theRenderer){ theRenderer->RemoveActor(myArrowActor); } +/*! Sets visibility for all Axis to \a theVis*/ void VTKViewer_Axis::SetVisibility(VTKViewer_Trihedron::TVisibility theVis) { switch(theVis){ @@ -213,20 +230,25 @@ void VTKViewer_Axis::SetVisibility(VTKViewer_Trihedron::TVisibility theVis) myVisibility = theVis; } -//**************************************************************** +/*! Set camera for myLabelActor + */ void VTKViewer_Axis::SetCamera(vtkCamera* theCamera){ myLabelActor->SetCamera(theCamera); } +/*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor + */ void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){ myLabelActor->SetProperty(theProperty); myArrowActor->SetProperty(theProperty); myLineActor->SetProperty(theProperty); } -void VTKViewer_Axis::SetSize(float theSize) +/*! Set size of VTKViewer_Axis + */ +void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize) { - float aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize}; + vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize}; myLineSource->SetPoint2(aPosition); myArrowActor->SetPosition(0.0,0.0,0.0); @@ -318,16 +340,22 @@ VTKViewer_ZAxis::VTKViewer_ZAxis() vtkStandardNewMacro(VTKViewer_Trihedron); +/*! + Constructor +*/ VTKViewer_Trihedron::VTKViewer_Trihedron() { myPresent = vtkActorCollection::New(); myAxis[0] = VTKViewer_XAxis::New(); myAxis[1] = VTKViewer_YAxis::New(); myAxis[2] = VTKViewer_ZAxis::New(); - static float aSize = 100; + static vtkFloatingPointType aSize = 100; SetSize(aSize); } +/*! + Destructor +*/ VTKViewer_Trihedron::~VTKViewer_Trihedron() { myPresent->RemoveAllItems(); @@ -336,24 +364,34 @@ VTKViewer_Trihedron::~VTKViewer_Trihedron() myAxis[i]->Delete(); } -void VTKViewer_Trihedron::SetSize(float theSize) +/*! Set size of axes + */ +void VTKViewer_Trihedron::SetSize(vtkFloatingPointType theSize) { mySize = theSize; for(int i = 0; i < 3; i++) myAxis[i]->SetSize(theSize); } +/*! Set visibility of axes + */ void VTKViewer_Trihedron::SetVisibility(TVisibility theVis) { for(int i = 0; i < 3; i++) myAxis[i]->SetVisibility(theVis); } +/*! + \return visibility of first axis +*/ VTKViewer_Trihedron::TVisibility VTKViewer_Trihedron::GetVisibility() { return myAxis[0]->GetVisibility(); } +/*! Add to render all Axis + * \param theRenderer - vtkRenderer pointer + */ void VTKViewer_Trihedron::AddToRender(vtkRenderer* theRenderer) { vtkCamera* aCamera = theRenderer->GetActiveCamera(); @@ -363,6 +401,9 @@ void VTKViewer_Trihedron::AddToRender(vtkRenderer* theRenderer) } } +/*! Remove all actors from \a theRenderer which are in myPresent. + * \param theRenderer - vtkRenderer pointer + */ void VTKViewer_Trihedron::RemoveFromRender(vtkRenderer* theRenderer) { myPresent->InitTraversal(); @@ -372,6 +413,9 @@ void VTKViewer_Trihedron::RemoveFromRender(vtkRenderer* theRenderer) myAxis[i]->RemoveFromRender(theRenderer); } +/*! Return count of visible actors. + * \param theRenderer - vtkRenderer pointer + */ int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer) { //TVisibility aVis = GetVisibility(); diff --git a/src/VTKViewer/VTKViewer_Trihedron.h b/src/VTKViewer/VTKViewer_Trihedron.h index d134740f8..0d29f11d8 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.h +++ b/src/VTKViewer/VTKViewer_Trihedron.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_TRIHEDRON_H #define VTKVIEWER_TRIHEDRON_H @@ -52,7 +52,7 @@ public: /*!Create new instance of VTKViewer_UnScaledActor.*/ static VTKViewer_UnScaledActor *New(); - virtual float* GetBounds(); + virtual vtkFloatingPointType* GetBounds(); virtual void SetSize(int theSize); virtual void Render(vtkRenderer *theRenderer); @@ -111,7 +111,6 @@ protected: VTKViewer_UnScaledActor* ArrowActor; }; -//**************************************************************** /*!This class provide support trihedron object in vtk viewer.*/ class VTKVIEWER_EXPORT VTKViewer_Trihedron : public vtkObject { @@ -133,14 +132,14 @@ public: static VTKViewer_Trihedron *New(); /*!Sets size of trihedron. - * \param theSize - float value + * \param theSize - vtkFloatingPointType value */ - virtual void SetSize(float theSize); + virtual void SetSize(vtkFloatingPointType theSize); /*! Get size of trihedron. - * \retval mySize - float value + * \retval mySize - vtkFloatingPointType value */ - virtual float GetSize() { return mySize;} + virtual vtkFloatingPointType GetSize() { return mySize;} enum TVisibility{eOff, eOn, eOnlyLineOn}; @@ -182,10 +181,9 @@ protected: VTKViewer_Axis* myAxis[3]; /*! Common size for trihedron, for each axis.*/ - float mySize; + vtkFloatingPointType mySize; }; -//**************************************************************** /*!The base class for concreate Axis. * Its only duty is to give correct initialization and destruction * of its pipe-lines @@ -225,7 +223,7 @@ public: /*! Set size of VTKViewer_Axis */ - virtual void SetSize(float theSize); + virtual void SetSize(vtkFloatingPointType theSize); /*! Get label actor. * \retval Return myLabelActor. @@ -248,7 +246,7 @@ protected: /*! \var myRot[3] * Orientation vector */ - float myDir[3], myRot[3]; + vtkFloatingPointType myDir[3], myRot[3]; /*! VTKViewer_LineActor actor pointer */ diff --git a/src/VTKViewer/VTKViewer_Utilities.cxx b/src/VTKViewer/VTKViewer_Utilities.cxx index a05b0a36f..5f061a64b 100755 --- a/src/VTKViewer/VTKViewer_Utilities.cxx +++ b/src/VTKViewer/VTKViewer_Utilities.cxx @@ -14,79 +14,100 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + +#include "VTKViewer_Utilities.h" #include "VTKViewer_Actor.h" +#include + // VTK Includes #include #include #include #include -#include "VTKViewer_Utilities.h" +using namespace std; -/*!@see vtkRenderer::ResetCamera(float bounds[6]) method*/ -void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) +/*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/ +void +ResetCamera(vtkRenderer* theRenderer, + int theUsingZeroFocalPoint) { - if(!theRenderer) return; - float bounds[6]; - int aCount = ComputeVisiblePropBounds(theRenderer,bounds); + if(!theRenderer) + return; + + vtkCamera* aCamera = theRenderer->GetActiveCamera(); + if(!aCamera) + return; + + vtkFloatingPointType aBounds[6]; + int aCount = ComputeVisiblePropBounds(theRenderer,aBounds); + if(theUsingZeroFocalPoint || aCount){ - float aLength = bounds[1]-bounds[0]; - aLength = max((bounds[3]-bounds[2]),aLength); - aLength = max((bounds[5]-bounds[4]),aLength); + static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + + vtkFloatingPointType aLength = aBounds[1]-aBounds[0]; + aLength = max((aBounds[3]-aBounds[2]),aLength); + aLength = max((aBounds[5]-aBounds[4]),aLength); - double vn[3]; - if ( theRenderer->GetActiveCamera() != NULL ) - theRenderer->GetActiveCamera()->GetViewPlaneNormal(vn); - else{ + if(aLength < MIN_DISTANCE) return; - } + + vtkFloatingPointType aWidth = + sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) + + (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) + + (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4])); + + if(aWidth < MIN_DISTANCE) + return; + + vtkFloatingPointType aViewPlaneNormal[3]; + aCamera->GetViewPlaneNormal(aViewPlaneNormal); - float center[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0}; if(!theUsingZeroFocalPoint){ - center[0] = (bounds[0] + bounds[1])/2.0; - center[1] = (bounds[2] + bounds[3])/2.0; - center[2] = (bounds[4] + bounds[5])/2.0; + aCenter[0] = (aBounds[0] + aBounds[1])/2.0; + aCenter[1] = (aBounds[2] + aBounds[3])/2.0; + aCenter[2] = (aBounds[4] + aBounds[5])/2.0; } - theRenderer->GetActiveCamera()->SetFocalPoint(center[0],center[1],center[2]); - - float width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + - (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + - (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); + aCamera->SetFocalPoint(aCenter[0],aCenter[1],aCenter[2]); - double ang = theRenderer->GetActiveCamera()->GetViewAngle(); - float distance = 2.0*width/tan(ang*vtkMath::Pi()/360.0); + vtkFloatingPointType aViewAngle = aCamera->GetViewAngle(); + vtkFloatingPointType aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0); // check view-up vector against view plane normal - double *vup = theRenderer->GetActiveCamera()->GetViewUp(); - if ( fabs(vtkMath::Dot(vup,vn)) > 0.999 ){ - theRenderer->GetActiveCamera()->SetViewUp(-vup[2], vup[0], vup[1]); - } + vtkFloatingPointType aViewUp[3]; + aCamera->GetViewUp(aViewUp); + if(fabs(vtkMath::Dot(aViewUp,aViewPlaneNormal)) > 0.999) + aCamera->SetViewUp(-aViewUp[2], aViewUp[0], aViewUp[1]); // update the camera - theRenderer->GetActiveCamera()->SetPosition(center[0]+distance*vn[0], - center[1]+distance*vn[1], - center[2]+distance*vn[2]); + aCamera->SetPosition(aCenter[0]+aDistance*aViewPlaneNormal[0], + aCenter[1]+aDistance*aViewPlaneNormal[1], + aCenter[2]+aDistance*aViewPlaneNormal[2]); + // find size of the window - int* winsize = theRenderer->GetSize(); - if(winsize[0] < winsize[1]) width *= float(winsize[1])/float(winsize[0]); + int* aWinSize = theRenderer->GetSize(); + if(aWinSize[0] < aWinSize[1]) + aWidth *= vtkFloatingPointType(aWinSize[1])/vtkFloatingPointType(aWinSize[0]); - if(theUsingZeroFocalPoint) width *= sqrt(2.0); + if(theUsingZeroFocalPoint) + aWidth *= sqrt(2.0); - theRenderer->GetActiveCamera()->SetParallelScale(width/2.0); + aCamera->SetParallelScale(aWidth/2.0); } - //workaround on VTK - //theRenderer->ResetCameraClippingRange(bounds); + ResetCameraClippingRange(theRenderer); } /*! Compute the bounds of the visible props*/ -int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6]) +int +ComputeVisiblePropBounds(vtkRenderer* theRenderer, + vtkFloatingPointType theBounds[6]) { - float *bounds; - int aCount=0; + int aCount = 0; theBounds[0] = theBounds[2] = theBounds[4] = VTK_LARGE_FLOAT; theBounds[1] = theBounds[3] = theBounds[5] = -VTK_LARGE_FLOAT; @@ -94,53 +115,40 @@ int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6]) // loop through all props vtkActorCollection* aCollection = theRenderer->GetActors(); aCollection->InitTraversal(); - while (vtkActor* prop = aCollection->GetNextActor()) { + while (vtkActor* aProp = aCollection->GetNextActor()) { // if it's invisible, or has no geometry, we can skip the rest - if ( prop->GetVisibility() ) - { - if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(prop)) - if(anActor->IsInfinitive()) continue; - bounds = prop->GetBounds(); - // make sure we haven't got bogus bounds - if ( bounds != NULL && - bounds[0] > -VTK_LARGE_FLOAT && bounds[1] < VTK_LARGE_FLOAT && - bounds[2] > -VTK_LARGE_FLOAT && bounds[3] < VTK_LARGE_FLOAT && - bounds[4] > -VTK_LARGE_FLOAT && bounds[5] < VTK_LARGE_FLOAT ) - { - aCount++; - - if (bounds[0] < theBounds[0]) - { - theBounds[0] = bounds[0]; - } - if (bounds[1] > theBounds[1]) - { - theBounds[1] = bounds[1]; - } - if (bounds[2] < theBounds[2]) - { - theBounds[2] = bounds[2]; - } - if (bounds[3] > theBounds[3]) - { - theBounds[3] = bounds[3]; - } - if (bounds[4] < theBounds[4]) - { - theBounds[4] = bounds[4]; - } - if (bounds[5] > theBounds[5]) - { - theBounds[5] = bounds[5]; - } - }//not bogus + if(aProp->GetVisibility() && aProp->GetMapper()){ + if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp)) + if(anActor->IsInfinitive()) + continue; + + vtkFloatingPointType *aBounds = aProp->GetBounds(); + static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; + // make sure we haven't got bogus bounds + if ( aBounds != NULL && + aBounds[0] > -MAX_DISTANCE && aBounds[1] < MAX_DISTANCE && + aBounds[2] > -MAX_DISTANCE && aBounds[3] < MAX_DISTANCE && + aBounds[4] > -MAX_DISTANCE && aBounds[5] < MAX_DISTANCE ) + { + aCount++; + + theBounds[0] = min(aBounds[0],theBounds[0]); + theBounds[2] = min(aBounds[2],theBounds[2]); + theBounds[4] = min(aBounds[4],theBounds[4]); + + theBounds[1] = max(aBounds[1],theBounds[1]); + theBounds[3] = max(aBounds[3],theBounds[3]); + theBounds[5] = max(aBounds[5],theBounds[5]); + + }//not bogus } } return aCount; } -/*!@see vtkRenderer::ResetCameraClippingRange(float bounds[6]) method*/ -void ResetCameraClippingRange(vtkRenderer* theRenderer) +/*!@see vtkRenderer::ResetCameraClippingRange(vtkFloatingPointType bounds[6]) method*/ +void +ResetCameraClippingRange(vtkRenderer* theRenderer) { if(!theRenderer || !theRenderer->VisibleActorCount()) return; @@ -150,28 +158,28 @@ void ResetCameraClippingRange(vtkRenderer* theRenderer) } // Find the plane equation for the camera view plane - double vn[3]; + vtkFloatingPointType vn[3]; anActiveCamera->GetViewPlaneNormal(vn); - double position[3]; + vtkFloatingPointType position[3]; anActiveCamera->GetPosition(position); - float bounds[6]; + vtkFloatingPointType bounds[6]; theRenderer->ComputeVisiblePropBounds(bounds); - double center[3]; + vtkFloatingPointType center[3]; center[0] = (bounds[0] + bounds[1])/2.0; center[1] = (bounds[2] + bounds[3])/2.0; center[2] = (bounds[4] + bounds[5])/2.0; - double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + + vtkFloatingPointType width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); - double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) + + vtkFloatingPointType distance = sqrt((position[0]-center[0])*(position[0]-center[0]) + (position[1]-center[1])*(position[1]-center[1]) + (position[2]-center[2])*(position[2]-center[2])); - float range[2] = {distance - width/2.0, distance + width/2.0}; + vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0}; // Do not let the range behind the camera throw off the calculation. if (range[0] < 0.0) range[0] = 0.0; @@ -180,23 +188,26 @@ void ResetCameraClippingRange(vtkRenderer* theRenderer) } /*!Compute trihedron size.*/ -bool ComputeTrihedronSize( vtkRenderer* theRenderer,double& theNewSize, - const double theSize, const float theSizeInPercents ) +bool +ComputeTrihedronSize( vtkRenderer* theRenderer, + vtkFloatingPointType& theNewSize, + const vtkFloatingPointType theSize, + const vtkFloatingPointType theSizeInPercents ) { // calculating diagonal of visible props of the renderer - float bnd[ 6 ]; + vtkFloatingPointType bnd[ 6 ]; if ( ComputeVisiblePropBounds( theRenderer, bnd ) == 0 ) { bnd[ 1 ] = bnd[ 3 ] = bnd[ 5 ] = 100; bnd[ 0 ] = bnd[ 2 ] = bnd[ 4 ] = 0; } - float aLength = 0; + vtkFloatingPointType aLength = 0; aLength = bnd[ 1 ]-bnd[ 0 ]; aLength = max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength ); aLength = max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength ); - static float EPS_SIZE = 5.0E-3; + static vtkFloatingPointType EPS_SIZE = 5.0E-3; theNewSize = aLength * theSizeInPercents / 100.0; // if the new trihedron size have sufficient difference, then apply the value diff --git a/src/VTKViewer/VTKViewer_Utilities.h b/src/VTKViewer/VTKViewer_Utilities.h index 6341e885d..7ef9cc550 100755 --- a/src/VTKViewer/VTKViewer_Utilities.h +++ b/src/VTKViewer/VTKViewer_Utilities.h @@ -14,27 +14,37 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_UTILITIES_H #define VTKVIEWER_UTILITIES_H -#include +#include "VTKViewer.h" class vtkRenderer; -VTKVIEWER_EXPORT extern void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint = false); -VTKVIEWER_EXPORT extern int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6]); -VTKVIEWER_EXPORT extern void ResetCameraClippingRange(vtkRenderer* theRenderer); -VTKVIEWER_EXPORT extern bool ComputeTrihedronSize(vtkRenderer* theRenderer, double& theNewSize, - const double theSize, const float theSizeInPercents); +VTKVIEWER_EXPORT +extern +void +ResetCamera(vtkRenderer* theRenderer, + int theUsingZeroFocalPoint = false); -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif +VTKVIEWER_EXPORT +extern +int +ComputeVisiblePropBounds(vtkRenderer* theRenderer, + vtkFloatingPointType theBounds[6]); -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif +VTKVIEWER_EXPORT +extern +void +ResetCameraClippingRange(vtkRenderer* theRenderer); +VTKVIEWER_EXPORT +extern +bool +ComputeTrihedronSize(vtkRenderer* theRenderer, + vtkFloatingPointType& theNewSize, + const vtkFloatingPointType theSize, + const vtkFloatingPointType theSizeInPercents); #endif diff --git a/src/VTKViewer/VTKViewer_VectorText.cxx b/src/VTKViewer/VTKViewer_VectorText.cxx index b4e62266a..5ec7a8c58 100755 --- a/src/VTKViewer/VTKViewer_VectorText.cxx +++ b/src/VTKViewer/VTKViewer_VectorText.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /*========================================================================= @@ -1751,6 +1751,11 @@ void VTKViewer_VectorText::Execute() newPolys->Delete(); } +/*! + Print text to stream + \param os - stream + \param indent +*/ void VTKViewer_VectorText::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); diff --git a/src/VTKViewer/VTKViewer_VectorText.h b/src/VTKViewer/VTKViewer_VectorText.h index 8ce64cdd4..5838f6a1d 100755 --- a/src/VTKViewer/VTKViewer_VectorText.h +++ b/src/VTKViewer/VTKViewer_VectorText.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /*========================================================================= diff --git a/src/VTKViewer/VTKViewer_ViewManager.cxx b/src/VTKViewer/VTKViewer_ViewManager.cxx index 2dedb7984..d67c92d1e 100755 --- a/src/VTKViewer/VTKViewer_ViewManager.cxx +++ b/src/VTKViewer/VTKViewer_ViewManager.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "VTKViewer_ViewManager.h" #include "VTKViewer_ViewModel.h" diff --git a/src/VTKViewer/VTKViewer_ViewManager.h b/src/VTKViewer/VTKViewer_ViewManager.h index 03f6d21da..49d9a26c8 100755 --- a/src/VTKViewer/VTKViewer_ViewManager.h +++ b/src/VTKViewer/VTKViewer_ViewManager.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_VIEWMANAGER_H #define VTKVIEWER_VIEWMANAGER_H diff --git a/src/VTKViewer/VTKViewer_ViewModel.cxx b/src/VTKViewer/VTKViewer_ViewModel.cxx index f8fd9913e..9653aeacf 100755 --- a/src/VTKViewer/VTKViewer_ViewModel.cxx +++ b/src/VTKViewer/VTKViewer_ViewModel.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "VTKViewer_ViewModel.h" #include "VTKViewer_ViewWindow.h" diff --git a/src/VTKViewer/VTKViewer_ViewModel.h b/src/VTKViewer/VTKViewer_ViewModel.h index 0ca65ab79..06cab857f 100755 --- a/src/VTKViewer/VTKViewer_ViewModel.h +++ b/src/VTKViewer/VTKViewer_ViewModel.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_VIEWMODEL_H #define VTKVIEWER_VIEWMODEL_H diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index d4500095a..aba392028 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "VTKViewer_ViewWindow.h" #include "VTKViewer_ViewModel.h" @@ -387,7 +387,7 @@ void VTKViewer_ViewWindow::onResetView() ::ResetCamera(myRenderer,true); if(aTriedronIsVisible) myTrihedron->VisibilityOn(); else myTrihedron->VisibilityOff(); - static float aCoeff = 3.0; + static vtkFloatingPointType aCoeff = 3.0; aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); Repaint(); } @@ -409,7 +409,7 @@ void VTKViewer_ViewWindow::setBackgroundColor( const QColor& color ) /*!Returns background of the viewport*/ QColor VTKViewer_ViewWindow::backgroundColor() const { - float backint[3]; + vtkFloatingPointType backint[3]; if ( myRenderer ) { myRenderer->GetBackground( backint ); return QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)); @@ -443,11 +443,11 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ int aVisibleNum = myTrihedron->GetVisibleActorCount(myRenderer); if(aVisibleNum){ // calculating diagonal of visible props of the renderer - float bnd[6]; + vtkFloatingPointType bnd[6]; myTrihedron->VisibilityOff(); ::ComputeVisiblePropBounds(myRenderer,bnd); myTrihedron->VisibilityOn(); - float aLength = 0; + vtkFloatingPointType aLength = 0; static bool CalcByDiag = false; if(CalcByDiag){ aLength = sqrt((bnd[1]-bnd[0])*(bnd[1]-bnd[0])+ @@ -459,13 +459,13 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ aLength = max((bnd[5]-bnd[4]),aLength); } - static float aSizeInPercents = 105; + static vtkFloatingPointType aSizeInPercents = 105; QString aSetting;// = SUIT_CONFIG->getSetting("Viewer:TrihedronSize"); if(!aSetting.isEmpty()) aSizeInPercents = aSetting.toFloat(); - static float EPS_SIZE = 5.0E-3; - float aSize = myTrihedron->GetSize(); - float aNewSize = aLength*aSizeInPercents/100.0; + static vtkFloatingPointType EPS_SIZE = 5.0E-3; + vtkFloatingPointType aSize = myTrihedron->GetSize(); + vtkFloatingPointType aNewSize = aLength*aSizeInPercents/100.0; // if the new trihedron size have sufficient difference, then apply the value if(fabs(aNewSize-aSize) > aSize*EPS_SIZE || fabs(aNewSize-aSize) > aNewSize*EPS_SIZE){ myTrihedron->SetSize(aNewSize); @@ -559,3 +559,54 @@ QImage VTKViewer_ViewWindow::dumpView() QPixmap px = QPixmap::grabWindow( myRenderWindow->winId() ); return px.convertToImage(); } + +/*! The method returns the visual parameters of this view as a formated string + */ +QString VTKViewer_ViewWindow::getVisualParameters() +{ + double pos[3], focalPnt[3], viewUp[3], parScale, scale[3]; + + vtkCamera* camera = myRenderer->GetActiveCamera(); + camera->GetPosition( pos ); + camera->GetFocalPoint( focalPnt ); + camera->GetViewUp( viewUp ); + parScale = camera->GetParallelScale(); + GetScale( scale ); + + QString retStr; + retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", + pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], viewUp[0], viewUp[1], + viewUp[2], parScale, scale[0], scale[1], scale[2] ); + return retStr; +} + +/*! The method restors visual parameters of this view from a formated string + */ +void VTKViewer_ViewWindow::setVisualParameters( const QString& parameters ) +{ + QStringList paramsLst = QStringList::split( '*', parameters, true ); + if ( paramsLst.size() == 13 ) { + double pos[3], focalPnt[3], viewUp[3], parScale, scale[3]; + pos[0] = paramsLst[0].toDouble(); + pos[1] = paramsLst[1].toDouble(); + pos[2] = paramsLst[2].toDouble(); + focalPnt[0] = paramsLst[3].toDouble(); + focalPnt[1] = paramsLst[4].toDouble(); + focalPnt[2] = paramsLst[5].toDouble(); + viewUp[0] = paramsLst[6].toDouble(); + viewUp[1] = paramsLst[7].toDouble(); + viewUp[2] = paramsLst[8].toDouble(); + parScale = paramsLst[9].toDouble(); + scale[0] = paramsLst[10].toDouble(); + scale[1] = paramsLst[11].toDouble(); + scale[2] = paramsLst[12].toDouble(); + + vtkCamera* camera = myRenderer->GetActiveCamera(); + camera->SetPosition( pos ); + camera->SetFocalPoint( focalPnt ); + camera->SetViewUp( viewUp ); + camera->SetParallelScale( parScale ); + myTransform->SetMatrixScale( scale[0], scale[1], scale[2] ); + myRWInteractor->Render(); + } +} diff --git a/src/VTKViewer/VTKViewer_ViewWindow.h b/src/VTKViewer/VTKViewer_ViewWindow.h index 951d96d4c..05c9ee9a8 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.h +++ b/src/VTKViewer/VTKViewer_ViewWindow.h @@ -14,7 +14,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef VTKVIEWER_VIEWWINDOW_H #define VTKVIEWER_VIEWWINDOW_H @@ -70,6 +70,9 @@ public: void AddActor( VTKViewer_Actor*, bool update = false ); void RemoveActor( VTKViewer_Actor*, bool update = false); + virtual QString getVisualParameters(); + virtual void setVisualParameters( const QString& parameters ); + public slots: void onFrontView(); void onBackView(); diff --git a/src/VTKViewer/resources/VTKViewerM_images.po b/src/VTKViewer/resources/VTKViewerM_images.po deleted file mode 100644 index ce2c6c728..000000000 --- a/src/VTKViewer/resources/VTKViewerM_images.po +++ /dev/null @@ -1,40 +0,0 @@ -# VISU VISUGUI : GUI of VISU component -# -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : -# Module : - -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: 2005-05-10 15:20+0400\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -msgid "ICON_SVTK_SCALING" -msgstr "view_scaling.png" - -msgid "ICON_GRADUATED_AXES" -msgstr "view_graduated_axes.png" diff --git a/src/VTKViewer/resources/VTKViewerM_msg_en.po b/src/VTKViewer/resources/VTKViewerM_msg_en.po deleted file mode 100644 index 7f2c72c31..000000000 --- a/src/VTKViewer/resources/VTKViewerM_msg_en.po +++ /dev/null @@ -1,109 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-02-22 16:56:46 CET\n" -"PO-Revision-Date: 2005-06-27 12:38+0400\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -#: SVTK_NonIsometricDlg.cxx - -msgid "SVTK_NonIsometricDlg::MEN_SCALING" -msgstr "Scaling" - -msgid "SVTK_NonIsometricDlg::O&K" -msgstr "" - -msgid "SVTK_NonIsometricDlg::&Apply" -msgstr "" - -msgid "SVTK_NonIsometricDlg::&Cancel" -msgstr "" - -msgid "SVTK_NonIsometricDlg::&Reset" -msgstr "" - -msgid "SVTK_NonIsometricDlg::DLG_TITLE" -msgstr "Scaling" - -msgid "SVTK_NonIsometricDlg::LBL_X" -msgstr "X :" - -msgid "SVTK_NonIsometricDlg::LBL_Y" -msgstr "Y :" - -msgid "SVTK_NonIsometricDlg::LBL_Z" -msgstr "Z :" - -msgid "SVTK_MainWindow::MNU_SVTK_SCALING" -msgstr "Scaling" - -msgid "SVTK_MainWindow::DSC_SVTK_SCALING" -msgstr "Scaling" - -msgid "SVTK_FontWidget::ARIAL" -msgstr "Arial" - -msgid "SVTK_FontWidget::COURIER" -msgstr "Courier" - -msgid "SVTK_FontWidget::TIMES" -msgstr "Times" - -msgid "SVTK_FontWidget::BOLD" -msgstr "Bold" - -msgid "SVTK_FontWidget::ITALIC" -msgstr "Italic" - -msgid "SVTK_FontWidget::SHADOW" -msgstr "Shadow" - -msgid "SVTK_CubeAxesDlg::CAPTION" -msgstr "Graduated axes" - -msgid "SVTK_CubeAxesDlg::X_AXIS" -msgstr "X axis" - -msgid "SVTK_CubeAxesDlg::Y_AXIS" -msgstr "Y axis" - -msgid "SVTK_CubeAxesDlg::Z_AXIS" -msgstr "Z axis" - -msgid "SVTK_CubeAxesDlg::IS_VISIBLE" -msgstr "Is visible" - -msgid "SVTK_AxisWidget::AXIS_NAME" -msgstr "Axis name" - -msgid "SVTK_AxisWidget::IS_VISIBLE" -msgstr "Is visible" - -msgid "SVTK_AxisWidget::NAME" -msgstr "Name" - -msgid "SVTK_AxisWidget::FONT" -msgstr "Font" - -msgid "SVTK_AxisWidget::LABELS" -msgstr "Labels" - -msgid "SVTK_AxisWidget::NUMBER" -msgstr "Number" - -msgid "SVTK_AxisWidget::OFFSET" -msgstr "Offset" - -msgid "SVTK_AxisWidget::TICK_MARKS" -msgstr "Tick marks" - -msgid "SVTK_AxisWidget::LENGTH" -msgstr "Length" - -msgid "SVTK_MainWindow::MNU_SVTK_GRADUATED_AXES" -msgstr "Graduated axes" - -msgid "SVTK_MainWindow::DSC_SVTK_GRADUATED_AXES" -msgstr "Graduated axes" \ No newline at end of file diff --git a/src/VTKViewer/resources/VTKViewer_images.po b/src/VTKViewer/resources/VTKViewer_images.po index ba4e5f730..0f618ddc5 100755 --- a/src/VTKViewer/resources/VTKViewer_images.po +++ b/src/VTKViewer/resources/VTKViewer_images.po @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # diff --git a/src/VTKViewer/resources/VTKViewer_msg_en.po b/src/VTKViewer/resources/VTKViewer_msg_en.po index 603fbb3c0..e98a1dc3c 100755 --- a/src/VTKViewer/resources/VTKViewer_msg_en.po +++ b/src/VTKViewer/resources/VTKViewer_msg_en.po @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # # @@ -131,9 +131,6 @@ msgstr "Cannot save file" msgid "ERROR" msgstr "Error" -msgid "BUT_OK" -msgstr "Ok" - msgid "VTKViewer_Viewer::MEN_DUMP_VIEW" msgstr "Dump view..." diff --git a/src/VTKViewer/resources/view_update_rate.png b/src/VTKViewer/resources/view_update_rate.png index 3d01ad18482c5a4b8c37a4d4784935bbf9dfda78..9065e6b4545832f1d932e15b4bfd4af4cceffc96 100755 GIT binary patch delta 13 UcmX@Zewv-7Gr-S%BkOTy03q`Pm;e9( delta 14 VcmX@jeuka3Gr-TCcO%PjW&kBo1f>7~ -- 2.39.2